// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/
// file : MG_ADAPT.cxx
#include "MG_ADAPT.hxx"
#include <unistd.h>
#include <TCollection_AsciiString.hxx>
#include <cstring>
+#include <cstdlib>
#include <boost/filesystem.hpp>
-
static std::string removeFile(std::string fileName, int& notOk)
{
std::string errStr;
{
std::vector<std::string> fieldFileNames;
- MeshFormatWriter writer;
+ 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!
void MgAdapt::convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const
{
- MeshFormatReader reader(meshFormatIn, solFieldFileNames);
+ MEDCoupling::MeshFormatReader reader(meshFormatIn, solFieldFileNames);
MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = reader.loadInMedFileDS();
// write MED
{
try // safety : FAMILY could be lost P2-->P1
{
- std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( fIt->_famId );
+ std::string givenFamNameFromMeshGemConverter = fileMesh->getFamilyNameGivenId( std::abs(fIt->_famId) );
+ fileMesh->changeFamilyId(std::abs(fIt->_famId), fIt->_famId);
fileMesh->changeFamilyName(givenFamNameFromMeshGemConverter, fIt->_famName);
}
catch (const std::exception& e)
tmpMfd->setFields( tmp_fields );
- MeshFormatWriter tmpWriter;
+ MEDCoupling::MeshFormatWriter tmpWriter;
tmpWriter.setMeshFileName(meshFormatsizeMapFile);
tmpWriter.setFieldFileNames( fieldFileNames);
tmpWriter.setMEDFileDS(tmpMfd);