{
}
-MEDFileFieldPerMeshPerTypePerDisc::MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other):RefCountObject(other),_type(other._type),_father(0),_start(other._start),_end(other._end),_nval(other._nval),_profile(other._profile),_localization(other._localization),_loc_id(other._loc_id),_tmp_work1(other._tmp_work1),_pd(other._pd)
+MEDFileFieldPerMeshPerTypePerDisc::MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other):RefCountObject(other),_type(other._type),_father(0),_start(other._start),_end(other._end),_nval(other._nval),_profile(other._profile),_localization(other._localization),_loc_id(other._loc_id),_profile_it(other._profile_it),_pd(other._pd),_tmp_work1(other._tmp_work1)
{
}
(*it1)->getMesh()->computeNodeIdsAlg(fetchedNodeIds);
int nMin(std::distance(fetchedNodeIds.begin(),std::find(fetchedNodeIds.begin(),fetchedNodeIds.end(),true)));
int nMax(std::distance(fetchedNodeIds.rbegin(),std::find(fetchedNodeIds.rbegin(),fetchedNodeIds.rend(),true)));
- nMax=nCoords-nMax-1;
+ nMax=nCoords-nMax;
for(std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> > >::const_iterator it0=_per_type_mesh.begin();it0!=_per_type_mesh.end();it0++)
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
(*it1)->getMesh()->renumberNodesWithOffsetInConn(-nMin);
med_bool changement,transformation;
int spaceDim((int)infosOnComp.size()),nCoords(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation));
_coords=DataArrayDouble::New();
- int nbNodesToLoad(nMax-nMin+1);
+ int nbNodesToLoad(nMax-nMin);
_coords->alloc(nbNodesToLoad,spaceDim);
med_filter filter=MED_FILTER_INIT,filter2=MED_FILTER_INIT;
MEDfilterBlockOfEntityCr(fid,/*nentity*/nCoords,/*nvaluesperentity*/1,/*nconstituentpervalue*/spaceDim,
arr[:,1]=range(100,125)
f.setArray(arr)
MEDLoader.WriteField(fileName,f,2)
+ f=MEDCouplingFieldDouble(ON_NODES,ONE_TIME) ; f.setMesh(m)
+ f.setName("FieldNode")
+ arr=DataArrayDouble(36,2) ; arr.setInfoOnComponents(compos)
+ arr[:,0]=range(200,236)
+ arr[:,1]=range(300,336)
+ f.setArray(arr)
+ f.checkCoherency()
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f)
+ #
+ ms=MEDFileMeshes()
+ mm=MEDFileUMesh.LoadPartOf(fileName,meshName,[NORM_QUAD4],[0,6,1])
+ ms.pushMesh(mm)
+ fs=MEDFileFields.LoadPartOf(fileName,False,ms)
+ self.assertEqual(fs[1][0].getFieldSplitedByType(),[(40,[(1,(0,14),'','')])])
#
ms=MEDFileMeshes()
mm=MEDFileUMesh.LoadPartOf(fileName,meshName,[NORM_QUAD4],[3,15,1])
arr=DataArrayDouble(12,2) ; arr[:,0]=range(3,15) ; arr[:,1]=range(103,115)
arr.setInfoOnComponents(compos)
self.assertTrue(fs[0][0].getUndergroundDataArray().isEqual(arr,1e-12))
+ fs[1][0].loadArrays()
+ arr=DataArrayDouble(21,2) ; arr[:,0]=range(203,224) ; arr[:,1]=range(303,324)
+ arr.setInfoOnComponents(compos)
+ self.assertTrue(fs[1][0].getUndergroundDataArray().isEqual(arr,1e-12))
pass
pass