throw INTERP_KERNEL::Exception(oss.str().c_str());
}
+std::string MEDFileMesh::simpleRepr() const
+{
+ std::ostringstream oss;
+ oss << "(*************************************)\n(* GENERAL INFORMATION ON THE MESH : *)\n(*************************************)\n";
+ oss << "- Name of the mesh : <<" << getName() << ">>\n";
+ oss << "- Description associated to the mesh : " << getDescription() << std::endl;
+ return oss.str();
+}
+
DataArrayInt *MEDFileMesh::getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum) const throw(INTERP_KERNEL::Exception)
{
std::vector<std::string> tmp(1);
}
}
+void MEDFileMesh::getFamilyRepr(std::ostream& oss) const
+{
+ oss << "(**************************)\n(* FAMILIES OF THE MESH : *)\n(**************************)\n";
+ for(std::map<std::string,int>::const_iterator it=_families.begin();it!=_families.end();it++)
+ {
+ oss << "- Family with name \"" << (*it).first << "\" with number " << (*it).second << std::endl;
+ oss << " - Groups lying on this family : ";
+ std::vector<std::string> grps=getGroupsOnFamily((*it).first.c_str());
+ std::copy(grps.begin(),grps.end(),std::ostream_iterator<std::string>(oss," "));
+ oss << std::endl << std::endl;
+ }
+}
+
MEDFileUMesh *MEDFileUMesh::New(const char *fileName, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception)
{
MEDFileUtilities::CheckFileForRead(fileName);
std::string MEDFileUMesh::simpleRepr() const
{
std::ostringstream oss;
- oss << "(*************************************)\n(* GENERAL INFORMATION ON THE MESH : *)\n(*************************************)\n";
- oss << "- Name of the mesh : <<" << getName() << ">>\n";
+ oss << MEDFileMesh::simpleRepr();
const DataArrayDouble *coo=_coords;
oss << "- The dimension of the space is ";
static const char MSG1[]= "*** NO COORDS SET ***";
else
oss << MSG1 << std::endl;
oss << "- Type of the mesh : UNSTRUCTURED\n";
- oss << "- Description associated to the mesh : " << getDescription() << std::endl;
oss << "- Number of nodes : ";
if(coo)
oss << _coords->getNumberOfTuples() << std::endl;
else
oss << MSG2 << std::endl;
}
- oss << "- Number of families : " << _families.size() << std::endl;
+ oss << "- Number of families : " << _families.size() << std::endl << std::endl;
+ if(coo)
+ {
+ oss << "(***********************)\n(* NODES OF THE MESH : *)\n(***********************)\n";
+ oss << "- Names of coordinates :" << std::endl;
+ std::vector<std::string> vars=coo->getVarsOnComponent();
+ std::copy(vars.begin(),vars.end(),std::ostream_iterator<std::string>(oss," "));
+ oss << std::endl << "- Units of coordinates : " << std::endl;
+ std::vector<std::string> units=coo->getUnitsOnComponent();
+ std::copy(units.begin(),units.end(),std::ostream_iterator<std::string>(oss," "));
+ }
+ oss << std::endl << std::endl;
+ getFamilyRepr(oss);
return oss.str();
}
std::string MEDFileCMesh::simpleRepr() const
{
+ return MEDFileMesh::simpleRepr();
}
std::string MEDFileCMesh::advancedRepr() const
std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const throw(INTERP_KERNEL::Exception);
std::string getFamilyNameGivenId(int id) const throw(INTERP_KERNEL::Exception);
virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception) = 0;
- virtual std::string simpleRepr() const = 0;
+ virtual std::string simpleRepr() const;
virtual std::string advancedRepr() const = 0;
//
virtual void setGroupsAtLevel(int meshDimRelToMaxExt, const std::vector<const DataArrayInt *>& grps, bool renum=false) throw(INTERP_KERNEL::Exception);
MEDFileMesh();
void dealWithTinyInfo(const MEDCouplingMesh *m) throw(INTERP_KERNEL::Exception);
virtual void synchronizeTinyInfoOnLeaves() const = 0;
+ void getFamilyRepr(std::ostream& oss) const;
virtual void appendFamilyEntries(const std::set<int>& famIds, const std::vector< std::vector<int> >& fidsOfGrps, const std::vector<std::string>& grpNames);
static void TranslateFamilyIds(int offset, DataArrayInt *famArr, std::vector< std::vector<int> >& famIdsPerGrp);
protected: