extern med_geometry_type typmai3[34];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const char MEDFileMesh::DFT_FAM_NAME[]="FAMILLE_ZERO";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
MEDFileUtilities::CheckFileForRead(fileName);
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> ret;
switch(meshType)
MEDFileMesh *MEDFileMesh::New(const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs, MEDFileJoints* joints)
{
MEDFileUtilities::CheckFileForRead(fileName);
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,dummy3,dummy0,dummy1,dummy2);
MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> ret;
switch(meshType)
return ret;
}
+/*!
+ * Returns names of groups that partly or fully appear on the level \a meshDimRelToMaxExt.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of interest.
+ * \return std::vector<std::string> - a sequence of group names at \a meshDimRelToMaxExt
+ * level.
+ */
+std::vector<std::string> MEDFileMesh::getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const
+{
+ std::vector<std::string> ret;
+ std::vector<std::string> allGrps(getGroupsNames());
+ for(std::vector<std::string>::const_iterator it=allGrps.begin();it!=allGrps.end();it++)
+ {
+ std::vector<int> levs(getGrpNonEmptyLevelsExt((*it)));
+ if(std::find(levs.begin(),levs.end(),meshDimRelToMaxExt)!=levs.end())
+ ret.push_back(*it);
+ }
+ return ret;
+}
+
+/*!
+ * Returns all relative mesh levels (including nodes) where a given group is defined.
+ * \param [in] grp - the name of the group of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpNonEmptyLevelsExt(const std::string& grp) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroup(grp));
+ return getFamsNonEmptyLevelsExt(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (**excluding nodes**) where given groups are defined.
+ * To include nodes, call getGrpsNonEmptyLevelsExt() method.
+ * \param [in] grps - a sequence of names of the groups of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroups(grps));
+ return getFamsNonEmptyLevels(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (including nodes) where given groups are defined.
+ * \param [in] grps - a sequence of names of the groups of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroups(grps));
+ return getFamsNonEmptyLevelsExt(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (**excluding nodes**) where a given group is defined.
+ * To include nodes, call getGrpNonEmptyLevelsExt() method.
+ * \param [in] grp - the name of the group of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpNonEmptyLevels(const std::string& grp) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroup(grp));
+ return getFamsNonEmptyLevels(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (**excluding nodes**) where a given family is defined.
+ * To include nodes, call getFamNonEmptyLevelsExt() method.
+ * \param [in] fam - the name of the family of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getFamNonEmptyLevels(const std::string& fam) const
+{
+ std::vector<std::string> fams(1,std::string(fam));
+ return getFamsNonEmptyLevels(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (including nodes) where a given family is defined.
+ * \param [in] fam - the name of the family of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getFamNonEmptyLevelsExt(const std::string& fam) const
+{
+ std::vector<std::string> fams(1,std::string(fam));
+ return getFamsNonEmptyLevelsExt(fams);
+}
+
std::string MEDFileMesh::GetMagicFamilyStr()
{
return std::string(MEDFileMeshL2::ZE_SEP_FOR_FAMILY_KILLERS);
std::vector<int> MEDFileMesh::getDistributionOfTypes(int meshDimRelToMax) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> mLev(getGenMeshAtLevel(meshDimRelToMax));
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> mLev(getMeshAtLevel(meshDimRelToMax));
return mLev->getDistributionOfTypes();
}
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
return new MEDFileUMesh(fid,ms.front(),dt,it,mrs);
}
void MEDFileUMesh::loadPartUMeshFromFile(med_idt fid, const std::string& mName, const std::vector<INTERP_KERNEL::NormalizedCellType>& types, const std::vector<int>& slicPerTyp, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUMeshL2 loaderl2;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
int mid(MEDFileUMeshL2::GetMeshIdFromName(fid,mName,meshType,dummy3,dummy0,dummy1,dummy2));
if(meshType!=UNSTRUCTURED)
{
_equiv->getRepr(oss);
}
+void MEDFileMesh::checkCartesian() const
+{
+ if(getAxType()!=AX_CART)
+ {
+ std::ostringstream oss; oss << "MEDFileMesh::checkCartesian : request for method that is dedicated to a cartesian convention ! But you are not in cartesian convention (" << DataArray::GetAxTypeRepr(getAxType()) << ").";
+ oss << std::endl << "To perform operation you have two possiblities :" << std::endl;
+ oss << " - call setAxType(AX_CART)" << std::endl;
+ oss << " - call cartesianize()";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+}
+
/*!
* \brief Return number of joints, which is equal to number of adjacent mesh domains
*/
void MEDFileUMesh::loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUMeshL2 loaderl2;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType axType;
+ MEDCoupling::MEDCouplingAxisType axType;
int mid(MEDFileUMeshL2::GetMeshIdFromName(fid,mName,meshType,axType,dummy0,dummy1,dummy2));
setAxType(axType);
if(meshType!=UNSTRUCTURED)
return ret;
}
-/*!
- * Returns all relative mesh levels (**excluding nodes**) where a given group is defined.
- * To include nodes, call getGrpNonEmptyLevelsExt() method.
- * \param [in] grp - the name of the group of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpNonEmptyLevels(const std::string& grp) const
-{
- std::vector<std::string> fams=getFamiliesOnGroup(grp);
- return getFamsNonEmptyLevels(fams);
-}
-
-/*!
- * Returns all relative mesh levels (including nodes) where a given group is defined.
- * \param [in] grp - the name of the group of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpNonEmptyLevelsExt(const std::string& grp) const
-{
- std::vector<std::string> fams=getFamiliesOnGroup(grp);
- return getFamsNonEmptyLevelsExt(fams);
-}
-
-/*!
- * Returns all relative mesh levels (**excluding nodes**) where a given family is defined.
- * To include nodes, call getFamNonEmptyLevelsExt() method.
- * \param [in] fam - the name of the family of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getFamNonEmptyLevels(const std::string& fam) const
-{
- std::vector<std::string> fams(1,std::string(fam));
- return getFamsNonEmptyLevels(fams);
-}
-
-/*!
- * Returns all relative mesh levels (including nodes) where a given family is defined.
- * \param [in] fam - the name of the family of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getFamNonEmptyLevelsExt(const std::string& fam) const
-{
- std::vector<std::string> fams(1,std::string(fam));
- return getFamsNonEmptyLevelsExt(fams);
-}
-
-/*!
- * Returns all relative mesh levels (**excluding nodes**) where given groups are defined.
- * To include nodes, call getGrpsNonEmptyLevelsExt() method.
- * \param [in] grps - a sequence of names of the groups of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const
-{
- std::vector<std::string> fams=getFamiliesOnGroups(grps);
- return getFamsNonEmptyLevels(fams);
-}
-
-/*!
- * Returns all relative mesh levels (including nodes) where given groups are defined.
- * \param [in] grps - a sequence of names of the groups of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const
-{
- std::vector<std::string> fams=getFamiliesOnGroups(grps);
- return getFamsNonEmptyLevelsExt(fams);
-}
-
/*!
* Returns all relative mesh levels (**excluding nodes**) where given families are defined.
* To include nodes, call getFamsNonEmptyLevelsExt() method.
std::vector<int> MEDFileUMesh::getFamsNonEmptyLevels(const std::vector<std::string>& fams) const
{
std::vector<int> ret;
- std::vector<int> levs=getNonEmptyLevels();
- std::vector<int> famIds=getFamiliesIds(fams);
+ std::vector<int> levs(getNonEmptyLevels());
+ std::vector<int> famIds(getFamiliesIds(fams));
for(std::vector<int>::const_iterator it=levs.begin();it!=levs.end();it++)
if(_ms[-(*it)]->presenceOfOneFams(famIds))
ret.push_back(*it);
*/
std::vector<int> MEDFileUMesh::getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const
{
- std::vector<int> ret0=getFamsNonEmptyLevels(fams);
- const DataArrayInt *famCoords=_fam_coords;
+ std::vector<int> ret0(getFamsNonEmptyLevels(fams));
+ const DataArrayInt *famCoords(_fam_coords);
if(!famCoords)
return ret0;
- std::vector<int> famIds=getFamiliesIds(fams);
+ std::vector<int> famIds(getFamiliesIds(fams));
if(famCoords->presenceOfValue(famIds))
{
std::vector<int> ret(ret0.size()+1);
return ret0;
}
-/*!
- * Returns names of groups that partly or fully appear on the level \a meshDimRelToMaxExt.
- * \param [in] meshDimRelToMaxExt - a relative dimension of interest.
- * \return std::vector<std::string> - a sequence of group names at \a meshDimRelToMaxExt
- * level.
- */
-std::vector<std::string> MEDFileUMesh::getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const
-{
- std::vector<std::string> ret;
- std::vector<std::string> allGrps=getGroupsNames();
- for(std::vector<std::string>::const_iterator it=allGrps.begin();it!=allGrps.end();it++)
- {
- std::vector<int> levs=getGrpNonEmptyLevelsExt((*it));
- if(std::find(levs.begin(),levs.end(),meshDimRelToMaxExt)!=levs.end())
- ret.push_back(*it);
- }
- return ret;
-}
-
int MEDFileUMesh::getMaxAbsFamilyIdInArrays() const
{
int ret=-std::numeric_limits<int>::max(),tmp=-1;
*/
DataArrayDouble *MEDFileUMesh::getCoords() const
{
+ checkCartesian();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp(_coords);
if((DataArrayDouble *)tmp)
{
*/
MEDCouplingUMesh *MEDFileUMesh::getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum) const
{
+ checkCartesian();
synchronizeTinyInfoOnLeaves();
std::vector<std::string> tmp(1);
tmp[0]=grp;
*/
MEDCouplingUMesh *MEDFileUMesh::getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum) const
{
+ checkCartesian();
synchronizeTinyInfoOnLeaves();
std::vector<std::string> fams2=getFamiliesOnGroups(grps);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> zeRet=getFamilies(meshDimRelToMaxExt,fams2,renum);
*/
MEDCouplingUMesh *MEDFileUMesh::getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum) const
{
+ checkCartesian();
synchronizeTinyInfoOnLeaves();
std::vector<std::string> tmp(1);
tmp[0]=fam;
*/
MEDCouplingUMesh *MEDFileUMesh::getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum) const
{
+ checkCartesian();
synchronizeTinyInfoOnLeaves();
if(meshDimRelToMaxExt==1)
{
* \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to
* delete using decrRef() as it is no more needed.
* \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh.
- * \sa getGenMeshAtLevel()
*/
MEDCouplingUMesh *MEDFileUMesh::getMeshAtLevel(int meshDimRelToMaxExt, bool renum) const
{
+ checkCartesian();
synchronizeTinyInfoOnLeaves();
if(meshDimRelToMaxExt==1)
{
return l1->getWholeMesh(renum);
}
-/*!
- * Returns a MEDCouplingUMesh of a given relative dimension.
- * \warning If \a meshDimRelToMaxExt == 1 (which means nodes), the returned mesh **is not
- * valid**. This is a feature, because MEDLoader does not create cells that do not exist!
- * To build a valid MEDCouplingUMesh from the returned one in this case,
- * call MEDCouplingUMesh::Build0DMeshFromCoords().
- * \param [in] meshDimRelToMax - the relative dimension of interest.
- * \param [in] renum - if \c true, the returned mesh is permuted according to the
- * optional numbers of mesh entities.
- * \return MEDCouplingMesh * - a pointer to MEDCouplingUMesh that the caller is to
- * delete using decrRef() as it is no more needed.
- * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a this mesh.
- * \sa getMeshAtLevel()
- */
-MEDCouplingMesh *MEDFileUMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum) const
-{
- return getMeshAtLevel(meshDimRelToMax,renum);
-}
-
std::vector<int> MEDFileUMesh::getDistributionOfTypes(int meshDimRelToMax) const
{
const MEDFileUMeshSplitL1 *l1(getMeshAtLevSafe(meshDimRelToMax));
*/
std::vector<MEDCoupling1GTUMesh *> MEDFileUMesh::getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const
{
+ checkCartesian();
const MEDFileUMeshSplitL1 *sp(getMeshAtLevSafe(meshDimRelToMax));
return sp->getDirectUndergroundSingleGeoTypeMeshes();
}
*/
MEDCoupling1GTUMesh *MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const
{
- const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(gt);
+ checkCartesian();
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(gt));
int lev=(int)cm.getDimension()-getMeshDimension();
const MEDFileUMeshSplitL1 *sp(getMeshAtLevSafe(lev));
return sp->getDirectUndergroundSingleGeoTypeMesh(gt);
end=PutInThirdComponentOfCodeOffset(code2,start);
newCode.insert(newCode.end(),code2.begin(),code2.end());
//
- if(o2nCellsPart2->isIdentity())
+ if(o2nCellsPart2->isIdentity2(o2nCellsPart2->getNumberOfTuples()))
continue;
if(famField)
{
*/
MEDFileUMesh *MEDFileUMesh::buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const
{
+ checkCartesian();
if(getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("MEDFileUMesh::buildExtrudedMesh : this is expected to be with mesh dimension equal to 2 !");
MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
*/
MEDFileUMesh *MEDFileUMesh::linearToQuadratic(int conversionType, double eps) const
{
+ checkCartesian();
MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
int initialNbNodes(getNumberOfNodes());
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0Tmp(getMeshAtLevel(0));
*/
MEDFileUMesh *MEDFileUMesh::quadraticToLinear(double eps) const
{
+ checkCartesian();
MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0Tmp(getMeshAtLevel(0));
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0(dynamic_cast<MEDCouplingUMesh *>(m0Tmp->deepCpy()));
* \return MEDCouplingMesh * - a pointer to MEDCouplingMesh that the caller is to
* delete using decrRef() as it is no more needed.
*/
-MEDCouplingMesh *MEDFileStructuredMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum) const
+MEDCouplingMesh *MEDFileStructuredMesh::getMeshAtLevel(int meshDimRelToMax, bool renum) const
{
+ checkCartesian();
if(renum)
throw INTERP_KERNEL::Exception("MEDFileCurveLinearMesh does not support renumbering ! To do it perform request of renum array directly !");
const MEDCouplingStructuredMesh *m(getStructuredMesh());
case -1:
{
if(!m)
- throw INTERP_KERNEL::Exception("MEDFileStructuredMesh::getGenMeshAtLevel : level -1 requested must be non empty to be able to compute unstructured sub mesh !");
+ throw INTERP_KERNEL::Exception("MEDFileStructuredMesh::getMeshAtLevel : level -1 requested must be non empty to be able to compute unstructured sub mesh !");
buildMinusOneImplicitPartIfNeeded();
- MEDCouplingMesh *ret(_faces_if_necessary);
+ MEDCoupling1SGTUMesh *ret(_faces_if_necessary);
if(ret)
ret->incrRef();
return ret;
}
}
+std::vector<int> MEDFileStructuredMesh::getFamsNonEmptyLevels(const std::vector<std::string>& fams) const
+{
+ std::vector<int> ret;
+ const DataArrayInt *famCells(_fam_cells),*famFaces(_fam_faces);
+ if(famCells && famCells->presenceOfValue(ret))
+ ret.push_back(0);
+ if(famFaces && famFaces->presenceOfValue(ret))
+ ret.push_back(-1);
+ return ret;
+}
+
+std::vector<int> MEDFileStructuredMesh::getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const
+{
+ std::vector<int> ret(getFamsNonEmptyLevels(fams));
+ const DataArrayInt *famNodes(_fam_nodes);
+ if(famNodes && famNodes->presenceOfValue(ret))
+ ret.push_back(1);
+ return ret;
+}
+
/*!
* Returns number of mesh entities of a given relative dimension in \a this mesh.
* \param [in] meshDimRelToMaxExt - the relative dimension of interest.
*/
MEDCoupling1SGTUMesh *MEDFileStructuredMesh::getImplicitFaceMesh() const
{
+ checkCartesian();
return _faces_if_necessary;
}
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
return new MEDFileCMesh(fid,ms.front(),dt,it,mrs);
}
void MEDFileCMesh::loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dtunit;
- ParaMEDMEM::MEDCouplingAxisType axType;
+ MEDCoupling::MEDCouplingAxisType axType;
int mid=MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,axType,dummy0,dummy1,dtunit);
if(meshType!=CARTESIAN)
{
}
MEDFileCMeshL2 loaderl2;
loaderl2.loadAll(fid,mid,mName,dt,it);
- setAxType(loaderl2.getAxType());
+ setAxType(axType);
MEDCouplingCMesh *mesh=loaderl2.getMesh();
mesh->incrRef();
_cmesh=mesh;
MEDLoaderBase::safeStrCpy2(c.c_str(),MED_SNAME_SIZE-1,comp+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
- // MED_CARTESIAN and not MEDFileMeshL2::TraduceAxisTypeRev(getAxType()) ! Yes it is not a bug. The discrimination is done in MEDmeshGridTypeWr.
- MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,spaceDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MED_CARTESIAN,comp,unit));
+ MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,spaceDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxType()),comp,unit));
if(_univ_wr_status)
MEDFILESAFECALLERWR0(MEDmeshUniversalNameWr,(fid,maa));
MEDFILESAFECALLERWR0(MEDmeshGridTypeWr,(fid,maa,MEDFileMeshL2::TraduceAxisTypeRevStruct(getAxType())));
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingAxisType dummy3;
std::string dummy2;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
return new MEDFileCurveLinearMesh(fid,ms.front(),dt,it,mrs);
void MEDFileCurveLinearMesh::loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dtunit;
- ParaMEDMEM::MEDCouplingAxisType axType;
+ MEDCoupling::MEDCouplingAxisType axType;
int mid=MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,axType,dummy0,dummy1,dtunit);
setAxType(axType);
if(meshType!=CURVE_LINEAR)
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
loadFromFile(fileName,ms.front());
}