material_stamp.cpp

Go to the documentation of this file.
00001 /* ./md/stamp/material_stamp.cpp 
00002 **********************************
00003 Copyright INRIA and CEA 
00004 
00005 author : Guillaume ANCIAUX (anciaux@labri.fr, g.anciaux@laposte.net)
00006 
00007 The LibMultiScale is a C++ parallel framework for the multiscale
00008 coupling methods dedicated to material simulations. This framework
00009 provides an API which makes it possible to program coupled simulations
00010 and integration of already existing codes.
00011 
00012 This Project is done in a collaboration between INRIA Futurs Bordeaux
00013 within ScAlApplix team and CEA/DPTA Ile de France. 
00014 
00015 This software is governed by the CeCILL-C license under French law and
00016 abiding by the rules of distribution of free software.  You can  use, 
00017 modify and/ or redistribute the software under the terms of the CeCILL-C
00018 license as circulated by CEA, CNRS and INRIA at the following URL
00019 "http://www.cecill.info". 
00020 
00021 As a counterpart to the access to the source code and  rights to copy,
00022 modify and redistribute granted by the license, users are provided only
00023 with a limited warranty  and the software's author,  the holder of the
00024 economic rights,  and the successive licensors  have only  limited
00025 liability. 
00026 
00027 In this respect, the user's attention is drawn to the risks associated
00028 with loading,  using,  modifying and/or developing or reproducing the
00029 software by the user in light of its specific status of free software,
00030 that may mean  that it is complicated to manipulate,  and  that  also
00031 therefore means  that it is reserved for developers  and  experienced
00032 professionals having in-depth computer knowledge. Users are therefore
00033 encouraged to load and test the software's suitability as regards their
00034 requirements in conditions enabling the security of their systems and/or 
00035 data to be ensured and,  more generally, to use and operate it in the 
00036 same conditions as regards security. 
00037 
00038 The fact that you are presently reading this means that you have had
00039 knowledge of the CeCILL-C license and that you accept its terms.
00040 ***********************************/
00041 
00042 #define NEED_STAMP
00043 #define LOCAL_MODULE MOD_MD
00044 
00045 #include "material_stamp.h"
00046 
00047 extern "C" {
00048   int LoadStamp(const char * fichier);
00049   extern void SetStampConfigFile(char *);
00050   extern void SetStampDimentionSysteme(double xmin,double xmax,double ymin,double ymax,double zmin,double zmax,int Dim);
00051 }
00052 
00053 void MaterialStamp::ConvertToAdim(){
00054 
00055 //   /* pour les conversions adims */
00056   
00057 //   double etalon_metre = 1;
00058 //   double etalon_masse = 1;
00059 //   double etalon_energie = 1;
00060 //   double etalon_temps = 1;
00061 //   //  double boltzman = 1.380662e-23;
00062 //   double etalon_temperature = 1;
00063 
00064 
00065 //   DUMP("Adimentional convertion : \nmetre = " << etalon_metre << 
00066 //        "\nmasse = " << etalon_masse << "\nenergie = " << etalon_energie <<
00067 //        "\ntemps = " << etalon_temps << "\ntemperature = " << etalon_temperature);
00068   
00069 //   globaux->deltaT /= etalon_temps;
00070 
00071 //   globaux->cavitation /= etalon_metre;
00072 //   globaux->Prequis /= etalon_metre;
00073 //   globaux->fragRate /= etalon_temps;
00074 
00075 //   globaux->vPiston = globaux->vPiston / etalon_metre * etalon_temps;
00076 
00077 
00078 //   globaux->lim1 /= etalon_metre;
00079 //   globaux->lim2 /= etalon_metre;
00080 //   globaux->rZero /= etalon_metre;
00081 //   globaux->aZero /= etalon_metre;
00082 //   globaux->aZerox /= etalon_metre;
00083 
00084 //   /* ------------------------------------ */
00085 //   globaux->vecteurZerox[0] /= etalon_metre;
00086 //   globaux->vecteurZeroy[0] /= etalon_metre;
00087 //   globaux->vecteurZeroz[0] /= etalon_metre;
00088 //   globaux->vecteurZerox[1] /= etalon_metre;
00089 //   globaux->vecteurZeroy[1] /= etalon_metre;
00090 //   globaux->vecteurZeroz[1] /= etalon_metre;
00091 //   globaux->vecteurZerox[2] /= etalon_metre;
00092 //   globaux->vecteurZeroy[2] /= etalon_metre;
00093 //   globaux->vecteurZeroz[2] /= etalon_metre;
00094 //   /* ------------------------------------ */
00095 //   globaux->rCut /= etalon_metre;
00096 //   globaux->rCutCoul /= etalon_metre;
00097 
00098 //   globaux->rCoulMin /= etalon_metre;
00099 //   globaux->rInf /= etalon_metre;
00100 //   globaux->rSup /= etalon_metre;
00101 //   globaux->rCutREBOLJ /= etalon_metre;
00102 //   globaux->r2Cut = globaux->rCut * globaux->rCut;
00103 //   globaux->r2CutREBOLJ = globaux->rCutREBOLJ * globaux->rCutREBOLJ;
00104 //   globaux->rVerlet /= etalon_metre;
00105 //   globaux->r2Verlet = globaux->rVerlet * globaux->rVerlet;
00106 
00107 //   globaux->eCinetiqueRequis /= etalon_energie;
00108 //   globaux->QeCinetiqueRequis /= etalon_energie;
00109 
00110 //   globaux->temperature /= etalon_temperature;
00111 
00112 //   globaux->masseNose *= etalon_temps*etalon_temps;
00113 //   globaux->masseHug *= etalon_temps*etalon_temps;
00114 //   globaux->eInitial /= etalon_energie;
00115 //   //  globaux->pressionInitial = PressionInitial;
00116 //   // globaux->DeriveLimite = DeriveLimite;
00117 //   // globaux->DeriveLimiteDistance = DeriveLimiteDistance;
00118 //   //globaux->masseBarostat = MasseBarostat;
00119 //   globaux->NouvelleTemperature /= etalon_temperature;
00120 
00121 //   globaux->tempsLimit /= etalon_temps;
00122 //   globaux->aMur /= etalon_energie;
00123 //   globaux->rcMur /= etalon_metre;
00124 //   globaux->vMurDroite *= etalon_temps / etalon_metre;
00125 //   globaux->vMatiere *= etalon_temps / etalon_metre;
00126 //   globaux->TzeroVitMatiere /= etalon_temps;
00127 //   globaux->RayonCylindre /= etalon_metre;
00128 //   globaux->RayonCylindre1 /= etalon_metre;
00129 //   globaux->RayonCylindre1 /= etalon_metre;
00130 //   globaux->PointCassure /= etalon_metre;
00131 //   globaux->HauteurMarche /= etalon_metre;
00132 //   globaux->LongueurMarche /= etalon_metre;
00133 //   globaux->EpaisseurMarche /= etalon_metre;
00134 //   globaux->EpaisseurSupport /= etalon_metre;
00135 //   globaux->OrigineMarche /= etalon_metre;
00136 
00137 //   globaux->A0Marche /= etalon_metre;
00138 //   globaux->A0Support /= etalon_metre;
00139 //   globaux->PositionPistonDroit /= etalon_metre;
00140 //   globaux->PositionPistonGauche /= etalon_metre;
00141 //   globaux->RayonCylindre2 /= etalon_metre;
00142 //   globaux->PosCylindre2 /= etalon_metre;
00143 //   //  globaux->MasseContour = MasseContour/avogadro ;
00144 
00145 //   globaux->TzeroVitPistonD /= etalon_temps;
00146 //   globaux->TzeroVitPistonG /= etalon_temps;
00147 //   globaux->TFinVitPistonD /= etalon_temps;
00148 //   globaux->TFinVitPistonG /= etalon_temps;
00149 //   globaux->TFinPistonD /= etalon_temps;
00150 //   globaux->TFinPistonG /= etalon_temps;
00151 //   globaux->TzeroVitMurD /= etalon_temps;
00152 //   globaux->TFinVitMurD /= etalon_temps;
00153 //   globaux->SigmaParoi /= etalon_metre;
00154 //   globaux->RcParoi /= etalon_metre;
00155 //   globaux->SigmaParoiSysteme /= etalon_metre;
00156 //   globaux->RcParoiSysteme /= etalon_metre;
00157 //   globaux->TzeroFrag /= etalon_temps;
00158 
00159 //   globaux->decalageMur /= etalon_metre;
00160 //   globaux->decalageMurD/= etalon_metre;
00161 //   globaux->decalageMurG/= etalon_metre;
00162 //   globaux->decalageMurBas/= etalon_metre;
00163 //   globaux->decalageMurHaut/= etalon_metre;
00164 //   globaux->decalageMurDevant/= etalon_metre;
00165 //   globaux->decalageMurDerriere/= etalon_metre;
00166 
00167 //   int i;
00168 
00169 //   for (i = 0 ; i < nbAtomes ; ++i){
00170 //     tableAtomes[i].masse /= etalon_masse;
00171 //     tableAtomes[i].sigma /= etalon_metre;
00172 //     tableAtomes[i].epsilon /= etalon_energie;
00173 
00174 //   }
00175 
00176 }
00177 
00178 // Geometrie & MaterialStamp::getGeometrieLocale(){
00179 //   if (geom_locale != -1)
00180 //     return MaterialAtomic::getGeometrieLocale();
00181 
00182 //   return *geom_locale;  
00183 // }
00184 
00185 
00186 void MaterialStamp::InitMaterial(){
00187   //  Boule * b = (Boule *) geom;
00188   //  unsigned int Dim = geom->GetDim();
00189 
00190   if (!LoadStamp(stampfile))
00191     {
00192       //      ConvertToAdim();
00193     }
00194 
00195 
00196   //  globaux->rayonDeMaSphere = b->Rmax();
00197   //globaux->cavitation = b->Rmin();
00198 
00199 //   if (Dim == 1)
00200 //     {
00201 //       globaux->rayonDeMaSphere = 1000;
00202 //       globaux->cavitation = 0.0;
00203       //    }
00204 
00205 }
00206 
00207 
00208 
00209 void MaterialStamp::LoadConfigFile(char * fichier)
00210 {
00211   Parser::ParseConfigFile<MaterialStamp>(fichier,"Stamp",this);
00212   Geometrie * g = GeometryManager::GetGeometry(geom);
00213   Cube & c = GeomTools::GetBoundingBox(*g);
00214   int Dim = g->GetDim();
00215   SetStampDimentionSysteme(c.Xmin(),c.Xmax(),c.Ymin(),c.Ymax(),c.Zmin(),c.Zmax(),Dim);
00216   delete &c;
00217   DUMP("Loading of config file ... done",DBG_INFO_STARTUP);
00218 
00219   if (geom == -1)
00220     FATAL("domain geometry has not been specified");
00221 
00222   if (geom_boundary == -1)
00223     FATAL("domain boundary geometry has not been specified");
00224 
00225   SetStampConfigFile(stampfile);
00226 }
00227 
00228 
00229 bool MaterialStamp::ParseLine(char * line)
00230 {
00231   char mot[256];
00232 
00233   if (UnitsConverter::GlobalUnits() != UnitsConverter::RealUnits)
00234     FATAL("Stamp cannot work with internal unities other than SI");
00235   
00236   bool parsed_flag = MaterialAtomic::ParseLine(line);
00237   if (parsed_flag)
00238     return true;
00239 
00240   line += Parser::strNext(mot,line);
00241   
00242   //analyse de la valeur en fonction du switch
00243   if(strcmp(mot,"STAMP_FILE")==0){
00244     line+=Parser::strNext(stampfile,line);
00245     DUMP("parsing STAMP_FILE commande = " << stampfile,DBG_INFO_STARTUP);
00246     parsed_flag = true;
00247   }
00248 
00249   return parsed_flag;
00250 }
00251 

Generated on Fri Sep 7 13:12:34 2007 for LibMultiScale by  doxygen 1.5.2