]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
22341: [CEA 958] sauv2med: different nb of gauss points in components
authoreap <eap@opencascade.com>
Fri, 11 Oct 2013 13:16:37 +0000 (13:16 +0000)
committereap <eap@opencascade.com>
Fri, 11 Oct 2013 13:16:37 +0000 (13:16 +0000)
 Fix regression of tests: correct creation of a supporting mesh for a
 partial field on nodes

src/MEDLoader/SauvMedConvertor.cxx

index f243840ce573f24d54cafc04d7df4c18d2bfca25..9d1e08eb423b20582d4383fea79af006a0775001 100644 (file)
@@ -3348,13 +3348,26 @@ void IntermediateMED::setTS( SauvUtilities::DoubleField*  fld,
   timeStamp->setName( fld->_name.c_str() );
   timeStamp->setDescription( fld->_description.c_str() );
   // set the mesh
-  MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh > dimMesh = mesh->getMeshAtLevel( dimRel );
   if ( onAll )
     {
+      MEDCouplingAutoRefCountObjectPtr
+        < MEDCouplingUMesh > dimMesh = mesh->getMeshAtLevel( dimRel );
       timeStamp->setMesh( dimMesh );
     }
+  else if ( timeStamp->getTypeOfField() == ParaMEDMEM::ON_NODES )
+    {
+      DataArrayDouble * coo = mesh->getCoords();
+      MEDCouplingAutoRefCountObjectPtr
+        <DataArrayDouble> subCoo = coo->selectByTupleId(support->_medGroup->begin(),
+                                                        support->_medGroup->end()); 
+      MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh > nodeSubMesh =
+        MEDCouplingUMesh::Build0DMeshFromCoords( subCoo );
+      timeStamp->setMesh( nodeSubMesh );
+    }
   else
     {
+      MEDCouplingAutoRefCountObjectPtr
+        < MEDCouplingUMesh > dimMesh = mesh->getMeshAtLevel( dimRel );
       MEDCouplingAutoRefCountObjectPtr
         <MEDCouplingMesh> subMesh = dimMesh->buildPart(support->_medGroup->begin(),
                                                        support->_medGroup->end());