std::vector<mcIdType> famIds=getFamiliesIds(fams);
if(meshDimRelToMaxExt==1)
{
- if((const DataArrayIdType *)_fam_coords)
+ if(_fam_coords.isNotNull())
{
MCAuto<DataArrayIdType> da;
if(!famIds.empty())
return da.retn();
}
else
- throw INTERP_KERNEL::Exception("MEDFileUMesh::getFamiliesArr : no family array specified on nodes !");
+ {
+ MCAuto<DataArrayIdType> ret(DataArrayIdType::New());
+ ret->alloc(0,1);
+ return ret.retn();
+ }
}
const MEDFileUMeshSplitL1 *l1=getMeshAtLevSafe(meshDimRelToMaxExt);
if(!famIds.empty())
self.assertEqual([1,2,4,13,15],medmesh.getFamiliesArr(0,["Family_-5","Family_-3"],True).getValues());
self.assertEqual([18,1,2,3,4,13,14,15],medmesh.getGroupsArr(0,["mesh2","mesh4","mesh3"],True).getValues());
famn=medmesh.getFamilyNameGivenId(0)
- self.assertRaises(InterpKernelException,medmesh.getNodeFamilyArr,famn,True);
+ #self.assertRaises(InterpKernelException,medmesh.getNodeFamilyArr,famn,True) # EDF26299
+ self.assertTrue(medmesh.getNodeFamilyArr(famn,True).isEqualWithoutConsideringStr(DataArrayInt([])))
#without renum
self.assertEqual([2,3,5,14,16],medmesh.getGroupArr(0,"mesh2").getValues());
self.assertEqual([2,3,16],medmesh.getFamilyArr(0,"Family_-3").getValues());
self.assertEqual([2,3,5,14,16],medmesh.getFamiliesArr(0,["Family_-5","Family_-3"]).getValues());
self.assertEqual([0,2,3,4,5,14,15,16],medmesh.getGroupsArr(0,["mesh2","mesh3","mesh4"],False).getValues());
- self.assertRaises(InterpKernelException,medmesh.getNodeFamilyArr,famn,False);
+ #self.assertRaises(InterpKernelException,medmesh.getNodeFamilyArr,famn,False) # EDF26299
+ self.assertTrue(medmesh.getNodeFamilyArr(famn,False).isEqualWithoutConsideringStr(DataArrayInt([])))
pass
# this tests emulates MEDMEM ( Except that it works ! ) The permutation are NOT taken into account
self.assertNotEqual(mm_reload.getGlobalNumFieldAtLevel(1).getClassName() , "DataArrayMedInt")
pass
+ def test44(self):
+ """
+ EDF26299 : symmetrization of the behavior between families at nodes and cells
+ """
+ arr = DataArrayDouble([0,1,2])
+ cmesh = MEDCouplingCMesh("TEST")
+ cmesh.setCoords(arr, arr, arr)
+ umesh3d = cmesh.buildUnstructured()
+ umesh2d = umesh3d.computeSkin()
+
+ cas1 = MEDFileUMesh()
+
+ cas1[0] = umesh3d
+ cas1[-1] = umesh2d
+ cas2 = cas1.deepCopy()
+
+ # cas1 only groups on cells
+ gcell1 = DataArrayInt([1])
+ gcell1.setName("GCELL1")
+ cas1.setGroupsAtLevel(0, [gcell1])
+
+
+ # Cas2 only groups on nodes
+ gnode1 = DataArrayInt([1])
+ gnode1.setName("GNODE1")
+ cas2.setGroupsAtLevel(1, [gnode1])
+ # On demande un groupe sur un niveau ou ce groupe n'existe pas
+ self.assertTrue( cas2.getGroupArr(0, "GNODE1").isEqualWithoutConsideringStr( DataArrayInt([]) ) ) # Expected to return empty array on both cases
+ self.assertTrue( cas1.getGroupArr(1, "GCELL1").isEqualWithoutConsideringStr( DataArrayInt([]) ) ) # Expected to return empty array on both cases
+
pass
if __name__ == "__main__":