{
static const char msg0[]="No coordinates specified !";
std::ostringstream ret;
+ if(!_cm)
+ {
+ ret << "No geometric type specified" << std::endl;
+ return ret.str();
+ }
ret << "Single static geometic type (" << _cm->getRepr() << ") unstructured mesh with name : \"" << getName() << "\"\n";
ret << "Description of mesh : \"" << getDescription() << "\"\n";
int tmpp1,tmpp2;
void MEDCoupling1SGTUMesh::reprQuickOverview(std::ostream& stream) const
{
- stream << "MEDCoupling1SGTUMesh C++ instance at " << this << ". Type=" << _cm->getRepr() << ". Name : \"" << getName() << "\".";
+ stream << "MEDCoupling1SGTUMesh C++ instance at " << this << ". Type=";
+ if(!_cm)
+ {
+ stream << "Not set";
+ return ;
+ }
+ stream << _cm->getRepr() << ". Name : \"" << getName() << "\".";
stream << " Mesh dimension : " << getMeshDimension() << ".";
if(!_coords)
{ stream << " No coordinates set !"; return ; }
std::string MEDCoupling1DGTUMesh::simpleRepr() const
{
static const char msg0[]="No coordinates specified !";
+ if(!_cm)
+ return std::string("Cell type not specified");
std::ostringstream ret;
ret << "Single dynamic geometic type (" << _cm->getRepr() << ") unstructured mesh with name : \"" << getName() << "\"\n";
ret << "Description of mesh : \"" << getDescription() << "\"\n";
void MEDCoupling1DGTUMesh::reprQuickOverview(std::ostream& stream) const
{
- stream << "MEDCoupling1DGTUMesh C++ instance at " << this << ". Type=" << _cm->getRepr() << ". Name : \"" << getName() << "\".";
+ stream << "MEDCoupling1DGTUMesh C++ instance at " << this << ". Type=";
+ if(!_cm)
+ {
+ stream << "Not defined";
+ return ;
+ }
+ stream << _cm->getRepr() << ". Name : \"" << getName() << "\".";
stream << " Mesh dimension : " << getMeshDimension() << ".";
if(!_coords)
{ stream << " No coordinates set !"; return ; }
self.assertTrue(d.eigenValues().isEqual(valuesExp,1e-12))
pass
+ def testBugOnReprOf1SGTUMesh(self):
+ """ Non reg bug on repr of empty MEDCoupling1SGTUMesh instance """
+ m = MEDCoupling1SGTUMesh()
+ m.simpleRepr()
+ str(m)
+ m.advancedRepr()
+ repr(m)
+ m = MEDCoupling1DGTUMesh()
+ m.simpleRepr()
+ str(m)
+ m.advancedRepr()
+ repr(m)
+
pass
if __name__ == '__main__':