DomainMultiScale Class Reference

#include <domain_multiscale.h>

Inheritance diagram for DomainMultiScale:

Inheritance graph
[legend]
Collaboration diagram for DomainMultiScale:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int build (char *config)
 This method build a full multiscale domain from a config file.
 DomainMultiScale (char *n)
CommunicatorgetCommunicator ()
 return the global communicator object
DumperMultiScalegetDumper ()
 return the global dumper object
double GetEcin (int domtype, unsigned int id=0)
double GetEcin ()
 virtual function to get kinetik energy
double GetEpot (int domtype, unsigned int id=0)
double GetEpot ()
 virtual function to get potential energy
double GetMultiScaleEcin ()
double GetMultiScaleEpot ()
DomainInterfacemodel (unsigned int i)
 return a model from its registering order index
unsigned int nb_models ()
 return the number of registered models
void SaveSituation (int i)
 method that delegate the dump to restart file format to the used codes
void Update ()
 perform a full step update
void UpdateForces ()
 compute forces
void UpdatePositions ()
 update positions
void UpdateStuck ()
 correction induced by the registered coupling
void UpdateVelocities ()
 update velocities
virtual ~DomainMultiScale ()

Private Member Functions

void build_indexes ()
 generate mapping from models ID to registered order of the models
void ParseLine (char *line)
 generic parser method that is called by the parser object on each red line

Private Attributes

Communicatorcommunicateur
 global communicator object used to perform all communications
unsigned int Dim
 dimension of the multiscale material (should be unified)
std::map< int, int > dom_group
 mapping between IDs and communication group IDs
std::vector< int > dom_indexes
 mapping between IDs and registered order
std::map< int, DomainInterface * > dom_tab
 mapping between IDs and models
DumperMultiScaledumper
 global dumper object used to perform any dump of the multiscale material
StimulationMultiScaleinit_stimulation
 stimulations of the multiscale material performed before initial step
unsigned int multi_step
 notificator of the multitimestep (not used at present time)
char my_config [256]
 global config file
StimulationMultiScalepermanent_stimulation
 stabilisation of Melh that need to be used at each timestep
std::vector< BridgingInterface * > rec_tab
 vector of registered bridged zones

Friends

class Parser

Detailed Description

Definition at line 58 of file domain_multiscale.h.


Constructor & Destructor Documentation

DomainMultiScale::DomainMultiScale ( char *  n  ) 

Definition at line 74 of file domain_multiscale.cpp.

References dumper, init_stimulation, and multi_step.

00074                                           :
00075   DomainInterface(n,MULTISCALE,MULTISCALE)
00076 {
00077   dumper = NULL;
00078   init_stimulation = NULL;
00079   multi_step = 1;
00080 }

DomainMultiScale::~DomainMultiScale (  )  [virtual]

Definition at line 56 of file domain_multiscale.cpp.

References build_indexes(), communicateur, DBG_INFO, dom_indexes, dom_tab, DUMP, dumper, init_stimulation, nb_models(), permanent_stimulation, and rec_tab.

00056                                    {
00057   delete dumper;
00058   delete init_stimulation;
00059   delete permanent_stimulation;
00060 
00061   for (unsigned int i = 0 ; i < nb_models() ; ++i){
00062     // here to build the dom_indexes just in case
00063     build_indexes();    
00064     DUMP("deleting domaine (ID=" << dom_indexes[i] << ") " << dom_tab[dom_indexes[i]],DBG_INFO);
00065     delete dom_tab[dom_indexes[i]];
00066   }
00067   
00068   for (unsigned int i = 0 ; i < rec_tab.size() ; ++i)
00069     delete rec_tab[i];  
00070 
00071   delete communicateur;
00072 }

Here is the call graph for this function:


Member Function Documentation

int DomainMultiScale::build ( char *  config  ) 

This method build a full multiscale domain from a config file.

Definition at line 264 of file domain_multiscale.cpp.

References communicateur, Dim, DUMP, dumper, FATAL, DumperMultiScale::Init(), init_stimulation, my_config, StimulationMultiScale::Stimulate(), and Communicator::Synchronize().

Referenced by main().

00264                                         {
00265 
00266   strncpy(my_config,config,255);
00267 
00268   if(world_size==1)
00269     communicateur = new UnityMPI();
00270 //   else if (world_size>1){
00271 // //   communicateur = new DistributedMPI(world_size);
00272 // //   DOMAINECONTINU = 0;
00273 // //   DOMAINEATOMIQUE = 1;
00274 //     communicateur = new LinearMPI();
00275 //     DOMAINECONTINU = communicateur->AddGroup(world_size);
00276 //     //DOMAINEATOMIQUE = communicateur->AddGroup(world_size-world_size/2);
00277 //     //    communicateur = new DistributedMPI(world_size);
00278 //   }
00279 
00280   Parser::ParseConfigFile<DomainMultiScale>(config,"MultiScale",this);
00281 
00282   if (!communicateur){FATAL("COM keyword should be used in config file");}
00283   
00284   if (dumper)
00285     dumper->Init();
00286   
00287   if (init_stimulation)
00288     init_stimulation->Stimulate();
00289 
00290   communicateur->Synchronize();
00291 
00292 #ifdef USING_EPSN
00293   int epsn_status = 0;
00294   // EPSN Ready  
00295   DUMP("EPSN is going to be READY...");
00296   epsn_status = epsn_itfc->ready();
00297   if (!epsn_status) {
00298     FATAL("error on  EPSN Node ready operation\n");
00299   }
00300   DUMP("EPSN READY");
00301   // the main loop
00302   DUMP("EPSN Begin HTG");
00303   epsn_itfc->beginHTM();
00304   epsn_itfc->beginLoop("main");
00305   DUMP("simulation ready to start for EPSN");
00306 #endif
00307 
00308   return Dim;
00309 }

Here is the call graph for this function:

void DomainMultiScale::build_indexes (  )  [private]

generate mapping from models ID to registered order of the models

Definition at line 724 of file domain_multiscale.cpp.

References DBG_INFO, dom_indexes, dom_tab, and DUMP.

Referenced by model(), and ~DomainMultiScale().

00724                                     {
00725   if (dom_indexes.size()==0){
00726     /* create index for domains */
00727     map<int,DomainInterface *>::iterator courant = dom_tab.begin();
00728     map<int,DomainInterface *>::iterator dernier = dom_tab.end();
00729       
00730     while (courant != dernier){
00731       DUMP("pushing ID " << (*courant).first,DBG_INFO);
00732       dom_indexes.push_back((*courant).first);
00733       ++courant;
00734     }  
00735   }
00736 }

Communicator& DomainMultiScale::getCommunicator (  )  [inline]

return the global communicator object

Definition at line 104 of file domain_multiscale.h.

References communicateur.

00104                                   {
00105     return *communicateur;
00106   }

DumperMultiScale& DomainMultiScale::getDumper (  )  [inline]

return the global dumper object

Definition at line 109 of file domain_multiscale.h.

References dumper, and FATAL.

Referenced by main().

00109                                 {
00110     if (dumper == NULL) FATAL("multiscale dumper not created : critical this should not append, have forgotten DIMENSION keyword ?");
00111     return *dumper;
00112   }

double DomainMultiScale::GetEcin ( int  domtype,
unsigned int  id = 0 
)

Definition at line 94 of file domain_multiscale.cpp.

References DBG_WARNING, and DUMP.

00094                                                                 {
00095 //   if (domaine_type == DOMAINEATOMIQUE)
00096 //     return domA_tab[i]->GetEcin();
00097 //   if (domaine_type == DOMAINECONTINU)
00098 //     return domC_tab[i]->GetEcin();
00099 
00100   DUMP("without effect for the moment"  << domaine_type << " " << i,DBG_WARNING);
00101   return 0;
00102 }

double DomainMultiScale::GetEcin (  )  [inline, virtual]

virtual function to get kinetik energy

Implements DomainInterface.

Definition at line 67 of file domain_multiscale.h.

00067 {return 0.0;};

double DomainMultiScale::GetEpot ( int  domtype,
unsigned int  id = 0 
)

Definition at line 116 of file domain_multiscale.cpp.

References DBG_WARNING, and DUMP.

00116                                                                 {
00117 
00118 //   if (domaine_type == DOMAINEATOMIQUE)
00119 //     if (communicateur->amIinGroup(DOMAINEATOMIQUE)){ 
00120 //       return domA_tab[i]->GetEpot();
00121 //     }
00122 //   if (domaine_type == DOMAINECONTINU)
00123 //     if (communicateur->amIinGroup(DOMAINECONTINU)){ 
00124 //       return domC_tab[i]->GetEpot();
00125 //     }
00126   DUMP("without effect for the moment " << domaine_type << " " << i,DBG_WARNING);
00127   return 0;
00128 }

double DomainMultiScale::GetEpot (  )  [inline, virtual]

virtual function to get potential energy

Implements DomainInterface.

Definition at line 68 of file domain_multiscale.h.

00068 {return 0.0;};

double DomainMultiScale::GetMultiScaleEcin (  ) 

Definition at line 83 of file domain_multiscale.cpp.

References DBG_WARNING, and DUMP.

00083                                            {
00084 //   if (communicateur->amIinGroup(DOMAINEATOMIQUE))
00085 //     return GetEcin(DOMAINEATOMIQUE);
00086   
00087 //   if (communicateur->amIinGroup(DOMAINECONTINU))
00088 //     return GetEcin(DOMAINECONTINU);
00089 
00090   DUMP("without effect for the moment",DBG_WARNING);
00091   return 0; 
00092 }

double DomainMultiScale::GetMultiScaleEpot (  ) 

Definition at line 104 of file domain_multiscale.cpp.

References DBG_WARNING, and DUMP.

00104                                            {
00105 //   if (communicateur->amIinGroup(DOMAINEATOMIQUE)){
00106 //     return GetEpot(DOMAINEATOMIQUE);
00107 //   }
00108   
00109 //   if (communicateur->amIinGroup(DOMAINECONTINU)){
00110 //     return GetEpot(DOMAINECONTINU);
00111 //   }
00112   DUMP("without effect for the moment",DBG_WARNING);
00113   return 0; 
00114 }

DomainInterface* DomainMultiScale::model ( unsigned int  i  )  [inline]

return a model from its registering order index

Definition at line 93 of file domain_multiscale.h.

References build_indexes(), dom_indexes, and dom_tab.

Referenced by DumperMultiScale::CreateDumper(), and StimulationMultiScale::CreateStimulation().

00093                                          {
00094     build_indexes();
00095     return dom_tab[dom_indexes[i]];
00096   };

Here is the call graph for this function:

unsigned int DomainMultiScale::nb_models (  )  [inline]

return the number of registered models

Definition at line 99 of file domain_multiscale.h.

References dom_tab.

Referenced by DumperMultiScale::CreateDumper(), StimulationMultiScale::CreateStimulation(), and ~DomainMultiScale().

00099                           {
00100     return dom_tab.size();
00101   };

void DomainMultiScale::ParseLine ( char *  line  )  [private]

generic parser method that is called by the parser object on each red line

Definition at line 311 of file domain_multiscale.cpp.

References _BELYTSCHKO, _BELYTSCHKO_FULL, _DUMMY, _FORMEFAIBLE, _LAMMPS, _LEAST_SQUARE, _LIBMESH, _MD1D, _MYMETHOD, _STAMP, Communicator::AddGroup(), UnitsConverter::AtomsUnits, MaterialContinuumInterface::AutoConfig(), BridgingInterface::build(), DomainContinuumInterface::build(), DomainAtomicInterface::build(), communicateur, UnitsConverter::ComputeEtalon(), DumperMultiScale::CreateDumper(), StimulationMultiScale::CreateStimulation(), DBG_DETAIL, DBG_INFO_STARTUP, DBG_WARNING, DEPGAUSS, DEPUNI, Dim, DISLOEDGE, dom_group, dom_tab, DUMP, dumper, DUMPER1D, DUMPERECIN, DUMPEREPSN, DUMPERFIG, DUMPERLAMMPS, DUMPERPARAVIEW, DUMPERRESTART, DUMPERSCOTCH, DUMPERTEXT, DUMPERVGROUPE, DUMPERXYZ, FATAL, DomainAtomicInterface::Geom(), DumperMultiScale::getDumper(), DomainContinuumInterface::getMaterial(), StimulationMultiScale::GetStimulation(), DomainInterface::ID, IMPULSE, BridgingInterface::Init(), init_stimulation, MATIERELANCEE, MODULATE, my_config, Parser::parse_geometrie(), Parser::parseDouble(), Parser::parseEntier(), Parser::parseMetre(), permanent_stimulation, RAZ, rec_tab, BridgingInterface::SetName(), DumperInterface::SetParam(), StimulationInterface::SetParam(), BridgingInterface::SetParam(), DumperInterface::SetPrefix(), SINUSOIDE, STABILISE, Parser::strNext(), UnitsConverter::unit_code, and VELGAUSS.

00312 {
00313   char mot[256];
00314 
00315   int ID;
00316   line += Parser::strNext(mot,line);
00317 
00318   //analyse de la valeur en fonction du switch
00319   if(!strcmp(mot,"MD_CODE")){
00320     char md_config[255];
00321     unsigned int md_code=_STAMP;
00322 
00323     DUMP("parsing MD_CODE commande = " << line,DBG_INFO_STARTUP);
00324     line+=Parser::strNext(mot,line);
00325 
00326     if(!strcmp(mot,"STAMP"))
00327       md_code = _STAMP;
00328     else if(!strcmp(mot,"LAMMPS"))
00329       md_code = _LAMMPS;
00330     else if(!strcmp(mot,"MD1D"))
00331       md_code = _MD1D;
00332     else if(!strcmp(mot,"DUMMY"))
00333       md_code = _DUMMY;
00334 
00335     line+=Parser::parseEntier(ID,line);    
00336     line+=Parser::strNext(md_config,line);
00337     if (md_config[0] == '\0')
00338       strcpy(md_config,my_config);
00339 
00340     if (world_size == 1)
00341       dom_group[ID] = 0;
00342 
00343     if (dom_group.count(ID) == 0)
00344       {FATAL("PROCESSOR KEYWORD SHOULD BE USED ON ID " << ID);}
00345     dom_tab[ID] = DomainAtomicInterface::build(md_config,md_code,*communicateur,ID,dom_group[ID]);
00346     if (dom_tab[ID] == NULL)
00347       {FATAL("pas bon");}
00348 
00349     DUMP("registered domain (ID=" << ID << ")  " << dom_tab[ID],DBG_WARNING);
00350   }
00351   else if(!strcmp(mot,"ELAST_CODE")){
00352     char elast_config[255];
00353     unsigned int elast_code;
00354 
00355     DUMP("parsing ELAST_CODE commande = " << line,DBG_INFO_STARTUP);
00356     line+=Parser::strNext(mot,line);
00357     
00358     if(!strcmp(mot,"LIBMESH"))
00359       elast_code = _LIBMESH;
00360 
00361     line+=Parser::parseEntier(ID,line);    
00362     line+=Parser::strNext(elast_config,line);
00363     if (elast_config[0] == '\0')
00364       strcpy(elast_config,my_config);
00365 
00366     if (world_size == 1)
00367       dom_group[ID] = 0;
00368 
00369     if (dom_group.count(ID) == 0)
00370       {FATAL("PROCESSOR KEYWORD SHOULD BE USED ON ID " << ID);}  
00371     dom_tab[ID] = DomainContinuumInterface::build(elast_config,Dim,*communicateur,ID,dom_group[ID]);
00372     //    dom_ID[nb_materials] = ID;
00373     DUMP("a continu model as been with ID " << ID << " has been created",DBG_WARNING);
00374   }
00375   else if(!strcmp(mot,"BRIDGING_CODE")){
00376 
00377     BridgingInterface * rec;  
00378     DomainAtomicInterface * domA;
00379     DomainContinuumInterface * domC;
00380     double param;
00381 
00382     int bridging_code=_BELYTSCHKO,IDMD,IDC,geomID;
00383 
00384     DUMP("parsing BRIDGING_CODE commande = " << line,DBG_INFO_STARTUP);
00385     line+=Parser::strNext(mot,line);
00386     
00387     if(!strcmp(mot,"BELYTSCHKO"))
00388       bridging_code = _BELYTSCHKO;
00389 
00390     if(!strcmp(mot,"BELYTSCHKOFULL"))
00391       bridging_code = _BELYTSCHKO_FULL;
00392 
00393     if(!strcmp(mot,"FORMEFAIBLE"))
00394       bridging_code = _FORMEFAIBLE;
00395 
00396     if(!strcmp(mot,"LEASTSQUARE"))
00397       bridging_code = _LEAST_SQUARE;
00398 
00399     if(!strcmp(mot,"MYMETHOD"))
00400       bridging_code = _MYMETHOD;
00401 
00402 
00403     line+=Parser::parseEntier(IDMD,line);
00404     line+=Parser::parseEntier(IDC,line);
00405     line+=Parser::parseEntier(geomID,line);
00406 
00407 
00408 
00409 
00410     domA = static_cast<DomainAtomicInterface *>(dom_tab[IDMD]);
00411     domC = static_cast<DomainContinuumInterface *>(dom_tab[IDC]);
00412 
00413     rec = BridgingInterface::build(bridging_code,*domA,*domC,geomID,Dim,*communicateur);
00414     
00415     int lu = Parser::strNext(mot,line);
00416 
00417     while (lu){
00418       line += lu;
00419       line+=Parser::parseDouble(param,line);      
00420       DUMP("parsing key " << mot << " value = " << param << " nb de rec = " << rec_tab.size(),DBG_WARNING);
00421       rec->SetParam(mot,param);  
00422       lu = Parser::strNext(mot,line);
00423       DUMP("lu = " << lu,DBG_DETAIL);
00424     }
00425     
00426     char recname[256];
00427     sprintf(recname,"bridge-%d",(int)rec_tab.size());
00428     rec->SetName(recname);
00429 
00430     rec->Init();
00431     rec_tab.push_back(rec);
00432     //    ++nb_recouvrement;
00433 
00434   }
00435   else if(!strcmp(mot,"AUTOCONFIG")){
00436     double tmesh;
00437     double padSize;
00438     int IDMD,IDC;
00439     DomainContinuumInterface * domC;
00440     DomainAtomicInterface * domA;
00441 
00442     DUMP("parsing AUTOCONFIG commande = " << line,DBG_INFO_STARTUP);
00443 
00444     line+=Parser::parseEntier(IDMD,line);
00445     line+=Parser::parseEntier(IDC,line);
00446 
00447     line+=Parser::parseMetre(tmesh,line);
00448     line+=Parser::parseMetre(padSize,line);
00449     
00450     domC = static_cast<DomainContinuumInterface *>(dom_tab[IDC]);
00451     domA = static_cast<DomainAtomicInterface *>(dom_tab[IDMD]);
00452 
00453     domC->getMaterial().AutoConfig(domA->Geom(),tmesh,padSize);
00454   }
00455   else if(!strcmp(mot,"DIMENSION")){
00456     line+=Parser::parseEntier((int &)Dim,line);
00457     DUMP("parsing DIMENSION commande = " << Dim,DBG_INFO_STARTUP);
00458     dumper = new DumperMultiScale(*this,Dim);
00459     init_stimulation = new StimulationMultiScale(*this,Dim);
00460     permanent_stimulation = new StimulationMultiScale(*this,Dim);
00461   }
00462   else if(!strcmp(mot,"STIMULATION")){
00463     line+=Parser::strNext(mot,line);
00464     
00465     if(!strcmp(mot,"GAUSS")){
00466       DUMP("parsing STIMULATION commande = " << line,DBG_INFO_STARTUP);
00467       double LWave,Intensity;
00468       line+=Parser::parseMetre(LWave,line);
00469       line+=Parser::parseMetre(Intensity,line);
00470       int bID = Parser::parse_geometrie(line);
00471       if (bID == -1){FATAL("Geometrie could not be parsed for keyword STIMULATIONGAUSS");}
00472       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00473       std::vector<int> stim_indexes = init_stimulation->CreateStimulation(DEPGAUSS,Intensity,bID);
00474       for (unsigned k = 0 ; k < stim_indexes.size() ; ++k)
00475         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("LWave",LWave);
00476 
00477       int lu = Parser::strNext(mot,line);
00478       double param;
00479       if (lu>0)
00480         if (!strcmp(mot,"Direction")){
00481           line += lu;
00482           line+=Parser::parseDouble(param,line);
00483           stim_indexes = init_stimulation->CreateStimulation(VELGAUSS,Intensity,bID);
00484           for (unsigned k = 0 ; k < stim_indexes.size() ; ++k){
00485             init_stimulation->GetStimulation(stim_indexes[k])->SetParam("LWave",LWave);
00486             init_stimulation->GetStimulation(stim_indexes[k])->SetParam("Direction",param);
00487           }
00488         }
00489     }
00490     else if(!strcmp(mot,"IMPULSE")){
00491       double direction;
00492       DUMP("parsing STIMULATION commande = " << line,DBG_INFO_STARTUP);
00493       double LWave,Intensity;
00494       line+=Parser::parseMetre(LWave,line);
00495       line+=Parser::parseMetre(Intensity,line);
00496       line+=Parser::parseDouble(direction,line);
00497       int bID = Parser::parse_geometrie(line);
00498       if (bID == -1){FATAL("Geometrie could not be parsed for keyword STIMULATIONGAUSS");}
00499       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00500       std::vector<int> stim_indexes = init_stimulation->CreateStimulation(IMPULSE,Intensity,bID);
00501       for (unsigned k = 0 ; k < stim_indexes.size() ; ++k){
00502         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("LWave",LWave);
00503         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("Direction",direction);
00504       }
00505     }
00506     else if(!strcmp(mot,"DISLOEDGE")){
00507       double direction;
00508       DUMP("parsing STIMULATION commande = " << line,DBG_INFO_STARTUP);
00509       double burgers,posx,posy,epsilonxy,width=0;
00510       line+=Parser::parseMetre(burgers,line);
00511       line+=Parser::parseMetre(width,line);
00512       line+=Parser::parseMetre(posx,line);
00513       line+=Parser::parseMetre(posy,line);
00514       line+=Parser::parseDouble(epsilonxy,line);
00515       int bID = Parser::parse_geometrie(line);
00516       if (bID == -1){FATAL("Geometrie could not be parsed for keyword STIMULATIONGAUSS");}
00517       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00518       std::vector<int> stim_indexes = init_stimulation->CreateStimulation(DISLOEDGE,width,bID);
00519       for (unsigned k = 0 ; k < stim_indexes.size() ; ++k){
00520         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("BURGERS",burgers);
00521         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("POSX",posx);
00522         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("POSY",posy);
00523         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("EPSILONXY",epsilonxy);
00524       }
00525     }
00526 
00527 
00528     if(!strcmp(mot,"MODULATE")){
00529       DUMP("parsing STIMULATION commande = " << line,DBG_INFO_STARTUP);
00530       double LWave,Intensity;
00531       line+=Parser::parseMetre(LWave,line);
00532       line+=Parser::parseDouble(Intensity,line);
00533       int bID = Parser::parse_geometrie(line);
00534       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00535       std::vector<int> stim_indexes = init_stimulation->CreateStimulation(MODULATE,Intensity,bID);
00536       for (unsigned k = 0 ; k < stim_indexes.size() ; ++k)
00537         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("LWave",LWave);
00538     }
00539     if(!strcmp(mot,"UNI")){
00540       DUMP("parsing STIMULATION commande = " << line,DBG_INFO_STARTUP);
00541       double Intensity;
00542       line+=Parser::parseMetre(Intensity,line);
00543 
00544       int bID = Parser::parse_geometrie(line);
00545       if (bID == -1){FATAL("Geometrie could not be parsed for keyword STIMULATIONGAUSS");}
00546       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00547       std::vector<int> stim_indexes = init_stimulation->CreateStimulation(DEPUNI,Intensity,bID);
00548      
00549       double param;
00550 
00551       int lu = Parser::strNext(mot,line);
00552       while (lu){
00553         line += lu;
00554         line+=Parser::parseDouble(param,line);      
00555         DUMP("parsing key " << mot << " value = " << param,DBG_INFO_STARTUP);
00556         for (unsigned k = 0 ; k < stim_indexes.size() ; ++k)
00557           init_stimulation->GetStimulation(stim_indexes[k])->SetParam(mot,param);
00558         lu = Parser::strNext(mot,line);
00559         DUMP("lu = " << lu,DBG_INFO_STARTUP);
00560       }
00561     }
00562     else if(!strcmp(mot,"SIN")){
00563       DUMP("parsing STIMULATION commande = " << line,DBG_INFO_STARTUP);
00564       double LWave,Intensity;
00565       line+=Parser::parseMetre(LWave,line);
00566       line+=Parser::parseMetre(Intensity,line);
00567       int bID = Parser::parse_geometrie(line);
00568       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00569       std::vector<int> stim_indexes = init_stimulation->CreateStimulation(SINUSOIDE,Intensity,bID);
00570       for (unsigned k = 0 ; k < stim_indexes.size() ; ++k)
00571         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("LWave",LWave);
00572     }
00573     else if(!strcmp(mot,"RAZ")){
00574       DUMP("parsing STIMULATION commande = " << mot << " " << line,DBG_INFO_STARTUP);
00575       int bID = Parser::parse_geometrie(line);
00576       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00577       int lu = Parser::strNext(mot,line);
00578       int freq = 1;
00579       if (lu && strcmp(mot,"FREQ")==0) {
00580         line += lu;
00581         line += Parser::parseEntier(freq,line);
00582         DUMP("parsing FREQ commande " << freq,DBG_INFO_STARTUP);
00583       }
00584       permanent_stimulation->CreateStimulation(RAZ,0,bID,freq);
00585     }
00586     else if(!strcmp(mot,"MATIERELANCEE")){
00587       DUMP("parsing STIMULATION commande = " << mot << " " << line,DBG_INFO_STARTUP);
00588       double intensity;
00589       double Axe;
00590       line += Parser::parseDouble(Axe,line);
00591       line += Parser::parseDouble(intensity,line);
00592       int bID = Parser::parse_geometrie(line);
00593       if (bID == -1){FATAL("je n'ai pas pu parser la geometrie pour matiere lancee !!");}
00594       if (!init_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00595       std::vector<int> stim_indexes = init_stimulation->CreateStimulation(MATIERELANCEE,intensity,bID);
00596       for (unsigned k = 0 ; k < stim_indexes.size() ; ++k)
00597         init_stimulation->GetStimulation(stim_indexes[k])->SetParam("Axe",Axe);
00598     }
00599     else if(!strcmp(mot,"STABILISE")){
00600        DUMP("parsing STIMULATION commande = " << mot,DBG_INFO_STARTUP);
00601        int lu = Parser::strNext(mot,line);
00602        int freq = 1;
00603        if (lu && strcmp(mot,"FREQ")==0) {
00604         line += lu;
00605         line += Parser::parseEntier(freq,line);
00606        }
00607 
00608 
00609        permanent_stimulation->CreateStimulation(STABILISE,0,-1,freq);
00610     }
00611     else if(!strcmp(mot,"DISLOEDGEBORDERS")){
00612       double direction;
00613       DUMP("parsing STIMULATION commande = " << line,DBG_INFO_STARTUP);
00614       double burgers,posx,posy,epsilonxy,width=0;
00615       line+=Parser::parseMetre(burgers,line);
00616       line+=Parser::parseMetre(width,line);
00617       line+=Parser::parseMetre(posx,line);
00618       line+=Parser::parseMetre(posy,line);
00619       line+=Parser::parseDouble(epsilonxy,line);
00620       int bID = Parser::parse_geometrie(line);
00621       if (bID == -1){FATAL("Geometrie could not be parsed for keyword STIMULATIONGAUSS");}
00622       if (!permanent_stimulation){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00623       std::vector<int> stim_indexes = permanent_stimulation->CreateStimulation(DISLOEDGE,width,bID);
00624       for (unsigned k = 0 ; k < stim_indexes.size() ; ++k){
00625         permanent_stimulation->GetStimulation(stim_indexes[k])->SetParam("BURGERS",burgers);
00626         permanent_stimulation->GetStimulation(stim_indexes[k])->SetParam("POSX",posx);
00627         permanent_stimulation->GetStimulation(stim_indexes[k])->SetParam("POSY",posy);
00628         permanent_stimulation->GetStimulation(stim_indexes[k])->SetParam("EPSILONXY",epsilonxy);
00629       }
00630     }
00631   }
00632   else if(!strcmp(mot,"UNITCODE")){
00633     DUMP("parsing UNITCODE commande = " << line,DBG_INFO_STARTUP);
00634     line+=Parser::strNext(mot,line);
00635     if (!strcmp(mot,"AtomsUnits"))
00636       UnitsConverter::unit_code = UnitsConverter::AtomsUnits;
00637 
00638     UnitsConverter::ComputeEtalon();
00639   }
00640   else if(!strcmp(mot,"PROCESSORS")){
00641     line+=Parser::strNext(mot,line);
00642     int id = atoi(mot);
00643     DUMP("id = " << id,DBG_INFO_STARTUP);
00644     line+=Parser::strNext(mot,line);
00645     int nb_procs = atoi(mot);
00646     DUMP("nb_procs = " << nb_procs,DBG_INFO_STARTUP);
00647     dom_group[id] = communicateur->AddGroup(nb_procs);
00648     DUMP("model ID "  << id << " got communication group " << dom_group[id],DBG_INFO_STARTUP);
00649   }
00650   else if(!strcmp(mot,"COM")){
00651     if (world_size==1)return;
00652     line+=Parser::strNext(mot,line);
00653     if (!strcmp(mot,"DISTRIBUTED")){
00654       communicateur = new LinearMPI();
00655     }    
00656   }
00657   else if(!strcmp(mot,"DUMPER")){
00658     char freq[255];
00659 
00660     std::vector<int> dump_indexes;
00661 
00662     DUMP("parsing DUMPER commande = " << line,DBG_INFO_STARTUP);
00663     line+=Parser::strNext(mot,line);
00664     line+=Parser::strNext(freq,line);
00665     int frequency = atoi(freq);
00666     DUMP("frequency injected = " << frequency,DBG_INFO_STARTUP);
00667     if (!dumper){FATAL("DIMENSION KEYWORD SHOULD BE USED BEFORE IN CONFIG FILE");}
00668     if (!strcmp(mot,"PARAVIEW"))
00669       dump_indexes = dumper->CreateDumper(DUMPERPARAVIEW,frequency);
00670     else if (!strcmp(mot,"TEXT"))
00671       dump_indexes = dumper->CreateDumper(DUMPERTEXT,frequency);
00672     else if (!strcmp(mot,"DUMPER1D"))
00673       dump_indexes = dumper->CreateDumper(DUMPER1D,frequency);
00674     else if (!strcmp(mot,"DUMPERVGROUPE"))
00675       dump_indexes = dumper->CreateDumper(DUMPERVGROUPE,frequency);
00676     else if (!strcmp(mot,"DUMPERECIN"))
00677       dump_indexes = dumper->CreateDumper(DUMPERECIN,frequency);
00678     else if (!strcmp(mot,"SCOTCH"))
00679       dump_indexes = dumper->CreateDumper(DUMPERSCOTCH,frequency);
00680 #ifdef USING_FIG
00681     else if (!strcmp(mot,"FIG"))
00682       dump_indexes = dumper->CreateDumper(DUMPERFIG,frequency);
00683 #endif
00684     else if (!strcmp(mot,"LAMMPS"))
00685       dump_indexes = dumper->CreateDumper(DUMPERLAMMPS,frequency);
00686     else if (!strcmp(mot,"XYZ"))
00687       dump_indexes = dumper->CreateDumper(DUMPERXYZ,frequency);
00688 #ifdef USING_EPSN
00689     else if (!strcmp(mot,"EPSN")){
00690       line+=Parser::strNext(mot,line);
00691       dump_indexes = dumper->CreateDumper(DUMPEREPSN,frequency);
00692       strncpy(xmlepsnfile,mot,255);
00693     }
00694 #endif //USING_EPSN
00695     else if (!strcmp(mot,"RESTART")){
00696       dump_indexes = dumper->CreateDumper(DUMPERRESTART,frequency);
00697     }
00698     else{FATAL("Unknown dumper : " << mot);}
00699     DUMP("dumpers instanciated ... ",DBG_INFO_STARTUP);
00700     while (strlen(mot)>0){
00701       double value = 1;
00702       
00703       line+=Parser::strNext(mot,line);
00704       if(!strcmp(mot,"FILTERDISP") || !strcmp(mot,"FILTERGEOM") 
00705          || !strcmp(mot,"FILTERFORCE") || !strcmp(mot,"FILTERVEL")){
00706         line+=Parser::parseDouble(value,line);
00707       }
00708       if(!strcmp(mot,"PREFIX")){
00709         char prefix[500];
00710         line+=Parser::strNext(prefix,line);
00711         for (unsigned k = 0 ; k < dump_indexes.size() ; ++k)
00712           dumper->getDumper(dump_indexes[k])->SetPrefix(prefix);
00713         continue;
00714       }
00715       for (unsigned k = 0 ; k < dump_indexes.size() ; ++k)
00716         dumper->getDumper(dump_indexes[k])->SetParam(mot,value);
00717     }
00718     DUMP("dumpers configured ... ",DBG_INFO_STARTUP);
00719   }
00720 
00721  
00722 }

Here is the call graph for this function:

void DomainMultiScale::SaveSituation ( int  i  )  [virtual]

method that delegate the dump to restart file format to the used codes

Implements DomainInterface.

Definition at line 130 of file domain_multiscale.cpp.

References Communicator::amIinGroup(), communicateur, dom_group, dom_tab, STARTTIMER, and STOPTIMER.

00130                                              {
00131 
00132   map<int,DomainInterface *>::iterator courant = dom_tab.begin();
00133   map<int,DomainInterface *>::iterator dernier = dom_tab.end();
00134 
00135   STARTTIMER("Saving Situation");       
00136   while (courant != dernier){
00137     if (communicateur->amIinGroup(dom_group[(*courant).first]))
00138       (*courant).second->SaveSituation(index);
00139   }
00140   STOPTIMER("Saving Situation");
00141 
00142 }

Here is the call graph for this function:

void DomainMultiScale::Update (  ) 

perform a full step update

a full explicit step is normally composed of a position update, a force computation, a velocity update, and an eventual coupling correction

Definition at line 145 of file domain_multiscale.cpp.

References Communicator::amIinGroup(), communicateur, dom_group, dom_tab, rec_tab, STARTTIMER, and STOPTIMER.

00145                              {
00146 
00147   map<int,DomainInterface *>::iterator courant = dom_tab.begin();
00148   map<int,DomainInterface *>::iterator dernier = dom_tab.end();
00149   
00150   STARTTIMER("FullStep");       
00151   while (courant != dernier){
00152     if (communicateur->amIinGroup(dom_group[(*courant).first]))
00153       {
00154 
00155         (*courant).second->UpdatePositions();
00156         (*courant).second->UpdateForces();      
00157         (*courant).second->UpdateVelocities();
00158       }
00159     ++courant;
00160   }
00161   
00162   for (unsigned int i = 0 ; i < rec_tab.size() ; ++i)
00163     rec_tab[i]->Stucking();
00164   
00165   STOPTIMER("FullStep");
00166 }

Here is the call graph for this function:

void DomainMultiScale::UpdateForces (  )  [virtual]

compute forces

Implements DomainInterface.

Definition at line 221 of file domain_multiscale.cpp.

References Communicator::amIinGroup(), communicateur, dom_group, dom_tab, permanent_stimulation, STARTTIMER, StimulationMultiScale::Stimulate(), and STOPTIMER.

Referenced by main().

00221                                     {
00222 #ifdef USING_EPSN
00223   if (epsn_itfc->isNodeInitialized())
00224     epsn_itfc->beginTask("updateforces");
00225 #endif
00226 
00227   map<int,DomainInterface *>::iterator courant = dom_tab.begin();
00228   map<int,DomainInterface *>::iterator dernier = dom_tab.end();
00229 
00230 
00231   STARTTIMER("StepForces");     
00232   while (courant != dernier){
00233     if (communicateur->amIinGroup(dom_group[(*courant).first]))
00234       (*courant).second->UpdateForces();
00235     ++courant;
00236   }
00237   STOPTIMER("StepForces");
00238 
00239   STARTTIMER("StabiliseStimulations");
00240   permanent_stimulation->Stimulate();
00241   STOPTIMER("StabiliseStimulations");
00242 
00243 #ifdef USING_EPSN
00244   if (epsn_itfc->isNodeInitialized())
00245     epsn_itfc->endTask("updateforces");
00246 #endif
00247 }

Here is the call graph for this function:

void DomainMultiScale::UpdatePositions (  )  [virtual]

update positions

Implements DomainInterface.

Definition at line 169 of file domain_multiscale.cpp.

References Communicator::amIinGroup(), communicateur, dom_group, dom_tab, STARTTIMER, and STOPTIMER.

Referenced by main().

00169                                        {
00170 #ifdef USING_EPSN
00171   if (epsn_itfc->isNodeInitialized())
00172     epsn_itfc->beginTask("updatepositions");
00173 #endif
00174 
00175   map<int,DomainInterface *>::iterator courant = dom_tab.begin();
00176   map<int,DomainInterface *>::iterator dernier = dom_tab.end();
00177 
00178   STARTTIMER("StepPositions");  
00179   while (courant != dernier){
00180     if (communicateur->amIinGroup(dom_group[(*courant).first])){
00181       (*courant).second->UpdatePositions();
00182     }
00183     
00184     ++courant;
00185   }
00186   STOPTIMER("StepPositions");
00187 
00188 #ifdef USING_EPSN
00189   if (epsn_itfc->isNodeInitialized())
00190     epsn_itfc->endTask("updatepositions");
00191 #endif
00192 
00193 }

Here is the call graph for this function:

void DomainMultiScale::UpdateStuck (  ) 

correction induced by the registered coupling

Definition at line 249 of file domain_multiscale.cpp.

References rec_tab.

Referenced by main().

00249                                   {
00250 #ifdef USING_EPSN
00251   if (epsn_itfc->isNodeInitialized())
00252     epsn_itfc->beginTask("updatecoupling");
00253 #endif
00254 
00255   for (unsigned int i=0; i < rec_tab.size(); ++i)
00256     rec_tab[i]->Stucking();
00257 
00258 #ifdef USING_EPSN
00259   if (epsn_itfc->isNodeInitialized())
00260     epsn_itfc->endTask("updatecoupling");
00261 #endif
00262 }

void DomainMultiScale::UpdateVelocities (  )  [virtual]

update velocities

Implements DomainInterface.

Definition at line 196 of file domain_multiscale.cpp.

References Communicator::amIinGroup(), communicateur, dom_group, dom_tab, STARTTIMER, and STOPTIMER.

Referenced by main().

00196                                         {
00197 #ifdef USING_EPSN
00198   if (epsn_itfc->isNodeInitialized())
00199     epsn_itfc->beginTask("updatevelocities");
00200 #endif
00201 
00202   map<int,DomainInterface *>::iterator courant = dom_tab.begin();
00203   map<int,DomainInterface *>::iterator dernier = dom_tab.end();
00204 
00205   STARTTIMER("StepVelocities"); 
00206   while (courant != dernier){
00207     if (communicateur->amIinGroup(dom_group[(*courant).first]))
00208       (*courant).second->UpdateVelocities();
00209     ++courant;
00210   }
00211   STOPTIMER("StepVelocities");
00212   
00213 #ifdef USING_EPSN
00214   if (epsn_itfc->isNodeInitialized())
00215     epsn_itfc->endTask("updatevelocities");
00216 #endif
00217 
00218 }

Here is the call graph for this function:


Friends And Related Function Documentation

friend class Parser [friend]

Definition at line 119 of file domain_multiscale.h.


Member Data Documentation

Communicator* DomainMultiScale::communicateur [private]

global communicator object used to perform all communications

Definition at line 145 of file domain_multiscale.h.

Referenced by build(), getCommunicator(), ParseLine(), SaveSituation(), Update(), UpdateForces(), UpdatePositions(), UpdateVelocities(), and ~DomainMultiScale().

unsigned int DomainMultiScale::Dim [private]

dimension of the multiscale material (should be unified)

Definition at line 139 of file domain_multiscale.h.

Referenced by build(), and ParseLine().

std::map<int,int> DomainMultiScale::dom_group [private]

mapping between IDs and communication group IDs

Definition at line 129 of file domain_multiscale.h.

Referenced by ParseLine(), SaveSituation(), Update(), UpdateForces(), UpdatePositions(), and UpdateVelocities().

std::vector<int> DomainMultiScale::dom_indexes [private]

mapping between IDs and registered order

Definition at line 132 of file domain_multiscale.h.

Referenced by build_indexes(), model(), and ~DomainMultiScale().

std::map<int, DomainInterface *> DomainMultiScale::dom_tab [private]

mapping between IDs and models

Definition at line 127 of file domain_multiscale.h.

Referenced by build_indexes(), model(), nb_models(), ParseLine(), SaveSituation(), Update(), UpdateForces(), UpdatePositions(), UpdateVelocities(), and ~DomainMultiScale().

DumperMultiScale* DomainMultiScale::dumper [private]

global dumper object used to perform any dump of the multiscale material

Definition at line 148 of file domain_multiscale.h.

Referenced by build(), DomainMultiScale(), getDumper(), ParseLine(), and ~DomainMultiScale().

StimulationMultiScale* DomainMultiScale::init_stimulation [private]

stimulations of the multiscale material performed before initial step

Definition at line 150 of file domain_multiscale.h.

Referenced by build(), DomainMultiScale(), ParseLine(), and ~DomainMultiScale().

unsigned int DomainMultiScale::multi_step [private]

notificator of the multitimestep (not used at present time)

Definition at line 137 of file domain_multiscale.h.

Referenced by DomainMultiScale().

char DomainMultiScale::my_config[256] [private]

global config file

Definition at line 142 of file domain_multiscale.h.

Referenced by build(), and ParseLine().

StimulationMultiScale* DomainMultiScale::permanent_stimulation [private]

stabilisation of Melh that need to be used at each timestep

Definition at line 152 of file domain_multiscale.h.

Referenced by ParseLine(), UpdateForces(), and ~DomainMultiScale().

std::vector<BridgingInterface *> DomainMultiScale::rec_tab [private]

vector of registered bridged zones

Definition at line 134 of file domain_multiscale.h.

Referenced by ParseLine(), Update(), UpdateStuck(), and ~DomainMultiScale().


The documentation for this class was generated from the following files:
Generated on Fri Sep 7 13:13:12 2007 for LibMultiScale by  doxygen 1.5.2