00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "../common/common.h"
00043
00044 #define NEED_STAMP
00045 #define NEED_PROTOMOL
00046 #define NEED_LAMMPS
00047 #define NEED_MD1D
00048 #define LOCAL_MODULE MOD_MD
00049 #include "domain_atomic.h"
00050 #ifdef USING_STAMP
00051 #include "stamp/contener_stamp.h"
00052 #endif //STAMP
00053 #ifdef USING_LAMMPS
00054 #include "lammps/contener_lammps.h"
00055 #endif //LAMMPS
00056 #ifdef USING_MD1D
00057 #include "1d/contener_md1d.h"
00058 #endif //MD1D
00059 #include "dummy/domain_dummymd.h"
00060
00061 template <typename C>
00062 inline void DomainAtomic<C>::TestGeometryCoherence(){
00063 typedef typename C::IteratorType IteratorAtoms;
00064 typedef typename C::Ref Ref;
00065
00066 IteratorAtoms it = atoms.GetIterator();
00067 Ref at = it.GetFirst();
00068
00069 while (!it.end())
00070 {
00071
00072 if (!geom.Contient(at.position0(0))){
00073 FATAL("atom at position " << FORMATREAL(at.position0(0)) << " pas dans la geometrie");
00074 }
00075 at = it.GetNext();
00076 }
00077 }
00078
00079
00080 template <typename C>
00081 inline void DomainAtomic<C>::ReadXMLFile(char * filename){
00082 XMLRestartParser parser;
00083
00084 DUMP("Setting Dummy simulation from libMultiScale XML Data format " << filename,DBG_INFO);
00085 parser.ParseFile(filename);
00086 DUMP("read done " << filename,DBG_INFO);
00087
00088 typename C::_Iterator & it = atoms.GetIterator();
00089 Ref at = it.GetFirst();
00090
00091 UnitsConverter unit;
00092 unit.SetReadUnits(UnitsConverter::AtomsUnits);
00093
00094 int cpt=0;
00095 int cpt2=0;
00096 int total = atoms.nbElem();
00097
00098
00099 for (at = it.GetFirst(); !it.end() ; at = it.GetNext()){
00100 double x=0,y=0,z=0;
00101
00102 x = at.position0(0);
00103 y = at.position0(1);
00104 z = at.position0(2);
00105
00106 if (cpt2%100 == 0) DUMP("passing atom number " << cpt2 << "/" << total << " reloaded",DBG_INFO);
00107 ++cpt2;
00108 if (!parser.IsDofRegistered(x,y,z)) continue;
00109
00110 double ux,uy,uz;
00111 parser.AssignDispField(x,y,z,ux,uy,uz);
00112
00113 at.position(0) = at.position0(0) + ux;
00114 at.position(1) = at.position0(1) + uy;
00115 at.position(2) = at.position0(2) + uz;
00116
00117 parser.AssignVelField(x,y,z,at.vitesse(0),at.vitesse(1),at.vitesse(2));
00118 parser.AssignForceField(x,y,z,at.force(0),at.force(1),at.force(2));
00119 if (cpt%100 == 0) DUMP("atom number " << cpt << "/" << total << " reloaded",DBG_INFO);
00120 ++cpt;
00121 }
00122
00123
00124 DUMP("associated " << cpt << " over " << atoms.nbElem(),DBG_INFO);
00125 };
00126
00127
00128
00129 #ifdef USING_STAMP
00130 template class DomainAtomic<ContenerStamp>;
00131 #endif
00132 #ifdef USING_LAMMPS
00133 template class DomainAtomic<ContenerLammps>;
00134 #endif
00135 template class DomainAtomic<ContenerMD1D>;
00136 template class DomainAtomic<ContenerDummy>;
00137