-
- data->myFileInDir = from->myFileInDir;
- data->myMeshFileIn = from->myMeshFileIn;
- data->myMeshFileBackground = from->myMeshFileBackground;
- data->myOutMeshName = from->myOutMeshName;
- data->myMeshFileOut = from->myMeshFileOut;
- data->myFileOutDir = from->myFileOutDir;
- data->myFileSizeMapDir = from->myFileSizeMapDir;
- data->myFieldName = from->myFieldName;
- data->fromMedFile = from->fromMedFile;
- data->myPublish = from->myPublish;
- data->myMeshOutMed = from->myMeshOutMed;
- data->myUseLocalMap = from->myUseLocalMap;
- data->myUseBackgroundMap = from->myUseBackgroundMap;
- data->myUseConstantValue = from->myUseConstantValue;
- data->myConstantValue = from->myConstantValue;
- data->myTimeStep = from->myTimeStep;
- data->myRank = from->myRank;
- data->myUseNoTimeStep = from->myUseNoTimeStep;
- data->myUseLastTimeStep = from->myUseLastTimeStep;
- data->myUseChosenTimeStep = from->myUseChosenTimeStep;
- data->myWorkingDir = from->myWorkingDir;
- data->myLogFile = from->myLogFile;
- data->myPrintLogInFile = from->myPrintLogInFile;
- data->myKeepFiles = from->myKeepFiles;
- data->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess;
- data->myVerboseLevel = from->myVerboseLevel;
-
-}
-
-
-void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& solFormatFieldFileName, std::string& meshFormatsizeMapFile)
-{
-
- std::vector<std::string> fieldFileNames;
- MEDCoupling::MeshFormatWriter writer;
- MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = MEDCoupling::MEDFileData::New(medFileIn);
- MEDCoupling::MEDFileMeshes* meshes = mfd->getMeshes();
- MEDCoupling::MEDFileMesh* fileMesh = meshes->getMeshAtPos(0); // ok only one mesh in file!
- if (meshNameOut =="")
- meshNameOut = fileMesh->getName();
- storeGroupsAndFams(fileMesh);
-
- MEDCoupling::MCAuto<MEDCoupling::MEDFileFields> fields = MEDCoupling::MEDFileFields::New();
- solFormatFieldFileName = getFileName();
- solFormatFieldFileName+=".sol";
- fieldFileNames.push_back(solFormatFieldFileName);
-
- if (useBackgroundMap)
+ data->myFileInDir = from->myFileInDir;
+ data->myMeshFileIn = from->myMeshFileIn;
+ data->myMeshFileBackground = from->myMeshFileBackground;
+ data->myOutMeshName = from->myOutMeshName;
+ data->myMeshFileOut = from->myMeshFileOut;
+ data->myFileOutDir = from->myFileOutDir;
+ data->myFileSizeMapDir = from->myFileSizeMapDir;
+ data->myFieldName = from->myFieldName;
+ data->fromMedFile = from->fromMedFile;
+ data->myPublish = from->myPublish;
+ data->myMeshOutMed = from->myMeshOutMed;
+ data->myUseLocalMap = from->myUseLocalMap;
+ data->myUseBackgroundMap = from->myUseBackgroundMap;
+ data->myUseConstantValue = from->myUseConstantValue;
+ data->myConstantValue = from->myConstantValue;
+ data->myTimeStep = from->myTimeStep;
+ data->myRank = from->myRank;
+ data->myUseNoTimeStep = from->myUseNoTimeStep;
+ data->myUseLastTimeStep = from->myUseLastTimeStep;
+ data->myUseChosenTimeStep = from->myUseChosenTimeStep;
+ data->myWorkingDir = from->myWorkingDir;
+ data->myLogFile = from->myLogFile;
+ data->myPrintLogInFile = from->myPrintLogInFile;
+ data->myKeepFiles = from->myKeepFiles;
+ data->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess;
+ data->myVerboseLevel = from->myVerboseLevel;
+}
+
+std::vector<std::string> MgAdapt::getListFieldsNames(std::string fileIn)
+{
+ MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = MEDCoupling::MEDFileData::New(fileIn);
+ std::vector<std::string> listFieldsNames(mfd->getFields()->getFieldsNames());
+ return listFieldsNames ;
+}
+
+void MgAdapt::checkDimensionOptionAdaptation()
+{
+ // Quand le maillage est 3D, tout est possible
+ // Quand le maillage est 2D, il faut 'surface' sauf si carte de fonds 3D
+ MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = MEDCoupling::MEDFileData::New(medFileIn);
+ int meshdim = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ;
+// std::cout << "meshdim = " << meshdim << std::endl;
+
+ if ( meshdim == 2 )
+ {
+ std::string optionName = "adaptation";
+ std::string optionValue = getOptionValue(optionName);
+// std::cout << "optionValue = '" << optionValue <<"'"<< std::endl;
+ bool a_tester = false ;
+ // carte locale ou constante : impératif d'avoir "surface"
+ if ( useLocalMap || useConstantValue) a_tester = true ;
+ // carte de fond : impératif d'avoir "surface" si le fonds est aussi 2D
+ else