ELSE()
SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
ENDIF()
+
# Handle the standard arguments of the find_package() command:
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE)
+IF(SPHINX_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} "--version" OUTPUT_VARIABLE SPHINX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+ STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" )
+ MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}")
+ IF(SPHINX_VERSION VERSION_LESS "1.3")
+ SET(SPHINX_THEME "basic")
+ ELSE()
+ SET(SPHINX_THEME "classic")
+ ENDIF()
+ENDIF(SPHINX_EXECUTABLE)
##
## 0. Initialization
##
+ PARSE_ARGUMENTS(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS "ENVVAR" "" ${ARGN})
# Package name, upper case
STRING(TOUPPER ${pkg} pkg_UC)
##
## 1. Load environment or any previously detected root dir for the package
##
- IF(DEFINED ENV{${pkg_UC}_ROOT_DIR})
- FILE(TO_CMAKE_PATH "$ENV{${pkg_UC}_ROOT_DIR}" _${pkg_UC}_ROOT_DIR_ENV)
+ SET(_envvar ${pkg_UC}_ROOT_DIR)
+ IF(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR)
+ SET(_envvar "${SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR}")
+ ENDIF()
+ IF(DEFINED ENV{${_envvar}})
+ FILE(TO_CMAKE_PATH "$ENV{${_envvar}}" _${pkg_UC}_ROOT_DIR_ENV)
SET(_dflt_value "${_${pkg_UC}_ROOT_DIR_ENV}")
ELSE()
# will be blank if no package was previously loaded:
SET(_dflt_value "${${pkg_UC}_ROOT_DIR_EXP}")
ENDIF()
-
# Detect if the variable has been set on the command line or elsewhere:
- IF(DEFINED ${pkg_UC}_ROOT_DIR)
+ IF(DEFINED ${_envvar})
SET(_var_already_there TRUE)
ELSE()
SET(_var_already_there FALSE)
ENDIF()
# Make cache entry
- SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory")
+ SET(${_envvar} "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory")
##
## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake)
# Override the variable - don't append to it, as it would give precedence
# to what was stored there before!
- SET(CMAKE_PREFIX_PATH "${${pkg_UC}_ROOT_DIR}")
+ IF(DEFINED ${_envvar})
+ SET(CMAKE_PREFIX_PATH "${${_envvar}}")
+ ENDIF()
# Try find_package in config mode. This has the priority, but is
# performed QUIET and not REQUIRED:
IF(NOT Salome${pkg}_FIND_QUIETLY)
IF(Salome${pkg}_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
- "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} "
+ "It currently contains ${_envvar}=${${_envvar}} "
"Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
ELSE()
MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
- "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} "
+ "It currently contains ${_envvar}=${${_envvar}} "
"Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
ENDIF()
ENDIF()
##
## 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR)
##
- IF(DEFINED ENV{${pkg_UC}_ROOT_DIR})
+ IF(DEFINED ENV{${_envvar}})
SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${_${pkg_UC}_ROOT_DIR_ENV}")
IF(NOT _res)
MESSAGE(WARNING "${pkg} was found, but not at the path given by the "
- "environment ${pkg_UC}_ROOT_DIR! Is the variable correctly set? "
+ "environment ${_envvar}! Is the variable correctly set? "
"The two paths are: ${_tmp_ROOT_DIR} and: ${_${pkg_UC}_ROOT_DIR_ENV}")
ELSE()
- MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${pkg_UC}_ROOT_DIR variable, all good!")
+ MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${_envvar} variable, all good!")
ENDIF()
ELSE()
IF(NOT _var_already_there)
- MESSAGE(STATUS "Variable ${pkg_UC}_ROOT_DIR was not explicitly defined. "
+ MESSAGE(STATUS "Variable ${_envvar} was not explicitly defined. "
"An installation was found anyway: ${_tmp_ROOT_DIR}")
ENDIF()
ENDIF()
##
## 6. Save the detected installation
##
- SET(${pkg_UC}_ROOT_DIR "${_tmp_ROOT_DIR}")
+ SET(${_envvar} "${_tmp_ROOT_DIR}")
ELSE()
MESSAGE(STATUS "${pkg} was not found.")
src1 = pvs.ParaMEDCorbaPluginSource()
src1.IORCorba = ior # This is where we need the CORBA reference of the object created
dr = pvs.Show(src1)
-
\ No newline at end of file
+
myCoords = DataArrayDouble.New()
myCoords.setValues(coordinates,nbOfNodes,3)
mesh.setCoords(myCoords)
- mesh.checkCoherency()
+ mesh.checkConsistencyLight()
print "6 ********************"
# Extraction of surfacic meshing
mesh2D = mesh.buildFacePartOfMySelfNode(nodes,True)
#print mesh2D
mesh2D.setName("3Dcube")
- mesh2D.checkCoherency()
+ mesh2D.checkConsistencyLight()
print "7 ********************"
# Creation of field : with following definition
field = MEDCouplingFieldDouble.New(ON_CELLS)
field.setMesh(mesh)
field.setName("field")
- field.setNature(Integral)
+ field.setNature(ExtensiveMaximum)
# Computing and setting field values
myCoords=DataArrayDouble.New()
sampleTab=[]
- bar = mesh.getBarycenterAndOwner()
+ bar = mesh.computeCellCenterOfMass()
print bar.getNbOfElems()
for i in range(nbOfCells):
x = bar.getIJ(i+1,1)
fBF = MEDCouplingFieldDouble.New(ON_CELLS)
fBF.setMesh(mesh2D)
fBF.setName("fieldBottomFace")
- fBF.setNature(Integral)
+ fBF.setNature(ExtensiveMaximum)
Cval = 10.
myCoords2D=DataArrayDouble.New()
sampleTab=[]
a = cI.deltaShiftIndex()
b = a - 1
myNewNbOfTuples = oldNbOfTuples - sum(b.getValues())
- o2n, newNbOfTuples = mc.DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2(oldNbOfTuples,c,cI)
+ o2n, newNbOfTuples = mc.DataArrayInt.ConvertIndexArrayToO2N(oldNbOfTuples,c,cI)
print "Have I got the right number of tuples?"
print "myNewNbOfTuples = %d, newNbOfTuples = %d" % (myNewNbOfTuples, newNbOfTuples)
assert(myNewNbOfTuples == newNbOfTuples)
m.insertNextCell(mc.NORM_POLYGON, cell_connec.getValues())
pass
# Check that everything is coherent (will throw if not)
- m.checkCoherency()
+ m.checkConsistencyLight()
# Write the result into a VTU file that can be read with ParaView
m.writeVTK("My7hexagons.vtu")
print "Are f and f2 equal?", f.isEqualWithoutConsideringStr(f2,1e-12,1e-12)
#
da1 = f.getArray() # a DataArrayDouble, which is a direct reference (not a copy) of the field's values
- ids1 = da1.getIdsInRange(0.,5.)
+ ids1 = da1.findIdsInRange(0.,5.)
fPart1 = f.buildSubPart(ids1)
fPart1.writeVTK("ExoField_fPart1.vtu")
- ids2 = f.getArray().getIdsInRange(50.,1.e300)
+ ids2 = f.getArray().findIdsInRange(50.,1.e300)
fPart2 = f.buildSubPart(ids2)
# Renumbering cells to follow MED file rules
- fPart1Cpy = fPart1.deepCpy()
+ fPart1Cpy = fPart1.deepCopy()
o2n = fPart1Cpy.getMesh().sortCellsInMEDFileFrmt()
fPart1Cpy.getArray().renumberInPlace(o2n)
# Check that fPart1Cpy and fPart1 are the same
fPart12 = mc.MEDCouplingFieldDouble.MergeFields([fPart1,fPart2])
fPart12.writeVTK("ExoField_fPart12.vtu")
# Evaluation on points
- bary = fPart12.getMesh().getBarycenterAndOwner()
+ bary = fPart12.getMesh().computeCellCenterOfMass()
arr1 = fPart12.getValueOnMulti(bary)
arr2 = f.getValueOnMulti(bary)
delta = arr1-arr2
delta.abs()
print "Is field evaluation matching?", (delta.accumulate()[0]<1e-12)
- # Integral computations
+ # ExtensiveMaximum computations
integ1 = fPart12.integral(0,True)
integ1_bis = fPart12.getArray().accumulate()[0]
print "First integral matching ?", ( abs(integ1 - integ1_bis) < 1e-8 )
fMc = f1ts.getFieldAtLevel(ml.ON_CELLS,0)
arr = fMc.getArray()
arr.getMinMaxPerComponent() # just to see the field variation range per component
- ids = arr.getIdsInRange(0.,1.)
+ ids = arr.findIdsInRange(0.,1.)
f2Mc = fMc[ids]
# Extract pression field on the swirler
pressMts = data.getFields()["PRESSION_ELEM_DOM"]
agitateurMesh3DMc = pressOnAgitateurMc.getMesh()
m3DSurf,desc,descI,revDesc,revDescI = agitateurMesh3DMc.buildDescendingConnectivity()
nbOf3DCellSharing = revDescI.deltaShiftIndex()
- ids2 = nbOf3DCellSharing.getIdsEqual(1)
+ ids2 = nbOf3DCellSharing.findIdsEqual(1)
agitateurSkinMc = m3DSurf[ids2]
offsetsOfTupleIdsInField = revDescI[ids2]
tupleIdsInField = revDesc[offsetsOfTupleIdsInField]
# Torque computation
singlePolyhedron = agitateurMesh3DMc.buildSpreadZonesWithPoly()
singlePolyhedron.orientCorrectlyPolyhedrons()
- centerOfMass = singlePolyhedron.getBarycenterAndOwner()
+ centerOfMass = singlePolyhedron.computeCellCenterOfMass()
- barySkin=agitateurSkinMc.getBarycenterAndOwner()
+ barySkin=agitateurSkinMc.computeCellCenterOfMass()
posSkin = barySkin-centerOfMass
torquePerCellOnSkin = ml.DataArrayDouble.CrossProduct(posSkin,forceVectSkin)
def computeAngle(locAgitateur1ts):
fMc = locAgitateur1ts.getFieldAtLevel(ml.ON_CELLS,0)
arr = fMc.getArray()
- ids = arr.getIdsInRange(0.,1.)
+ ids = arr.findIdsInRange(0.,1.)
f2Mc = fMc[ids]
m3DSurf,desc,descI,revDesc,revDescI = f2Mc.getMesh().buildDescendingConnectivity()
nbOf3DCellSharing = revDescI.deltaShiftIndex()
- ids2 = nbOf3DCellSharing.getIdsEqual(1)
+ ids2 = nbOf3DCellSharing.findIdsEqual(1)
agitateurSkinMc = m3DSurf[ids2]
#
singlePolyhedron = agitateurMesh3DMc.buildSpreadZonesWithPoly()
singlePolyhedron.orientCorrectlyPolyhedrons()
- centerOfMass = singlePolyhedron.getBarycenterAndOwner()
- bary = agitateurSkinMc.getBarycenterAndOwner()
+ centerOfMass = singlePolyhedron.computeCellCenterOfMass()
+ bary = agitateurSkinMc.computeCellCenterOfMass()
posSkin = bary-centerOfMass
x2=posSkin[:,0]*posSkin[:,0] ; x2=x2.accumulate()[0]
y2=posSkin[:,1]*posSkin[:,1] ; y2=y2.accumulate()[0]
import MEDLoader as ml
def displayVTK(m,fname):
- tmp = m.deepCpy()
+ tmp = m.deepCopy()
tmp.tessellate2D(0.1)
tmp.writeVTK(fname)
return
mobm = mobile.getMeshAtLevel(0)
mobm.mergeNodes(1e-10)
# Visualize fixm and mobm with PARAVIEW
- fixm2 = fixm.deepCpy() # tessellate2D() modifies the current mesh
+ fixm2 = fixm.deepCopy() # tessellate2D() modifies the current mesh
fixm2.tessellate2D(0.1)
fixm2.writeVTK("fixm2.vtu")
- mobm2 = mobm.deepCpy()
+ mobm2 = mobm.deepCopy()
mobm2.tessellate2D(0.1)
mobm2.writeVTK("mobm2.vtu")
# mobm2 is in several pieces, take the first one
partFixMob, iPart, iMob = ml.MEDCouplingUMesh.Intersect2DMeshes(partFixm,zone1Mobm,1e-10)
partFixMob.mergeNodes(1e-10)
# Get the part of partFixm not included in zone1Mobm using partFixMob
- ids3 = iMob.getIdsEqual(-1)
+ ids3 = iMob.findIdsEqual(-1)
partFixmWithoutZone1Mobm = partFixMob[ids3]
displayVTK(partFixmWithoutZone1Mobm,"partFixmWithoutZone1Mobm.vtu")
# Check that intersection worked properly
areaZone1Mobm = zone1Mobm.getMeasureField(ml.ON_CELLS).getArray()
areaZone1Mobm.abs()
val3 = areaZone1Mobm.accumulate()[0]
- ids4 = iMob.getIdsNotEqual(-1)
+ ids4 = iMob.findIdsNotEqual(-1)
areaPartFixMob2 = areaPartFixMob[ids4]
val4 = areaPartFixMob2.accumulate()[0]
print "Check #1 %lf == %lf with precision 1e-8 ? %s" % (val3,val4,str(abs(val3-val4)<1e-8))
# Check #2
isCheck2OK = True
for icell in xrange(partFixm.getNumberOfCells()):
- ids5 = iPart.getIdsEqual(icell)
+ ids5 = iPart.findIdsEqual(icell)
areaOfCells = areaPartFixMob[ids5]
areaOfCells.abs()
if abs(areaOfCells.accumulate()[0] - areaPartFixm[icell]) > 1e-9:
print "Check #2? %s" % (str(isCheck2OK))
# Indicator field creation
f = ml.MEDCouplingFieldDouble(ml.ON_CELLS,ml.ONE_TIME)
- m = partFixMob.deepCpy()
+ m = partFixMob.deepCopy()
m.tessellate2D(0.1)
f.setMesh(m)
arr = ml.DataArrayDouble(partFixMob.getNumberOfCells(),1)
- arr[iMob.getIdsEqual(-1)] = 0.
- arr[iMob.getIdsNotEqual(-1)] = 1.
+ arr[iMob.findIdsEqual(-1)] = 0.
+ arr[iMob.findIdsNotEqual(-1)] = 1.
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
f.setName("Zone")
ml.MEDCouplingFieldDouble.WriteVTK("Zone.vtu",[f])
# Other zones
partFixMob2,iPart2,iMob2 = ml.MEDCouplingUMesh.Intersect2DMeshes(partFixm,zonesMobm,1e-10)
partFixMob2.mergeNodes(1e-10)
f2 = ml.MEDCouplingFieldDouble(ml.ON_CELLS, ml.ONE_TIME)
- m2 = partFixMob2.deepCpy()
+ m2 = partFixMob2.deepCopy()
m2.tessellate2D(0.1)
f2.setMesh(m2)
arr = ml.DataArrayDouble(partFixMob2.getNumberOfCells(),1)
- arr[iMob2.getIdsEqual(-1)]=0.
+ arr[iMob2.findIdsEqual(-1)]=0.
st = 0
end = st + len(zonesInMobm[0])
- arr[iMob2.getIdsInRange(st,end)] = 1.
+ arr[iMob2.findIdsInRange(st,end)] = 1.
st += len(zonesInMobm[0]) ;
end = st + len(zonesInMobm[1])
- arr[iMob2.getIdsInRange(st,end)] = 2.
+ arr[iMob2.findIdsInRange(st,end)] = 2.
st += len(zonesInMobm[1])
end = st + len(zonesInMobm[2])
- arr[iMob2.getIdsInRange(st,end)] = 3.
+ arr[iMob2.findIdsInRange(st,end)] = 3.
f2.setArray(arr)
- f2.checkCoherency()
+ f2.checkConsistencyLight()
f2.setName("Zone2")
ml.MEDCouplingFieldDouble.WriteVTK("Zone2.vtu",[f2])
mat = rem.getCrudeCSRMatrix()
indptr = mc.DataArrayInt(mat.indptr)
indptr2 = indptr.deltaShiftIndex()
- cellIdsOfSkin = indptr2.getIdsEqual(1)
+ cellIdsOfSkin = indptr2.findIdsEqual(1)
skin = skinAndNCFaces[cellIdsOfSkin]
skin.writeVTK("skin.vtu")
pass
print "5 ********************"
- mesh.checkCoherency()
+ mesh.checkConsistencyLight()
medFileName = "MEDCoupling_Fleur.med"
MEDLoader.WriteUMesh(medFileName,mesh,True)
res=f.getValueOn(pos)
# Verify if value is OK
- bar = mesh3D.getBarycenterAndOwner()
+ bar = mesh3D.computeCellCenterOfMass()
x=bar.getIJ(1,1)
y=bar.getIJ(1,2)
z=bar.getIJ(1,3)
srcField.getArray().setInfoOnComponent(0, "powercell [W]")
# Transfer field
#remap.transferField(srcField, 1e300)
- srcField.setNature(mc.ConservativeVolumic)
+ srcField.setNature(mc.IntensiveMaximum)
trgFieldCV = remap.transferField(srcField,1e300)
- # ConservativeVolumic
+ # IntensiveMaximum
integSource = srcField.integral(True)[0]
integTarget = trgFieldCV.integral(True)[0]
- print "ConservativeVolumic -- integrals: %lf == %lf" % (integSource, integTarget)
+ print "IntensiveMaximum -- integrals: %lf == %lf" % (integSource, integTarget)
accSource = srcField.getArray().accumulate()[0]
accTarget = trgFieldCV.getArray().accumulate()[0]
- print "ConservativeVolumic -- sums: %lf != %lf" % (accSource, accTarget)
- # IntegralGlobConstraint
- srcField.setNature(mc.IntegralGlobConstraint)
+ print "IntensiveMaximum -- sums: %lf != %lf" % (accSource, accTarget)
+ # ExtensiveConservation
+ srcField.setNature(mc.ExtensiveConservation)
trgFieldI = remap.transferField(srcField,1e300)
#
integSource = srcField.integral(True)[0]
integTarget = trgFieldI.integral(True)[0]
- print "IntegralGlobConstraint -- integrals: %lf != %lf" % (integSource, integTarget)
+ print "ExtensiveConservation -- integrals: %lf != %lf" % (integSource, integTarget)
accSource = srcField.getArray().accumulate()[0]
accTarget = trgFieldI.getArray().accumulate()[0]
- print "IntegralGlobConstraint -- sums: %lf == %lf" % (accSource, accTarget)
+ print "ExtensiveConservation -- sums: %lf == %lf" % (accSource, accTarget)
mesh3D.setCoords(myCoords);
mesh3D.orientCorrectlyPolyhedrons()
mesh3D.sortCellsInMEDFileFrmt()
- mesh3D.checkCoherency()
+ mesh3D.checkConsistencyLight()
renum = mc.DataArrayInt(60) ; renum[:15]=range(15,30) ; renum[15:30]=range(15) ; renum[30:45]=range(45,60) ; renum[45:]=range(30,45)
mesh3D.renumberNodes(renum,60)
# Scale coordinates from meters to centimeters
# Extract cells from a given Z level - Solution 1
tmp,cellIdsSol1 = mesh3D.buildSlice3D([0.,0.,(zLev[1]+zLev[2])/2],[0.,0.,1.],1e-12)
# Idem - Solution 2
- bary = mesh3D.getBarycenterAndOwner()
+ bary = mesh3D.computeCellCenterOfMass()
baryZ = bary[:,2]
- cellIdsSol2 = baryZ.getIdsInRange(zLev[1],zLev[2])
+ cellIdsSol2 = baryZ.findIdsInRange(zLev[1],zLev[2])
# Idem - Solution 3
nodeIds = mesh3D.findNodesOnPlane([0.,0.,zLev[0]],[0.,0.,1.],1e-10)
mesh2D = mesh3D.buildFacePartOfMySelfNode(nodeIds,True)
- extMesh = mc.MEDCouplingExtrudedMesh(mesh3D,mesh2D,0)
+ extMesh = mc.MEDCouplingMappedExtrudedMesh(mesh3D,mesh2D,0)
n_cells = mesh2D.getNumberOfCells()
cellIdsSol3 = extMesh.getMesh3DIds()[n_cells:2*n_cells]
# Compare the 3 methods
baryXY = bary[:,[0,1]]
baryXY -= [250.,150.]
magn = baryXY.magnitude()
- cellIds2Sol1 = magn.getIdsInRange(0.,1e-12)
+ cellIds2Sol1 = magn.findIdsInRange(0.,1e-12)
# Extract cells along a line - Solution 2
- bary2 = mesh2D.getBarycenterAndOwner()[:,[0,1]]
+ bary2 = mesh2D.computeCellCenterOfMass()[:,[0,1]]
bary2 -= [250.,150.]
magn = bary2.magnitude()
- ids = magn.getIdsInRange(0.,1e-12)
+ ids = magn.findIdsInRange(0.,1e-12)
idStart = int(ids) # ids is assumed to contain only one value, if not an exception is thrown
ze_range = range(idStart,mesh3D.getNumberOfCells(),mesh2D.getNumberOfCells())
cellIds2Sol2 = extMesh.getMesh3DIds()[ze_range]
mesh3DSlice2 = mesh3D[cellIds2Sol1]
mesh3DSlice2.zipCoords()
# Aggregate two meshes, one being the translated version of the original
- mesh3DSlice2bis = mesh3DSlice2.deepCpy()
+ mesh3DSlice2bis = mesh3DSlice2.deepCopy()
mesh3DSlice2bis.translate([0.,1000.,0.])
mesh3DSlice2All = mc.MEDCouplingUMesh.MergeUMeshes([mesh3DSlice2,mesh3DSlice2bis])
mesh3DSlice2All.writeVTK("mesh3DSlice2All.vtu")
# Discover descending connectivity
mesh3DSurf,desc,descIndx,revDesc,revDescIndx = mesh3D.buildDescendingConnectivity()
numberOf3DCellSharing = revDescIndx.deltaShiftIndex()
- cellIds = numberOf3DCellSharing.getIdsNotEqual(1)
+ cellIds = numberOf3DCellSharing.findIdsNotEqual(1)
mesh3DSurfInside = mesh3DSurf[cellIds]
mesh3DSurfInside.writeVTK("mesh3DSurfInside.vtu")
::
import MEDLoader as ml
- from MEDLoader import MEDLoader
# Mesh creation
targetCoords = [-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ]
targetConn = [0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
#
f = ml.MEDCouplingFieldDouble(ml.ON_CELLS, ml.ONE_TIME)
f.setTime(5.6,7,8)
- f.setArray(targetMesh.getBarycenterAndOwner())
+ f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
# Prepare field for writing
::
import MEDLoader as ml
- from MEDLoader import MEDLoader
# Mesh creation
targetCoords = [-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ]
targetConn = [0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
targetMesh.setCoords(myCoords)
# Writing mesh only
- MEDLoader.WriteUMesh("TargetMesh.med",targetMesh,True) # True means 'from scratch'
+ ml.WriteUMesh("TargetMesh.med",targetMesh,True) # True means 'from scratch'
# Re-read it and test equality
- meshRead = MEDLoader.ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
+ meshRead = ml.ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
print "Is the read mesh equal to 'targetMesh' ?", meshRead.isEqual(targetMesh,1e-12)
# Writing a field and its support mesh in one go
f = ml.MEDCouplingFieldDouble.New(ml.ON_CELLS, ml.ONE_TIME)
f.setTime(5.6,7,8) # Declare the timestep associated to the field
- f.setArray(targetMesh.getBarycenterAndOwner())
+ f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
- MEDLoader.WriteField("MyFirstField.med",f,True)
+ ml.WriteField("MyFirstField.med",f,True)
# Re-read it ans test equality
- f2 = MEDLoader.ReadFieldCell("MyFirstField.med", f.getMesh().getName(), 0, f.getName(), 7, 8)
+ f2 = ml.ReadFieldCell("MyFirstField.med", f.getMesh().getName(), 0, f.getName(), 7, 8)
print "Is the read field identical to 'f' ?", f2.isEqual(f,1e-12,1e-12)
# Writing in several steps
- MEDLoader.WriteUMesh("MySecondField.med",f.getMesh(),True)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f)
+ ml.WriteUMesh("MySecondField.med",f.getMesh(),True)
+ ml.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f)
# A second field to write
f2 = f.clone(True) # 'True' means that we need a deep copy
f2.getArray()[:] = 2.0
f2.setTime(7.8,9,10)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
+ ml.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
# Re-read and test this two-timestep field
- f3 = MEDLoader.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),7,8)
+ f3 = ml.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),7,8)
print "Is the field read in file equals to 'f' ?", f.isEqual(f3,1e-12,1e-12)
- f4 = MEDLoader.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),9,10)
+ f4 = ml.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),9,10)
print "Is the field read in file equals to 'f2' ?", f2.isEqual(f4,1e-12,1e-12)
cellField0_read = MEDLoader.ReadFieldCell("proc0.med","mesh",0,"CellField",5,6)
cellField1_read = MEDLoader.ReadFieldCell("proc1.med","mesh",0,"CellField",5,6)
cellField_read = ml.MEDCouplingFieldDouble.MergeFields([cellField0_read,cellField1_read])
- cellFieldCpy = cellField.deepCpy()
+ cellFieldCpy = cellField.deepCopy()
cellFieldCpy.substractInPlaceDM(cellField_read,10,1e-12)
cellFieldCpy.getArray().abs()
print cellFieldCpy.getArray().isUniform(0.,1e-12)
nodeField1_read = MEDLoader.ReadFieldNode("proc1.med","mesh",0,"NodeField",5,6)
nodeField_read = ml.MEDCouplingFieldDouble.MergeFields([nodeField0_read, nodeField1_read])
nodeField_read.mergeNodes(1e-10)
- nodeFieldCpy = nodeField.deepCpy()
+ nodeFieldCpy = nodeField.deepCopy()
nodeFieldCpy.mergeNodes(1e-10)
nodeFieldCpy.substractInPlaceDM(nodeField_read,10,1e-12)
print nodeFieldCpy.getArray().isUniform(0.,1e-12)
if typp == ml.ON_CELLS:
arr.renumberInPlace(o2nML[lev])
mcf = ml.MEDCouplingFieldDouble(typp,ml.ONE_TIME) ; mcf.setName(fieldName) ; mcf.setTime(tim,dt,it) ; mcf.setArray(arr)
- mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkCoherency()
+ mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkConsistencyLight()
mergeField.appendFieldNoProfileSBT(mcf)
pass
pass
# Options for HTML output
# -----------------------
-html_theme = 'basic'
+html_theme = '@SPHINX_THEME@'
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
for i in range(6):
mesh.insertNextCell(NORM_POLYGON,6,connectivity[6*i:6*(i+1)])
pass
- mesh.checkCoherency()
+ mesh.checkConsistencyLight()
Saving the mesh in a med file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pass
# Check mesh consistency:
- mesh.checkCoherency()
+ mesh.checkConsistencyLight()
Method by extrusion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
field = MEDCouplingFieldDouble.New(ON_CELLS)
field.setMesh(mesh)
field.setName("field")
- field.setNature(Integral)
+ field.setNature(ExtensiveMaximum)
# Computing and setting field values
myCoords=DataArrayDouble.New()
sampleTab=[]
- bar = mesh.getBarycenterAndOwner()
+ bar = mesh.computeCellCenterOfMass()
print bar.getNbOfElems()
for i in range(nbOfCells):
x = bar.getIJ(...)
mesh2D = mesh.buildFacePartOfMySelfNode(nodes,True)
#print mesh2D
mesh2D.setName("3Dcube")
- mesh2D.checkCoherency()
+ mesh2D.checkConsistencyLight()
medFileName = "MEDCoupling_cube3D.med"
meshes=[mesh2D,mesh]
res=f.getValueOn(pos)
# Verify if value is OK
- bar = mesh3D.getBarycenterAndOwner()
+ bar = mesh3D.computeCellCenterOfMass()
x=bar.getIJ(...)
y=bar.getIJ(...)
z=bar.getIJ(...)
An alternative (and more compact) way to do it : ::
- ds=[d.deepCpy() for i in xrange(len(translationToPerform))]
+ ds=[d.deepCopy() for i in xrange(len(translationToPerform))]
for (elt,t) in zip(ds,translationToPerform) : elt+=t
Aggregating DataArrayDouble
The format 'old-2-new' is systematically used for all renumbering operations (one-to-one correspondence).
-The static method DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2() performs the conversion from one storage mode to the other (c, cI to o2n).
+The static method DataArrayInt.ConvertIndexArrayToO2N() performs the conversion from one storage mode to the other (c, cI to o2n).
We get for free the number of elements in Y, i.e. the variable newNbOfTuples. ::
- o2n,newNbOfTuples=DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2(oldNbOfTuples,c,cI)
+ o2n,newNbOfTuples=DataArrayInt.ConvertIndexArrayToO2N(oldNbOfTuples,c,cI)
print "Have I got the right result? %s"%(str(myNewNbOfTuples==newNbOfTuples))
Using o2n and newNbOfTuples invoke DataArrayDouble.renumberAndReduce() on d2. ::
Check that m is coherent. ::
- m.checkCoherency()
+ m.checkConsistencyLight()
To visually check m, write it in a VTU file ("My7hexagons.vtu") and display it in ParaVis. ::
.. note:: Pour toutes les opérations de renumérotation en MEDCoupling (bijection),
le format "old-2-new" est systématiquement utilisé.
-La méthode statique ``DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2()`` (nom un peu barbare, on vous l'accorde)
+La méthode statique ``DataArrayInt.ConvertIndexArrayToO2N()`` (nom un peu barbare, on vous l'accorde)
permet de passer du mode de stockage de cette surjection ``c``, ``cI`` au format ``o2n``.
On récupère au passage card(Y) c'est-à-dire le ``newNbOfTuples``. ::
- o2n, newNbOfTuples = mc.DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2(oldNbOfTuples,c,cI)
+ o2n, newNbOfTuples = mc.DataArrayInt.ConvertIndexArrayToO2N(oldNbOfTuples,c,cI)
print "Have I got the right number of tuples?"
print "myNewNbOfTuples = %d, newNbOfTuples = %d" % (myNewNbOfTuples, newNbOfTuples)
assert(myNewNbOfTuples == newNbOfTuples)
Vérifier que ``m`` est correct et ne contient pas d'anomalie. ::
- m.checkCoherency()
+ m.checkConsistencyLight()
.. note:: Il est toujours une bonne idée d'appeler cette méthode après la construction "from scratch" d'un maillage.
Cela assure qu'il n'y a pas de gros "couacs" dans la connectivité, etc ...
Builing of a subpart of a field
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Store in ids1 the list of tuple ids whose value is within [0.0,5.0] (DataArrayDouble.getIdsInRange) . From ids1 build the sub-part fPart1 of the field "f". ::
+Store in ids1 the list of tuple ids whose value is within [0.0,5.0] (DataArrayDouble.findIdsInRange) . From ids1 build the sub-part fPart1 of the field "f". ::
- ids1=f.getArray().getIdsInRange(0.,5.)
+ ids1=f.getArray().findIdsInRange(0.,5.)
fPart1=f.buildSubPart(ids1)
.. image:: images/FieldDouble1_1.png
Select the part "fPart2" of the field "f" whose values are in [50.,infinity). ::
- ids2=f.getArray().getIdsInRange(50.,1.e300)
+ ids2=f.getArray().findIdsInRange(50.,1.e300)
fPart2=f.buildSubPart(ids2)
Renumbering cells
The generated file "fPart1" is valid for MEDCoupling, but its cells are not sorted by geometric type: it is not valid from a MED file point of view. By using MEDCouplingUMesh.sortCellsInMEDFileFrmt and DataArrayDouble.renumberInPlace
renumber manually fPart1 starting from a deep copy of fPart1. ::
- fPart1Cpy=fPart1.deepCpy()
+ fPart1Cpy=fPart1.deepCopy()
o2n=fPart1Cpy.getMesh().sortCellsInMEDFileFrmt()
fPart1Cpy.getArray().renumberInPlace(o2n)
Evaluate the values of the computed field "fPart12" on the barycenters of its mesh.
Evaluate the field "f" on the same barycenters. The method used is MEDCouplingFieldDouble.getValueOnMulti(). ::
- bary=fPart12.getMesh().getBarycenterAndOwner()
+ bary=fPart12.getMesh().computeCellCenterOfMass()
arr1=fPart12.getValueOnMulti(bary)
arr2=f.getValueOnMulti(bary)
delta=arr1-arr2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Récupérer dans une variable ``ids1`` la liste des identifiants de cellules pour lesquelles la valeur du champ est dans le
-range [0.0,5.0]. Utiliser pour cela la méthode ``DataArrayDouble.getIdsInRange()``. Avec ce résultat, construire la
+range [0.0,5.0]. Utiliser pour cela la méthode ``DataArrayDouble.findIdsInRange()``. Avec ce résultat, construire la
sous-partie ``fPart1`` du champ ``f``. ::
da1 = f.getArray() # a DataArrayDouble, which is a direct reference (not a copy) of the field's values
- ids1 = da1.getIdsInRange(0., 5.)
+ ids1 = da1.findIdsInRange(0., 5.)
fPart1 = f.buildSubPart(ids1)
fPart1.writeVTK("ExoField_fPart1.vtu")
Sélectionner la partie ``fPart2`` du champ ``f`` dont toutes les valeurs de tuples
sont dans ``[50.,+infinity)``. ::
- ids2 = f.getArray().getIdsInRange(50., 1.e300)
+ ids2 = f.getArray().findIdsInRange(50., 1.e300)
fPart2 = f.buildSubPart(ids2)
Ce genre de technique permet d'extraire facilement les parties d'un champ relatives à un groupe de mailles par exemple.
L'idée est d'utiliser les deux méthodes ``MEDCouplingUMesh.sortCellsInMEDFileFrmt()`` et
``DataArrayDouble.renumberInPlace()`` pour renuméroter manuellement une *copie* de ``fPart1``: ::
- fPart1Cpy = fPart1.deepCpy()
+ fPart1Cpy = fPart1.deepCopy()
o2n = fPart1Cpy.getMesh().sortCellsInMEDFileFrmt()
fPart1Cpy.getArray().renumberInPlace(o2n)
Evaluer la valeur du champ ``fPart12`` calculé précédemment sur les barycentres des cellules de son
maillage (variable ``bary``) et mettre le résultat dans ``arr1``.
-Utiliser pour cela les méthodes ``MEDCouplingFieldDouble.getValueOnMulti()`` et ``MEDCouplingMesh.getBarycenterAndOwner()``.
+Utiliser pour cela les méthodes ``MEDCouplingFieldDouble.getValueOnMulti()`` et ``MEDCouplingMesh.computeCellCenterOfMass()``.
De manière similaire, évaluer ensuite directement le champ ``f`` en utilisant la même liste de points
que précédemment (``bary``) et mettre le résultat dans ``arr2``.
Vérifier ensuite que ``arr1`` et ``arr2`` sont bien égaux: ::
- bary = fPart12.getMesh().getBarycenterAndOwner()
+ bary = fPart12.getMesh().computeCellCenterOfMass()
arr1 = fPart12.getValueOnMulti(bary)
arr2 = f.getValueOnMulti(bary)
delta = arr1-arr2
mesh3D.setCoords(myCoords)
mesh3D.orientCorrectlyPolyhedrons()
mesh3D.sortCellsInMEDFileFrmt()
- mesh3D.checkCoherency()
+ mesh3D.checkConsistencyLight()
renum=DataArrayInt.New(60) ; renum[:15]=range(15,30) ; renum[15:30]=range(15) ; renum[30:45]=range(45,60) ; renum[45:]=range(30,45)
mesh3D.renumberNodes(renum,60)
Firstly, compute the barycenters of the 3D cells. Then select the 2nd component of the barycenter of the cells.
Finally select the tuple ids (corresponding to cell ids) falling in the range [zLev[1],zLev[2]]. ::
- bary=mesh3D.getBarycenterAndOwner()
+ bary=mesh3D.computeCellCenterOfMass()
baryZ=bary[:,2]
- cellIdsSol2=baryZ.getIdsInRange(zLev[1],zLev[2])
+ cellIdsSol2=baryZ.findIdsInRange(zLev[1],zLev[2])
-* Using MEDCouplingExtrudedMesh :
+* Using MEDCouplingMappedExtrudedMesh :
This is the safest method since it only uses the nodal connectivity to compute the extrusion. The coordinates are ignored.
-Two things are needed to build a MEDCouplingExtrudedMesh. The 3D mesh you expect to be an extruded mesh, and a 2D mesh
+Two things are needed to build a MEDCouplingMappedExtrudedMesh. The 3D mesh you expect to be an extruded mesh, and a 2D mesh
lying on the same coordinates, from which the extrusion will be computed.
Let's begin with the build of the 2D mesh. We build it from all the nodes on a plane going through point [0.,0.,zLev[0]] and with normal vector [0.,0.,1.] (MEDCouplingUMesh.findNodesOnPlane()).
Then invoke MEDCouplingUMesh.buildFacePartOfMySelfNode to build mesh2D (read the documentation of buildFacePartOfMySelfNode()). ::
Then it is possible to compute an extrusion from mesh3D and mesh2D. ::
- extMesh=MEDCouplingExtrudedMesh.New(mesh3D,mesh2D,0)
+ extMesh=MEDCouplingMappedExtrudedMesh.New(mesh3D,mesh2D,0)
Then simply request the 2nd row. ::
baryXY=bary[:,[0,1]]
baryXY-=[250.,150.]
magn=baryXY.magnitude()
- cellIds2Sol1=magn.getIdsInRange(0.,1e-12)
+ cellIds2Sol1=magn.findIdsInRange(0.,1e-12)
-* using extrusion extMesh: starting from the unique cell in mesh2D whose center is at [250.,150.,0.] MEDCouplingExtrudedMesh.getMesh3DIds retrieves the cell IDs sorted by slice. ::
+* using extrusion extMesh: starting from the unique cell in mesh2D whose center is at [250.,150.,0.] MEDCouplingMappedExtrudedMesh.getMesh3DIds retrieves the cell IDs sorted by slice. ::
- bary2=mesh2D.getBarycenterAndOwner()[:,[0,1]]
+ bary2=mesh2D.computeCellCenterOfMass()[:,[0,1]]
bary2-=[250.,150.]
magn=bary2.magnitude()
- ids=magn.getIdsInRange(0.,1e-12)
+ ids=magn.findIdsInRange(0.,1e-12)
idStart=int(ids) # ids is assumed to contain only one value, if not an exception is thrown
cellIds2Sol2=extMesh.getMesh3DIds()[range(idStart,mesh3D.getNumberOfCells(),mesh2D.getNumberOfCells())]
Perform a deep copy of mesh3DSlice2. On this copy perform a translation v=[0.,1000.,0.].
Then aggregate mesh3DSlice2 with its translated copy, using MEDCouplingUMesh.MergeUMeshes. ::
- mesh3DSlice2bis=mesh3DSlice2.deepCpy()
+ mesh3DSlice2bis=mesh3DSlice2.deepCopy()
mesh3DSlice2bis.translate([0.,1000.,0.])
mesh3DSlice2All=MEDCouplingUMesh.MergeUMeshes([mesh3DSlice2,mesh3DSlice2bis])
mesh3DSurf,desc,descIndx,revDesc,revDescIndx=mesh3D.buildDescendingConnectivity()
numberOf3DCellSharing=revDescIndx.deltaShiftIndex()
- cellIds=numberOf3DCellSharing.getIdsNotEqual(1)
+ cellIds=numberOf3DCellSharing.findIdsNotEqual(1)
mesh3DSurfInside=mesh3DSurf[cellIds]
mesh3DSurfInside.writeVTK("mesh3DSurfInside.vtu")
mesh3D.setCoords(myCoords)
mesh3D.orientCorrectlyPolyhedrons()
mesh3D.sortCellsInMEDFileFrmt()
- mesh3D.checkCoherency()
+ mesh3D.checkConsistencyLight()
renum = mc.DataArrayInt(60); renum[:15]=range(15,30) ; renum[15:30]=range(15) ; renum[30:45]=range(45,60) ; renum[45:]=range(30,45)
mesh3D.renumberNodes(renum,60)
L'utilisation des barycentres est une technique classique pour identifier un ensemble de cellules répondant à certains
critères géométriques.
Il s'agit d'abord de calculer les barycentres des cellules 3D de ``mesh3D`` (méthode
- ``MEDCouplingUMesh.getBarycenterAndOwner()``).
+ ``MEDCouplingUMesh.computeCellCenterOfMass()``).
(*Note*: le nom -- un peu trop long -- de cette méthode hérite du passé. Le "AndOwner" indique le fait qu'en C++
l'appelant est responsable de la désallocation de l'objet retourné : il prend l'*ownership* du résultat).
Ensuite sélectionner la composante #2 des barycentres des cellules et mettre le résultat dans ``baryZ``.
Ensuite il suffit de selectionner dans ``baryZ`` les tuples qui sont dans l'intervalle ``[zLev[1], zLev[2]]``.
Les identifiants de ces tuples (i.e. leur index dans ``baryZ``) est directement un identifiant de cellule
- car ``getBarycenterAndOwner()`` retourne un tableau indéxé par les numéros de cellule.::
+ car ``computeCellCenterOfMass()`` retourne un tableau indéxé par les numéros de cellule.::
- bary = mesh3D.getBarycenterAndOwner()
+ bary = mesh3D.computeCellCenterOfMass()
baryZ = bary[:,2]
- cellIdsSol2 = baryZ.getIdsInRange(zLev[1], zLev[2])
+ cellIdsSol2 = baryZ.findIdsInRange(zLev[1], zLev[2])
-* En utilisant ``MEDCouplingExtrudedMesh`` :
+* En utilisant ``MEDCouplingMappedExtrudedMesh`` :
C'est la méthode exclusivement basée sur la connectivité nodale pour déduire l'extrusion. Les coordonnées sont ici ignorées.
- Pour construire un ``MEDCouplingExtrudedMesh`` deux objets sont requis. Le maillage non-structuré 3D
+ Pour construire un ``MEDCouplingMappedExtrudedMesh`` deux objets sont requis. Le maillage non-structuré 3D
représentant en fait un maillage *extrudé*, et un maillage non structuré 3D surfacique (mesh-dim 2)
reposant sur les mêmes coordonnéees, à partir duquel l'extrusion sera calculée.
Commencer par construire le maillage 3D surfacique. Pour ce faire il suffit de repérer les noeuds appartenant
plante. Le maillage 2D est forcément en haut ou en bas du 3D volumique, et le dernier entier spécifie la cellule à partir
de laquelle le fil de fer 1D guidant l'extrusion sera construit : ::
- extMesh = mc.MEDCouplingExtrudedMesh(mesh3D, mesh2D, 0)
+ extMesh = mc.MEDCouplingMappedExtrudedMesh(mesh3D, mesh2D, 0)
On a alors la garantie que, dans ``extMesh``, les cellules sont ordonnées par niveau Z croissant.
- Il suffit de récupérer le 2ème niveau (``MEDCouplingExtrudedMesh.getMesh3DIds()``). ::
+ Il suffit de récupérer le 2ème niveau (``MEDCouplingMappedExtrudedMesh.getMesh3DIds()``). ::
n_cells = mesh2D.getNumberOfCells()
cellIdsSol3 = extMesh.getMesh3DIds()[n_cells:2*n_cells]
baryXY = bary[:,[0,1]]
baryXY -= [250.,150.]
magn = baryXY.magnitude()
- cellIds2Sol1 = magn.getIdsInRange(0.,1e-12)
+ cellIds2Sol1 = magn.findIdsInRange(0.,1e-12)
* utiliser le maillage extrudé ``extMesh`` : partant de l'unique cellule dans ``mesh2D`` dont le centre est
- en ``[250.,150.,0.]``, la méthdode ``MEDCouplingExtrudedMesh.getMesh3DIds()`` retourne les identifiants de
+ en ``[250.,150.,0.]``, la méthdode ``MEDCouplingMappedExtrudedMesh.getMesh3DIds()`` retourne les identifiants de
cellules rangée par rangée. ::
- bary2 = mesh2D.getBarycenterAndOwner()[:,[0,1]]
+ bary2 = mesh2D.computeCellCenterOfMass()[:,[0,1]]
bary2 -= [250.,150.]
magn = bary2.magnitude()
- ids = magn.getIdsInRange(0.,1e-12)
+ ids = magn.findIdsInRange(0.,1e-12)
idStart = int(ids) # ids is assumed to contain only one value, if not an exception is thrown
ze_range = range(idStart,mesh3D.getNumberOfCells(),mesh2D.getNumberOfCells())
cellIds2Sol2 = extMesh.getMesh3DIds()[ze_range]
Sur cette copie effectuer une translation de ``v=[0.,1000.,0.]``.
Puis aggréger ``mesh3DSlice2`` avec sa copie translatée ``mesh3DSlice2bis``, en utilisant ``MEDCouplingUMesh.MergeUMeshes()``. ::
- mesh3DSlice2bis = mesh3DSlice2.deepCpy()
+ mesh3DSlice2bis = mesh3DSlice2.deepCopy()
mesh3DSlice2bis.translate([0.,1000.,0.])
mesh3DSlice2All = mc.MEDCouplingUMesh.MergeUMeshes([mesh3DSlice2,mesh3DSlice2bis])
mesh3DSlice2All.writeVTK("mesh3DSlice2All.vtu")
mesh3DSurf, desc, descIndx, revDesc, revDescIndx = mesh3D.buildDescendingConnectivity()
numberOf3DCellSharing = revDescIndx.deltaShiftIndex()
- cellIds = numberOf3DCellSharing.getIdsNotEqual(1)
+ cellIds = numberOf3DCellSharing.findIdsNotEqual(1)
mesh3DSurfInside = mesh3DSurf[cellIds]
mesh3DSurfInside.writeVTK("mesh3DSurfInside.vtu")
fMc=f1ts.getFieldAtLevel(ON_CELLS,0)
arr=fMc.getArray()
arr.getMinMaxPerComponent() # just to see the variation range of the field per component
- ids=arr.getIdsInRange(0.,1.)
+ ids=arr.findIdsInRange(0.,1.)
f2Mc=fMc[ids]
Using the field "PRESSION_ELEM_DOM" find the 3D pression field applied on the agitator.
agitateurMesh3DMc=pressOnAgitateurMc.getMesh()
m3DSurf,desc,descI,revDesc,revDescI=agitateurMesh3DMc.buildDescendingConnectivity()
nbOf3DCellSharing=revDescI.deltaShiftIndex()
- ids2=nbOf3DCellSharing.getIdsEqual(1)
+ ids2=nbOf3DCellSharing.findIdsEqual(1)
agitateurSkinMc=m3DSurf[ids2]
OffsetsOfTupleIdsInField=revDescI[ids2]
tupleIdsInField=revDesc[OffsetsOfTupleIdsInField]
singlePolyhedron=agitateurMesh3DMc.buildSpreadZonesWithPoly()
singlePolyhedron.orientCorrectlyPolyhedrons()
- centerOfMass=singlePolyhedron.getBarycenterAndOwner()
+ centerOfMass=singlePolyhedron.computeCellCenterOfMass()
.. note:: The call to MEDCouplingUMesh.orientCorrectlyPolyhedrons() is not mandatory
but is recommended: if the polyhedron happens to be mis-oriented, its center of mass will
To this end compute "posSkin", a DataArrayDouble giving for each skin cell the vector
centerOfMass -> G, where G represents the center of mass of the current cell. ::
- barySkin=agitateurSkinMc.getBarycenterAndOwner()
+ barySkin=agitateurSkinMc.computeCellCenterOfMass()
posSkin=barySkin-centerOfMass
Compute the cross product for each cell of "posSkin" using "forceVectSkin"
fMc = f1ts.getFieldAtLevel(ml.ON_CELLS,0)
arr = fMc.getArray()
arr.getMinMaxPerComponent() # just to see the field variation range per component
- ids = arr.getIdsInRange(0.,1.)
+ ids = arr.findIdsInRange(0.,1.)
f2Mc = fMc[ids]
A l'aide du champ "PRESSION_ELEM_DOM" trouver le champ de pression 3D qu'applique l'agitateur. Mettre le résultat dans
agitateurMesh3DMc = pressOnAgitateurMc.getMesh()
m3DSurf,desc,descI,revDesc,revDescI = agitateurMesh3DMc.buildDescendingConnectivity()
nbOf3DCellSharing = revDescI.deltaShiftIndex()
- ids2 = nbOf3DCellSharing.getIdsEqual(1) # Cells with only one neighbor are on the boundary, i.e. on the skin
+ ids2 = nbOf3DCellSharing.findIdsEqual(1) # Cells with only one neighbor are on the boundary, i.e. on the skin
agitateurSkinMc = m3DSurf[ids2]
offsetsOfTupleIdsInField = revDescI[ids2]
tupleIdsInField = revDesc[offsetsOfTupleIdsInField]
singlePolyhedron = agitateurMesh3DMc.buildSpreadZonesWithPoly()
singlePolyhedron.orientCorrectlyPolyhedrons()
- centerOfMass = singlePolyhedron.getBarycenterAndOwner()
+ centerOfMass = singlePolyhedron.computeCellCenterOfMass()
.. note:: L'appel à ``MEDCouplingUMesh.orientCorrectlyPolyhedrons()`` n'est pas obligatoire mais conseillé car
si par malheur le polyhèdre est mal orienté, son barycentre sera incorrect !
Pour ce faire calculer ``posSkin`` le ``DataArrayDouble`` donnant pour chaque cellule de la peau de l'agitateur
le vecteur ``centerOfMass`` -> ``G``, avec ``G`` le barycentre de la cellule courante. ::
- barySkin=agitateurSkinMc.getBarycenterAndOwner()
+ barySkin=agitateurSkinMc.computeCellCenterOfMass()
posSkin = barySkin-centerOfMass
Appliquer maintenant la formule classique de calcul du moment : calculer le produit
It only take a cut fineness parameter (0.1 will suffice (angle expressed in rd)). Remember not to modify
neither "fixm" nor "mobm"! ::
- fixm2=fixm.deepCpy() # tessellate2D is non const - a mesh copy is required
+ fixm2=fixm.deepCopy() # tessellate2D is non const - a mesh copy is required
fixm2.tessellate2D(0.1)
fixm2.writeVTK("fixm2.vtu")
- mobm2=mobm.deepCpy()
+ mobm2=mobm.deepCopy()
mobm2.tessellate2D(0.1)
mobm2.writeVTK("mobm2.vtu")
Define a small method displayVTK() which we will use later on. ::
def displayVTK(m,fname):
- tmp=m.deepCpy()
+ tmp=m.deepCopy()
tmp.tessellate2D(0.1)
tmp.writeVTK(fname)
return
Get and display partFixm part which is not in zone1Mobm. Call this mesh partFixmWithoutZone1Mobm. ::
- ids3=iMob.getIdsEqual(-1)
+ ids3=iMob.findIdsEqual(-1)
partFixmWithoutZone1Mobm=partFixMob[ids3]
displayVTK(partFixmWithoutZone1Mobm,"partFixmWithoutZone1Mobm.vtu")
areaZone1Mobm=zone1Mobm.getMeasureField(ON_CELLS).getArray()
areaZone1Mobm.abs()
val3=areaZone1Mobm.accumulate()[0]
- ids4=iMob.getIdsNotEqual(-1)
+ ids4=iMob.findIdsNotEqual(-1)
areaPartFixMob2=areaPartFixMob[ids4]
val4=areaPartFixMob2.accumulate()[0]
print "Check #1 %lf == %lf a 1e-8 ? %s"%(val3,val4,str(abs(val3-val4)<1e-8))
isCheck2OK=True
for icell in xrange(partFixm.getNumberOfCells()):
- ids5=iPart.getIdsEqual(icell)
+ ids5=iPart.findIdsEqual(icell)
areaOfCells=areaPartFixMob[ids5]
areaOfCells.abs()
if abs(areaOfCells.accumulate()[0]-areaPartFixm[icell])>1e-9:
part. Visualize it in a VTK file. ::
f=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME)
- m=partFixMob.deepCpy() ; m.tessellate2D(0.1)
+ m=partFixMob.deepCopy() ; m.tessellate2D(0.1)
f.setMesh(m)
arr=DataArrayDouble(partFixMob.getNumberOfCells(),1)
- arr[iMob.getIdsEqual(-1)]=0.
- arr[iMob.getIdsNotEqual(-1)]=1.
+ arr[iMob.findIdsEqual(-1)]=0.
+ arr[iMob.findIdsNotEqual(-1)]=1.
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
f.setName("Zone")
MEDCouplingFieldDouble.WriteVTK("Zone.vtu",[f])
partFixMob2,iPart2,iMob2=MEDCouplingUMesh.Intersect2DMeshes(partFixm,zonesMobm,1e-10)
partFixMob2.mergeNodes(1e-10)
f2=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME)
- m2=partFixMob2.deepCpy() ; m2.tessellate2D(0.1)
+ m2=partFixMob2.deepCopy() ; m2.tessellate2D(0.1)
f2.setMesh(m2)
arr=DataArrayDouble(partFixMob2.getNumberOfCells(),1)
- arr[iMob2.getIdsEqual(-1)]=0.
+ arr[iMob2.findIdsEqual(-1)]=0.
st=0 ; end=st+len(zonesInMobm[0])
- arr[iMob2.getIdsInRange(st,end)]=1.
+ arr[iMob2.findIdsInRange(st,end)]=1.
st+=len(zonesInMobm[0]) ; end=st+len(zonesInMobm[1])
- arr[iMob2.getIdsInRange(st,end)]=2.
+ arr[iMob2.findIdsInRange(st,end)]=2.
st+=len(zonesInMobm[1]) ; end=st+len(zonesInMobm[2])
- arr[iMob2.getIdsInRange(st,end)]=3.
+ arr[iMob2.findIdsInRange(st,end)]=3.
f2.setArray(arr)
- f2.checkCoherency()
+ f2.checkConsistencyLight()
f2.setName("Zone2")
MEDCouplingFieldDouble.WriteVTK("Zone2.vtu",[f2])
le maillage. Nous faisons donc une copie préalable. Nous passons en paramètre la finesse de découpage (0.1 est suffisant
-- angle en radian). Attention donc à ne pas modifer ni ``fixm`` ni ``mobm`` ! ::
- fixm2 = fixm.deepCpy() # tessellate2D() modifies the current mesh
+ fixm2 = fixm.deepCopy() # tessellate2D() modifies the current mesh
fixm2.tessellate2D(0.1)
fixm2.writeVTK("fixm2.vtu")
- mobm2 = mobm.deepCpy()
+ mobm2 = mobm.deepCopy()
mobm2.tessellate2D(0.1)
mobm2.writeVTK("mobm2.vtu")
Faire une petite méthode ``displayVTK()``, faisant le travail qui nous servira souvent après. ::
def displayVTK(m,fname):
- tmp = m.deepCpy()
+ tmp = m.deepCopy()
tmp.tessellate2D(0.1)
tmp.writeVTK(fname)
return
Récupérer et afficher la partie de ``partFixm`` qui n'est pas dans ``zone1Mobm``. Appeler ce maillage ``partFixmWithoutZone1Mobm``. ::
- ids3 = iMob.getIdsEqual(-1)
+ ids3 = iMob.findIdsEqual(-1)
partFixmWithoutZone1Mobm = partFixMob[ids3]
displayVTK(partFixmWithoutZone1Mobm,"partFixmWithoutZone1Mobm.vtu")
areaZone1Mobm = zone1Mobm.getMeasureField(ml.ON_CELLS).getArray()
areaZone1Mobm.abs()
val3 = areaZone1Mobm.accumulate()[0]
- ids4 = iMob.getIdsNotEqual(-1)
+ ids4 = iMob.findIdsNotEqual(-1)
areaPartFixMob2 = areaPartFixMob[ids4]
val4 = areaPartFixMob2.accumulate()[0]
print "Check #1 %lf == %lf with precision 1e-8 ? %s" % (val3,val4,str(abs(val3-val4)<1e-8))
isCheck2OK = True
for icell in xrange(partFixm.getNumberOfCells()):
- ids5 = iPart.getIdsEqual(icell)
+ ids5 = iPart.findIdsEqual(icell)
areaOfCells = areaPartFixMob[ids5]
areaOfCells.abs()
if abs(areaOfCells.accumulate()[0] - areaPartFixm[icell]) > 1e-9:
Le visualiser en utilisant un fichier VTK (ne pas oublier l'option *Triangulate* de ParaView). ::
f = ml.MEDCouplingFieldDouble(ml.ON_CELLS,ml.ONE_TIME)
- m = partFixMob.deepCpy()
+ m = partFixMob.deepCopy()
m.tessellate2D(0.1)
f.setMesh(m)
arr = ml.DataArrayDouble(partFixMob.getNumberOfCells(),1)
- arr[iMob.getIdsEqual(-1)] = 0.
- arr[iMob.getIdsNotEqual(-1)] = 1.
+ arr[iMob.findIdsEqual(-1)] = 0.
+ arr[iMob.findIdsNotEqual(-1)] = 1.
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
f.setName("Zone")
ml.MEDCouplingFieldDouble.WriteVTK("Zone.vtu",[f])
partFixMob2,iPart2,iMob2 = ml.MEDCouplingUMesh.Intersect2DMeshes(partFixm,zonesMobm,1e-10)
partFixMob2.mergeNodes(1e-10)
f2 = ml.MEDCouplingFieldDouble(ml.ON_CELLS, ml.ONE_TIME)
- m2 = partFixMob2.deepCpy()
+ m2 = partFixMob2.deepCopy()
m2.tessellate2D(0.1)
f2.setMesh(m2)
arr = ml.DataArrayDouble(partFixMob2.getNumberOfCells(),1)
- arr[iMob2.getIdsEqual(-1)]=0.
+ arr[iMob2.findIdsEqual(-1)]=0.
st = 0
end = st + len(zonesInMobm[0])
- arr[iMob2.getIdsInRange(st,end)] = 1.
+ arr[iMob2.findIdsInRange(st,end)] = 1.
st += len(zonesInMobm[0]) ;
end = st + len(zonesInMobm[1])
- arr[iMob2.getIdsInRange(st,end)] = 2.
+ arr[iMob2.findIdsInRange(st,end)] = 2.
st += len(zonesInMobm[1])
end = st + len(zonesInMobm[2])
- arr[iMob2.getIdsInRange(st,end)] = 3.
+ arr[iMob2.findIdsInRange(st,end)] = 3.
f2.setArray(arr)
- f2.checkCoherency()
+ f2.checkConsistencyLight()
f2.setName("Zone2")
ml.MEDCouplingFieldDouble.WriteVTK("Zone2.vtu",[f2])
indptr = mc.DataArrayInt(mat.indptr)
indptr2 = indptr.deltaShiftIndex()
- cellIdsOfSkin = indptr2.getIdsEqual(1)
+ cellIdsOfSkin = indptr2.findIdsEqual(1)
C'est presque fini. Créer le sous maillage contenant uniquement la peau et l'écrire dans
un fichier VTK ou MED pour le visualiser avec ParaView. ::
indptr = mc.DataArrayInt(mat.indptr)
indptr2 = indptr.deltaShiftIndex()
- cellIdsOfSkin = indptr2.getIdsEqual(1)
+ cellIdsOfSkin = indptr2.findIdsEqual(1)
C'est presque fini. Créer le sous maillage contenant uniquement la peau et l'écrire dans
un fichier VTK ou MED pour le visualiser avec ParaView. ::
.. note:: An exception is raised since "srcField" hasn't got an explicitly defined nature.
In what follows the impact of this attribute on the final result will be explained.
-Set the nature of "srcField" to ConservativeVolumic (intensive field, e.g. a temperature). ::
+Set the nature of "srcField" to IntensiveMaximum (intensive field, e.g. a temperature). ::
- srcField.setNature(ConservativeVolumic)
+ srcField.setNature(IntensiveMaximum)
trgFieldCV=remap.transferField(srcField,1e300)
Check that with this nature the field integral is conserved. On the other side
the sum on cells (accumulation) is NOT conserved. ::
- print "ConservativeVolumic %lf == %lf"%(srcField.integral(True)[0],trgFieldCV.integral(True)[0])
- print "ConservativeVolumic %lf != %lf"%(srcField.getArray().accumulate()[0],trgFieldCV.getArray().accumulate()[0])
+ print "IntensiveMaximum %lf == %lf"%(srcField.integral(True)[0],trgFieldCV.integral(True)[0])
+ print "IntensiveMaximum %lf != %lf"%(srcField.getArray().accumulate()[0],trgFieldCV.getArray().accumulate()[0])
-Set the nature of "srcField" to IntegralGlobConstraint (extensive field, e.g. a power). ::
+Set the nature of "srcField" to ExtensiveConservation (extensive field, e.g. a power). ::
- srcField.setNature(IntegralGlobConstraint)
+ srcField.setNature(ExtensiveConservation)
trgFieldI=remap.transferField(srcField,1e300)
Check that given this nature the field integral is NOT conserved. On the other side the
cumulative sum on cells is conserved. ::
::
- print "IntegralGlobConstraint %lf != %lf"%(srcField.integral(True)[0],trgFieldI.integral(True)[0])
- print "IntegralGlobConstraint %lf == %lf"%(srcField.getArray().accumulate()[0],trgFieldI.getArray().accumulate()[0])
+ print "ExtensiveConservation %lf != %lf"%(srcField.integral(True)[0],trgFieldI.integral(True)[0])
+ print "ExtensiveConservation %lf == %lf"%(srcField.getArray().accumulate()[0],trgFieldI.getArray().accumulate()[0])
Visualize the fields using ParaViS.
.. note:: Une exception est envoyée car ``srcField`` n'a pas de *nature* définie.
Nous allons voir dans la suite l'impact de cet attribut sur le résultat final.
-Mettre la nature de ``srcField`` à ``ConservativeVolumic``. Cela signifie que le champ doit être interprété commé étant
+Mettre la nature de ``srcField`` à ``IntensiveMaximum``. Cela signifie que le champ doit être interprété commé étant
intensif (une température par exemple). ::
- srcField.setNature(mc.ConservativeVolumic)
+ srcField.setNature(mc.IntensiveMaximum)
trgFieldCV = remap.transferField(srcField,1e300)
-Vérifier qu'avec la nature ``ConservativeVolumic``, l'intégrale du champ est conservée. Par contre,
+Vérifier qu'avec la nature ``IntensiveMaximum``, l'intégrale du champ est conservée. Par contre,
la somme sur les cellules (accumulation) n'est **pas** conservée ! ::
integSource = srcField.integral(True)[0]
integTarget = trgFieldCV.integral(True)[0]
- print "ConservativeVolumic -- integrals: %lf == %lf" % (integSource, integTarget)
+ print "IntensiveMaximum -- integrals: %lf == %lf" % (integSource, integTarget)
accSource = srcField.getArray().accumulate()[0]
accTarget = trgFieldCV.getArray().accumulate()[0]
- print "ConservativeVolumic -- sums: %lf != %lf" % (accSource, accTarget)
+ print "IntensiveMaximum -- sums: %lf != %lf" % (accSource, accTarget)
-Maintenant mettre la nature de ``srcField`` à ``IntegralGlobConstraint``. Le champ doit être interprété commé étant
+Maintenant mettre la nature de ``srcField`` à ``ExtensiveConservation``. Le champ doit être interprété commé étant
extensif (par exemple une puissance ou un volume). ::
- srcField.setNature(mc.IntegralGlobConstraint)
+ srcField.setNature(mc.ExtensiveConservation)
trgFieldI = remap.transferField(srcField,1e300)
-Vérifier qu'avec la nature ``IntegralGlobConstraint``, l'intégrale du champ n'est **pas** conservée.
+Vérifier qu'avec la nature ``ExtensiveConservation``, l'intégrale du champ n'est **pas** conservée.
Par contre, la somme sur les cellules est conservée. ::
integSource = srcField.integral(True)[0]
integTarget = trgFieldI.integral(True)[0]
- print "IntegralGlobConstraint -- integrals: %lf != %lf" % (integSource, integTarget)
+ print "ExtensiveConservation -- integrals: %lf != %lf" % (integSource, integTarget)
accSource = srcField.getArray().accumulate()[0]
accTarget = trgFieldI.getArray().accumulate()[0]
- print "IntegralGlobConstraint -- sums: %lf == %lf" % (accSource, accTarget)
+ print "ExtensiveConservation -- sums: %lf == %lf" % (accSource, accTarget)
Visualiser les champs avec ParaViS, ou en les écrivant dans un fichier.
Compare "CellField_read" and "CellField0". Problem: because of the constraint on the MED file numbering, the initial numbering has been lost. Or more exactly there is no standard way to retrieve it. This means that a call to MEDCouplingFieldDouble.isEqual() won't succeed. Let's use the method MEDCouplingFieldDouble.substractInPlaceDM() which operates a renumbering based on a given policy (see HTML doc).
To this end, create a deep copy of "CellField" into "CellFieldCpy" and invoke substractInPlaceDM() on it (DM stands for "Different Meshes", contrarily to substract() which only succeeds if the fields share the same mesh). ::
- CellFieldCpy=CellField.deepCpy()
+ CellFieldCpy=CellField.deepCopy()
CellFieldCpy.substractInPlaceDM(CellField_read,10,1e-12)
CellFieldCpy.getArray().abs()
print CellFieldCpy.getArray().isUniform(0.,1e-12)
Make a deep copy called "NodeFieldCpy" from "NodeField" and call MEDCouplingUMesh.mergeNodes(). ::
NodeField_read.mergeNodes(1e-10)
- NodeFieldCpy=NodeField.deepCpy()
+ NodeFieldCpy=NodeField.deepCopy()
NodeFieldCpy.mergeNodes(1e-10)
.. note:: mergeNodes() takes two epsilons: the first classical one on the absolute distance between nodes, and the second expressing a tolerance on the values. If the field value of two nodes to be merged is bigger than this an exception is raised.
if typp==ON_CELLS:
arr.renumberInPlace(o2nML[lev])
mcf=MEDCouplingFieldDouble(typp,ONE_TIME) ; mcf.setName(fieldName) ; mcf.setTime(tim,dt,it) ; mcf.setArray(arr)
- mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkCoherency()
+ mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkConsistencyLight()
mergeField.appendFieldNoProfileSBT(mcf)
pass
pass
un ``substractInPlaceDM`` (DM pour "Different Meshes", contrairement à ``substract`` qui ne marche que
s'ils partagent le même maillage): ::
- cellFieldCpy = cellField.deepCpy()
+ cellFieldCpy = cellField.deepCopy()
cellFieldCpy.substractInPlaceDM(cellField_read,10,1e-12)
cellFieldCpy.getArray().abs()
print cellFieldCpy.getArray().isUniform(0.,1e-12)
et supprimer encore les doublons : ::
nodeField_read.mergeNodes(1e-10)
- nodeFieldCpy = nodeField.deepCpy()
+ nodeFieldCpy = nodeField.deepCopy()
nodeFieldCpy.mergeNodes(1e-10)
.. note:: A noter que ``mergeNodes()`` possède deux paramètres de précisions (*epsilons*), le premier,
if typp == ml.ON_CELLS:
arr.renumberInPlace(o2nML[lev])
mcf = ml.MEDCouplingFieldDouble(typp,ml.ONE_TIME) ; mcf.setName(fieldName) ; mcf.setTime(tim,dt,it) ; mcf.setArray(arr)
- mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkCoherency()
+ mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkConsistencyLight()
mergeField.appendFieldNoProfileSBT(mcf)
pass
pass
To implement this exercise we use the Python scripting language and import the MEDLoader Python module.
The whole MEDCoupling module is fully included in MEDLoader. No need to import MEDCoupling when MEDLoader has been loaded. ::
- from MEDLoader import *
+ import MEDLoader as ml
Writing and Reading meshes using MEDLoader's advanced API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ]
targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
- targetMesh=MEDCouplingUMesh.New("MyMesh",2)
+ targetMesh=ml.MEDCouplingUMesh.New("MyMesh",2)
targetMesh.allocateCells(5)
targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7])
targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10])
targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4])
targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14])
targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18])
- myCoords=DataArrayDouble.New(targetCoords,9,2)
+ myCoords=ml.DataArrayDouble.New(targetCoords,9,2)
targetMesh.setCoords(myCoords)
Create 2 groups on level 0. The first called "grp0_Lev0" on cells [0,1,3] and the second called "grp1_Lev0" on cells [1,2,3,4] ::
- grp0_0=DataArrayInt.New([0,1,3]) ; grp0_0.setName("grp0_Lev0")
- grp1_0=DataArrayInt.New([1,2,3,4]) ; grp1_0.setName("grp1_Lev0")
+ grp0_0=ml.DataArrayInt.New([0,1,3]) ; grp0_0.setName("grp0_Lev0")
+ grp1_0=ml.DataArrayInt.New([1,2,3,4]) ; grp1_0.setName("grp1_Lev0")
meshMEDFile.setGroupsAtLevel(0,[grp0_0,grp1_0])
Create 3 groups on level -1. The 1st called "grp0_LevM1" on cells [0,1], the 2nd called "grp1_LevM1" on cells [0,1,2], and the 3rd called "grp2_LevM1" on cells [1,2,3] ::
- grp0_M1=DataArrayInt.New([0,1]) ; grp0_M1.setName("grp0_LevM1")
- grp1_M1=DataArrayInt.New([0,1,2]) ; grp1_M1.setName("grp1_LevM1")
- grp2_M1=DataArrayInt.New([1,2,3]) ; grp2_M1.setName("grp2_LevM1")
+ grp0_M1=ml.DataArrayInt.New([0,1]) ; grp0_M1.setName("grp0_LevM1")
+ grp1_M1=ml.DataArrayInt.New([0,1,2]) ; grp1_M1.setName("grp1_LevM1")
+ grp2_M1=ml.DataArrayInt.New([1,2,3]) ; grp2_M1.setName("grp2_LevM1")
meshMEDFile.setGroupsAtLevel(-1,[grp0_M1,grp1_M1,grp2_M1])
Creation of a simple vector field on cells called f. ::
- f=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME)
+ f=ml.MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME)
f.setTime(5.6,7,8)
- f.setArray(targetMesh.getBarycenterAndOwner())
+ f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
Build a reduction on cells [1,2,3] of f and call it fPart. ::
- pfl=DataArrayInt.New([1,2,3]) ; pfl.setName("My1stPfl")
+ pfl=ml.DataArrayInt.New([1,2,3]) ; pfl.setName("My1stPfl")
fPart=f.buildSubPart(pfl)
fPart.setName("fPart")
si ``MEDLoader`` a été chargé. ::
import MEDLoader as ml
- from MEDLoader import MEDLoader
Lecture, écriture d'un maillage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f = ml.MEDCouplingFieldDouble(ml.ON_CELLS, ml.ONE_TIME)
f.setTime(5.6,7,8)
- f.setArray(targetMesh.getBarycenterAndOwner())
+ f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
To implement this exercise we use the Python scripting language and import the MEDLoader Python module.
The whole MEDCoupling module is fully included in MEDLoader. No need to import MEDCoupling when MEDLoader has been loaded. ::
- from MEDLoader import *
+ import MEDLoader as ml
Writing/Reading a mesh
~~~~~~~~~~~~~~~~~~~~~~
targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ]
targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
- targetMesh=MEDCouplingUMesh.New("MyMesh",2)
+ targetMesh=ml.MEDCouplingUMesh.New("MyMesh",2)
targetMesh.allocateCells(5)
targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7])
targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10])
targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4])
targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14])
targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18])
- myCoords=DataArrayDouble.New(targetCoords,9,2)
+ myCoords=ml.DataArrayDouble.New(targetCoords,9,2)
myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
targetMesh.setCoords(myCoords)
We are then ready to write it. ::
- MEDLoader.WriteUMesh("TargetMesh.med",targetMesh,True)
+ ml.WriteUMesh("TargetMesh.med",targetMesh,True)
Then trying to read it. ::
- meshRead=MEDLoader.ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
+ meshRead=ml.ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
print "Is the mesh read in file equals targetMesh? %s"%(meshRead.isEqual(targetMesh,1e-12))
Writing/Reading a field on one time step at once
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creation of a vector field "f" on cell supported by "targetMesh". ::
- f=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME)
+ f=ml.MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME)
f.setTime(5.6,7,8)
- f.setArray(targetMesh.getBarycenterAndOwner())
+ f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
- MEDLoader.WriteField("MyFirstField.med",f,True)
+ ml.WriteField("MyFirstField.med",f,True)
.. note:: Mesh AND Field is written at once into MyFirstField.
Reading into MyFirstField.med ::
- f2=MEDLoader.ReadFieldCell("MyFirstField.med",f.getMesh().getName(),0,f.getName(),7,8)
+ f2=ml.ReadFieldCell("MyFirstField.med",f.getMesh().getName(),0,f.getName(),7,8)
print "Is the field read in file equals f ? %s"%(f2.isEqual(f,1e-12,1e-12))
Writing/Reading a field on one or many times steps in "multi-session mode"
Here contrary to the previous steps, we are going to write in a multi-session mode on the same MED file.
First dealing with the mesh. ::
- MEDLoader.WriteUMesh("MySecondField.med",f.getMesh(),True)
+ ml.WriteUMesh("MySecondField.med",f.getMesh(),True)
Then writing only array part of field. ::
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f)
+ ml.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f)
Then put a another time step. ::
f2=f.clone(True)
f2.getArray()[:]=2.0
f2.setTime(7.8,9,10)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
+ ml.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
Now "MySecondField.med" file contains 2 time steps.
si ``MEDLoader`` a été chargé. ::
import MEDLoader as ml
- from MEDLoader import MEDLoader
Lecture, écriture d'un maillage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Le maillage peut alors directement être écrit ... ::
- MEDLoader.WriteUMesh("TargetMesh.med",targetMesh,True) # True means 'from scratch'
+ ml.WriteUMesh("TargetMesh.med",targetMesh,True) # True means 'from scratch'
... et relu. ::
- meshRead = MEDLoader.ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
+ meshRead = ml.ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
print "Is the read mesh equal to 'targetMesh' ?", meshRead.isEqual(targetMesh,1e-12)
Lire/Ecrire un champ sur un pas de temps
f = ml.MEDCouplingFieldDouble.New(ml.ON_CELLS, ml.ONE_TIME)
f.setTime(5.6,7,8) # Declare the timestep associated to the field
- f.setArray(targetMesh.getBarycenterAndOwner())
+ f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
- MEDLoader.WriteField("MyFirstField.med",f,True)
+ ml.WriteField("MyFirstField.med",f,True)
Question subsidiaire : à quoi correspond le champ ainsi créé ?
Nous relisons ensuite MyFirstField.med : ::
- f2 = MEDLoader.ReadFieldCell("MyFirstField.med", f.getMesh().getName(), 0, f.getName(), 7, 8)
+ f2 = ml.ReadFieldCell("MyFirstField.med", f.getMesh().getName(), 0, f.getName(), 7, 8)
print "Is the read field identical to 'f' ?", f2.isEqual(f,1e-12,1e-12)
.. note:: Lors de la lecture du champ, on doit donc connaître: son nom, le nom de sa mesh de support
Ici contrairement au cas précédent, nous écrivons en plusieurs fois dans le *même* fichier MED.
Ecrivons tout d'abord le maillage. ::
- MEDLoader.WriteUMesh("MySecondField.med",f.getMesh(),True)
+ ml.WriteUMesh("MySecondField.med",f.getMesh(),True)
Ensuite, nous écrivons seulement les informations relatives au champ (principalement son tableau de valeurs en fait
). ::
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f) # mesh is not re-written
+ ml.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f) # mesh is not re-written
Nous rajoutons ensuite un second pas de temps sur le *même* maillage. ::
f2 = f.clone(True) # 'True' means that we need a deep copy
f2.getArray()[:] = 2.0
f2.setTime(7.8,9,10)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
+ ml.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
Maintenant le fichier "MySecondField.med" contient le maillage et un champ à deux pas de temps porté par ce maillage.
Nous pouvons relire tout cela avec des méthodes similaires à ce qui a été vu précédemment : ::
- f3 = MEDLoader.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),7,8)
+ f3 = ml.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),7,8)
print "Is the field read in file equals to 'f' ?", f.isEqual(f3,1e-12,1e-12)
- f4 = MEDLoader.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),9,10)
+ f4 = ml.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),9,10)
print "Is the field read in file equals to 'f2' ?", f2.isEqual(f4,1e-12,1e-12)
Solution
MEDCouplingIMesh.* \
MEDCouplingStructuredMesh.* \
MEDCouplingCurveLinearMesh.* \
- MEDCouplingExtrudedMesh.* \
+ MEDCouplingMappedExtrudedMesh.* \
MEDCouplingFieldDouble.* \
MEDCouplingField.* \
MEDCouplingNatureOfFieldEnum \
MEDCouplingCartesianAMRMesh.* \
MEDCouplingTimeLabel.* \
MEDCouplingRefCountObject.* \
- MEDCouplingAutoRefCountObjectPtr.* \
+ MCAuto.* \
MEDCouplingMemArray.* \
MEDCouplingGaussLocalization.* \
MEDCouplingRemapper.* \
Some useful complementary resources:
+- \subpage porting
- \subpage glossary
- \subpage med-file
- \subpage install
- \subpage interpkernel
- \ref MPIAccess-det
-*/
\ No newline at end of file
+*/
--- /dev/null
+/*!
+
+\page porting Porting code/scripts from version 7 to 8
+
+\section port-migrate How to migrate
+
+Significant API changes have been made between version 7.x and 8.x of MEDCoupling.
+This page guides you through the changes you have to apply to migrate.
+
+First of all, the script
+\code
+ medcoup7to8.py
+\endcode
+
+installed in the binary directory can do most of the job. It takes as first argument the path of the directory
+containing the sources you want to port. Only some extensions are handled. A backup of the modified files is
+done. Run
+\code
+ medcoup7to8.py --help
+\endcode
+for a full usage description, including the handled file extensions.
+
+Beware however that the two substitutions below can not be done via this script, because they might conflict with
+standard STL C++ functions:
+- DataArray*::search -> DataArray*::findIdSequence
+- DataArray*::substr -> DataArray*::subArray
+Those will have to be treated manually.
+
+The script doesn't handle either the namespace change described below.
+
+\section port-medloader Namespace change and MEDLoader high level API
+
+The namespace ParaMEDMEM has been turned into MEDCoupling, and now contains MEDLoader high level API.
+The MEDLoader high level API is hence accessible:
+ - at the MEDCoupling namespace level in C++ (direct static functions, no more MEDLoader class)
+ - at the MEDLoader module level in Python. Scripts using the high level API of the MEDLoader
+typically need to get read of all the occurences of "MEDLoader." in their code.
+
+Note that on the Python side the module MEDLoader is still here, but doesn't containt the MEDLoader class anymore.
+As before it re-includes all of MEDCoupling classes, plus the low level MEDLoader classes (MEDFile* classes).
+
+\section port-full-ref Name changes - Reference list
+
+The following changes have been applied:
+- methods ending with a number (mergeNodes2, ...) have been made more explicit
+- search functions have been unified (they all begin with 'findId(s)')
+- plus some other various renames
+
+Full list of method name changes:
+
+- Interpolation
+ + RevIntegral / IntensiveConservation
+ + ConservativeVolumic / IntensiveMaximum
+ + IntegralGlobConstraint / ExtensiveConservation
+ + Integral / ExtensiveMaximum
+- All classes
+ + deepCpy / deepCopy
+ + performCpy / performCopyOrIncrRef
+- Auto-pointer
+ + MEDCouplingAutoRefCountObjectPtr / MCAuto
+- MEDCouplingExtrudedMesh
+ + MEDCouplingExtrudedMesh / MEDCouplingMappedExtrudedMesh
+- MEDCouplingMesh
+ + getBarycenterAndOwner / computeCellCenterOfMass
+ + checkCoherency / checkConsistencyLight
+ + checkCoherency1 / checkConsistency
+- MEDCouplingPointSet
+ + mergeNodes2 / mergeNodesCenter
+ + renumberNodes2 / renumberNodesCenter
+ + buildPartOfMySelf2 / buildPartOfMySelfSlice
+ + buildPartOfMySelfKeepCoords2 / buildPartOfMySelfKeepCoordsSlice
+ + deepCpyConnectivityOnly / deepCopyConnectivityOnly
+- MEDCoupling1DGTUMesh
+ + checkCoherencyOfConnectivity / checkConsistencyOfConnectivity
+- MEDCouplingUMesh
+ + getMeshLength / getNodalConnectivityArrayLen
+ + AreCellsEqual0 / AreCellsEqualPolicy0
+ + AreCellsEqual1 / AreCellsEqualPolicy1
+ + AreCellsEqual2 / AreCellsEqualPolicy2
+ + AreCellsEqual7 / AreCellsEqualPolicy7
+ + AreCellsEqual3 / AreCellsEqualPolicy2NoType
+ + areCellsIncludedIn2 / areCellsIncludedInPolicy7
+ + setPartOfMySelf2 / setPartOfMySelfSlice
+ + ExtractFromIndexedArrays2 / ExtractFromIndexedArraysSlice
+ + SetPartOfIndexedArrays2 / SetPartOfIndexedArraysSlice
+ + SetPartOfIndexedArraysSameIdx2 / SetPartOfIndexedArraysSameIdxSlice
+ + deepCpyConnectivityOnly / deepCopyConnectivityOnly
+- DataArray
+ + setContigPartOfSelectedValues2 / setContigPartOfSelectedValuesSlice
+ + selectByTupleId2 / selectByTupleIdSafe
+ + GetAxTypeRepr / GetAxisTypeRepr
+ + cpyFrom / deepCopyFrom
+- DataArrayInt
+ + isIdentity2 / isIota
+ + selectByTupleId2 / selectByTupleIdSlice
+ + BuildOld2NewArrayFromSurjectiveFormat2 / ConvertIndexArrayToO2N
+ + getIdsEqual / findIdsEqual
+ + getIdsNotEqual / findIdsNotEqual
+ + getIdsEqualList / findIdsEqualList
+ + getIdsNotEqualList / findIdsNotEqualList
+ + getIdsEqualTuple / findIdsEqualTuple
+ + locateValue / findIdFirstEqual
+ + locateTuple / findIdFirstEqualTuple
+ + search / findIdSequence (<b>WARNING not handled by the porting script!</b>)
+ + getIdsInRange / findIdsInRange
+ + getIdsNotInRange / findIdsNotInRange
+ + getIdsStrictlyNegative / findIdsStricltyNegative
+ + searchRangesInListOfIds / findIdsRangesInListOfIds
+ + computeOffsets2 / computeOffsetsFull
+- DataArrayDouble
+ + substr / subArray (<b>WARNING not handled by the porting script!</b>)
+ + applyFunc2 / applyFuncCompo
+ + applyFunc3 / applyFuncNamedCompo
+- MEDCouplingFieldDouble
+ + getIdsInRange / findIdsInRange
+ + fillFromAnalytic2 / fillFromAnalyticCompo
+ + fillFromAnalytic3 / fillFromAnalyticNamedCompo
+ + applyFunc2 / applyFuncCompo
+ + applyFunc3 / applyFuncNamedCompo
+ + mergeNodes2 / mergeNodesCenter
+
+*/
+
-# Jeffrey Grandy, Conservative remapping and region overlays by intersecting arbitrary polyhedra, Journal of Computational Physics, vol 148, 433-466 (1999)
-# F. Preparata and M. Shamos Computational Geometry. Springer-Verlag, New York, 1985
-*/
\ No newline at end of file
+*/
- \subpage medcouplingpyexamples
- \subpage medcouplingcppexamples
-*/
\ No newline at end of file
+*/
\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_0
-The easiest way to build the \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble instance" called \c arrayDouble simply call :
+The easiest way to build the \ref MEDCoupling::DataArrayDouble "DataArrayDouble instance" called \c arrayDouble simply call :
\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_1bis
\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_2
-The easiest way to build the \ref ParaMEDMEM::DataArrayInt "DataArrayInt instance" called \c arrayInt simply call :
+The easiest way to build the \ref MEDCoupling::DataArrayInt "DataArrayInt instance" called \c arrayInt simply call :
\snippet MEDCouplingExamplesTest.py PySnippetDataArrayBuild1_3bis
In this example we will create arrays with 12 tuples constituted each
of 3 components. These arrays will be created using different ways.\n
-The following code is only based using \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble"
-but the use of \ref ParaMEDMEM::DataArrayInt "DataArrayInt" is strictly equivalent.
+The following code is only based using \ref MEDCoupling::DataArrayDouble "DataArrayDouble"
+but the use of \ref MEDCoupling::DataArrayInt "DataArrayInt" is strictly equivalent.
\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_0
\anchor MEDCouplingArrayBasicsCopyDeepAssign
<h3>Assignation by deep copy of DataArray</h3>
-We start by building a instance of ParaMEDMEM::DataArrayDouble allocated or not. Here, instance is not allocated, only built empty.
+We start by building a instance of MEDCoupling::DataArrayDouble allocated or not. Here, instance is not allocated, only built empty.
\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_11
\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_12
-Then \c coordsArrCpy is a deep copy of \c coordsArr except that the instance of ParaMEDMEM::DataArrayDouble is those specified.
+Then \c coordsArrCpy is a deep copy of \c coordsArr except that the instance of MEDCoupling::DataArrayDouble is those specified.
But the behaviour is the same than those seen for \ref MEDCouplingArrayBasicsCopyDeepTestEqual "deep copy".
\snippet MEDCouplingExamplesTest.cxx CppSnippetDataArrayBuild1_13
\subsubsection cpp_mcdataarrayint_buildpermutationarr Building a permutation array
Here we create two arrays containing same values but in different order and then we use
-\ref ParaMEDMEM::DataArrayInt::buildPermutationArr "DataArrayInt::buildPermutationArr()" to get
+\ref MEDCoupling::DataArrayInt::buildPermutationArr "DataArrayInt::buildPermutationArr()" to get
an array showing in what places the values of \b b array are located in \b a array.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_buildPermutationArr_1
The result array \b c contains [1,0,4,2,3].
Here we re-fill \b da with zeros and copy \b dv into a component of \b da.
Note that the last parameter \b strictCompoCompare should be \c False
-in this case, else \ref ParaMEDMEM::DataArrayDouble::setPartOfValues1()
+in this case, else \ref MEDCoupling::DataArrayDouble::setPartOfValues1()
throws an exception because \b da has 2 components but only one target
component is specified.
\snippet MEDCouplingExamplesTest.py Snippet_DataArrayDouble_setPartOfValues1_3
Tuple #2 : 0 7 0 7
Tuple #3 : 0 0 0 0
</pre>
-\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValuesSimple2() can't
+\note \ref MEDCoupling::DataArrayDouble::setPartOfValuesSimple2() can't
be explicitly called in Python.
Tuple #2 : 0 7 0 7
Tuple #3 : 0 0 0 0
</pre>
-\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValuesSimple3() can't
+\note \ref MEDCoupling::DataArrayDouble::setPartOfValuesSimple3() can't
be explicitly called in Python.
Tuple #2 : 7 0 8 9 10 11 12
Tuple #3 : 7 0 8 9 10 11 12
</pre>
-\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValues2() can't
+\note \ref MEDCoupling::DataArrayDouble::setPartOfValues2() can't
be explicitly called in Python.
Tuple #2 : 7 0 8 9 10 11 12
Tuple #3 : 0 0 0 0 0 0 0
</pre>
-\note \ref ParaMEDMEM::DataArrayDouble::setPartOfValues3() can't
+\note \ref MEDCoupling::DataArrayDouble::setPartOfValues3() can't
be explicitly called in Python.
Here we re-fill \b da with zeros and copy \b dv into a component of \b da.
Note that the last parameter \b strictCompoCompare should be \c False
-in this case, else \ref ParaMEDMEM::DataArrayInt::setPartOfValues1()
+in this case, else \ref MEDCoupling::DataArrayInt::setPartOfValues1()
throws an exception because \b da has 2 components but only one target
component is specified.
\snippet MEDCouplingExamplesTest.py Snippet_DataArrayInt_setPartOfValues1_3
Tuple #2 : 0 7 0 7
Tuple #3 : 0 0 0 0
</pre>
-\note \ref ParaMEDMEM::DataArrayInt::setPartOfValuesSimple2() can't
+\note \ref MEDCoupling::DataArrayInt::setPartOfValuesSimple2() can't
be explicitly called in Python.
Tuple #2 : 0 7 0 7
Tuple #3 : 0 0 0 0
</pre>
-\note \ref ParaMEDMEM::DataArrayInt::setPartOfValuesSimple3() can't
+\note \ref MEDCoupling::DataArrayInt::setPartOfValuesSimple3() can't
be explicitly called in Python.
Tuple #2 : 7 0 8 9 10 11 12
Tuple #3 : 7 0 8 9 10 11 12
</pre>
-\note \ref ParaMEDMEM::DataArrayInt::setPartOfValues2() can't
+\note \ref MEDCoupling::DataArrayInt::setPartOfValues2() can't
be explicitly called in Python.
Tuple #2 : 7 0 8 9 10 11 12
Tuple #3 : 0 0 0 0 0 0 0
</pre>
-\note \ref ParaMEDMEM::DataArrayInt::setPartOfValues3() can't
+\note \ref MEDCoupling::DataArrayInt::setPartOfValues3() can't
be explicitly called in Python.
In this example we create two data arrays including \b same number of
tuples and then we concatenate them using \ref
-ParaMEDMEM::DataArrayDouble::meldWith "meldWith()".
+MEDCoupling::DataArrayDouble::meldWith "meldWith()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayDouble_Meld1_1
Now the array \b da1 includes 7 tuples (as before) of 3 components
each. Its components are: "c0da1","c1da1","c0da2".
In this example we create two data arrays including \b same number of
tuples and then we concatenate them using \ref
-ParaMEDMEM::DataArrayInt::meldWith "meldWith()".
+MEDCoupling::DataArrayInt::meldWith "meldWith()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_DataArrayInt_Meld1_1
Now the array \b da1 includes 7 tuples (as before) of 3 components
each. Its components are: "c0da1","c1da1","c0da2".
the result array \b a2 includes 30 elements (5 tuples per 6 components).
Note that
-\ref ParaMEDMEM::DataArrayInt::keepSelectedComponents() "DataArrayInt::keepSelectedComponents()"
+\ref MEDCoupling::DataArrayInt::keepSelectedComponents() "DataArrayInt::keepSelectedComponents()"
is called, providing the same result, by the following python code:
\snippet MEDCouplingExamplesTest.py SnippeDataArrayIntKeepSelectedComponents1_3
In this example we
- create two fields with two tuples per two components,
- use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::MaxFields "MaxFields()"
+\ref MEDCoupling::MEDCouplingFieldDouble::MaxFields "MaxFields()"
to get a field holding maximal values of the two fields.
- use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::MinFields "MinFields()"
+\ref MEDCoupling::MEDCouplingFieldDouble::MinFields "MinFields()"
to get a field holding minimal values of the two fields.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_MaxFields_1
- make a deep copy of the mesh and the field,
- translate the mesh and the field,
- use two variants of
-\ref ParaMEDMEM::MEDCouplingFieldDouble::MergeFields "MergeFields()"
+\ref MEDCoupling::MEDCouplingFieldDouble::MergeFields "MergeFields()"
to create one field from the two by concatenating them and their meshes.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_MergeFields_1
\subsubsection cpp_mcfielddouble_buildNewTimeReprFromThis Getting a field copy with different time discretization
First, we create a supporting 2D mesh and a field on it got using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
\ref MEDCouplingTemporalDisc "Time discretization" of this field is
-\ref ParaMEDMEM::ONE_TIME "ONE_TIME".
+\ref MEDCoupling::ONE_TIME "ONE_TIME".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_1
Now we use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis "buildNewTimeReprFromThis()"
+\ref MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis "buildNewTimeReprFromThis()"
to get a copy of \b field1 whose time discretization is
-\ref ParaMEDMEM::NO_TIME "NO_TIME".
+\ref MEDCoupling::NO_TIME "NO_TIME".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_2
First, we create a 2D Cartesian mesh constituted by 2 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic3_1
Now we use
-\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3 "fillFromAnalytic3()"
-to get a \ref ParaMEDMEM::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
+\ref MEDCoupling::MEDCouplingMesh::fillFromAnalytic3 "fillFromAnalytic3()"
+to get a \ref MEDCoupling::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
with values computed using an expression \b func. This expression is applied to coordinates of
each point (barycenter) for which the field value is computed. We want to get the
field on cells, with 3 components computed as follows. (In \b func, we refer to the
corresponding coordinates within a function.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic2_1
Now we use
-\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2 "fillFromAnalytic2()"
-to get a \ref ParaMEDMEM::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
+\ref MEDCoupling::MEDCouplingMesh::fillFromAnalytic2 "fillFromAnalytic2()"
+to get a \ref MEDCoupling::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
with values computed using an expression \b func. This expression is applied to coordinates of
each point (barycenter) for which the field value is computed. We want to get the
field on cells, with 3 components computed as follows. (In \b func, we refer to the
First, we create a 2D Cartesian mesh constituted by 2 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingMesh_fillFromAnalytic_1
Now we use
-\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic "fillFromAnalytic()"
-to get a \ref ParaMEDMEM::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
+\ref MEDCoupling::MEDCouplingMesh::fillFromAnalytic "fillFromAnalytic()"
+to get a \ref MEDCoupling::MEDCouplingFieldDouble "MEDCouplingFieldDouble" on cells filled
with values computed using an expression \b func. This expression is applied to coordinates of
each point (barycenter) for which the field value is computed. We want to get the
field on cells, with 3 components computed as follows. (In \b func, we refer to the
Now let's create a subfield on cells \b f2 from \b f1.
\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_2
-\b f1 is a field on cells, \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on cells too.
+\b f1 is a field on cells, \ref MEDCoupling::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on cells too.
So the array \b part1 lists ids on cells.
Now let's create a subfield on nodes \b f2 from \b f1.
\snippet MEDCouplingExamplesTest.cxx CppSnippetFieldDoubleBuildSubPart1_4
-\b f1 is a field on nodes, but \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on \b cells.
+\b f1 is a field on nodes, but \ref MEDCoupling::MEDCouplingFieldDouble::buildSubPart "buildSubPart" method performs an extraction on \b cells.
-After the call of \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart" on node field \b f1, \b f1 will be reduced on a
+After the call of \ref MEDCoupling::MEDCouplingFieldDouble::buildSubPart "buildSubPart" on node field \b f1, \b f1 will be reduced on a
submesh of \b mesh1 containing cells whose ids are in \b part2. So here the number of cells of \b f2 is 2 and the number of nodes is 4.
\n
-So contrary to fields on cells, it is normal for fields on nodes that number of tuples of the returned field of \ref ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart "buildSubPart"
+So contrary to fields on cells, it is normal for fields on nodes that number of tuples of the returned field of \ref MEDCoupling::MEDCouplingFieldDouble::buildSubPart "buildSubPart"
method does not match the size of the input array (here \b part2).
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_1
We are going to subtract \b field2 from \b field1, though they are on
different meshes.
-\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
+\ref MEDCoupling::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
allows us doing this. We use a mesh comparison level \b levOfCheck = 10 that allows
subtracting fields on meshes with different node arrays.<br>
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_2
After applying
-\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
+\ref MEDCoupling::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
the both fields lie on \b mesh2. As
-\ref ParaMEDMEM::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
+\ref MEDCoupling::MEDCouplingFieldDouble::substractInPlaceDM "substractInPlaceDM()"
permutes values of \b field1 before value subtraction, and thus \b field1 becomes
equal to \b field2, hence their subtraction results in a zero field.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_3
in the two meshes.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_1
We are going to use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()"
+\ref MEDCoupling::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()"
to set \b mesh2 instead of \b mesh1 as a support of a field. <br>
We use
-\ref ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic "fillFromAnalytic()"
+\ref MEDCoupling::MEDCouplingMesh::fillFromAnalytic "fillFromAnalytic()"
to make a field on nodes of \b mesh1, so that its values to equal to node coordinates.
Then we use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()"
+\ref MEDCoupling::MEDCouplingFieldDouble::changeUnderlyingMesh "changeUnderlyingMesh()"
to change the underlying mesh of the \b field.
(We use a mesh comparison level \b levOfCheck = 10 that allows substituting meshes with
different node arrays.) As a result, we expect that values of the \b field are also
We create a 2D vector field with 2 tuples and we want to transform this
field using an expression using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int, const std::string&) "applyFunc()".
+\ref MEDCoupling::MEDCouplingFieldDouble::applyFunc(int, const std::string&) "applyFunc()".
The expression \b func is applied to each atomic value of the \b field. We want to change
the \b field as follows. (In \b func, we use the variable "v" to refer to an atomic field value).
- Component #0 = component #0 (remains the same); hence "IVec * v" in \b func.
We create a 2D vector field with 2 values (vectors) and then we transform this
field into a 3D vector field by applying an expression to values of the 2D field
using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc3() "applyFunc3()".
+\ref MEDCoupling::MEDCouplingFieldDouble::applyFunc3() "applyFunc3()".
The expression \b func is applied to components of each vector of the \b field. We want
the \b field to have 3 components computed as follows. (In \b func, we refer to the
first component of a field value using the variable "a", and to the second component, using
We create a 2D vector field with 2 values (vectors) and then we transform this
field into a 3D vector field by applying an expression to values of the 2D field
using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const std::string&) "applyFunc2()".
+\ref MEDCoupling::MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const std::string&) "applyFunc2()".
Note that we set component info the \b array ("a" and "b" ) which will be used to refer to
corresponding components within a function.
The expression \b func is applied to components of each vector of the \b field. We want
We create a 2D vector field with 2 values (vectors) and then we transform this
field into a 3D vector field by applying an expression to values of the 2D field
using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()".
+\ref MEDCoupling::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()".
The expression \b func is applied to components of each vector of the \b field. We want
the \b field to have 3 components computed as follows. (In \b func, we refer to the
first component of a field value using the variable "a", and to the second component, using
equal to a certain value. First, we create the 2D mesh and the vector field on it.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_val_1
Finally we use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, double val) "applyFunc()"
+\ref MEDCoupling::MEDCouplingFieldDouble::applyFunc(int nbOfComp, double val) "applyFunc()"
to change the number of components and all field values.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_applyFunc_val_2
As a result, number of tuples in the field equals to the number of cells in the mesh,
First, we create a 2D Cartesian mesh constituted by 2 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_1
Now we create a field on cells and use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()"
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()"
to fill it
with values computed using an expression \b func. This expression is applied to coordinates of
each point (barycenter) for which the field value is computed. We want the \b field
corresponding coordinates within a function.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_1
Now we create a field on cells and use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()"
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic2 "fillFromAnalytic2()"
to fill it
with values computed using an expression \b func. This expression is applied to coordinates of
each point (barycenter) for which the field value is computed. We want the \b field
First, we create a 2D Cartesian mesh constituted by 2 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_1
Now we create a field on cells and use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
to fill it
with values computed using an expression \b func. This expression is applied to coordinates of
each point (barycenter) for which the field value is computed. We want the \b field to have
First, we create a supporting 2D mesh constituted by 4 cells. We create a 2x2
Cartesian mesh and then convert it to an unstructured one, since the Cartesian mesh
is not suitable for
-\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberNodes "renumberNodes()" as its
+\ref MEDCoupling::MEDCouplingFieldDouble::renumberNodes "renumberNodes()" as its
nature does not imply node renumbering.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_1
Then we create a field on nodes using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()",
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()",
such that its values to coincide with coordinates of field location points that are
- nodes in our case (as our field is \ref ParaMEDMEM::ON_NODES "ON_NODES").
+ nodes in our case (as our field is \ref MEDCoupling::ON_NODES "ON_NODES").
At last we ascertain that field values are equal to node coordinates.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_2
Now, we are going to reverse order of nodes using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberNodes "renumberNodes()".
+\ref MEDCoupling::MEDCouplingFieldDouble::renumberNodes "renumberNodes()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberNodes_3
As a result, the underlying mesh of \b field is changed and its nodes are also
renumbered.
First, we create a supporting 2D mesh constituted by 4 cells. We create a 2x2
Cartesian mesh and then convert it to an unstructured one, since the Cartesian mesh
is not suitable for
-\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberCells "renumberCells()" as its
+\ref MEDCoupling::MEDCouplingFieldDouble::renumberCells "renumberCells()" as its
nature does not imply cell renumbering.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_1
Then we create a field on cells using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()",
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()",
such that its values to coincide with coordinates of field location points that are
- cell barycenters in our case (as our field is \ref ParaMEDMEM::ON_CELLS "ON_CELLS").
+ cell barycenters in our case (as our field is \ref MEDCoupling::ON_CELLS "ON_CELLS").
At last we ascertain that field values are equal to cell barycenters.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_2
Now, we are going to reverse order of cells using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::renumberCells "renumberCells()".
+\ref MEDCoupling::MEDCouplingFieldDouble::renumberCells "renumberCells()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_renumberCells_3
As a result, the underlying mesh of \b field is changed and its cells are also
renumbered.
coordinates of a 2D point.
\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_fillFromAnalytic_c_func_0
Then we create the 2D mesh and the field on it, and finally we use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, FunctionToEvaluate func) "fillFromAnalytic()"
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, FunctionToEvaluate func) "fillFromAnalytic()"
to fill the field with values each composed of 3 components.
\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_fillFromAnalytic_c_func_1
As a result, number of tuples in the field equals to the number of cells in the mesh,
Then we create the 2D mesh and the vector field on it.
\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_applyFunc_c_func_1
Finally we use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, FunctionToEvaluate func) "applyFunc()"
+\ref MEDCoupling::MEDCouplingFieldDouble::applyFunc(int nbOfComp, FunctionToEvaluate func) "applyFunc()"
to change the field values.
\snippet MEDCouplingExamplesTest.cxx Snippet_MEDCouplingFieldDouble_applyFunc_c_func_2
As a result, number of tuples in the field equals to the number of cells in the mesh,
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_1
Then we create a scalar field on cells, whose values vary linearly in time.
We set all field values at a start time to be equal 10.0 using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
And we set all field values at an end time to be equal 20.0 by doubling the start
time array.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_time_2
First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh
constituted by 4 cells. Then we create a scalar field on cells using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_1
Now, we want to retrieve all field values using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()".
+\ref MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()".
The field values relate to cells, hence we will use cell barycenters as a parameter of
-\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()".
+\ref MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()".
We expect that the double array returned
-\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()"
+\ref MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti "getValueOnMulti()"
is equal to that stored by \b field.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_2
First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh
constituted by 4 cells. Then we create a scalar field on cells using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_1
Now, we want to retrieve all field values using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn()".
+\ref MEDCoupling::MEDCouplingFieldDouble::getValueOn "getValueOn()".
The field values relate to cells, hence we will use cell barycenters to get a field
value at each cell.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOn_2
We collected all values returned by
-\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn()" in an array, so
+\ref MEDCoupling::MEDCouplingFieldDouble::getValueOn "getValueOn()" in an array, so
that we can ascertain that the array of returned values is same as that stored by \b
field.
First, we create a supporting structured mesh. We create a 2x2 Cartesian mesh
constituted by 4 cells. Then we create a scalar field on cells using
-\ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
+\ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic "fillFromAnalytic()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnPos_1
Now, we retrieve a field value relating to the cell #3 (this cell has a structured indexed
(1,1)). For that we use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOnPos "getValueOnPos()" where we
+\ref MEDCoupling::MEDCouplingFieldDouble::getValueOnPos "getValueOnPos()" where we
pass the structured indexed of the cell: 1,1,-1 (the last index is meaningless as the
mesh is 2D).
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_getValueOnPos_2
Firstly retrieve basic data in full interlace mode for coordinates, and nodal connectivity cell per cell.
\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_1
-Then create ParaMEDMEM::MEDCouplingUMesh instance giving its mesh dimension (2 here) and a name.
+Then create MEDCoupling::MEDCouplingUMesh instance giving its mesh dimension (2 here) and a name.
\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_2
Gives an upper bound of the number of cells to be inserted into the unstructured mesh.
-\n Then enter nodal connectivity of all cells, cell per cell using ParaMEDMEM::MEDCouplingUMesh::insertNextCell method.
-\n When the nodal connectivity cell per cell has been finished, call ParaMEDMEM::MEDCouplingUMesh::finishInsertingCells method in order to restore \b mesh instance.
+\n Then enter nodal connectivity of all cells, cell per cell using MEDCoupling::MEDCouplingUMesh::insertNextCell method.
+\n When the nodal connectivity cell per cell has been finished, call MEDCoupling::MEDCouplingUMesh::finishInsertingCells method in order to restore \b mesh instance.
\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshStdBuild1_3
Firstly retrieve basic data in full interlace mode for coordinates, and nodal connectivity cell per cell, cell type \b included (3 for INTERP_KERNEL::NORM_TRI3 and 4 for INTERP_KERNEL::QUAD4).
\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_1
-Then create ParaMEDMEM::MEDCouplingUMesh instance giving its mesh dimension (2 here) and a name.
+Then create MEDCoupling::MEDCouplingUMesh instance giving its mesh dimension (2 here) and a name.
\snippet MEDCouplingExamplesTest.cxx CppSnippetUMeshAdvBuild1_2
We are going to build a 2D cartesian mesh, constituted from 9 nodes along X axis, and 7 nodes along Y axis.
-Firstly retrieve for each direction the discretization and build a \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble instance" on the corresponding direction.
+Firstly retrieve for each direction the discretization and build a \ref MEDCoupling::DataArrayDouble "DataArrayDouble instance" on the corresponding direction.
\snippet MEDCouplingExamplesTest.cxx CppSnippetCMeshStdBuild1_1
-Then create ParaMEDMEM::MEDCouplingCMesh instance giving the 2 instances of \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble" obtained above.
+Then create MEDCoupling::MEDCouplingCMesh instance giving the 2 instances of \ref MEDCoupling::DataArrayDouble "DataArrayDouble" obtained above.
There are 2 techniques to get it.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::buildBoundaryMesh "buildBoundaryMesh()" to get a mesh
+\ref MEDCoupling::MEDCouplingUMesh::buildBoundaryMesh "buildBoundaryMesh()" to get a mesh
of lower dimension bounding \b mesh.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_2
Depending on the value of a parameter,
-\ref ParaMEDMEM::MEDCouplingUMesh::buildBoundaryMesh "buildBoundaryMesh()"
+\ref MEDCoupling::MEDCouplingUMesh::buildBoundaryMesh "buildBoundaryMesh()"
creates the mesh sharing the node coordinates array with \b mesh or not.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_1
In the following code we retrieve nodes of the cell #0 an then we call
-\ref ParaMEDMEM::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()"
+\ref MEDCoupling::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()"
twice with these nodes and with varying last parameter \b allNodes as input.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_2
<br>If the last parameter is \c true
-\ref ParaMEDMEM::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()" looks
+\ref MEDCoupling::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()" looks
for segements whose all nodes are given to it, hence it finds segments bounding the cell #0 only.
<br>If the last parameter is \c false
-\ref ParaMEDMEM::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()" looks
+\ref MEDCoupling::MEDCouplingUMesh::buildFacePartOfMySelfNode "buildFacePartOfMySelfNode()" looks
for any segment whose nodes are given to it, hence it adds more segments to \b mesh2.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_1
In the following code we retrieve nodes of the cell #0 an then we call
-\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()"
+\ref MEDCoupling::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()"
twice with these nodes and with varying last parameter \b allNodes as input.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_2
<br>If the last parameter is \c true
-\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()" looks
+\ref MEDCoupling::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()" looks
for cells whose all nodes are given to it, hence it finds the cell #0 only.
<br>If the last parameter is \c false
-\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()" looks
+\ref MEDCoupling::MEDCouplingUMesh::buildPartOfMySelfNode "buildPartOfMySelfNode()" looks
for any cell whose nodes are given to it, hence it finds all cells of \b mesh because all
cells share the node #4.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelf_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOfMySelf "buildPartOfMySelf()" to get a mesh
+\ref MEDCoupling::MEDCouplingUMesh::buildPartOfMySelf "buildPartOfMySelf()" to get a mesh
containing only two cells of \b mesh.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOfMySelf_2
First, we create a mesh with 2 incorrectly oriented "extruded" volumes.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_1
Now we check that
-\ref ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells "findAndCorrectBadOriented3DExtrudedCells()"
+\ref MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells "findAndCorrectBadOriented3DExtrudedCells()"
finds and fixes the reversed cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_2
two "extruded" polyhedra and then convert them to correctly defined polyhedra.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented_1
Now we check that
-\ref ParaMEDMEM::MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented "arePolyhedronsNotCorrectlyOriented()"
+\ref MEDCoupling::MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented "arePolyhedronsNotCorrectlyOriented()"
finds one reversed cell. After that we fix it using
-\ref ParaMEDMEM::MEDCouplingUMesh::orientCorrectlyPolyhedrons "orientCorrectlyPolyhedrons()" and
+\ref MEDCoupling::MEDCouplingUMesh::orientCorrectlyPolyhedrons "orientCorrectlyPolyhedrons()" and
re-check the orientation of polyhedra.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented_2
reversed comparing with others.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_1
Now we check that
-\ref ParaMEDMEM::MEDCouplingUMesh::are2DCellsNotCorrectlyOriented "are2DCellsNotCorrectlyOriented()"
+\ref MEDCoupling::MEDCouplingUMesh::are2DCellsNotCorrectlyOriented "are2DCellsNotCorrectlyOriented()"
finds one reversed face. After that we fix the incorrectly oriented cell using
-\ref ParaMEDMEM::MEDCouplingUMesh::orientCorrectly2DCells "orientCorrectly2DCells()" and
+\ref MEDCoupling::MEDCouplingUMesh::orientCorrectly2DCells "orientCorrectly2DCells()" and
re-check the orientation of cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_2
First, we create a 2D mesh with 1 QUAD4 cell and with undefined coordinates of nodes.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodesInConn_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodesInConn "renumberNodesInConn()"
+\ref MEDCoupling::MEDCouplingUMesh::renumberNodesInConn "renumberNodesInConn()"
to get the following nodal connectivity of a sole cell: 0,1,2,3.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodesInConn_2
\b old2newIds array defines how node ids are changed:
First, we create a 2D mesh with 4 nodes and no cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodes_1
Next, we use
-\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes "renumberNodes()"
+\ref MEDCoupling::MEDCouplingUMesh::renumberNodes "renumberNodes()"
to permute nodes so that
- old node #0 becomes #2,
- old node #1 remains #1,
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodes_2
Next we compare behavior of
-\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes "renumberNodes()" and that of
-\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes2 "renumberNodes2()" which, in contrast to
-\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes "renumberNodes()",
+\ref MEDCoupling::MEDCouplingUMesh::renumberNodes "renumberNodes()" and that of
+\ref MEDCoupling::MEDCouplingUMesh::renumberNodes2 "renumberNodes2()" which, in contrast to
+\ref MEDCoupling::MEDCouplingUMesh::renumberNodes "renumberNodes()",
moves merged nodes to their barycenter.<br>
We set #2 as new id of old node #3 and expect that
-\ref ParaMEDMEM::MEDCouplingUMesh::renumberNodes2 "renumberNodes2()" moves old nodes #0
+\ref MEDCoupling::MEDCouplingUMesh::renumberNodes2 "renumberNodes2()" moves old nodes #0
and #3 to their barycenter (-0.3,0.0) which becomes position of node #2.<br>
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_renumberNodes_3
of which 2 nodes fully coincide (#3 and #4) and 3 nodes are equal with precision 0.003.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_mergeNodes_1
Now we merge node duplicates using
-\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()" and check values it returns.
+\ref MEDCoupling::MEDCouplingUMesh::mergeNodes "mergeNodes()" and check values it returns.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_mergeNodes_2
Contents of \b arr shows ids of old nodes after the merging. The nodes considered equal
one to the other have the same id in \b arr.
Next we compare behavior of
-\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()" and that of
-\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes2 "mergeNodes2()" which, in contrast to
-\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()",
+\ref MEDCoupling::MEDCouplingUMesh::mergeNodes "mergeNodes()" and that of
+\ref MEDCoupling::MEDCouplingUMesh::mergeNodes2 "mergeNodes2()" which, in contrast to
+\ref MEDCoupling::MEDCouplingUMesh::mergeNodes "mergeNodes()",
moves merged nodes to their barycenter.<br> We expect that
-\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes2 "mergeNodes2()" moves old nodes #0, #2
+\ref MEDCoupling::MEDCouplingUMesh::mergeNodes2 "mergeNodes2()" moves old nodes #0, #2
and #5 to their barycenter equal to position of node #2.<br>
First we check that
-\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes()" does not move nodes
+\ref MEDCoupling::MEDCouplingUMesh::mergeNodes "mergeNodes()" does not move nodes
coincident with the node #2 to the position of node #2, and then we check that
-\ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes2()" does move.
+\ref MEDCoupling::MEDCouplingUMesh::mergeNodes "mergeNodes2()" does move.
(We check only the second (Y) component of node coordinates since the first component of
these nodes is exactly same.)
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_mergeNodes_3
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer "zipConnectivityTraducer()"
+\ref MEDCoupling::MEDCouplingUMesh::zipConnectivityTraducer "zipConnectivityTraducer()"
to remove duplicate cells. Then we check that two cells, having exactly same nodal
connectivity with other cells, have been removed.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_2
The cell #3 equals to the cell #0 (== \b arr[3] ).<br>
The cell #4 has no equal cell. This is because the cell comparison technique specified
when we called
-\ref ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer "zipConnectivityTraducer()"
+\ref MEDCoupling::MEDCouplingUMesh::zipConnectivityTraducer "zipConnectivityTraducer()"
was 0 ("exact"), if we had used the technique 2 ("nodal"), \b arr[4] would be 0.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_1
Now we create \b mesh2 including all nodes but only two cells of \b mesh, and we use \ref
-ParaMEDMEM::MEDCouplingUMesh::zipCoordsTraducer "zipCoordsTraducer()" to remove unused
+MEDCoupling::MEDCouplingUMesh::zipCoordsTraducer "zipCoordsTraducer()" to remove unused
nodes from \b mesh2.
-\ref ParaMEDMEM::MEDCouplingUMesh::zipCoordsTraducer "zipCoordsTraducer()" returns an array
+\ref MEDCoupling::MEDCouplingUMesh::zipCoordsTraducer "zipCoordsTraducer()" returns an array
with -1 for unused nodes and new ids for used ones.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_2
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_1
Now we create \b mesh2 including all nodes but only two cells of \b mesh, and we use \ref
-ParaMEDMEM::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" to get nodes of \b mesh2
+MEDCoupling::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" to get nodes of \b mesh2
used in its two cells.
-\ref ParaMEDMEM::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" returns an array
+\ref MEDCoupling::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" returns an array
with -1 for unused nodes and new ids for used ones.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_2
Now we use \b newNbOfNodes returned by
-\ref ParaMEDMEM::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" to convert \b arr
+\ref MEDCoupling::MEDCouplingUMesh::getNodeIdsInUse "getNodeIdsInUse()" to convert \b arr
to "New to Old" mode.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_3
\subsubsection cpp_mccmesh_getCoordsAt Getting node coordinates along an axis
We create an 1D Cartesian mesh and retrieves node coordinates using
-\ref ParaMEDMEM::MEDCouplingCMesh::getCoordsAt "getCoordsAt()".
+\ref MEDCoupling::MEDCouplingCMesh::getCoordsAt "getCoordsAt()".
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingCMesh_getCoordsAt_1
\subsubsection cpp_mcpointset_getcoordinatesofnode Getting coordinates of a node
-The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
+The following code creates a 2D \ref MEDCoupling::MEDCouplingUMesh
"MEDCouplingUMesh" with 3 nodes and no cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_1
Here we get coordinates of the second node and check its two coordinates.
share the same node coordinates array.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_2
Now we ascertain that
-- \ref ParaMEDMEM::MEDCouplingUMesh::areCellsIncludedIn "areCellsIncludedIn()"
+- \ref MEDCoupling::MEDCouplingUMesh::areCellsIncludedIn "areCellsIncludedIn()"
detects that all cells of \b mesh2 are present in \b mesh1,
- the correspondence array \b corr2to1, which gives cell ids of \b mesh2 within
\b mesh1, is equal to the array \b cells2 which selected cells from \b mesh1 for creation
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_3
Now we apply
-\ref ParaMEDMEM::MEDCouplingUMesh::areCellsIncludedIn "areCellsIncludedIn()"
+\ref MEDCoupling::MEDCouplingUMesh::areCellsIncludedIn "areCellsIncludedIn()"
in a reverse direction and ascertain that it returns \c false.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_4
The contents of the correspondence
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_1
Then we check that
-- \ref ParaMEDMEM::MEDCouplingUMesh::checkDeepEquivalWith "checkDeepEquivalWith()"
+- \ref MEDCoupling::MEDCouplingUMesh::checkDeepEquivalWith "checkDeepEquivalWith()"
considers the meshes equal (i.e. it does not throw any exception) if it is called with a cell
comparison policy \b cellCompPol == 1
- mapping from \b mesh1 to \b mesh2 for both nodes and cells is as expected.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_2
Next we ascertain that
-\ref ParaMEDMEM::MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith "checkDeepEquivalOnSameNodesWith()"
+\ref MEDCoupling::MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith "checkDeepEquivalOnSameNodesWith()"
consider \b mesh1 and \b mesh2 different as they do not share the same nodal connectivity
array. <br>
After that we make the meshes share the node coordinates array and insert new
triangles based on the same nodes but in different order. This is to ascertain that
-\ref ParaMEDMEM::MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith "checkDeepEquivalOnSameNodesWith()"
+\ref MEDCoupling::MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith "checkDeepEquivalOnSameNodesWith()"
called with the weakest cell comparison policy considers the meshes equal.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_3
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner "getPartBarycenterAndOwner()" to get
+\ref MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner "getPartBarycenterAndOwner()" to get
barycenters of all but the first cell.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_3
The returned array contains 4 tuples per 2 components.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoints_1
Then we use
-\ref ParaMEDMEM::MEDCouplingUMesh::getCellsContainingPoints "getCellsContainingPoints()" to
+\ref MEDCoupling::MEDCouplingUMesh::getCellsContainingPoints "getCellsContainingPoints()" to
get cells in contact with tree points. Two of them are in contact with some cells and one is not.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoints_2
The contents of the result arrays \b cells ([4, 0, 1]) and \b cellsIndex ([0, 0, 1, 3])
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoint_1
Then we use
-\ref ParaMEDMEM::MEDCouplingUMesh::getCellsContainingPoint "getCellsContainingPoint()" to
+\ref MEDCoupling::MEDCouplingUMesh::getCellsContainingPoint "getCellsContainingPoint()" to
get cells in contact with a small ball (point with precision) located near the node #4 and
shifted from this node by its radius \b eps.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsContainingPoint_2
reversed.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField "buildPartOrthogonalField()" to get
+\ref MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField "buildPartOrthogonalField()" to get
normal vectors to the cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_2
reversed.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField "getPartMeasureField()" to get
+\ref MEDCoupling::MEDCouplingUMesh::getPartMeasureField "getPartMeasureField()" to get
volumes of all but the first cell. If we call
-\ref ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField "getPartMeasureField()" with \b
+\ref MEDCoupling::MEDCouplingUMesh::getPartMeasureField "getPartMeasureField()" with \b
isAbs == \c true, the area of the cell #1 is returned positive, else, negative that
reflects its inverse orientation.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getPartMeasureField_2
First, we create a 2D mesh with 1 TRI3 cell. Bounding box of this cell is [0.,0., 1.,1].
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_1
Now we check how
-\ref ParaMEDMEM::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()"
+\ref MEDCoupling::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()"
searches for cells using the bounding box. We use a bounding box touching the bounding box
of the sole cell at one point (1.,1.).
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_2
-If \ref ParaMEDMEM::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()" is
+If \ref MEDCoupling::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()" is
called with parameter \b eps == 0.0, the cell is not found because the two bounding boxes
(one of the cell and the one passed as parameter) do not overlap. <br>
-If \ref ParaMEDMEM::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()" is
+If \ref MEDCoupling::MEDCouplingUMesh::getCellsInBoundingBox "getCellsInBoundingBox()" is
called with parameter \b eps == 0.1, the cell is found because \b eps is used to increase
the bounding box of the cell and thus the two bounding boxes intersect each other. <br>
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findBoundaryNodes_1
Now we use
-\ref ParaMEDMEM::MEDCouplingUMesh::findBoundaryNodes "findBoundaryNodes()" to get ids
+\ref MEDCoupling::MEDCouplingUMesh::findBoundaryNodes "findBoundaryNodes()" to get ids
of boundary nodes.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_findBoundaryNodes_2
-\ref ParaMEDMEM::MEDCouplingUMesh::findBoundaryNodes "findBoundaryNodes()" returns all
+\ref MEDCoupling::MEDCouplingUMesh::findBoundaryNodes "findBoundaryNodes()" returns all
node ids except the node #4 which is in the middle of \b mesh.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_1
In the following code we retrieve nodes of the cell #0 an then we call
-\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()"
+\ref MEDCoupling::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()"
twice with these nodes and with varying last parameter \b allNodes as input.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_2
<br>If the last parameter is \c true
-\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()" looks
+\ref MEDCoupling::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()" looks
for cells whose all nodes are given to it, hence it finds the cell #0 only.
<br>If the last parameter is \c false
-\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()" looks
+\ref MEDCoupling::MEDCouplingUMesh::getCellIdsLyingOnNodes "getCellIdsLyingOnNodes()" looks
for any cell whose nodes are given to it, hence it finds all cells of \b mesh because all
cells share the node #4.
First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_1
In the following code we retrieve nodes of two cells an then we use
-\ref ParaMEDMEM::MEDCouplingUMesh::getCellIdsFullyIncludedInNodeIds
+\ref MEDCoupling::MEDCouplingUMesh::getCellIdsFullyIncludedInNodeIds
"getCellIdsFullyIncludedInNodeIds()" to find these cells by their nodes.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_2
\subsubsection cpp_mcpointset_getnodeidsnearpoint Getting nodes close to a point
-The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
+The following code creates a 2D \ref MEDCoupling::MEDCouplingUMesh
"MEDCouplingUMesh" with 5 nodes and no cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_1
Now we define an array of coordinates of a point close to nodes #0, #2 and #4.
Thus we expect that
-\ref ParaMEDMEM::MEDCouplingPointSet::getNodeIdsNearPoint "getNodeIdsNearPoint()" that
+\ref MEDCoupling::MEDCouplingPointSet::getNodeIdsNearPoint "getNodeIdsNearPoint()" that
we are going to use,
if called with \b eps = 0.003, would return ids of nodes #0, #2 and #4.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_2
\subsubsection cpp_mcpointset_getnodeidsnearpoints Getting nodes close to some points
-The following code creates a 2D \ref ParaMEDMEM::MEDCouplingUMesh
+The following code creates a 2D \ref MEDCoupling::MEDCouplingUMesh
"MEDCouplingUMesh" with 7 nodes and no cells.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_1
Now we define an array of coordinates of 3 points near which we want to find nodes of the mesh.
- Point #2 is close to nodes #3, #4 and #5.
Thus we expect that
-\ref ParaMEDMEM::MEDCouplingPointSet::getNodeIdsNearPoints "getNodeIdsNearPoints()" that
+\ref MEDCoupling::MEDCouplingPointSet::getNodeIdsNearPoints "getNodeIdsNearPoints()" that
we are going to use,
if called with \b eps = 0.003, would return ids of close nodes #1, #3, #4 and #5.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_2
First, we create a mesh with 6 nodes, of which two nodes (#3 and #4) are fully coincident
and 3 nodes (#0, #2 and #5) have distance less than 0.004 between them.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_findCommonNodes_1
-Then, we use \ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" to find
+Then, we use \ref MEDCoupling::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" to find
coincident nodes, and check that (1) calling
-\ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" with \b prec
+\ref MEDCoupling::MEDCouplingPointSet::findCommonNodes() "findCommonNodes()" with \b prec
== 1e-13 finds the two fully coincident nodes only and (2)
-\ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes() "findCommonNodes"(0.004) finds 5
+\ref MEDCoupling::MEDCouplingPointSet::findCommonNodes() "findCommonNodes"(0.004) finds 5
equal nodes.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingPointSet_findCommonNodes_2
In this example we
- create an 2D mesh and 3 fields on it,
- use
-\ref ParaMEDMEM::MEDCouplingFieldDouble::WriteVTK "WriteVTK()"
+\ref MEDCoupling::MEDCouplingFieldDouble::WriteVTK "WriteVTK()"
to write all the fields and the mesh to a VTK file.
\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingFieldDouble_WriteVTK_1
To read it there are 3 main approaches :
-- Use ParaMEDMEM::MEDFileField1TS class :
+- Use MEDCoupling::MEDFileField1TS class :
\snippet MEDLoaderExamplesTest.py PySnippetReadFieldOnAllEntity1_3
-- Use ParaMEDMEM::MEDFileFieldMultiTS class :
+- Use MEDCoupling::MEDFileFieldMultiTS class :
\snippet MEDLoaderExamplesTest.py PySnippetReadFieldOnAllEntity1_4
-- Use iteration ParaMEDMEM::MEDFileFieldMultiTS class :
+- Use iteration MEDCoupling::MEDFileFieldMultiTS class :
\snippet MEDLoaderExamplesTest.py PySnippetReadFieldOnAllEntity1_5
\snippet MEDLoaderExamplesTest.py PySnippetReadFieldPartial1_4
-\ref medcoupling "MEDCoupling" allows to make bridges between the approaches. For example \a pfl \ref ParaMEDMEM::DataArrayInt "DataArrayInt instance" retrieved directly
+\ref medcoupling "MEDCoupling" allows to make bridges between the approaches. For example \a pfl \ref MEDCoupling::DataArrayInt "DataArrayInt instance" retrieved directly
from the file in the second approach can be retrieved starting from first approach.
Starting from mesh \a firstApproachMesh of read field in first approach \a fread, whith the whole mesh \a wholeMesh the profile \a pflComputed can be computed :
For starter, take a look at the \ref MEDLoaderBasicAPIPage "basic MEDLoader API".
\subsubsection f-coher "How to control the validity of my mesh"
-Use the methods \ref ParaMEDMEM::MEDCouplingUMesh::checkCoherency() "MEDCouplingUMesh::checkCoherency()" or
-\ref ParaMEDMEM::MEDCouplingUMesh::checkCoherency1() "MEDCouplingUMesh::checkCoherency1()"
+Use the methods \ref MEDCoupling::MEDCouplingUMesh::checkConsistencyLight() "MEDCouplingUMesh::checkConsistencyLight()" or
+\ref MEDCoupling::MEDCouplingUMesh::checkConsistency() "MEDCouplingUMesh::checkConsistency()"
\subsubsection f-groups "How can I read/write groups on a mesh"
Take a look at \ref AdvMEDLoaderAPIMeshReading and \ref AdvMEDLoaderAPIMeshWriting.
\subsubsection f-unstruc "How can I transform a structured mesh into an unstructured one"
-Use the method \ref ParaMEDMEM::MEDCouplingCMesh::buildUnstructured() "MEDCouplingCMesh::buildUnstructured()"
+Use the method \ref MEDCoupling::MEDCouplingCMesh::buildUnstructured() "MEDCouplingCMesh::buildUnstructured()"
\subsection faq-interp Projection, interpolation, remapping
\subsubsection f-proj How to project a field from one mesh to the other
to spot the place where the segfault happens.
The most common source of mistake is some memory mis-allocation and/or deallocation.
With this respect using the auto pointer class
-\ref ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr "MEDCouplingAutoRefCountObjectPtr"
+\ref MEDCoupling::MCAuto "MCAuto"
can be of great help.
\n
\n
-*/
\ No newline at end of file
+*/
\endif
- \ref appendix
+ - \ref porting
- \ref glossary
- \ref med-file
- \ref install
-- \ref ParaMEDMEM "MEDCoupling (and other parallel classes) API documentation"
-- \ref MEDLoader "MEDLoader API documentation"
+- \ref MEDCoupling "MEDCoupling, MEDLoader (and other parallel classes) API documentation"
*/
MEDCoupling, \ref parallel "ParaMEDMEM", and \ref medloader "MEDLoader" modules so it should be correctly
understood to efficiently deal with \ref meshes "Meshes" and \ref fields "Fields".
-\ref ParaMEDMEM::DataArray "DataArrays" are the atomic element of potentially heavy-memory objects in
+\ref MEDCoupling::DataArray "DataArrays" are the atomic element of potentially heavy-memory objects in
the 3 modules mentionned above.
There are for the moment two types of arrays :
- - double precision float (64 bits) array incarnated by \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble class".
- - signed integer (32 bits) array incarnated by \ref ParaMEDMEM::DataArrayInt "DataArrayInt class".
+ - double precision float (64 bits) array incarnated by \ref MEDCoupling::DataArrayDouble "DataArrayDouble class".
+ - signed integer (32 bits) array incarnated by \ref MEDCoupling::DataArrayInt "DataArrayInt class".
-\ref ParaMEDMEM::DataArrayDouble "DataArrayDouble" and \ref ParaMEDMEM::DataArrayInt "DataArrayInt" classes inherits from
-\ref ParaMEDMEM::DataArray "DataArray" \b non \b instantiable \b class that factorizes some common methods of inherited instantiable classes.
+\ref MEDCoupling::DataArrayDouble "DataArrayDouble" and \ref MEDCoupling::DataArrayInt "DataArrayInt" classes inherits from
+\ref MEDCoupling::DataArray "DataArray" \b non \b instantiable \b class that factorizes some common methods of inherited instantiable classes.
-In the rest of the documentation \b DataArray will be used for both \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble" and \ref ParaMEDMEM::DataArrayInt "DataArrayInt".
+In the rest of the documentation \b DataArray will be used for both \ref MEDCoupling::DataArrayDouble "DataArrayDouble" and \ref MEDCoupling::DataArrayInt "DataArrayInt".
\section MEDCouplingArrayBasics Basics concepts of the DataArrays.
-It will be presented in this section common concept shared by the two classes to \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble" and \ref ParaMEDMEM::DataArrayInt "DataArrayInt".
+It will be presented in this section common concept shared by the two classes to \ref MEDCoupling::DataArrayDouble "DataArrayDouble" and \ref MEDCoupling::DataArrayInt "DataArrayInt".
\subsection MEDCouplingArrayBasicsName Name
-A \ref ParaMEDMEM::DataArray "DataArray" instance has an attribute **name**.
+A \ref MEDCoupling::DataArray "DataArray" instance has an attribute **name**.
-**name** is particularly useful for \ref ParaMEDMEM::DataArray "DataArray" representing profiles, families, groups, fields in MEDLoader.
-But excepted these useful usecases, **name** attribute is often ignored when \ref ParaMEDMEM::DataArray "DataArrays" are aggregated (field array, connectivity, coordinates) in a bigger object.
-Whatever the usage of the **name** attribute of \ref ParaMEDMEM::DataArray "DataArrays", all methods in ParaMEDMEM::DataArrayDouble and ParaMEDMEM::DataArrayInt class deal with **name** as they do for components names.
+**name** is particularly useful for \ref MEDCoupling::DataArray "DataArray" representing profiles, families, groups, fields in MEDLoader.
+But excepted these useful usecases, **name** attribute is often ignored when \ref MEDCoupling::DataArray "DataArrays" are aggregated (field array, connectivity, coordinates) in a bigger object.
+Whatever the usage of the **name** attribute of \ref MEDCoupling::DataArray "DataArrays", all methods in MEDCoupling::DataArrayDouble and MEDCoupling::DataArrayInt class deal with **name** as they do for components names.
\subsection MEDCouplingArrayBasicsTuplesAndCompo Raw data, tuples and components of DataArrays.
-The main goal of \ref ParaMEDMEM::DataArray "DataArray" is to store contiguous vector of atomical elements with same basic datatype (signed integers, double precision...). This vector of atomical elements is called **raw data** of \ref ParaMEDMEM::DataArray "DataArray".
+The main goal of \ref MEDCoupling::DataArray "DataArray" is to store contiguous vector of atomical elements with same basic datatype (signed integers, double precision...). This vector of atomical elements is called **raw data** of \ref MEDCoupling::DataArray "DataArray".
-The size of this vector of data is called <em>"number of elements"</em>. So the number of bytes stored by a \ref ParaMEDMEM::DataArray "DataArray" instance, is equal to
+The size of this vector of data is called <em>"number of elements"</em>. So the number of bytes stored by a \ref MEDCoupling::DataArray "DataArray" instance, is equal to
the product of the __number of elements__ * __constant size of DataType__ .
-As \ref ParaMEDMEM::DataArray "DataArray" instances are designed to store vector fields, tensor fields, coordinate of nodes, the notion of _components_ has been added.
+As \ref MEDCoupling::DataArray "DataArray" instances are designed to store vector fields, tensor fields, coordinate of nodes, the notion of _components_ has been added.
-So, \ref ParaMEDMEM::DataArray "DataArrays" have an additional attribute that is number of components that represent the size of a contiguous set of atomical elements.
-The vector of atomical elements stored into \ref ParaMEDMEM::DataArray "DataArrays" are grouped in contiguous memory set of atomical elements having each same size.
+So, \ref MEDCoupling::DataArray "DataArrays" have an additional attribute that is number of components that represent the size of a contiguous set of atomical elements.
+The vector of atomical elements stored into \ref MEDCoupling::DataArray "DataArrays" are grouped in contiguous memory set of atomical elements having each same size.
The contiguous set of atomical elements is called **tuple**. And each **tuple** stored in raw data, has a length exactly equal to the number of components of
-\ref ParaMEDMEM::DataArray "DataArray" storing it.
+\ref MEDCoupling::DataArray "DataArray" storing it.
Thus :
N_{bytes}=N_{elements}*sizeof(DataType)=N_{tuples}*N_{components}*sizeof(DataType).
\f]
-In other words, **raw data** of \ref ParaMEDMEM::DataArray "DataArrays" can be seen as a dense matrix, whose number of components would be the row size and number of tuples
-would be the column size. In this point of view of \ref ParaMEDMEM::DataArray "DataArrays" a **tuple** is represented by the corresponding row in the dense matrix.
+In other words, **raw data** of \ref MEDCoupling::DataArray "DataArrays" can be seen as a dense matrix, whose number of components would be the row size and number of tuples
+would be the column size. In this point of view of \ref MEDCoupling::DataArray "DataArrays" a **tuple** is represented by the corresponding row in the dense matrix.
-Typically in the **raw data** of \ref ParaMEDMEM::DataArray "DataArrays" **number of tuples** is highly bigger than **number of components** !
+Typically in the **raw data** of \ref MEDCoupling::DataArray "DataArrays" **number of tuples** is highly bigger than **number of components** !
To finish, raw data is stored tuples by tuples, in another words, in **full interlace mode**, which is the natural storage strategy in C/C++ world.
\subsection MEDCouplingArrayBasicsCompoName Information on components name.
-As seen in the sub section above, a \ref ParaMEDMEM::DataArray "DataArray" instance has a defined number of components.
+As seen in the sub section above, a \ref MEDCoupling::DataArray "DataArray" instance has a defined number of components.
-There is an information attached to each of these components constituting the \ref ParaMEDMEM::DataArray "DataArray".
+There is an information attached to each of these components constituting the \ref MEDCoupling::DataArray "DataArray".
This information is concretely a string of characters that allows, if needed, to give information about the corresponding component.
\subsection MEDCouplingArrayBasicsTimeLabel DataArrays and TimeLabel.
-\ref ParaMEDMEM::DataArray "DataArrays instances" can consume big amount of data in memory so they inherit from \ref MEDCouplingTimeLabelPage "TimeLabel".
+\ref MEDCoupling::DataArray "DataArrays instances" can consume big amount of data in memory so they inherit from \ref MEDCouplingTimeLabelPage "TimeLabel".
So in C++ it is a good practice to use :
- \c getConstPointer method in readonly access.
- \c getPointer method only if write is needed.
-If the user in C++ or Python wants to modify intensively its **big** \ref ParaMEDMEM::DataArray "DataArray" instance **not** using raw data pointer it is better to invoke
-\c setIJSilent just after invocation of \c declareAsNew instead of calling \c setIJ method that will increment time label of \ref ParaMEDMEM::DataArray "DataArray" instance
+If the user in C++ or Python wants to modify intensively its **big** \ref MEDCoupling::DataArray "DataArray" instance **not** using raw data pointer it is better to invoke
+\c setIJSilent just after invocation of \c declareAsNew instead of calling \c setIJ method that will increment time label of \ref MEDCoupling::DataArray "DataArray" instance
on each call.
\c setIJ method usage should be reduced to little modification sessions.
\section MEDCouplingArrayBuildFromScratch Building an array from scratch
-Here is a description of typical usages of \ref ParaMEDMEM::DataArrayDouble "MEDCoupling arrays".
+Here is a description of typical usages of \ref MEDCoupling::DataArrayDouble "MEDCoupling arrays".
\if ENABLE_EXAMPLES
\ref MEDCouplingArraySteps1 "Here is a C++ example."<br>
\section MEDCouplingArrayBasicsCopy Copy DataArrays
-As \ref ParaMEDMEM::DataArray "DataArrays" are the atomic entity of potentially big memory objects into \ref medcoupling "MEDCoupling"
-, \ref ParaMEDMEM::DataArray "DataArrays" introduces concepts of copy and comparison that will be used by aggregating classes.
+As \ref MEDCoupling::DataArray "DataArrays" are the atomic entity of potentially big memory objects into \ref medcoupling "MEDCoupling"
+, \ref MEDCoupling::DataArray "DataArrays" introduces concepts of copy and comparison that will be used by aggregating classes.
For more complex objects (that aggregate themselves big objects)
-like ParaMEDMEM::MEDCouplingFieldDouble the concept of copy (shallow or deep) is less straight forward because which aggregated subobjects are copied or not.
+like MEDCoupling::MEDCouplingFieldDouble the concept of copy (shallow or deep) is less straight forward because which aggregated subobjects are copied or not.
\subsection MEDCouplingArrayBasicsCopyDeep Deep copy of DataArray
-As for all potentially heavy memory consumer objects in \ref medcoupling "MEDCoupling", \ref ParaMEDMEM::DataArray "DataArrays" implement
- method \c deepCpy. This method deeply copies an instance. The life cycle of the returned object is *fully* independent from the instance on which the method
-\c deepCpy has been invoked.
+As for all potentially heavy memory consumer objects in \ref medcoupling "MEDCoupling", \ref MEDCoupling::DataArray "DataArrays" implement
+ method \c deepCopy. This method deeply copies an instance. The life cycle of the returned object is *fully* independent from the instance on which the method
+\c deepCopy has been invoked.
\if ENABLE_EXAMPLES
\ref cpp_mcdataarray_deepcopy "Here is a C++ example."<br>
\subsection MEDCouplingArrayBasicsCopyShallow Shallow copy of DataArray
-As \ref ParaMEDMEM::DataArray "DataArrays" are the atomic entity of potentially big memory objects into \ref medcoupling "MEDCoupling", the shallow copy
+As \ref MEDCoupling::DataArray "DataArrays" are the atomic entity of potentially big memory objects into \ref medcoupling "MEDCoupling", the shallow copy
simply returns the same object with the reference counter incremented.
\if ENABLE_EXAMPLES
There are two types of comparison :
- strict, that compares strictly all the non mutable attributes (state sensitive). Methods to perform this strict comparison are :
- - ParaMEDMEM::DataArrayInt::isEqual
- - ParaMEDMEM::DataArrayDouble::isEqual.
+ - MEDCoupling::DataArrayInt::isEqual
+ - MEDCoupling::DataArrayDouble::isEqual.
- less strict, that focus only on non string attributes. Methods to perform less strict comparison are :
- - ParaMEDMEM::DataArrayInt::isEqualWithoutConsideringStr
- - ParaMEDMEM::DataArrayDouble::isEqualWithoutConsideringStr
+ - MEDCoupling::DataArrayInt::isEqualWithoutConsideringStr
+ - MEDCoupling::DataArrayDouble::isEqualWithoutConsideringStr
\section MEDCouplingArrayFill Filling DataArray with values
Both DataArrayDouble and DataArrayInt provide comfort methods that
fill the array with some values. These methods are:
-- ParaMEDMEM::DataArrayInt::fillWithZero and
- ParaMEDMEM::DataArrayDouble::fillWithZero which assigns zero to all
+- MEDCoupling::DataArrayInt::fillWithZero and
+ MEDCoupling::DataArrayDouble::fillWithZero which assigns zero to all
values in array.
-- ParaMEDMEM::DataArrayInt::fillWithValue and
- ParaMEDMEM::DataArrayDouble::fillWithValue which assigns a certain value to all
+- MEDCoupling::DataArrayInt::fillWithValue and
+ MEDCoupling::DataArrayDouble::fillWithValue which assigns a certain value to all
values in array.
-- ParaMEDMEM::DataArrayInt::iota() and
- ParaMEDMEM::DataArrayDouble::iota() which assigns incrementing values to all
+- MEDCoupling::DataArrayInt::iota() and
+ MEDCoupling::DataArrayDouble::iota() which assigns incrementing values to all
values in array.
\section MEDCouplingArrayApplyFunc Application of a function on DataArrayDouble instances.
-This section is only dedicated for \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble instances".
+This section is only dedicated for \ref MEDCoupling::DataArrayDouble "DataArrayDouble instances".
-It is possible to apply to \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble instance" a function given by a string.
+It is possible to apply to \ref MEDCoupling::DataArrayDouble "DataArrayDouble instance" a function given by a string.
-There are different API for applyFunc* methods of \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble class".
+There are different API for applyFunc* methods of \ref MEDCoupling::DataArrayDouble "DataArrayDouble class".
\subsection MEDCouplingArrayApplyFuncExpr Expressions supported
\subsection MEDCouplingArrayApplyFunc0 applyFunc method with only one parameter
This method produces a newly allocated DataArrayDouble instance having exactly the same number of components **and** number of tuples than the instance on which the
-\ref ParaMEDMEM::DataArrayDouble::applyFunc(const std::string &, bool) const applyFunc method is applied.
+\ref MEDCoupling::DataArrayDouble::applyFunc(const std::string &, bool) const applyFunc method is applied.
**This method is useful when the evaluation expression do not need to consider the components of each tuple separately**.
-That's why this method of \ref ParaMEDMEM::DataArrayDouble::applyFunc(const std::string &, bool) const applyFunc method with one parameter accepts at most only one variable.
+That's why this method of \ref MEDCoupling::DataArrayDouble::applyFunc(const std::string &, bool) const applyFunc method with one parameter accepts at most only one variable.
If it is not the case an exception is thrown as seen here :
As the example shows, the output \c d1 has 2 components as \c d.
-Whereas all the components of the input of \c d be not considered separately, it is also, possible with \ref ParaMEDMEM::DataArrayDouble::applyFunc(const std::string &, bool) const applyFunc method with one parameter
+Whereas all the components of the input of \c d be not considered separately, it is also, possible with \ref MEDCoupling::DataArrayDouble::applyFunc(const std::string &, bool) const applyFunc method with one parameter
to build an output having same number of components than input but where components in input are treated separately.
Let's build an example using DataArrayDouble instance \c d defined just above.
\subsection MEDCouplingArrayApplyFunc1 applyFunc method with only two parameters
-This method also returns a newly allocated DataArrayDouble instance having the same number of tuples than the DataArrayDouble instance on which \ref ParaMEDMEM::DataArrayDouble::applyFunc(int,const std::string &, bool) const applyFunc method is called, but the contrary to previous \ref MEDCouplingArrayApplyFunc0 "applyFunc with one parameter version" here the number of components is set by the user.
+This method also returns a newly allocated DataArrayDouble instance having the same number of tuples than the DataArrayDouble instance on which \ref MEDCoupling::DataArrayDouble::applyFunc(int,const std::string &, bool) const applyFunc method is called, but the contrary to previous \ref MEDCouplingArrayApplyFunc0 "applyFunc with one parameter version" here the number of components is set by the user.
The big difference with \ref MEDCouplingArrayApplyFunc0 "applyFunc method with one parameter" seen above is that here components of tuples are treated separately.
-The method that implements it is \ref ParaMEDMEM::DataArrayDouble::applyFunc(int,const std::string &, bool) const here.
+The method that implements it is \ref MEDCoupling::DataArrayDouble::applyFunc(int,const std::string &, bool) const here.
-Here the number of variables appearing in the expression should be equal at most to the number of component of the DataArrayDouble instance on which \ref ParaMEDMEM::DataArrayDouble::applyFunc(int,const std::string &, bool) const applyFunc method is called.
+Here the number of variables appearing in the expression should be equal at most to the number of component of the DataArrayDouble instance on which \ref MEDCoupling::DataArrayDouble::applyFunc(int,const std::string &, bool) const applyFunc method is called.
Let's consider the following DataArrayDouble having 4 tuples with 3 components called dd.
of \c dd.
\n
The expression \c "a+c" will add component #0 to component #1 as seen in warning section !!!! It can appear silly, but this strategy has been chosen in order to support different set of variables.
-\n \ref ParaMEDMEM::DataArrayDouble::applyFunc2 "applyFunc2" and \ref ParaMEDMEM::DataArrayDouble::applyFunc3 "applyFunc3" methods have been developed to remedy to that feature that can be surprising.
-\n These two methods are explained respectively \ref MEDCouplingArrayApplyFunc2 "here for applyFunc2" and \ref MEDCouplingArrayApplyFunc3 "here for applyFunc3".
+\n \ref MEDCoupling::DataArrayDouble::applyFuncCompo "applyFuncCompo" and \ref MEDCoupling::DataArrayDouble::applyFuncNamedCompo "applyFuncNamedCompo" methods have been developed to remedy to that feature that can be surprising.
+\n These two methods are explained respectively \ref MEDCouplingArrayApplyFunc2 "here for applyFuncCompo" and \ref MEDCouplingArrayApplyFunc3 "here for applyFuncNamedCompo".
-Whatever it is possible to find a workaround using \ref ParaMEDMEM::DataArrayDouble::applyFunc(int,const std::string &, bool) const applyFunc with 2 parameters.
+Whatever it is possible to find a workaround using \ref MEDCoupling::DataArrayDouble::applyFunc(int,const std::string &, bool) const applyFunc with 2 parameters.
\n Here is a solution to compute \c dd2 :
\snippet MEDCouplingExamplesTest.py PySnippetDataArrayApplyFunc1_6
-\subsection MEDCouplingArrayApplyFunc2 applyFunc2 method
+\subsection MEDCouplingArrayApplyFunc2 applyFuncCompo method
-The method that implements it is \ref ParaMEDMEM::DataArrayDouble::applyFunc2 here.
+The method that implements it is \ref MEDCoupling::DataArrayDouble::applyFuncCompo here.
This method is very close to \ref MEDCouplingArrayApplyFunc1 "applyFunc method with only two parameters".
\snippet MEDCouplingExamplesTest.py PySnippetDataArrayApplyFunc1_8
-\subsection MEDCouplingArrayApplyFunc3 applyFunc3 method
+\subsection MEDCouplingArrayApplyFunc3 applyFuncNamedCompo method
-The method that implements it is \ref ParaMEDMEM::DataArrayDouble::applyFunc3 here.
+The method that implements it is \ref MEDCoupling::DataArrayDouble::applyFuncNamedCompo here.
-This method is very close to \ref MEDCouplingArrayApplyFunc1 "applyFunc method with only two parameters" and \ref MEDCouplingArrayApplyFunc2 "applyFunc2".
+This method is very close to \ref MEDCouplingArrayApplyFunc1 "applyFunc method with only two parameters" and \ref MEDCouplingArrayApplyFunc2 "applyFuncCompo".
-The only difference is the mapping between variables found in expression and tuple id. Rather than using rank in string sorting as in \ref MEDCouplingArrayApplyFunc1 "applyFunc method with only two parameters uses" or the component information as in \ref MEDCouplingArrayApplyFunc2 "applyFunc2", here an explicit vector is given in input.
+The only difference is the mapping between variables found in expression and tuple id. Rather than using rank in string sorting as in \ref MEDCouplingArrayApplyFunc1 "applyFunc method with only two parameters uses" or the component information as in \ref MEDCouplingArrayApplyFunc2 "applyFuncCompo", here an explicit vector is given in input.
Let's consider DataArrayDouble instance \c ddd constituted with 4 tuples containing each 3 components. To add first component (component #0) and the third component (component #2) simply do that :
\page numbering Array indexing and numbering
The MED library make constant use of arrays of integer or double to represent the various
-data it needs. The arrays of integer (\ref ParaMEDMEM::DataArrayInt "DataArrayInt") are of special importance as they
+data it needs. The arrays of integer (\ref MEDCoupling::DataArrayInt "DataArrayInt") are of special importance as they
often constitutes the return value of the functions provided by the API. This can be
a list of nodes, a list of cells, a way to rearrange the cell in a mesh (a permutation), a part of the
domain when doing parallel computation, etc ...
Formally a "renumbering" is a mathematical application that can be surjective, injective or bijective.
This application is defined using an instance of
-\ref ParaMEDMEM::DataArrayInt "DataArrayInt". There are different ways to define this application.
+\ref MEDCoupling::DataArrayInt "DataArrayInt". There are different ways to define this application.
\section MEDCouplingArrayRenumberingO2N Old-to-new mode
The old to new mode is particularly recommanded for surjective and bijective applications. This
-is typically the case of \ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "MEDCouplingUMesh::mergeNodes" method.
-Let's consider a call to \ref ParaMEDMEM::MEDCouplingUMesh::mergeNodes "mergeNodes" that reduces the
+is typically the case of \ref MEDCoupling::MEDCouplingUMesh::mergeNodes "MEDCouplingUMesh::mergeNodes" method.
+Let's consider a call to \ref MEDCoupling::MEDCouplingUMesh::mergeNodes "mergeNodes" that reduces the
number of nodes from 5 nodes to 3 nodes.\n
In old to new mode the array \b MySurjection that specifies this surjection will have 5 tuples
and 1 component. The content of the 5*1 values will be in {0,1,2}.\n
Method in old to new mode that works on bijective applications :
-- \ref ParaMEDMEM::DataArrayDouble::renumber "DataArrayDouble::renumber"
-- \ref ParaMEDMEM::DataArrayDouble::renumberInPlace "DataArrayDouble::renumberInPlace"
+- \ref MEDCoupling::DataArrayDouble::renumber "DataArrayDouble::renumber"
+- \ref MEDCoupling::DataArrayDouble::renumberInPlace "DataArrayDouble::renumberInPlace"
Method in old to new mode that works on surjective applications :
-- \ref ParaMEDMEM::DataArrayDouble::renumberAndReduce "DataArrayDouble::renumberAndReduce"
+- \ref MEDCoupling::DataArrayDouble::renumberAndReduce "DataArrayDouble::renumberAndReduce"
Sometimes the format old to new for surjections can be replaced by another format with 2 arrays.
-Less compact in memory. The \ref ParaMEDMEM::DataArrayInt::changeSurjectiveFormat "DataArrayInt::changeSurjectiveFormat" method performs that.
+Less compact in memory. The \ref MEDCoupling::DataArrayInt::changeSurjectiveFormat "DataArrayInt::changeSurjectiveFormat" method performs that.
\section MEDCouplingArrayRenumberingN2O New-to-old mode
The new-to-old mode is particularly recommended for strictly injective and bijective permutations.
This is particularly useful for methods that increase the number of entities like for example
-\ref ParaMEDMEM::MEDCouplingUMesh::simplexize "MEDCouplingUMesh::simplexize".\n
-All non static methods in \ref ParaMEDMEM::DataArrayDouble "DataArrayDouble"
-or \ref ParaMEDMEM::DataArrayInt "DataArrayInt" having as last letter \b R (meaning Reversed) in
+\ref MEDCoupling::MEDCouplingUMesh::simplexize "MEDCouplingUMesh::simplexize".\n
+All non static methods in \ref MEDCoupling::DataArrayDouble "DataArrayDouble"
+or \ref MEDCoupling::DataArrayInt "DataArrayInt" having as last letter \b R (meaning Reversed) in
capital works with the mode new to old.
-Let's consider a call to \ref ParaMEDMEM::MEDCouplingUMesh::simplexize "simplexize" that increases
+Let's consider a call to \ref MEDCoupling::MEDCouplingUMesh::simplexize "simplexize" that increases
the number of cell from 4 cells to 6 cells.\n
In new-to-old mode the array \b MyInjection that specifies this injection will have 6 tuples
and 1 component. The content of the 5*1 values will be in {0,1,2,3}.\n
Method in new-to-old mode that works on bijective applications :
-- \ref ParaMEDMEM::DataArrayDouble::renumberR "DataArrayDouble::renumberR"
-- \ref ParaMEDMEM::DataArrayDouble::renumberInPlace "DataArrayDouble::renumberInPlaceR"
+- \ref MEDCoupling::DataArrayDouble::renumberR "DataArrayDouble::renumberR"
+- \ref MEDCoupling::DataArrayDouble::renumberInPlace "DataArrayDouble::renumberInPlaceR"
Method in new-to-old mode that works on surjective applications :
-- \ref ParaMEDMEM::DataArrayDouble::selectByTupleId "DataArrayDouble::selectByTupleId"
-- \ref ParaMEDMEM::DataArrayDouble::selectByTupleIdSafe "DataArrayDouble::selectByTupleIdSafe"
-- \ref ParaMEDMEM::DataArrayDouble::selectByTupleId2 "DataArrayDouble::selectByTupleId2"
-- \ref ParaMEDMEM::DataArrayDouble::selectByTupleRanges "DataArrayDouble::selectByTupleRanges"
+- \ref MEDCoupling::DataArrayDouble::selectByTupleId "DataArrayDouble::selectByTupleId"
+- \ref MEDCoupling::DataArrayDouble::selectByTupleIdSafe "DataArrayDouble::selectByTupleIdSafe"
+- \ref MEDCoupling::DataArrayDouble::selectByTupleIdSafeSlice "DataArrayDouble::selectByTupleIdSafeSlice"
+- \ref MEDCoupling::DataArrayDouble::selectByTupleRanges "DataArrayDouble::selectByTupleRanges"
\section numbering-indirect Indirect indexing
This format is widely used internally (this is how the connectivity of
\ref MEDCouplingUMeshPage "unstructured cells" is stored for example), and is also returned by
many functions, e.g.:
-- \ref ParaMEDMEM::MEDCouplingPointSet::findCommonCells "MEDCouplingPointSet::findCommonCells"
-- \ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes "MEDCouplingPointSet::findCommonNodes"
-- \ref ParaMEDMEM::MEDCouplingPointSet::getNodeIdsNearPoints "MEDCouplingPointSet::getNodeIdsNearPoints"
-- \ref ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity "MEDCouplingUMesh::buildDescendingConnectivity"
-- \ref ParaMEDMEM::MEDCouplingUMesh::computeNeighborsOfNodes "MEDCouplingUMesh::computeNeighborsOfNodes"
-- \ref ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh "MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh"
-- \ref ParaMEDMEM::MEDCouplingUMesh::setConnectivity "MEDCouplingUMesh::setConnectivity"
-- \ref ParaMEDMEM::MEDCouplingUMesh::split2DCells "MEDCouplingUMesh::split2DCells"
+- \ref MEDCoupling::MEDCouplingPointSet::findCommonCells "MEDCouplingPointSet::findCommonCells"
+- \ref MEDCoupling::MEDCouplingPointSet::findCommonNodes "MEDCouplingPointSet::findCommonNodes"
+- \ref MEDCoupling::MEDCouplingPointSet::getNodeIdsNearPoints "MEDCouplingPointSet::getNodeIdsNearPoints"
+- \ref MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity "MEDCouplingUMesh::buildDescendingConnectivity"
+- \ref MEDCoupling::MEDCouplingUMesh::computeNeighborsOfNodes "MEDCouplingUMesh::computeNeighborsOfNodes"
+- \ref MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh "MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh"
+- \ref MEDCoupling::MEDCouplingUMesh::setConnectivity "MEDCouplingUMesh::setConnectivity"
+- \ref MEDCoupling::MEDCouplingUMesh::split2DCells "MEDCouplingUMesh::split2DCells"
Some functions in the API to manipulate this format:
-- \ref ParaMEDMEM::DataArrayInt::changeSurjectiveFormat "DataArrayInt::changeSurjectiveFormat"
-- \ref ParaMEDMEM::MEDCouplingUMesh::ExtractFromIndexedArrays "(static) MEDCouplingUMesh::ExtractFromIndexedArrays"
-- \ref ParaMEDMEM::MEDCouplingUMesh::ExtractFromIndexedArrays2 "(static) MEDCouplingUMesh::ExtractFromIndexedArrays2"
+- \ref MEDCoupling::DataArrayInt::changeSurjectiveFormat "DataArrayInt::changeSurjectiveFormat"
+- \ref MEDCoupling::MEDCouplingUMesh::ExtractFromIndexedArrays "(static) MEDCouplingUMesh::ExtractFromIndexedArrays"
+- \ref MEDCoupling::MEDCouplingUMesh::ExtractFromIndexedArraysSlice "(static) MEDCouplingUMesh::ExtractFromIndexedArraysSlice"
-*/
\ No newline at end of file
+*/
\page MEDCouplingTimeLabelPage Time label in MEDCoupling
Time label is a **non instantiable** class whose each object consuming potentially big amount of memory inherits from.
-The class that incarnates this concept is ParaMEDMEM::TimeLabel.
+The class that incarnates this concept is MEDCoupling::TimeLabel.
-Here are some of examples of classes that inherit from \ref ParaMEDMEM::TimeLabel "TimeLabel" class :
+Here are some of examples of classes that inherit from \ref MEDCoupling::TimeLabel "TimeLabel" class :
-- ParaMEDMEM::DataArrayInt, ParaMEDMEM::DataArrayDouble
-- ParaMEDMEM::MEDCouplingMesh
-- ParaMEDMEM::MEDCouplingFieldDouble
+- MEDCoupling::DataArrayInt, MEDCoupling::DataArrayDouble
+- MEDCoupling::MEDCouplingMesh
+- MEDCoupling::MEDCouplingFieldDouble
- ...
This class is in charge of storing a 32 bits unsigned integer called the time label, that allows the user to know easily, if an heavy object in memory has been modified or not.
The usage is simple :
-- Call ParaMEDMEM::TimeLabel::getTimeOfThis a first time to retrieve a reference. Store the returned unsigned integer.
-- When you need to know if the instance inheriting from ParaMEDMEM::TimeLabel has changed or not simply invoke ParaMEDMEM::TimeLabel::getTimeOfThis again and compare with the stored value.
+- Call MEDCoupling::TimeLabel::getTimeOfThis a first time to retrieve a reference. Store the returned unsigned integer.
+- When you need to know if the instance inheriting from MEDCoupling::TimeLabel has changed or not simply invoke MEDCoupling::TimeLabel::getTimeOfThis again and compare with the stored value.
If the value is different, the instance has changed, if not the instance has **not** changed.
-The virtual call to ParaMEDMEM::TimeLabel::updateTime changes the behaviour of ParaMEDMEM::TimeLabel::getTimeOfThis ; it is a bug, so please notify the bug on the SALOME forum.
+The virtual call to MEDCoupling::TimeLabel::updateTime changes the behaviour of MEDCoupling::TimeLabel::getTimeOfThis ; it is a bug, so please notify the bug on the SALOME forum.
*/
Using the C++ API provided by MED requires you to be familiar with some specificities which are not
visible to the Python user.
-- \ref ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr "MEDCouplingAutoRefCountObjectPtr"
+- \ref MEDCoupling::MCAuto "MCAuto"
- \subpage MEDCouplingTimeLabelPage
-\b Note: all the standard (sequential) MEDCoupling API lies in the \ref ParaMEDMEM "ParaMEDMEM namespace".
+\b Note: all the standard (sequential) MEDCoupling API lies in the \ref MEDCoupling "MEDCoupling namespace".
This is quite unfortunate but due to historical reasons. The true parallel functionalities
of the \ref library "MED library" are detailed here: \ref parallel
The memory management of the various strucutres is eased by the class
-\ref ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr "MEDCouplingAutoRefCountObjectPtr". It acts as an auto pointer and takes care of deleting the
+\ref MEDCoupling::MCAuto "MCAuto". It acts as an auto pointer and takes care of deleting the
memory automatically when going out of scope. See an example usage in \ref cpp_mcfielddouble_WriteVTK .
Beware however that not all functions return a pointer that should be deleted when going out of scope.
-Some methods only return an observer to the data, see for example \ref ParaMEDMEM::MEDCouplingPointSet::getCoords() "getCoords()". The API documentation of each method indicates whether the caller is responsible of the returned
+Some methods only return an observer to the data, see for example \ref MEDCoupling::MEDCouplingPointSet::getCoords() "getCoords()". The API documentation of each method indicates whether the caller is responsible of the returned
data or not.
For advanced usage, one has to be aware of the stamping mechanism used internally to know
They are directly related to the equivalent class in MEDCoupling, without the string \c Servant at the end of the
name:
-- \ref ParaMEDMEM::DataArrayDoubleServant "DataArrayDoubleServant"
-- \ref ParaMEDMEM::DataArrayIntServant "DataArrayIntServant"
-- \ref ParaMEDMEM::MEDCouplingUMeshServant "MEDCouplingUMeshServant"
-- \ref ParaMEDMEM::MEDCouplingCMeshServant "MEDCouplingCMeshServant"
-- \ref ParaMEDMEM::MEDCouplingFieldDoubleServant "MEDCouplingFieldDoubleServant"
+- \ref MEDCoupling::DataArrayDoubleServant "DataArrayDoubleServant"
+- \ref MEDCoupling::DataArrayIntServant "DataArrayIntServant"
+- \ref MEDCoupling::MEDCouplingUMeshServant "MEDCouplingUMeshServant"
+- \ref MEDCoupling::MEDCouplingCMeshServant "MEDCouplingCMeshServant"
+- \ref MEDCoupling::MEDCouplingFieldDoubleServant "MEDCouplingFieldDoubleServant"
TODO: complete the list.
- \ref ParaMESH-det "ParaMESH", the parallel instanciation of a \ref meshes "MEDCoupling mesh"
- \ref ParaFIELD-det "ParaFIELD", the parallel instanciation of a \ref fields "MEDCoupling field"
- \ref MPIProcessorGroup-det "MPIProcessorGroup" (which inherits from the abstract
-\ref ParaMEDMEM::ProcessorGroup "ProcessorGroup"), a group of processors (typically MPI nodes)
+\ref MEDCoupling::ProcessorGroup "ProcessorGroup"), a group of processors (typically MPI nodes)
In an advanced usage, the topology of the nodes in the computation is accessed through the following elements:
- \ref BlockTopology-det "BlockTopology", specification of a topology based on the (structured) mesh.
it works in a similar fashion than what the \ref remapper "sequential remapper" does.
- \b NonCoincidentDEC (deprecated for now)
-Besides, all the DECs inherit from the class \ref ParaMEDMEM::DECOptions "DECOptions" which provides
+Besides, all the DECs inherit from the class \ref MEDCoupling::DECOptions "DECOptions" which provides
the necessary methods to adjust the parameters used in the transfer/remapping.
The most commonly used %DEC is the \c %InterpKernelDEC, and here is a simple example to of its usage:
This definition of field in MEDCoupling allows an instance of field to
know at any point inside its spatial-temporal support the value.
-The class that incarnates the concept described above is : \ref ParaMEDMEM::MEDCouplingFieldDouble.
+The class that incarnates the concept described above is : \ref MEDCoupling::MEDCouplingFieldDouble.
Some of most important implemented methods are :
-- \ref ParaMEDMEM::MEDCouplingFieldDouble::getNumberOfComponents "getNumberOfComponents"
-- \ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn"
-- \ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc "applyFunc"
-- \ref ParaMEDMEM::MEDCouplingFieldDouble::AddFields "cross instances operations"
+- \ref MEDCoupling::MEDCouplingFieldDouble::getNumberOfComponents "getNumberOfComponents"
+- \ref MEDCoupling::MEDCouplingFieldDouble::getValueOn "getValueOn"
+- \ref MEDCoupling::MEDCouplingFieldDouble::applyFunc "applyFunc"
+- \ref MEDCoupling::MEDCouplingFieldDouble::AddFields "cross instances operations"
\section MEDCouplingSpatialDisc Spatial discretization concept
This is the concept that makes the link, independently from temporal
concept allows the field to make a check and interpretation of an
array of values given a spatial support (\ref meshes "mesh").
-The abstract class that incarnates the concept is : \ref ParaMEDMEM::MEDCouplingFieldDiscretization.
+The abstract class that incarnates the concept is : \ref MEDCoupling::MEDCouplingFieldDiscretization.
The most important pure virtual methods are :
-- \ref ParaMEDMEM::MEDCouplingFieldDiscretization::getNumberOfTuples "getnumberOfTuples"
-- \ref ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOn "getValueOn"
-- \ref ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField "getMeasureField"
+- \ref MEDCoupling::MEDCouplingFieldDiscretization::getNumberOfTuples "getnumberOfTuples"
+- \ref MEDCoupling::MEDCouplingFieldDiscretization::getValueOn "getValueOn"
+- \ref MEDCoupling::MEDCouplingFieldDiscretization::getMeasureField "getMeasureField"
\section MEDCouplingTemporalDisc Temporal discretization concept
defined. This concept is able to give the value at any time of
the definition interval (if any).
-The abstract class \ref ParaMEDMEM::MEDCouplingTimeDiscretization
+The abstract class \ref MEDCoupling::MEDCouplingTimeDiscretization
incarnates this described concept.
This classes and its subclasses are responsible in storing the arrays
The most important methods are :
-- \ref ParaMEDMEM::MEDCouplingTimeDiscretization::setTime "setTime" and \ref ParaMEDMEM::MEDCouplingTimeDiscretization::getTime "getTime"
-- \ref ParaMEDMEM::MEDCouplingTimeDiscretization::getArray "getArray" and \ref ParaMEDMEM::MEDCouplingTimeDiscretization::setArray "setArray"
-- \ref ParaMEDMEM::MEDCouplingTimeDiscretization::getArraysForTime "getArraysForTime"
-- \ref ParaMEDMEM::MEDCouplingTimeDiscretization::getValueForTime "getValueForTime"
+- \ref MEDCoupling::MEDCouplingTimeDiscretization::setTime "setTime" and \ref MEDCoupling::MEDCouplingTimeDiscretization::getTime "getTime"
+- \ref MEDCoupling::MEDCouplingTimeDiscretization::getArray "getArray" and \ref MEDCoupling::MEDCouplingTimeDiscretization::setArray "setArray"
+- \ref MEDCoupling::MEDCouplingTimeDiscretization::getArraysForTime "getArraysForTime"
+- \ref MEDCoupling::MEDCouplingTimeDiscretization::getValueForTime "getValueForTime"
\section MEDCouplingFirstSteps3 Building a field from scratch
\section MEDCouplingSecondStep0 Operations on Fields
-Here we will make the assumption that an instance of \ref ParaMEDMEM::MEDCouplingMesh "MEDCouplingMesh"
+Here we will make the assumption that an instance of \ref MEDCoupling::MEDCouplingMesh "MEDCouplingMesh"
called \c mesh has been created with spaceDim==2.
\ref medcouplingcppexamplesFieldDoubleBuild5 "Here a C++ example of more advanced use of MEDCouplingFieldDouble instances".
\section field-space Spatial discretization
A field can be supported by:
- the nodes (vertices) of the mesh: this is built with the
-\ref ParaMEDMEM::TypeOfField "ON_NODES" keyword in the
-\ref ParaMEDMEM::MEDCouplingFieldDouble::New(TypeOfField , TypeOfTimeDiscretization) "constructor of a field".
+\ref MEDCoupling::TypeOfField "ON_NODES" keyword in the
+\ref MEDCoupling::MEDCouplingFieldDouble::New(TypeOfField , TypeOfTimeDiscretization) "constructor of a field".
- the cells (or "elements") of the mesh: built with the
-\ref ParaMEDMEM::TypeOfField "ON_CELLS" keyword in the
-\ref ParaMEDMEM::MEDCouplingFieldDouble::New(TypeOfField , TypeOfTimeDiscretization) "constructor of a field".
+\ref MEDCoupling::TypeOfField "ON_CELLS" keyword in the
+\ref MEDCoupling::MEDCouplingFieldDouble::New(TypeOfField , TypeOfTimeDiscretization) "constructor of a field".
- or more complex items:
- - Gauss points: built with \ref ParaMEDMEM::TypeOfField "ON_GAUSS_PT"
- - Gauss points on nodes per element: built with \ref ParaMEDMEM::TypeOfField "ON_GAUSS_NE"
- - Kriging points: built with \ref ParaMEDMEM::TypeOfField "ON_NODES_KR"
+ - Gauss points: built with \ref MEDCoupling::TypeOfField "ON_GAUSS_PT"
+ - Gauss points on nodes per element: built with \ref MEDCoupling::TypeOfField "ON_GAUSS_NE"
+ - Kriging points: built with \ref MEDCoupling::TypeOfField "ON_NODES_KR"
The spatial discretization is at the center of the \ref interpolation "interpolation" mechanisms,
since one of the main interpolation paramter is indeed specifying from which source discretization
- a P1->P0 interpolation means that a field on nodes this time will be transfered to a cell-based field.
- etc ...
-Finally, in the code itself, the class \ref ParaMEDMEM::MEDCouplingFieldDiscretization "MEDCouplingFieldDiscretization"
+Finally, in the code itself, the class \ref MEDCoupling::MEDCouplingFieldDiscretization "MEDCouplingFieldDiscretization"
is the concrete representation of this concept.
\section field-time Temporal discretization
Similarly to the spatial discretization, a field object in MEDCoupling has a time discretization
representing the time range that is covered by the data. It is also specified in the
-\ref ParaMEDMEM::MEDCouplingFieldDouble::New(TypeOfField , TypeOfTimeDiscretization) "constructor of a field".
+\ref MEDCoupling::MEDCouplingFieldDouble::New(TypeOfField , TypeOfTimeDiscretization) "constructor of a field".
It can be one of:
-- \ref ParaMEDMEM::TypeOfTimeDiscretization "NO_TIME", in this case no time is attached to the field, and no
+- \ref MEDCoupling::TypeOfTimeDiscretization "NO_TIME", in this case no time is attached to the field, and no
time-related operation is permitted (for example unable to call
-\ref ParaMEDMEM::MEDCouplingFieldDouble::getValueOn "getValueOn()")
-- \ref ParaMEDMEM::TypeOfTimeDiscretization "ONE_TIME", the field data represent a single time step.
-- \ref ParaMEDMEM::TypeOfTimeDiscretization "LINEAR_TIME", the field data contains \b two arrays, stamped with two
+\ref MEDCoupling::MEDCouplingFieldDouble::getValueOn "getValueOn()")
+- \ref MEDCoupling::TypeOfTimeDiscretization "ONE_TIME", the field data represent a single time step.
+- \ref MEDCoupling::TypeOfTimeDiscretization "LINEAR_TIME", the field data contains \b two arrays, stamped with two
different time points. A linear interpolation of the field values between those two time steps is then possible.
-- \ref ParaMEDMEM::TypeOfTimeDiscretization "CONST_ON_TIME_INTERVAL", the field data contains a single array
+- \ref MEDCoupling::TypeOfTimeDiscretization "CONST_ON_TIME_INTERVAL", the field data contains a single array
of data, but a start- and end-time can be specified, thus declaring that the field represent a constant
set of data during this time interval. All time evaluation function then just check that the given time
fits in the interval.
-Finally, in the code itself, the class \ref ParaMEDMEM::MEDCouplingTimeDiscretization "MEDCouplingTimeDiscretization"
+Finally, in the code itself, the class \ref MEDCoupling::MEDCouplingTimeDiscretization "MEDCouplingTimeDiscretization"
is the concrete representation of this concept.
*/
- \ref NatureOfField
-*/
\ No newline at end of file
+*/
- "NoNature", the default value, does not allow the use of any interpolation tools
For intensive fields:
-- \ref TableNatureOfFieldExampleConservVol "ConservativeVolumic", for intensive field with the maximum principle favored over conservativity. Relevant for temperature, pressure fields.
+- \ref TableNatureOfFieldExampleConservVol "IntensiveMaximum", for intensive field with the maximum principle favored over conservativity. Relevant for temperature, pressure fields.
-- \ref TableNatureOfFieldExampleRevIntegral "RevIntegral", for intensive field with the conservativity favored over maximum principle. Relevant for power density fields.
+- \ref TableNatureOfFieldExampleRevIntegral "IntensiveConservation", for intensive field with the conservativity favored over maximum principle. Relevant for power density fields.
For extensive fields:
-- \ref TableNatureOfFieldExampleIntegral "Integral", for extensive field with the maximum principle favored over conservativity. Relevant for power fields.
+- \ref TableNatureOfFieldExampleIntegral "ExtensiveMaximum", for extensive field with the maximum principle favored over conservativity. Relevant for power fields.
-- \ref TableNatureOfFieldExampleIntegralGlobConstraint "IntegralGlobConstraint", for extensive fields with conservativity favored over the maximum principle. Relevant for power fields.
+- \ref TableNatureOfFieldExampleIntegralGlobConstraint "ExtensiveConservation", for extensive fields with conservativity favored over the maximum principle. Relevant for power fields.
\n
const char targetFileName[]="target.med";
MEDCouplingUMesh *med_target_mesh=MEDLoader::ReadUMeshFromFile(targetFileName,"Target_Mesh",0);
//
-sourceField->setNature(ConservativeVolumic);
+sourceField->setNature(IntensiveMaximum);
...
\endcode
* <TABLE BORDER=1 >
* <TR><TD> </TD><TD>Intensive</TD><TD> extensive </TD></TR>
- * <TR><TD> Conservation</TD><TD> \f[\frac{Vol(T_i\cap S_j)}{ Vol(T_i)}\f] <br /> \ref TableNatureOfFieldExampleRevIntegral "RevIntegral" </TD><TD> \f[ \frac{Vol(T_i\cap S_j)}{ \sum_{T_i} Vol(S_j\cap T_i) }\f] <br /> \ref TableNatureOfFieldExampleIntegralGlobConstraint "IntegralGlobConstraint" </TD></TR>
- * <TR><TD> Maximum principle </TD><TD> \f[\frac{Vol(T_i\cap S_j)}{ \sum_{S_j} Vol(T_i\cap S_j)}\f] <br /> \ref TableNatureOfFieldExampleConservVol "ConservativeVolumic" </TD><TD> \f[\frac{Vol(T_i\cap S_j)}{ Vol(S_j) }\f] <br /> \ref TableNatureOfFieldExampleIntegral "Integral"</TD></TR>
+ * <TR><TD> Conservation</TD><TD> \f[\frac{Vol(T_i\cap S_j)}{ Vol(T_i)}\f] <br /> \ref TableNatureOfFieldExampleRevIntegral "IntensiveConservation" </TD><TD> \f[ \frac{Vol(T_i\cap S_j)}{ \sum_{T_i} Vol(S_j\cap T_i) }\f] <br /> \ref TableNatureOfFieldExampleIntegralGlobConstraint "ExtensiveConservation" </TD></TR>
+ * <TR><TD> Maximum principle </TD><TD> \f[\frac{Vol(T_i\cap S_j)}{ \sum_{S_j} Vol(T_i\cap S_j)}\f] <br /> \ref TableNatureOfFieldExampleConservVol "IntensiveMaximum" </TD><TD> \f[\frac{Vol(T_i\cap S_j)}{ Vol(S_j) }\f] <br /> \ref TableNatureOfFieldExampleIntegral "ExtensiveMaximum"</TD></TR>
*</TABLE>
\section TableNatureOfFieldExample Illustration of a non overlapping P0P0 interpolation
As we can see here the maximum principle is respected.This nature of field is particularly recommended to interpolate an intensive
field such as \b temperature or \b pressure.
-\subsection TableNatureOfFieldExampleIntegral Integral case
+\subsection TableNatureOfFieldExampleIntegral ExtensiveMaximum case
-If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{Integral} \f$ matrix :
+If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{ExtensiveMaximum} \f$ matrix :
\f[
- M_{Integral}=\left[\begin{tabular}{cc}
+ M_{ExtensiveMaximum}=\left[\begin{tabular}{cc}
$\displaystyle{\frac{0.125}{9}}$ & $\displaystyle{\frac{0.75}{3}}$ \\
\end{tabular}\right]=\left[\begin{tabular}{cc}
0.013888 & 0.25 \\
So from the 104 W of the source field \f$ FS \f$, only 25.055 W are transmitted in the target field using this nature of field.
In order to treat differently a power field, another policy, \ref TableNatureOfFieldExampleIntegralGlobConstraint "integral global constraint nature" is available.
-\subsection TableNatureOfFieldExampleIntegralGlobConstraint Integral with global constraints case
+\subsection TableNatureOfFieldExampleIntegralGlobConstraint ExtensiveMaximum with global constraints case
-If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{IntegralGlobConstraint} \f$ matrix :
+If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{ExtensiveConservation} \f$ matrix :
\f[
- M_{IntegralGlobConstraint}=\left[\begin{tabular}{cc}
+ M_{ExtensiveConservation}=\left[\begin{tabular}{cc}
$\displaystyle{\frac{0.125}{0.125}}$ & ${\displaystyle\frac{0.75}{0.75}}$ \\
\end{tabular}\right]=\left[\begin{tabular}{cc}
1 & 1 \\
\subsection TableNatureOfFieldExampleRevIntegral Reverse integral case
-If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{RevIntegral} \f$ matrix :
+If we apply the formula \ref TableNatureOfField "above" it leads to the following \f$ M_{IntensiveConservation} \f$ matrix :
\f[
- M_{RevIntegral}=\left[\begin{tabular}{cc}
+ M_{IntensiveConservation}=\left[\begin{tabular}{cc}
$\displaystyle{\frac{0.125}{1.5}}$ & $\displaystyle{\frac{0.75}{1.5}}$ \\
\end{tabular}\right]=\left[\begin{tabular}{cc}
0.083333 & 0.5 \\
\page intersec-specifics Specificities of 2D and 3D intersectors
All the options described here can be set using the
-\ref ParaMEDMEM::MEDCouplingRemapper::setOptionInt "MEDCouplingRemapper::setOptionInt",
-\ref ParaMEDMEM::MEDCouplingRemapper::setOptionDouble "MEDCouplingRemapper::setOptionDouble",
-and \ref ParaMEDMEM::MEDCouplingRemapper::setOptionString "MEDCouplingRemapper::setOptionString"
+\ref MEDCoupling::MEDCouplingRemapper::setOptionInt "MEDCouplingRemapper::setOptionInt",
+\ref MEDCoupling::MEDCouplingRemapper::setOptionDouble "MEDCouplingRemapper::setOptionDouble",
+and \ref MEDCoupling::MEDCouplingRemapper::setOptionString "MEDCouplingRemapper::setOptionString"
methods.
\section interpolation2D Special features of 2D intersectors
\endverbatim
-*/
\ No newline at end of file
+*/
- the \ref remapper "remapper class" (based on the underlying \ref interpkernel "InterpKernel" library)
for sequential codes, which uses MEDCoupling \ref fields "fields" and other core data structures.
- the \ref parallel "ParaMEDMEM API" for parallel MPI based codes using \c %ParaMEDMEM distributed fields
-(\ref ParaMEDMEM::ParaFIELD "ParaFIELD"), which is also based on the algorithms of the
+(\ref MEDCoupling::ParaFIELD "ParaFIELD"), which is also based on the algorithms of the
\ref interpkernel "InterpKernel" library.
The following space/mesh dimensions are covered:
\section InterpKerHighLevUsage High-level usage
-The simplest way of using the \ref intro-interp "interpolations" in sequential mode is to use the class \c ParaMEDMEM::MEDCouplingRemapper . This class fulfills \c HXX2SALOME rules and may be used in YACS coupling graphs.
+The simplest way of using the \ref intro-interp "interpolations" in sequential mode is to use the class \c MEDCoupling::MEDCouplingRemapper . This class fulfills \c HXX2SALOME rules and may be used in YACS coupling graphs.
-If you intend to use \ref medcoupling "MEDCoupling data structures", the ParaMEDMEM::MEDCouplingRemapper class should be used.
+If you intend to use \ref medcoupling "MEDCoupling data structures", the MEDCoupling::MEDCouplingRemapper class should be used.
\if ENABLE_EXAMPLES
Here is a \ref cpp_mcfield_remapper_highlevel "C++ example".
-*/
\ No newline at end of file
+*/
--- /dev/null
+/* \page MEDLoader Static functions offering the "basic" API to read and write MED files
+
+ A set of static methods is available at the MEDCoupling namespace level and offers the
+ high level API to access MED files. Take a look at \ref medloader for more details.
+
+ */
Each time this parameter appears in API, it will have the semantic
explained here.
The value of the parameter \c meshDimRelToMax is at most in {0,-1,-2,-3}. This relative value specifies a level
-relative to the value returned by ParaMEDMEM::MEDFileMesh::getMeshDimension().
+relative to the value returned by MEDCoupling::MEDFileMesh::getMeshDimension().
A mesh containing MED_TETRA4, MED_TRI3, MED_QUAD4 and MED_POINT1 has a meshDimension
equal to 3. For \c meshDimRelToMax equal to 0 the user will
deal with cells which dimension equals 3-1 that is to say MED_TRI3
and MED_QUAD4.
-An important method is ParaMEDMEM::MEDFileUMesh::getNonEmptyLevels(). It returns all
+An important method is MEDCoupling::MEDFileUMesh::getNonEmptyLevels(). It returns all
non empty levels available. In the previous example, this method will
return {0,-1,-3}. -2 does not appear because no cells with dimension
equal to 1 (3-2) appear in MED file mesh (no MED_SEG2, no MED_SEG3).
nodes.
The parameter of \c meshDimRelToMaxExt appears in
-\ref ParaMEDMEM::MEDFileUMesh "umesh advanced API" of %MEDLoader with the following semantics.
+\ref MEDCoupling::MEDFileUMesh "umesh advanced API" of %MEDLoader with the following semantics.
Some of MED file concepts are available both for cells and
nodes (for example families, groups, numbering) ; that's why for a simpler API this
\subsection AdvMEDLoaderAPIMeshReading Reading a mesh.
-The class that incarnates Read/Write mesh in MED file is ParaMEDMEM::MEDFileUMesh.
+The class that incarnates Read/Write mesh in MED file is MEDCoupling::MEDFileUMesh.
First of all, like basic %MEDLoader API, only MEDfile files whose version >= 2.2 are able
to be read with advanced API.
- Retrieving a family at a specified level :
- Either an array of node/cell id
- \c getFamilyArr method or \c getFamiliesArr
- - Or on \ref ParaMEDMEM::MEDCouplingUMesh "MEDCouplingUMesh" form by calling
+ - Or on \ref MEDCoupling::MEDCouplingUMesh "MEDCouplingUMesh" form by calling
- \c getFamily method or \c getFamilies
- Retrieving a group at a specified level :
- Either an array of node/cell id
- \c getGroupArr method or \c getGroupsArr
- - Or on \ref ParaMEDMEM::MEDCouplingUMesh "MEDCouplingUMesh" form by calling
+ - Or on \ref MEDCoupling::MEDCouplingUMesh "MEDCouplingUMesh" form by calling
- \c getGroup method or \c getGroups
- Retrieving family field array :
\anchor AdvMEDLoaderAPIMeshReadingSampl
\if ENABLE_EXAMPLES
-Here is a \ref cpp_mcumesh_loadfile "C++ example" illustrating a typical use of \ref ParaMEDMEM::MEDCouplingUMesh "MEDCouplingUMesh" instance.
+Here is a \ref cpp_mcumesh_loadfile "C++ example" illustrating a typical use of \ref MEDCoupling::MEDCouplingUMesh "MEDCouplingUMesh" instance.
\endif
\subsection AdvMEDLoaderAPIMeshWriting Writing a mesh.
The use is very symmetric to reading part. It is possible to either
-build a \ref ParaMEDMEM::MEDFileUMesh "MEDFileUMesh" instance from
+build a \ref MEDCoupling::MEDFileUMesh "MEDFileUMesh" instance from
scratch, or to work with an existing instance coming from a loading
from a file.
One important point is that coordinates of a mesh are shared by all
cells whatever their level. That's why the
-\ref ParaMEDMEM::DataArrayDouble "DataArrayDouble" instance
-should be shared by all \ref ParaMEDMEM::MEDCouplingUMesh "MEDCouplingUMesh" used in input parameter of
-set* methods. If the user intends to build a \ref ParaMEDMEM::MEDFileUMesh "MEDFileUMesh" instance from
+\ref MEDCoupling::DataArrayDouble "DataArrayDouble" instance
+should be shared by all \ref MEDCoupling::MEDCouplingUMesh "MEDCouplingUMesh" used in input parameter of
+set* methods. If the user intends to build a \ref MEDCoupling::MEDFileUMesh "MEDFileUMesh" instance from
scratch, a call to \c setCoords should be done first.
Here the list of classes in %MEDLoader advanced API top down sorted :
-- Level 0 : ParaMEDMEM::MEDFileFields
-- Level -1 : ParaMEDMEM::MEDFileFieldMultiTSWithoutSDA
-- Level -2 : ParaMEDMEM::MEDFileField1TSWithoutSDA
-- Level -3 : ParaMEDMEM::MEDFileFieldPerMesh (present only for backward compatibility MED file 2.2)
-- Level -4 : ParaMEDMEM::MEDFileFieldPerMeshPerType
-- Level -5 : ParaMEDMEM::MEDFileFieldPerMeshPerTypePerDisc
+- Level 0 : MEDCoupling::MEDFileFields
+- Level -1 : MEDCoupling::MEDFileFieldMultiTSWithoutSDA
+- Level -2 : MEDCoupling::MEDFileField1TSWithoutSDA
+- Level -3 : MEDCoupling::MEDFileFieldPerMesh (present only for backward compatibility MED file 2.2)
+- Level -4 : MEDCoupling::MEDFileFieldPerMeshPerType
+- Level -5 : MEDCoupling::MEDFileFieldPerMeshPerTypePerDisc
Each level in the tree representing a field (cyan box) is represented by a class. The only difference is that values are grouped in a single big array located
-in level -2 (ParaMEDMEM::MEDFileField1TSWithoutSDA) in which each leaf (level -5) of MED file field
+in level -2 (MEDCoupling::MEDFileField1TSWithoutSDA) in which each leaf (level -5) of MED file field
points to range [\a start, \a end).
As different time steps of a same field and different fields inside a MED file can share or not profiles (yellow box) and localization (red box) a manipulable field classes instance
-(ParaMEDMEM::MEDFileField1TS and ParaMEDMEM::MEDFileFieldMultiTS) in advanced API is the result of a subclass of a data class
-(respectively ParaMEDMEM::MEDFileField1TSWithoutSDA, ParaMEDMEM::MEDFileFieldMultiTSWithoutSDA) and an instance of ParaMEDMEM::MEDFileFieldGlobsReal representing the shared data arrays (SDA)
+(MEDCoupling::MEDFileField1TS and MEDCoupling::MEDFileFieldMultiTS) in advanced API is the result of a subclass of a data class
+(respectively MEDCoupling::MEDFileField1TSWithoutSDA, MEDCoupling::MEDFileFieldMultiTSWithoutSDA) and an instance of MEDCoupling::MEDFileFieldGlobsReal representing the shared data arrays (SDA)
at a specified scope inside the MED file.
\subsection AdvMEDLoaderAPIFieldR Reading a field
\image html med-loader-adv-classes.png "Class diagram of the advanced MEDLoader API"
The blue rectangles show the links to the MEDCoupling objects. Note that in MEDCoupling there is no
-representation of a field of integer. Those are extracted directly as \ref ParaMEDMEM::DataArrayInt "DataArrayInt".
+representation of a field of integer. Those are extracted directly as \ref MEDCoupling::DataArrayInt "DataArrayInt".
-The classes shown on this diagram (all part of the \ref cpp "unfortunately named ParaMEDMEM namespace"):
-- \ref ParaMEDMEM::MEDFileData "MEDFileData", the encapsulation of a complete MED file
+The classes shown on this diagram (all part of the \ref cpp "named MEDCoupling namespace"):
+- \ref MEDCoupling::MEDFileData "MEDFileData", the encapsulation of a complete MED file
and also:
-- \ref ParaMEDMEM::MEDFileMeshes "MEDFileMeshes", the set of meshes in the file
-- \ref ParaMEDMEM::MEDFileMeshMultiTS "MEDFileMeshMultiTS", a single mesh with muliple time steps
-- \ref ParaMEDMEM::MEDFileMesh "MEDFileMesh", a single mesh on a single timestep
-- \ref ParaMEDMEM::MEDFileUMesh "MEDFileUMesh", a single unstructured mesh
+- \ref MEDCoupling::MEDFileMeshes "MEDFileMeshes", the set of meshes in the file
+- \ref MEDCoupling::MEDFileMeshMultiTS "MEDFileMeshMultiTS", a single mesh with muliple time steps
+- \ref MEDCoupling::MEDFileMesh "MEDFileMesh", a single mesh on a single timestep
+- \ref MEDCoupling::MEDFileUMesh "MEDFileUMesh", a single unstructured mesh
and also:
-- \ref ParaMEDMEM::MEDFileFields "MEDFileFields", the set of fields in a MED file
-- \ref ParaMEDMEM::MEDFileAnyTypeFieldMultiTS "MEDFileAnyTypeFieldMultiTS", a single field with multiple
+- \ref MEDCoupling::MEDFileFields "MEDFileFields", the set of fields in a MED file
+- \ref MEDCoupling::MEDFileAnyTypeFieldMultiTS "MEDFileAnyTypeFieldMultiTS", a single field with multiple
time steps (can be an integer field or a double field)
-- \ref ParaMEDMEM::MEDFileFieldMultiTS "MEDFileFieldMultiTS", a single field of doubles with multiple time steps
-- \ref ParaMEDMEM::MEDFileIntFieldMultiTS "MEDFileIntFieldMultiTS", a single field of int with multiple time steps
-- \ref ParaMEDMEM::MEDFileFieldMultiTS "MEDFileAnyTypeField1TS", a single field with a single time step
+- \ref MEDCoupling::MEDFileFieldMultiTS "MEDFileFieldMultiTS", a single field of doubles with multiple time steps
+- \ref MEDCoupling::MEDFileIntFieldMultiTS "MEDFileIntFieldMultiTS", a single field of int with multiple time steps
+- \ref MEDCoupling::MEDFileFieldMultiTS "MEDFileAnyTypeField1TS", a single field with a single time step
(integer or double)
-- \ref ParaMEDMEM::MEDFileField1TS "MEDFileField1TS", a single field of doubles with a single time step
-- \ref ParaMEDMEM::MEDFileIntField1TS "MEDFileIntField1TS", a single field of ints with a single time step
+- \ref MEDCoupling::MEDFileField1TS "MEDFileField1TS", a single field of doubles with a single time step
+- \ref MEDCoupling::MEDFileIntField1TS "MEDFileIntField1TS", a single field of ints with a single time step
and finally:
-- \ref ParaMEDMEM::MEDFileParameters "MEDFileParameters", numerical parameters stored in a MED file
+- \ref MEDCoupling::MEDFileParameters "MEDFileParameters", numerical parameters stored in a MED file
The aim of this page is to present MEDLoader basic API. The goal of
this basic API is to perform a read or a write in one shot without any
-internal state. That's why the basic API of MEDLoader offers \b only \b static methods whose names have the first
-character in capital. You are intended to use these methods. The following
+internal state. That's why the basic API of MEDLoader offers \b only \b static functions whose names have the first
+character in capital. You are intended to use these functions. The following
chapters will try to describe in details some of important ones.
The basic idea of MEDLoader is to exploit as much as possible MED
file capabilities to store MEDCoupling data file in a MED file and
reversely to load from a MED file into a MEDCoupling data structure.
-Basically, the info on components of ParaMEDMEM::DataArrayDouble instances are stored into components and units into MED files. The
+Basically, the info on components of MEDCoupling::DataArrayDouble instances are stored into components and units into MED files. The
name of meshes and fields are used by MEDLoader as is into
-MED file. From a field f with \ref ParaMEDMEM::MEDCouplingTimeDiscretization
+MED file. From a field f with \ref MEDCoupling::MEDCouplingTimeDiscretization
"time discretization" set to ONE_TIME, calls to
\c f->getTime(time,iteration,order) are used by MEDLoader to store the field into MED file. All strings used by MEDLoader should fulfill the rules of MED file where string length
is limited.
\section BasicMEDLoaderBasicAPIGlobalInfo Retrieving tiny global information from MED files using basic API
-The MEDLoader::CheckFileForRead method will perform such a check before any attempt of read.
-A field is also discriminated by its name. The methods MEDLoader::GetCellFieldNamesOnMesh and MEDLoader::GetNodeFieldNamesOnMesh are available to know all fields
+The MEDCoupling::CheckFileForRead function will perform such a check before any attempt of read.
+A field is also discriminated by its name. The functions MEDCoupling::GetCellFieldNamesOnMesh and MEDCoupling::GetNodeFieldNamesOnMesh are available to know all fields
respectively on cells and on nodes lying on a specified mesh.
A field is defined by several time steps discriminated by a pair of ints
(iteration,order). It is \b not possible to store 2 time steps of a same
field having the same iteration and order
numbers. The floating point value attached to this couple of ids (iteration,order) is only present for information.
-Static methods MEDLoader::GetCellFieldIterations and
-MEDLoader::GetNodeFieldIterations return a vector of pairs (iteration, order).
+Static functions MEDCoupling::GetCellFieldIterations and
+MEDCoupling::GetNodeFieldIterations return a vector of pairs (iteration, order).
A field time step lies on one \b or \b more mesh(es) specified by its \b or \b their name(s). A field time step in
MED file could be defined on point \b and on cell \b and, \b or on Gauss points \b and, \b or on point per element.
\anchor MEDLoaderMeshNameConstraint MED file can contain several meshes. These meshes are
discriminated by their names (two meshes could not have the same
name). In the same way a MED file can contain several fields.
-So MEDLoader offers the MEDLoader::GetMeshNames method to
+So MEDLoader offers the MEDCoupling::GetMeshNames function to
discover all the mesh names contained in your file.
\section BasicMEDLoaderBasicAPIMesh Reading and writing meshes in MED files using basic API
MED_TETRA4, MED_TRIA6, MED_SEG2, MED_POINT1, MED_POLYGON,
MED_POLYHEDRA in a same mesh. In MEDCouplingUMesh such a mix is not
allowed as described \ref MEDCouplingMeshes "here". So to \b read such mesh it
-is important to know which mesh dimension you are interested in. The parameter \b meshDimRelToMax of method MEDLoader::ReadUMeshFromFile corresponds to the mesh dimension you are
+is important to know which mesh dimension you are interested in. The parameter \b meshDimRelToMax of function MEDCoupling::ReadUMeshFromFile corresponds to the mesh dimension you are
interested in, expressed relatively to the maximal dimension of cells contained
in the mesh in file.
\snippet MEDLoaderExamplesTest.py PySnippetMeshAdvAPI1_10
-The method MEDLoader::ReadUMeshDimFromFile could
+The function MEDCoupling::ReadUMeshDimFromFile could
help you to have this mesh dimension.
Here is a \ref MEDLoaderExample2 "Python example".<br>
is called the familyId. A family is discriminated by its id. MED file
attaches a name to its id to be more user friendly. So by construction, 2 different
families could not share anything. The user can retrieve all the
-families names available on a mesh with the static method MEDLoader::GetMeshFamiliesNames.
+families names available on a mesh with the static function MEDCoupling::GetMeshFamiliesNames.
A group is a set of families. So groups can overlap each other,
contrary to families. Groups are also discriminated by a name. As for
-families the static method to retrieve the groups of a specified mesh is MEDLoader::GetMeshGroupsNames.
+families the static function to retrieve the groups of a specified mesh is MEDCoupling::GetMeshGroupsNames.
MEDLoader allows you to retrieve the
-corresponding "part of meshes" thanks to static methods
-MEDLoader::ReadUMeshFromFamilies and MEDLoader::ReadUMeshFromGroups.
-These methods allow you to combine several families and groups in the
+corresponding "part of meshes" thanks to static functions
+MEDCoupling::ReadUMeshFromFamilies and MEDCoupling::ReadUMeshFromGroups.
+These functions allow you to combine several families and groups in the
same returned mesh.
\subsection BasicMEDLoaderAPIField Reading a field at one time step in MED files
to append data to an existing file, or if you want to create a new
file from scratch. This explains the presence of boolean parameter \b
writeFromScratch in API of MEDLoader starting with \b
-MEDLoader::Write* .
+MEDCoupling::Write* .
If \b writeFromScratch parameter is set to \b true and if the file
already exists the file will be crashed and replaced by the new
file does \b not \b exist the new file is created, but if the file
exists MEDLoader will enter in appended mode.
-Two classes of MEDLoader write methods exist when \b writeFromScratch
+Two classes of MEDLoader write functions exist when \b writeFromScratch
is set to \b false :
-- Methods \b MEDLoader::Write*Dep : The write operation is performed without any question in file. The
+- Functions \b MEDCoupling::Write*Dep : The write operation is performed without any question in file. The
responsibility is let to the user because the MED file could be
- corrupted. The advantage of this method is that it is faster
+ corrupted. The advantage of this function is that it is faster
because no check is done.
-- Methods \b MEDLoader::Write* : MEDLoader will not corrupt your file
+- Functions \b MEDCoupling::Write* : MEDLoader will not corrupt your file
by always trying to append data. The consequence is that a
read of part (and data processing) of MED file could be needed before any attempt of
- writing. So these methods could be in some cases much time and memory consuming.
+ writing. So these functions could be in some cases much time and memory consuming.
The behaviour of MEDLoader when \b writeFromScratch is set to false will be precised
-for each \b MEDLoader::Write* methods is the next subsections.
+for each \b MEDCoupling::Write* functions is the next subsections.
\subsection MEDLoaderWriteMesh Writing one mesh in a MED file with MEDLoader
The first think to know is that MEDLoader is using the \b meshName in
-ParaMEDMEM::MEDCouplingMesh instance to put it in MED file.
+MEDCoupling::MEDCouplingMesh instance to put it in MED file.
As explained in previous section \ref MEDLoaderMeshNameConstraint "here",
a mesh in MED file is discriminated by a name, so the \b meshName
It could be interesting to write several meshes in one shot. Two
possibilities:
-- Write several instances of ParaMEDMEM::MEDCouplingUMesh
- lying \b on \b same \b coords \b with \b different \b mesh \b dimensions. In this case MEDLoader::WriteUMeshes is the method you should
- use. Typically this method should be used to write files such as
+- Write several instances of MEDCoupling::MEDCouplingUMesh
+ lying \b on \b same \b coords \b with \b different \b mesh \b dimensions. In this case MEDCoupling::WriteUMeshes is the function you should
+ use. Typically this function should be used to write files such as
defined \ref MEDLoaderExample2 "here".
- This method first checks that all instances share the same
- ParaMEDMEM::DataArrayDouble instance as coords. If not an
+ This function first checks that all instances share the same
+ MEDCoupling::DataArrayDouble instance as coords. If not an
INTERP_KERNEL::Exception will be thrown and an invocation on
- ParaMEDMEM::MEDCouplingPointSet::tryToShareSameCoords will be necessary.
+ MEDCoupling::MEDCouplingPointSet::tryToShareSameCoords will be necessary.
- Write a partition of meshes having \b same \b mesh \b dimension, that is to say a set of
groups and families from given meshes. As in the previous case the
check of same coords will be done (if not an INTERP_KERNEL::Exception is
- thrown). After this step this method will
+ thrown). After this step this function will
merge input (preserving order) and will simplify the
merged mesh. After this operation, the groups will be constituted by
assigning the group names with the corresponding names of
- instance. That's why all meshes must have a not empty name which is different from one mesh to the other. The method to use in this case is
- MEDLoader::WriteUMeshesPartition.
+ instance. That's why all meshes must have a not empty name which is different from one mesh to the other. The function to use in this case is
+ MEDCoupling::WriteUMeshesPartition.
-For these 2 described methods the semantic of \b writeFromScratch when
+For these 2 described functions the semantic of \b writeFromScratch when
\b false is the same, that is to say : no writing
(INTERP_KERNEL::Exception thrown) will be done if the
file already exists and contains a mesh with name 'meshName'
-for MEDLoader::WriteUMeshesPartition method and the name of first element
+for MEDCoupling::WriteUMeshesPartition function and the name of first element
of unstructured mesh vector passed as first parameter of
-MEDLoader::WriteUMeshes.
+MEDCoupling::WriteUMeshes.
\subsection MEDLoaderWriteField Writing one time step of a field in a MED file with MEDLoader
To write \b one \b time \b step of a field from scratch with MEDLoader
-use MEDLoader::WriteField method. The behaviour of this method depends
+use MEDCoupling::WriteField function. The behaviour of this function depends
on the value of the \b writeFromScratch parameter :
-- When \b writeFromScratch equals to \b true, this method performs two things, it
+- When \b writeFromScratch equals to \b true, this function performs two things, it
writes the underlying mesh and writes the specified time step on it.
-- When \b writeFromScatch equals to \b false, this method checks that
+- When \b writeFromScatch equals to \b false, this function checks that
the underlying mesh exists (by looking to the contents of \c field->getMesh()->getName()) in file. If not, the behaviour is the
same that previous case with \b writeFromScratch parameter set to
\b true. If the mesh already exists, MEDLoader reads the field and
\ref medloader "MEDLoader" is a package in charge of loading from a file or write to a file
in MED format a \ref medcoupling "MEDCoupling data structure". The fact that these
-functionalities are not merged in the \ref library "MEDCoupling library" is explained by a
+functionalities are not merged in the \ref library "MEDCoupling library" (separated .so files) is explained by a
willingness of reducing as much as possible the dependencies of this library.
As a MED file can combine several \ref medcoupling "MEDCoupling" aspects in one (for example meshes in
This approach is less close to MED file concepts, but closer to \ref medcoupling "MEDCoupling concepts".
-So, basic API is simpler, as shown by method MEDLoader::WriteUMesh that needs no special knowledge about MED file concepts to interact with MED files.
+So, basic API is simpler, as shown by method MEDCoupling::WriteUMesh that needs no special knowledge about MED file concepts to interact with MED files.
-This API is in the form of a list of public static methods in a class ParaMEDMEM::MEDLoader.
+This API is in the form of a list of public static functions directly in the namespace MEDCoupling.
This simplicity has a cost, the I/O are not (cannot be) optimized.
More information on the MED file format itself can be found at:
- \ref med-file
-*/
\ No newline at end of file
+*/
The n arrays will have only one component and the values contained in these arrays will be ascendently sorted.
-The class that incarnates the described concept is : ParaMEDMEM::MEDCouplingCMesh.
+The class that incarnates the described concept is : MEDCoupling::MEDCouplingCMesh.
\section MEDCouplingCMeshStdBuild Standard building of a cartesian mesh from scratch
This class is also useful for users that want to map the 3D unstructured mesh cell ids level by level along an axis.
-The class that incarnates this concept in MEDCoupling is : \ref ParaMEDMEM::MEDCouplingExtrudedMesh.
+The class that incarnates this concept in MEDCoupling is : \ref MEDCoupling::MEDCouplingMappedExtrudedMesh.
*/
This is a \b non \b instantiable class that implements many algorithm working only on a set of points without any connectivity aspect.
The presence of this class is only for factorization reasons.
-The class that incarnates this concept in \ref medcoupling "MEDCoupling" is : \ref ParaMEDMEM::MEDCouplingPointSet.
-Instantiable class ParaMEDMEM::MEDCouplingUMesh inherits from ParaMEDMEM::MEDCouplingPointSet.
+The class that incarnates this concept in \ref medcoupling "MEDCoupling" is : \ref MEDCoupling::MEDCouplingPointSet.
+Instantiable class MEDCoupling::MEDCouplingUMesh inherits from MEDCoupling::MEDCouplingPointSet.
-Some of most important implemented methods by \ref ParaMEDMEM::MEDCouplingPointSet "MEDCouplingPointSet" class are :
+Some of most important implemented methods by \ref MEDCoupling::MEDCouplingPointSet "MEDCouplingPointSet" class are :
-- \ref ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension "getSpaceDimension"
-- \ref ParaMEDMEM::MEDCouplingPointSet::getNumberOfNodes "getNumberOfNodes"
-- \ref ParaMEDMEM::MEDCouplingPointSet::rotate "rotate"
-- \ref ParaMEDMEM::MEDCouplingPointSet::translate "translate"
-- \ref ParaMEDMEM::MEDCouplingPointSet::scale "scale"
-- \ref ParaMEDMEM::MEDCouplingPointSet::findCommonNodes "findCommonNodes"
-- \ref ParaMEDMEM::MEDCouplingPointSet::renumberNodes "renumberNodes"
-- \ref ParaMEDMEM::MEDCouplingPointSet::getBoundingBox "getBoundingBox"
+- \ref MEDCoupling::MEDCouplingPointSet::getSpaceDimension "getSpaceDimension"
+- \ref MEDCoupling::MEDCouplingPointSet::getNumberOfNodes "getNumberOfNodes"
+- \ref MEDCoupling::MEDCouplingPointSet::rotate "rotate"
+- \ref MEDCoupling::MEDCouplingPointSet::translate "translate"
+- \ref MEDCoupling::MEDCouplingPointSet::scale "scale"
+- \ref MEDCoupling::MEDCouplingPointSet::findCommonNodes "findCommonNodes"
+- \ref MEDCoupling::MEDCouplingPointSet::renumberNodes "renumberNodes"
+- \ref MEDCoupling::MEDCouplingPointSet::getBoundingBox "getBoundingBox"
*/
The norm used for cells connectivity of different types, is the same as specified in MED file except
that connectivities are represented in \b C \b format and \b not \b in \b FORTRAN \b format !
-The class that incarnates the described concept is : ParaMEDMEM::MEDCouplingUMesh.
-\n This class inherits from ParaMEDMEM::MEDCouplingPointSet abstract class.
+The class that incarnates the described concept is : MEDCoupling::MEDCouplingUMesh.
+\n This class inherits from MEDCoupling::MEDCouplingPointSet abstract class.
\n So \ref MEDCouplingUMeshPage "MEDCouplingUMesh" inherits from all \ref MEDCouplingPointSetPage "point set features".
\section MEDCouplingUMeshStdBuild Standard building of an unstructured mesh from scratch
\section MEDCouplingUMeshNodalConnectivity How MEDCouplingUMesh stores its nodal connectivity
-\ref ParaMEDMEM::MEDCouplingUMesh "MEDCouplingUMesh class" stores its nodal connectivity into 2 arrays.
+\ref MEDCoupling::MEDCouplingUMesh "MEDCouplingUMesh class" stores its nodal connectivity into 2 arrays.
-- The first one, the biggest is ParaMEDMEM::MEDCouplingUMesh::_nodal_connectivity.
-- The second one, the less big is ParaMEDMEM::MEDCouplingUMesh::_nodal_connectivity_index.
+- The first one, the biggest is MEDCoupling::MEDCouplingUMesh::_nodal_connectivity.
+- The second one, the less big is MEDCoupling::MEDCouplingUMesh::_nodal_connectivity_index.
\image html MEDCouplingUMeshConn.png "Nodal connectivity storage into MEDCouplingUMesh class"
\image latex MEDCouplingUMeshConn.eps "Nodal connectivity storage into MEDCouplingUMesh class"
\section MEDCouplingUMeshAdvBuild Advanced building of an unstructured mesh from scratch
-Here we are going to build the mesh in a more advanced manner. This method expects that the user knows the storage format underlying ParaMEDMEM::MEDCouplingUMesh.
+Here we are going to build the mesh in a more advanced manner. This method expects that the user knows the storage format underlying MEDCoupling::MEDCouplingUMesh.
The same mesh than \ref MEDCouplingUMeshStdBuild "in the standard section above" is going to be implemented using advanced method.
to 2, can have \b cells of type NORM_TRI3 (triangles) and NORM_POLYGON (arbitrary 2D polygons) for example.
It can still have a space dimension of 3, meaning that we describe a planar surface embedded in a 3D space.
-The (abstract) class that covers the concept described above is \ref ParaMEDMEM::MEDCouplingMesh.
+The (abstract) class that covers the concept described above is \ref MEDCoupling::MEDCouplingMesh.
<h1>Available (non abstract) mesh types in MEDCoupling</h1>
- \subpage MEDCouplingFieldTemplatesPage
-*/
\ No newline at end of file
+*/
\subsection directOperations_creation Field creation
- From scratch: \b New
-- Copy: \b clone*, \b deepCpy
+- Copy: \b clone*, \b deepCopy
\subsection directOperations_modification Partial modifications
- Creation: \b New, \b setMesh, \b setArray* \n
- \ref medcoupling "MEDCoupling" that describes data structures used for cross process exchange of \ref meshes "meshes" and \ref fields "fields".
- \ref medloader "MEDLoader" and ParaMEDLoader that provides I/O functions to the MED file format with sequential and parallel processing, respectively. Those are built on top of the MED-file library.
- \ref intro-interp "interpolation tools" that provides mathematical structures and algorithms for interpolation and
- localization. It is implemented in three blocks: \ref INTERP_KERNEL "InterpKernel", \ref ParaMEDMEM::MEDCouplingRemapper "Remapper" and \ref parallel "ParaMEDMEM" (Remapper with parallel processing).
+ localization. It is implemented in three blocks: \ref INTERP_KERNEL "InterpKernel", \ref MEDCoupling::MEDCouplingRemapper "Remapper" and \ref parallel "ParaMEDMEM" (Remapper with parallel processing).
*/
The following intuitive rules have been used to map the C++ objects to the Python ones:
- std::vector become standard Python lists, see for example \ref py_mcdataarrayint_setpartofvalues where the function
-ParaMEDMEM::DataArray::setInfoOnComponents() is used.
+MEDCoupling::DataArray::setInfoOnComponents() is used.
- the return values of C++ functions (usually passed as last arguments in the C++ prototype) are
-returned directly as a tuple, see for example the Python usage of ParaMEDMEM::MEDCouplingUMesh::getReverseNodalConnectivity() in \ref cpp_mcumesh_getReverseNodalConnectivity. The
+returned directly as a tuple, see for example the Python usage of MEDCoupling::MEDCouplingUMesh::getReverseNodalConnectivity() in \ref cpp_mcumesh_getReverseNodalConnectivity. The
initial prototype where the return values are passed as argument can however still be used, provided you instantiate
the returned objects first.
- the indexing mechanism is greatly simplified in Python, and offers similar functionalities to what NumPy
\endcode
-*/
\ No newline at end of file
+*/
The %MEDCoupling/%MEDLoader Python tutorial is accessible here:
- <a class="el" href="tutorial/index.html">MEDCoupling tutorial</a>
-*/
\ No newline at end of file
+*/
# MEDCoupling classes to include
#
SET(_classes_MEDCoupling
- ParaMEDMEM_1_1MEDCouplingPointSet
- ParaMEDMEM_1_1MEDCouplingUMesh
- ParaMEDMEM_1_1MEDCouplingCMesh
- ParaMEDMEM_1_1MEDCouplingRemapper
- ParaMEDMEM_1_1DataArray
- ParaMEDMEM_1_1DataArrayInt
- ParaMEDMEM_1_1DataArrayDouble
+ MEDCoupling_1_1MEDCouplingPointSet
+ MEDCoupling_1_1MEDCouplingUMesh
+ MEDCoupling_1_1MEDCouplingCMesh
+ MEDCoupling_1_1MEDCouplingRemapper
+ MEDCoupling_1_1DataArray
+ MEDCoupling_1_1DataArrayInt
+ MEDCoupling_1_1DataArrayDouble
)
#
# MEDLoader classes to include
#
SET(_classes_MEDLoader
- MEDLoader
- ParaMEDMEM_1_1MEDFileMeshes
- ParaMEDMEM_1_1MEDFileMesh
- ParaMEDMEM_1_1MEDFileUMesh
- ParaMEDMEM_1_1MEDFileCMesh
+ MEDCoupling_1_1MEDFileMeshes
+ MEDCoupling_1_1MEDFileMesh
+ MEDCoupling_1_1MEDFileUMesh
+ MEDCoupling_1_1MEDFileCMesh
)
##
// generation of documentation for inline methods.
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Checks if \a this field is correctly defined, else an exception is thrown.
void MEDCouplingField::checkCoherency() const throw(INTERP_KERNEL::Exception) {}
/*!
* Returns the underlying mesh of \a this field.
- * \return const ParaMEDMEM::MEDCouplingMesh * - a const pointer to the underlying mesh.
+ * \return const MEDCoupling::MEDCouplingMesh * - a const pointer to the underlying mesh.
*/
- const ParaMEDMEM::MEDCouplingMesh *MEDCouplingField::getMesh() const {}
+ const MEDCoupling::MEDCouplingMesh *MEDCouplingField::getMesh() const {}
/*!
* Returns the description of \a this field.
* \return const char * - a string containing the field description.
// * groupping methods into "Basic API", "Advanced" and "Others..." sections
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Returns a new MEDCouplingFieldDouble containing sum values of corresponding values of
double MEDCouplingFieldDouble::getIJ(int tupleId, int compoId) const {}
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*! \name Basic API */
///@{
// * groupping methods into "Basic API", "Advanced" and "Others..." sections
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Returns the attribute \a _name of \a this array.
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
//================================================================================
/////////////////////// DataArray GROUPPING //////////////////////////////////////
DataArrayDouble::selectByTupleIdSafe(const int* new2OldBg, const int* new2OldEnd) const;
DataArrayDouble::selectByTupleId2(int bg, int end2, int step) const;
DataArrayDouble::selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
-DataArrayDouble::substr(int tupleIdBg, int tupleIdEnd=-1) const;
+DataArrayDouble::subArray(int tupleIdBg, int tupleIdEnd=-1) const;
DataArrayDouble::rearrange(int newNbOfCompo);
DataArrayDouble::transpose();
DataArrayDouble::changeNbOfComponents(int newNbOfComp, double dftValue) const;
DataArrayInt::buildPermArrPerLevel() const;
DataArrayInt::isIdentity2(int sizeExpected) const;
DataArrayInt::isUniform(int val) const;
-DataArrayInt::substr(int tupleIdBg, int tupleIdEnd=-1) const;
+DataArrayInt::subArray(int tupleIdBg, int tupleIdEnd=-1) const;
DataArrayInt::rearrange(int newNbOfCompo);
DataArrayInt::transpose();
DataArrayInt::changeNbOfComponents(int newNbOfComp, int dftValue) const;
DataArrayInt::locateTuple(const std::vector<int>& tupl) const;
DataArrayInt::locateValue(int value) const;
DataArrayInt::locateValue(const std::vector<int>& vals) const;
-DataArrayInt::search(const std::vector<int>& vals) const;
+DataArrayInt::findIdSequence(const std::vector<int>& vals) const;
DataArrayInt::presenceOfTuple(const std::vector<int>& tupl) const;
DataArrayInt::accumulate(int* res) const;
DataArrayInt::accumulate(int compId) const;
// * groupping methods into "Basic API", "Advanced" and "Others..." sections
-namespace ParaMEDMEM
+namespace MEDCoupling
{
//================================================================================
/*!
void MEDCouplingMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception) {}
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
//================================================================================
/////////////////////// GROUPPING members of MEDCouplingMesh /////////////////////
// This file contains some code used only for
// * generation of documentation for inline methods of MEDCouplingPointSet
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
// * generation of documentation for inline methods of MEDCouplingUMesh class,
// * groupping methods into "Basic API", "Advanced" and "Others..." sections
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Returns the nodal connectivity array. For more info on how data in stored in
DataArrayInt * MEDCouplingUMesh::getNodalConnectivityIndex() {}
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
//================================================================================
/////////////////////// MEDCouplingUMesh GROUPPING ///////////////////////////////
// generation of documentation for inline methods.
-namespace ParaMEDMEM // inline methods of MEDFileField1TSWithoutSDA
+namespace MEDCoupling // inline methods of MEDFileField1TSWithoutSDA
{
/*!
* Returns the number of iteration where \a this field has been calculated.
// const std::string& MEDFileField1TSWithoutSDA::getDtUnit() const {}
}
-namespace ParaMEDMEM // inline methods of MEDFileFieldGlobsReal
+namespace MEDCoupling // inline methods of MEDFileFieldGlobsReal
{
/*!
* Returns non empty names of all used profiles. To get all profiles call getPfls().
// * groupping methods into "Basic API", "Advanced" and "Others..." sections
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Sets the name of \a this mesh.
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*! \name Basic API */
///@{
*/
/*!
- * \namespace ParaMEDMEM
+ * \namespace MEDCoupling
* \brief Namespace gathering the core MEDCoupling functionalities, the advanced MEDLoader classes and the parallel classes.
*/
_value=valuesInExpr[pos];
}
-LeafExprVal *LeafExprVal::deepCpy() const
+LeafExprVal *LeafExprVal::deepCopy() const
{
return new LeafExprVal(*this);
}
return true;
}
-LeafExprVar *LeafExprVar::deepCpy() const
+LeafExprVar *LeafExprVar::deepCopy() const
{
return new LeafExprVar(*this);
}
for(std::vector<ExprParserOfEval>::iterator it=_sub_parts.begin();it!=_sub_parts.end();it++)
(*it).sortMemory();
if(_leaf)
- _leaf=_leaf->deepCpy();
+ _leaf=_leaf->deepCopy();
for(std::vector<Function *>::iterator it=_funcs.begin();it!=_funcs.end();it++)
if(*it)
- *it=(*it)->deepCpy();
+ *it=(*it)->deepCopy();
}
ExprParser::ExprParser(const std::string& expr, ExprParser *father):_father(father),_is_parsed(false),_leaf(0),_is_parsing_ok(false),_expr(expr)
INTERPKERNEL_EXPORT virtual void compileX86(std::vector<std::string>& ass) const = 0;
INTERPKERNEL_EXPORT virtual void compileX86_64(std::vector<std::string>& ass) const = 0;
INTERPKERNEL_EXPORT virtual void replaceValues(const std::vector<double>& valuesInExpr) = 0;
- INTERPKERNEL_EXPORT virtual LeafExpr *deepCpy() const = 0;
+ INTERPKERNEL_EXPORT virtual LeafExpr *deepCopy() const = 0;
INTERPKERNEL_EXPORT static LeafExpr *buildInstanceFrom(const std::string& expr);
};
INTERPKERNEL_EXPORT void compileX86_64(std::vector<std::string>& ass) const;
INTERPKERNEL_EXPORT void fillValue(Value *val) const;
INTERPKERNEL_EXPORT void replaceValues(const std::vector<double>& valuesInExpr);
- INTERPKERNEL_EXPORT LeafExprVal *deepCpy() const;
+ INTERPKERNEL_EXPORT LeafExprVal *deepCopy() const;
private:
double _value;
};
INTERPKERNEL_EXPORT void prepareExprEvaluationVec() const;
INTERPKERNEL_EXPORT void replaceValues(const std::vector<double>& valuesInExpr);
INTERPKERNEL_EXPORT static bool isRecognizedKeyVar(const std::string& var, int& pos);
- INTERPKERNEL_EXPORT LeafExprVar *deepCpy() const;
+ INTERPKERNEL_EXPORT LeafExprVar *deepCopy() const;
public:
static const char END_OF_RECOGNIZED_VAR[];
private:
virtual void operateStackOfDoubleSafe(std::vector<double>& stck) const { operateStackOfDouble(stck); }
virtual const char *getRepr() const = 0;
virtual bool isACall() const = 0;
- virtual Function *deepCpy() const = 0;
+ virtual Function *deepCopy() const = 0;
};
class INTERPKERNEL_EXPORT UnaryFunction : public Function
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- IdentityFunction *deepCpy() const { return new IdentityFunction; }
+ IdentityFunction *deepCopy() const { return new IdentityFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- PositiveFunction *deepCpy() const { return new PositiveFunction; }
+ PositiveFunction *deepCopy() const { return new PositiveFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- NegateFunction *deepCpy() const { return new NegateFunction; }
+ NegateFunction *deepCopy() const { return new NegateFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- CosFunction *deepCpy() const { return new CosFunction; }
+ CosFunction *deepCopy() const { return new CosFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- SinFunction *deepCpy() const { return new SinFunction; }
+ SinFunction *deepCopy() const { return new SinFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- TanFunction *deepCpy() const { return new TanFunction; }
+ TanFunction *deepCopy() const { return new TanFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- ACosFunction *deepCpy() const { return new ACosFunction; }
+ ACosFunction *deepCopy() const { return new ACosFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- ASinFunction *deepCpy() const { return new ASinFunction; }
+ ASinFunction *deepCopy() const { return new ASinFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- ATanFunction *deepCpy() const { return new ATanFunction; }
+ ATanFunction *deepCopy() const { return new ATanFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- CoshFunction *deepCpy() const { return new CoshFunction; }
+ CoshFunction *deepCopy() const { return new CoshFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- SinhFunction *deepCpy() const { return new SinhFunction; }
+ SinhFunction *deepCopy() const { return new SinhFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- TanhFunction *deepCpy() const { return new TanhFunction; }
+ TanhFunction *deepCopy() const { return new TanhFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- SqrtFunction *deepCpy() const { return new SqrtFunction; }
+ SqrtFunction *deepCopy() const { return new SqrtFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- AbsFunction *deepCpy() const { return new AbsFunction; }
+ AbsFunction *deepCopy() const { return new AbsFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- ExpFunction *deepCpy() const { return new ExpFunction; }
+ ExpFunction *deepCopy() const { return new ExpFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- LnFunction *deepCpy() const { return new LnFunction; }
+ LnFunction *deepCopy() const { return new LnFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- LogFunction *deepCpy() const { return new LogFunction; }
+ LogFunction *deepCopy() const { return new LogFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- Log10Function *deepCpy() const { return new Log10Function; }
+ Log10Function *deepCopy() const { return new Log10Function; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- PlusFunction *deepCpy() const { return new PlusFunction; }
+ PlusFunction *deepCopy() const { return new PlusFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- MinusFunction *deepCpy() const { return new MinusFunction; }
+ MinusFunction *deepCopy() const { return new MinusFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- MultFunction *deepCpy() const { return new MultFunction; }
+ MultFunction *deepCopy() const { return new MultFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- DivFunction *deepCpy() const { return new DivFunction; }
+ DivFunction *deepCopy() const { return new DivFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- PowFunction *deepCpy() const { return new PowFunction; }
+ PowFunction *deepCopy() const { return new PowFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- MaxFunction *deepCpy() const { return new MaxFunction; }
+ MaxFunction *deepCopy() const { return new MaxFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- MinFunction *deepCpy() const { return new MinFunction; }
+ MinFunction *deepCopy() const { return new MinFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- GreaterThanFunction *deepCpy() const { return new GreaterThanFunction; }
+ GreaterThanFunction *deepCopy() const { return new GreaterThanFunction; }
public:
static const char REPR[];
};
void operateStackOfDouble(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- LowerThanFunction *deepCpy() const { return new LowerThanFunction; }
+ LowerThanFunction *deepCopy() const { return new LowerThanFunction; }
public:
static const char REPR[];
};
void operateStackOfDoubleSafe(std::vector<double>& stck) const;
const char *getRepr() const;
bool isACall() const;
- IfFunction *deepCpy() const { return new IfFunction; }
+ IfFunction *deepCopy() const { return new IfFunction; }
public:
static const char REPR[];
};
//#define VOL_PREC 1.0e-6
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace INTERP_KERNEL;
double Interpolation3DTest::sumRow(const IntersectionMatrix& m, int i) const
}
-void Interpolation3DTest::getVolumes(ParaMEDMEM::MEDCouplingUMesh& mesh, double *tab) const
+void Interpolation3DTest::getVolumes(MEDCoupling::MEDCouplingUMesh& mesh, double *tab) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=mesh->getMeasureField(true);
+ MCAuto<MEDCouplingFieldDouble> vol=mesh->getMeasureField(true);
std::copy(vol->getArray()->begin(),vol->getArray()->end(),tab);
}
#include <iostream>
#include <vector>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
namespace INTERP_TEST
{
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingCMesh.hxx"
#include "MEDMeshMaker.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
-ParaMEDMEM::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge)
+MEDCoupling::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> c=MEDCouplingCMesh::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
+ MCAuto<MEDCouplingCMesh> c=MEDCouplingCMesh::New();
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
arr->alloc(nbedge+1,1); arr->iota(0.); arr->applyLin(1./double(nbedge),0.);
switch(dim)
{
#include "MEDCouplingUMesh.hxx"
-ParaMEDMEM::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge);
+MEDCoupling::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge);
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
}
double sumCol(const IntersectionMatrix& m, int i) const;
- void getVolumes(ParaMEDMEM::MEDCouplingUMesh& mesh, double* tab) const;
+ void getVolumes(MEDCoupling::MEDCouplingUMesh& mesh, double* tab) const;
- bool testVolumes(const IntersectionMatrix& m, ParaMEDMEM::MEDCouplingUMesh& sMesh, ParaMEDMEM::MEDCouplingUMesh& tMesh) const;
+ bool testVolumes(const IntersectionMatrix& m, MEDCoupling::MEDCouplingUMesh& sMesh, MEDCoupling::MEDCouplingUMesh& tMesh) const;
double sumVolume(const IntersectionMatrix& m) const;
#include <cppunit/extensions/HelperMacros.h>
//#define VOL_PREC 1.0e-6
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace INTERP_KERNEL;
namespace INTERP_TEST
* @param tab pointer to double[no. elements of mesh] array in which to store the volumes
*/
template <int SPACEDIM, int MESHDIM>
- void MeshTestToolkit<SPACEDIM,MESHDIM>::getVolumes(ParaMEDMEM::MEDCouplingUMesh& mesh, double *tab) const
+ void MeshTestToolkit<SPACEDIM,MESHDIM>::getVolumes(MEDCoupling::MEDCouplingUMesh& mesh, double *tab) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=mesh.getMeasureField(true);
+ MCAuto<MEDCouplingFieldDouble> vol=mesh.getMeasureField(true);
std::copy(vol->getArray()->begin(),vol->getArray()->end(),tab);
}
* @return true if the condition is verified, false if not.
*/
template <int SPACEDIM, int MESHDIM>
- bool MeshTestToolkit<SPACEDIM,MESHDIM>::testVolumes(const IntersectionMatrix& m, ParaMEDMEM::MEDCouplingUMesh& sMesh, ParaMEDMEM::MEDCouplingUMesh& tMesh) const
+ bool MeshTestToolkit<SPACEDIM,MESHDIM>::testVolumes(const IntersectionMatrix& m, MEDCoupling::MEDCouplingUMesh& sMesh, MEDCoupling::MEDCouplingUMesh& tMesh) const
{
bool ok = true;
LOG(1, std::endl << "=== -> intersecting src = " << mesh1path << ", target = " << mesh2path );
LOG(5, "Loading " << mesh1 << " from " << mesh1path);
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> sMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh1path).c_str(),mesh1);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> sMesh=sMeshML->getMeshAtLevel(0);
+ MCAuto<MEDFileUMesh> sMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh1path).c_str(),mesh1);
+ MCAuto<MEDCouplingUMesh> sMesh=sMeshML->getMeshAtLevel(0);
LOG(5, "Loading " << mesh2 << " from " << mesh2path);
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> tMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh2path).c_str(),mesh2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tMesh=tMeshML->getMeshAtLevel(0);
+ MCAuto<MEDFileUMesh> tMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh2path).c_str(),mesh2);
+ MCAuto<MEDCouplingUMesh> tMesh=tMeshML->getMeshAtLevel(0);
MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM> sMesh_wrapper(sMesh);
MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM> tMesh_wrapper(tMesh);
LOG(1, std::endl << "=== -> intersecting src = " << mesh1 << ", target = " << mesh2 );
LOG(5, "Loading " << mesh1 << " from " << mesh1path);
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> sMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh1path).c_str(),mesh1);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> sMesh=sMeshML->getMeshAtLevel(0);
+ MCAuto<MEDFileUMesh> sMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh1path).c_str(),mesh1);
+ MCAuto<MEDCouplingUMesh> sMesh=sMeshML->getMeshAtLevel(0);
LOG(5, "Loading " << mesh2 << " from " << mesh2path);
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> tMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh2path).c_str(),mesh2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tMesh=tMeshML->getMeshAtLevel(0);
+ MCAuto<MEDFileUMesh> tMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh2path).c_str(),mesh2);
+ MCAuto<MEDCouplingUMesh> tMesh=tMeshML->getMeshAtLevel(0);
MEDCouplingNormalizedUnstructuredMesh<3,3> sMesh_wrapper(sMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> tMesh_wrapper(tMesh);
void INTERP_TEST::ThreeDSurfProjectionTest::test2()
{// here the two triangles have their center of inertia very close (eps) but the angle between the two planes is "big"
//coo=DataArrayDouble([0.,0.,0.,1.,0.,0.,0.,1.,0.],3,3)
- //coocpy=coo.deepCpy()
+ //coocpy=coo.deepCopy()
//MEDCouplingPointSet.Rotate3DAlg([0.,0.,0.],[-1,-1.,0.],pi/3,coocpy)
//coocpy+=[eps*sqrt(3)/2,eps/2,eps*0.]
//
MEDCouplingRefCountObject.cxx
MEDCouplingPointSet.cxx
MEDCouplingFieldTemplate.cxx
- MEDCouplingExtrudedMesh.cxx
+ MEDCouplingMappedExtrudedMesh.cxx
MEDCouplingMesh.cxx
MEDCouplingGaussLocalization.cxx
MEDCouplingNatureOfField.cxx
--- /dev/null
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (CEA/DEN)
+
+#ifndef __PARAMEDMEM_MEDCOUPLINGAUTOREFCOUNTOBJECTPTR_HXX__
+#define __PARAMEDMEM_MEDCOUPLINGAUTOREFCOUNTOBJECTPTR_HXX__
+
+#include "MEDCouplingRefCountObject.hxx"
+#include "InterpKernelException.hxx"
+
+namespace MEDCoupling
+{
+ template<class T>
+ class MCAuto
+ {
+ public:
+ MCAuto(const MCAuto& other):_ptr(0) { referPtr(other._ptr); }
+ MCAuto(T *ptr=0):_ptr(ptr) { }
+ ~MCAuto() { destroyPtr(); }
+ bool operator==(const MCAuto& other) const { return _ptr==other._ptr; }
+ bool operator==(const T *other) const { return _ptr==other; }
+ MCAuto &operator=(const MCAuto& other) { if(_ptr!=other._ptr) { destroyPtr(); referPtr(other._ptr); } return *this; }
+ MCAuto &operator=(T *ptr) { if(_ptr!=ptr) { destroyPtr(); _ptr=ptr; } return *this; }
+ T *operator->() { return _ptr ; }
+ const T *operator->() const { return _ptr; }
+ T& operator*() { return *_ptr; }
+ const T& operator*() const { return *_ptr; }
+ operator T *() { return _ptr; }
+ operator const T *() const { return _ptr; }
+ T *retn() { if(_ptr) _ptr->incrRef(); return _ptr; }
+ private:
+ void referPtr(T *ptr) { _ptr=ptr; if(_ptr) _ptr->incrRef(); }
+ void destroyPtr() { if(_ptr) _ptr->decrRef(); }
+ private:
+ T *_ptr;
+ };
+
+ template<class T, class U>
+ typename MEDCoupling::MCAuto<U> DynamicCast(typename MEDCoupling::MCAuto<T>& autoSubPtr) throw()
+ {
+ T *subPtr(autoSubPtr);
+ U *ptr(dynamic_cast<U *>(subPtr));
+ typename MEDCoupling::MCAuto<U> ret(ptr);
+ if(ptr)
+ ptr->incrRef();
+ return ret;
+ }
+
+ template<class T, class U>
+ typename MEDCoupling::MCAuto<U> DynamicCastSafe(typename MEDCoupling::MCAuto<T>& autoSubPtr)
+ {
+ T *subPtr(autoSubPtr);
+ U *ptr(dynamic_cast<U *>(subPtr));
+ if(subPtr && !ptr)
+ throw INTERP_KERNEL::Exception("DynamicCastSafe : U is not a subtype of T !");
+ typename MEDCoupling::MCAuto<U> ret(ptr);
+ if(ptr)
+ ptr->incrRef();
+ return ret;
+ }
+}
+
+#endif
#include "DiameterCalculator.hxx"
#include "InterpKernelAutoPtr.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const int MEDCoupling1SGTUMesh::HEXA8_FACE_PAIRS[6]={0,1,2,4,3,5};
*/
DataArrayInt *MEDCoupling1GTUMesh::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
if(type==getCellModelEnum())
ret->alloc(getNumberOfCells(),1);
else
code.resize(3); idsInPflPerType.resize(1);
code[0]=(int)getCellModelEnum(); code[1]=nbTuples;
idsInPflPerType.resize(1);
- if(profile->isIdentity2(nbOfCells))
+ if(profile->isIota(nbOfCells))
{
code[2]=-1;
idsInPflPerType[0]=const_cast<DataArrayInt *>(profile); idsInPflPerType[0]->incrRef();
void MEDCoupling1GTUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
m->writeVTKLL(ofs,cellData,pointData,byteData);
}
return true;
}
-void MEDCoupling1GTUMesh::checkCoherency() const
+void MEDCoupling1GTUMesh::checkConsistencyLight() const
{
- MEDCouplingPointSet::checkCoherency();
+ MEDCouplingPointSet::checkConsistencyLight();
}
-DataArrayDouble *MEDCoupling1GTUMesh::getBarycenterAndOwner() const
+DataArrayDouble *MEDCoupling1GTUMesh::computeCellCenterOfMass() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=m->getBarycenterAndOwner();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<DataArrayDouble> ret=m->computeCellCenterOfMass();
return ret.retn();
}
MEDCouplingFieldDouble *MEDCoupling1GTUMesh::getMeasureField(bool isAbs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=m->getMeasureField(isAbs);
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingFieldDouble> ret=m->getMeasureField(isAbs);
ret->setMesh(this);
return ret.retn();
}
MEDCouplingFieldDouble *MEDCoupling1GTUMesh::getMeasureFieldOnNode(bool isAbs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=m->getMeasureFieldOnNode(isAbs);
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingFieldDouble> ret=m->getMeasureFieldOnNode(isAbs);
ret->setMesh(this);
return ret.retn();
}
*/
int MEDCoupling1GTUMesh::getCellContainingPoint(const double *pos, double eps) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
return m->getCellContainingPoint(pos,eps);
}
MEDCouplingFieldDouble *MEDCoupling1GTUMesh::buildOrthogonalField() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=m->buildOrthogonalField();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingFieldDouble> ret=m->buildOrthogonalField();
ret->setMesh(this);
return ret.retn();
}
DataArrayInt *MEDCoupling1GTUMesh::getCellsInBoundingBox(const double *bbox, double eps) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
return m->getCellsInBoundingBox(bbox,eps);
}
DataArrayInt *MEDCoupling1GTUMesh::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
return m->getCellsInBoundingBox(bbox,eps);
}
MEDCouplingPointSet *MEDCoupling1GTUMesh::buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
return m->buildFacePartOfMySelfNode(start,end,fullyIn);
}
DataArrayInt *MEDCoupling1GTUMesh::findBoundaryNodes() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
return m->findBoundaryNodes();
}
MEDCouplingPointSet *MEDCoupling1GTUMesh::buildBoundaryMesh(bool keepCoords) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
return m->buildBoundaryMesh(keepCoords);
}
void MEDCoupling1GTUMesh::findCommonCells(int compType, int startCellId, DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
m->findCommonCells(compType,startCellId,commonCellsArr,commonCellsIArr);
}
throw INTERP_KERNEL::Exception("MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh : the first instance in input parts is null !");
const DataArrayDouble *coords(firstPart->getCoords());
int meshDim(firstPart->getMeshDimension());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(firstPart->getName(),meshDim)); ret->setDescription(firstPart->getDescription());
+ MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(firstPart->getName(),meshDim)); ret->setDescription(firstPart->getDescription());
ret->setCoords(coords);
int nbOfCells(0),connSize(0);
for(std::vector< const MEDCoupling1GTUMesh *>::const_iterator it=parts.begin();it!=parts.end();it++)
nbOfCells+=(*it)->getNumberOfCells();
connSize+=(*it)->getNodalConnectivityLength();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
connI->alloc(nbOfCells+1,1); conn->alloc(connSize+nbOfCells,1);
int *c(conn->getPointer()),*ci(connI->getPointer()); *ci=0;
for(std::vector< const MEDCoupling1GTUMesh *>::const_iterator it=parts.begin();it!=parts.end();it++)
{
const DataArrayInt *c(other._conn);
if(c)
- _conn=c->deepCpy();
+ _conn=c->deepCopy();
}
}
if(gts.size()!=1)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::New : input mesh must have exactly one geometric type !");
int geoType((int)*gts.begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(m->getName(),*gts.begin()));
+ MCAuto<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(m->getName(),*gts.begin()));
ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription());
int nbCells(m->getNumberOfCells());
int nbOfNodesPerCell(ret->getNumberOfNodesPerCell());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()); conn->alloc(nbCells*nbOfNodesPerCell,1);
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()); conn->alloc(nbCells*nbOfNodesPerCell,1);
int *c(conn->getPointer());
const int *cin(m->getNodalConnectivity()->begin()),*ciin(m->getNodalConnectivityIndex()->begin());
for(int i=0;i<nbCells;i++,ciin++)
}
/*!
- * This method behaves mostly like MEDCoupling1SGTUMesh::deepCpy method, except that only nodal connectivity arrays are deeply copied.
+ * This method behaves mostly like MEDCoupling1SGTUMesh::deepCopy method, except that only nodal connectivity arrays are deeply copied.
* The coordinates are shared between \a this and the returned instance.
*
* \return MEDCoupling1SGTUMesh * - A new object instance holding the copy of \a this (deep for connectivity, shallow for coordiantes)
- * \sa MEDCoupling1SGTUMesh::deepCpy
+ * \sa MEDCoupling1SGTUMesh::deepCopy
*/
-MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::deepCpyConnectivityOnly() const
+MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::deepCopyConnectivityOnly() const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(clone(false));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(_conn->deepCpy());
+ checkConsistencyLight();
+ MCAuto<MEDCoupling1SGTUMesh> ret(clone(false));
+ MCAuto<DataArrayInt> c(_conn->deepCopy());
ret->setNodalConnectivity(c);
return ret.retn();
}
return ret;
}
-MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::deepCpy() const
+MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::deepCopy() const
{
return clone(true);
}
return true;
}
-void MEDCoupling1SGTUMesh::checkCoherencyOfConnectivity() const
+void MEDCoupling1SGTUMesh::checkConsistencyOfConnectivity() const
{
const DataArrayInt *c1(_conn);
if(c1)
throw INTERP_KERNEL::Exception("Nodal connectivity array not defined !");
}
-void MEDCoupling1SGTUMesh::checkCoherency() const
+void MEDCoupling1SGTUMesh::checkConsistencyLight() const
{
- MEDCouplingPointSet::checkCoherency();
- checkCoherencyOfConnectivity();
+ MEDCouplingPointSet::checkConsistencyLight();
+ checkConsistencyOfConnectivity();
}
-void MEDCoupling1SGTUMesh::checkCoherency1(double eps) const
+void MEDCoupling1SGTUMesh::checkConsistency(double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
const DataArrayInt *c1(_conn);
int nbOfTuples=c1->getNumberOfTuples();
int nbOfNodesPerCell=(int)_cm->getNumberOfNodes();
if(nbOfTuples%nbOfNodesPerCell!=0)
{
- std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::checkCoherency1 : the nb of tuples in conn is " << nbOfTuples << " and number of nodes per cell is " << nbOfNodesPerCell << ". But " << nbOfTuples << "%" << nbOfNodesPerCell << " !=0 !";
+ std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::checkConsistency : the nb of tuples in conn is " << nbOfTuples << " and number of nodes per cell is " << nbOfNodesPerCell << ". But " << nbOfTuples << "%" << nbOfNodesPerCell << " !=0 !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
int nbOfNodes=getNumberOfNodes();
DataArrayInt *MEDCoupling1SGTUMesh::computeNbOfNodesPerCell() const
{
checkNonDynamicGeoType();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(getNumberOfCells(),1);
ret->fillWithValue((int)_cm->getNumberOfNodes());
return ret.retn();
DataArrayInt *MEDCoupling1SGTUMesh::computeNbOfFacesPerCell() const
{
checkNonDynamicGeoType();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(getNumberOfCells(),1);
ret->fillWithValue((int)_cm->getNumberOfSons());
return ret.retn();
DataArrayInt *MEDCoupling1SGTUMesh::computeEffectiveNbOfNodesPerCell() const
{
checkNonDynamicGeoType();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbCells(getNumberOfCells());
ret->alloc(nbCells,1);
int *retPtr(ret->getPointer());
DataArrayDouble *MEDCoupling1SGTUMesh::computeIsoBarycenterOfNodesPerCell() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int spaceDim=getSpaceDimension();
- int nbOfCells=getNumberOfCells();//checkCoherency()
+ int nbOfCells=getNumberOfCells();//checkConsistencyLight()
int nbOfNodes=getNumberOfNodes();
ret->alloc(nbOfCells,spaceDim);
double *ptToFill=ret->getPointer();
void MEDCoupling1SGTUMesh::renumberCells(const int *old2NewBg, bool check)
{
int nbCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=DataArrayInt::New();
+ MCAuto<DataArrayInt> o2n=DataArrayInt::New();
o2n->useArray(old2NewBg,false,C_DEALLOC,nbCells,1);
if(check)
o2n=o2n->checkAndPreparePermutation();
//
const int *conn=_conn->begin();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o=o2n->invertArrayO2N2N2O(nbCells);
+ MCAuto<DataArrayInt> n2o=o2n->invertArrayO2N2N2O(nbCells);
const int *n2oPtr=n2o->begin();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
newConn->alloc(_conn->getNumberOfTuples(),1);
newConn->copyStringInfoFrom(*_conn);
int sz=getNumberOfNodesPerCell();
void MEDCoupling1SGTUMesh::fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const
{
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsKept=DataArrayInt::New(); cellIdsKept->alloc(0,1);
+ MCAuto<DataArrayInt> cellIdsKept=DataArrayInt::New(); cellIdsKept->alloc(0,1);
int tmp=-1;
int sz=_conn->getMaxValue(tmp); sz=std::max(sz,0)+1;
std::vector<bool> fastFinder(sz,false);
MEDCouplingUMesh *MEDCoupling1SGTUMesh::buildUnstructured() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
ret->setCoords(getCoords());
const int *nodalConn=_conn->begin();
int nbCells=getNumberOfCells();
int nbNodesPerCell=getNumberOfNodesPerCell();
int geoType=(int)getCellModelEnum();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New(); c->alloc(nbCells*(nbNodesPerCell+1),1);
+ MCAuto<DataArrayInt> c=DataArrayInt::New(); c->alloc(nbCells*(nbNodesPerCell+1),1);
int *cPtr=c->getPointer();
for(int i=0;i<nbCells;i++,nodalConn+=nbNodesPerCell)
{
*cPtr++=geoType;
cPtr=std::copy(nodalConn,nodalConn+nbNodesPerCell,cPtr);
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cI=DataArrayInt::Range(0,(nbCells+1)*(nbNodesPerCell+1),nbNodesPerCell+1);
+ MCAuto<DataArrayInt> cI=DataArrayInt::Range(0,(nbCells+1)*(nbNodesPerCell+1),nbNodesPerCell+1);
ret->setConnectivity(c,cI,true);
try
{ ret->copyTinyInfoFrom(this); }
*/
DataArrayInt *MEDCoupling1SGTUMesh::computeFetchedNodeIds() const
{
- checkCoherencyOfConnectivity();
+ checkConsistencyOfConnectivity();
int nbNodes(getNumberOfNodes());
std::vector<bool> fetchedNodes(nbNodes,false);
computeNodeIdsAlg(fetchedNodes);
int sz((int)std::count(fetchedNodes.begin(),fetchedNodes.end(),true));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
int *retPtr(ret->getPointer());
for(int i=0;i<nbNodes;i++)
if(fetchedNodes[i])
nbrOfNodesInUse=-1;
int nbOfNodes=getNumberOfNodes();
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
ret->alloc(nbOfNodes,1);
int *traducer=ret->getPointer();
std::fill(traducer,traducer+nbOfNodes,-1);
for(std::size_t ii=0;ii<sz;ii++)
if(&(a[ii]->getCellModel())!=cm)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::Merge1SGTUMeshes : all items must have the same geo type !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> > bb(sz);
+ std::vector< MCAuto<MEDCoupling1SGTUMesh> > bb(sz);
std::vector< const MEDCoupling1SGTUMesh * > aa(sz);
int spaceDim=-3;
for(std::size_t i=0;i<sz && spaceDim==-3;i++)
if(coords!=(*it)->getCoords())
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords : not lying on same coords !");
}
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh("merge",*cm));
+ MCAuto<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh("merge",*cm));
ret->setCoords(coords);
ret->_conn=DataArrayInt::Aggregate(ncs);
return ret.retn();
}
std::vector<const MEDCouplingPointSet *> aps(a.size());
std::copy(a.begin(),a.end(),aps.begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> pts=MergeNodesArray(aps);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh("merge",*cm));
+ MCAuto<DataArrayDouble> pts=MergeNodesArray(aps);
+ MCAuto<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh("merge",*cm));
ret->setCoords(pts);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New();
+ MCAuto<DataArrayInt> c=DataArrayInt::New();
c->alloc(nbOfCells*nbNodesPerCell,1);
int *cPtr=c->getPointer();
int offset=0;
MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const
{
int ncell=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
+ MCAuto<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
std::size_t nbOfElemsRet=std::distance(begin,end);
const int *inConn=_conn->getConstPointer();
int sz=getNumberOfNodesPerCell();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connRet=DataArrayInt::New(); connRet->alloc((int)nbOfElemsRet*sz,1);
+ MCAuto<DataArrayInt> connRet=DataArrayInt::New(); connRet->alloc((int)nbOfElemsRet*sz,1);
int *connPtr=connRet->getPointer();
for(const int *work=begin;work!=end;work++,connPtr+=sz)
{
return ret.retn();
}
-MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const
+MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const
{
int ncell=getNumberOfCells();
- int nbOfElemsRet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2 : ");
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
+ int nbOfElemsRet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoordsSlice : ");
+ MCAuto<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
const int *inConn=_conn->getConstPointer();
int sz=getNumberOfNodesPerCell();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connRet=DataArrayInt::New(); connRet->alloc((int)nbOfElemsRet*sz,1);
+ MCAuto<DataArrayInt> connRet=DataArrayInt::New(); connRet->alloc((int)nbOfElemsRet*sz,1);
int *connPtr=connRet->getPointer();
int curId=start;
for(int i=0;i<nbOfElemsRet;i++,connPtr+=sz,curId+=step)
std::copy(inConn+curId*sz,inConn+(curId+1)*sz,connPtr);
else
{
- std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2 : On pos #" << i << " input cell id =" << curId << " should be in [0," << ncell << ") !";
+ std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoordsSlice : On pos #" << i << " input cell id =" << curId << " should be in [0," << ncell << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::buildSetInstanceFromThis(int spaceDim) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1;
+ MCAuto<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
+ MCAuto<DataArrayInt> tmp1;
const DataArrayInt *nodalConn(_conn);
if(!nodalConn)
{
ret->_conn=tmp1;
if(!_coords)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords=DataArrayDouble::New(); coords->alloc(0,spaceDim);
+ MCAuto<DataArrayDouble> coords=DataArrayDouble::New(); coords->alloc(0,spaceDim);
ret->setCoords(coords);
}
else
int nbOfCells=getNumberOfCells();
if(getCellModelEnum()!=INTERP_KERNEL::NORM_QUAD4)
return DataArrayInt::Range(0,nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(2*3*nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(2*nbOfCells,1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(2*3*nbOfCells,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(2*nbOfCells,1);
const int *c(_conn->begin());
int *retPtr(ret->getPointer()),*newConnPtr(newConn->getPointer());
for(int i=0;i<nbOfCells;i++,c+=4,newConnPtr+=6,retPtr+=2)
int nbOfCells=getNumberOfCells();
if(getCellModelEnum()!=INTERP_KERNEL::NORM_QUAD4)
return DataArrayInt::Range(0,nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(2*3*nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(2*nbOfCells,1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(2*3*nbOfCells,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(2*nbOfCells,1);
const int *c(_conn->begin());
int *retPtr(ret->getPointer()),*newConnPtr(newConn->getPointer());
for(int i=0;i<nbOfCells;i++,c+=4,newConnPtr+=6,retPtr+=2)
int nbOfCells=getNumberOfCells();
if(getCellModelEnum()!=INTERP_KERNEL::NORM_HEXA8)
return DataArrayInt::Range(0,nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(5*4*nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(5*nbOfCells,1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(5*4*nbOfCells,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(5*nbOfCells,1);
const int *c(_conn->begin());
int *retPtr(ret->getPointer()),*newConnPtr(newConn->getPointer());
for(int i=0;i<nbOfCells;i++,c+=8,newConnPtr+=20,retPtr+=5)
int nbOfCells=getNumberOfCells();
if(getCellModelEnum()!=INTERP_KERNEL::NORM_HEXA8)
return DataArrayInt::Range(0,nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(6*4*nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(6*nbOfCells,1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(6*4*nbOfCells,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(6*nbOfCells,1);
const int *c(_conn->begin());
int *retPtr(ret->getPointer()),*newConnPtr(newConn->getPointer());
for(int i=0;i<nbOfCells;i++,c+=8,newConnPtr+=24,retPtr+=6)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4 : this method can be applied only on HEXA8 mesh !");
int nbHexa8(getNumberOfCells());
const int *inConnPtr(getNodalConnectivity()->begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),INTERP_KERNEL::NORM_QUAD4));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(DataArrayInt::New()); c->alloc(nbHexa8*6*4,1);
+ MCAuto<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),INTERP_KERNEL::NORM_QUAD4));
+ MCAuto<DataArrayInt> c(DataArrayInt::New()); c->alloc(nbHexa8*6*4,1);
int *cPtr(c->getPointer());
for(int i=0;i<nbHexa8;i++,inConnPtr+=8)
{
*/
MEDCouplingCMesh *MEDCoupling1SGTUMesh::structurizeMe(DataArrayInt *& cellPerm, DataArrayInt *& nodePerm, double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
int spaceDim(getSpaceDimension()),meshDim(getMeshDimension()),nbNodes(getNumberOfNodes());
if(MEDCouplingStructuredMesh::GetGeoTypeGivenMeshDimension(meshDim)!=getCellModelEnum())
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::structurizeMe : the unique geo type in this is not compatible with the geometric type regarding mesh dimension !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> cm(MEDCouplingCMesh::New());
+ MCAuto<MEDCouplingCMesh> cm(MEDCouplingCMesh::New());
for(int i=0;i<spaceDim;i++)
{
std::vector<int> tmp(1,i);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> elt(static_cast<DataArrayDouble*>(getCoords()->keepSelectedComponents(tmp)));
+ MCAuto<DataArrayDouble> elt(static_cast<DataArrayDouble*>(getCoords()->keepSelectedComponents(tmp)));
elt=elt->getDifferentValues(eps);
elt->sort(true);
cm->setCoordsAt(i,elt);
try
{ cm->copyTinyInfoFrom(this); }
catch(INTERP_KERNEL::Exception&) { }
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> um(cm->buildUnstructured()),self(buildUnstructured());
+ MCAuto<MEDCouplingUMesh> um(cm->buildUnstructured()),self(buildUnstructured());
self->checkGeoEquivalWith(um,12,eps,cellPerm,nodePerm);
return cm.retn();
}
*/
DataArrayInt *MEDCoupling1SGTUMesh::sortHexa8EachOther()
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> quads(explodeEachHexa8To6Quad4());//checks that only hexa8
+ MCAuto<MEDCoupling1SGTUMesh> quads(explodeEachHexa8To6Quad4());//checks that only hexa8
int nbHexa8(getNumberOfCells()),*cQuads(quads->getNodalConnectivity()->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> neighOfQuads(DataArrayInt::New()); neighOfQuads->alloc(nbHexa8*6,1); neighOfQuads->fillWithValue(-1);
+ MCAuto<DataArrayInt> neighOfQuads(DataArrayInt::New()); neighOfQuads->alloc(nbHexa8*6,1); neighOfQuads->fillWithValue(-1);
int *ptNeigh(neighOfQuads->getPointer());
{//neighOfQuads tells for each face of each Quad8 which cell (if!=-1) is connected to this face.
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> quadsTmp(quads->buildUnstructured());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ccSafe,cciSafe;
+ MCAuto<MEDCouplingUMesh> quadsTmp(quads->buildUnstructured());
+ MCAuto<DataArrayInt> ccSafe,cciSafe;
DataArrayInt *cc(0),*cci(0);
quadsTmp->findCommonCells(3,0,cc,cci);
ccSafe=cc; cciSafe=cci;
for(int i=0;i<nbOfPair;i++)
{ ptNeigh[ccPtr[2*i+0]]=ccPtr[2*i+1]/6; ptNeigh[ccPtr[2*i+1]]=ccPtr[2*i+0]/6; }
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
std::vector<bool> fetched(nbHexa8,false);
std::vector<bool>::iterator it(std::find(fetched.begin(),fetched.end(),false));
while(it!=fetched.end())//it will turns as time as number of connected zones
if(getCellModelEnum()!=INTERP_KERNEL::NORM_TETRA4)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::computeDualMesh3D : only TETRA4 supported !");
checkFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> thisu(buildUnstructured());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revNodArr(DataArrayInt::New()),revNodIArr(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> thisu(buildUnstructured());
+ MCAuto<DataArrayInt> revNodArr(DataArrayInt::New()),revNodIArr(DataArrayInt::New());
thisu->getReverseNodalConnectivity(revNodArr,revNodIArr);
const int *revNod(revNodArr->begin()),*revNodI(revNodIArr->begin()),*nodal(_conn->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1Arr(DataArrayInt::New()),di1Arr(DataArrayInt::New()),rd1Arr(DataArrayInt::New()),rdi1Arr(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> edges(thisu->explode3DMeshTo1D(d1Arr,di1Arr,rd1Arr,rdi1Arr));
+ MCAuto<DataArrayInt> d1Arr(DataArrayInt::New()),di1Arr(DataArrayInt::New()),rd1Arr(DataArrayInt::New()),rdi1Arr(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> edges(thisu->explode3DMeshTo1D(d1Arr,di1Arr,rd1Arr,rdi1Arr));
const int *d1(d1Arr->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2Arr(DataArrayInt::New()),di2Arr(DataArrayInt::New()),rd2Arr(DataArrayInt::New()),rdi2Arr(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> faces(thisu->buildDescendingConnectivity(d2Arr,di2Arr,rd2Arr,rdi2Arr)); thisu=0;
+ MCAuto<DataArrayInt> d2Arr(DataArrayInt::New()),di2Arr(DataArrayInt::New()),rd2Arr(DataArrayInt::New()),rdi2Arr(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> faces(thisu->buildDescendingConnectivity(d2Arr,di2Arr,rd2Arr,rdi2Arr)); thisu=0;
const int *d2(d2Arr->begin()),*rdi2(rdi2Arr->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> edgesBaryArr(edges->getBarycenterAndOwner()),facesBaryArr(faces->getBarycenterAndOwner()),baryArr(getBarycenterAndOwner());
+ MCAuto<DataArrayDouble> edgesBaryArr(edges->computeCellCenterOfMass()),facesBaryArr(faces->computeCellCenterOfMass()),baryArr(computeCellCenterOfMass());
const int nbOfNodes(getNumberOfNodes()),offset0(nbOfNodes+faces->getNumberOfCells()),offset1(offset0+edges->getNumberOfCells());
edges=0; faces=0;
std::vector<const DataArrayDouble *> v(4); v[0]=getCoords(); v[1]=facesBaryArr; v[2]=edgesBaryArr; v[3]=baryArr;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0; facesBaryArr=0;
+ MCAuto<DataArrayDouble> zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0; facesBaryArr=0;
std::string name("DualOf_"); name+=getName();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name,INTERP_KERNEL::NORM_POLYHED)); ret->setCoords(zeArr);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1);
+ MCAuto<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name,INTERP_KERNEL::NORM_POLYHED)); ret->setCoords(zeArr);
+ MCAuto<DataArrayInt> cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1);
for(int i=0;i<nbOfNodes;i++,revNodI++)
{
int nbOfCellsSharingNode(revNodI[1]-revNodI[0]);
if(getCellModelEnum()!=INTERP_KERNEL::NORM_TRI3)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::computeDualMesh2D : only TRI3 supported !");
checkFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> thisu(buildUnstructured());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revNodArr(DataArrayInt::New()),revNodIArr(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> thisu(buildUnstructured());
+ MCAuto<DataArrayInt> revNodArr(DataArrayInt::New()),revNodIArr(DataArrayInt::New());
thisu->getReverseNodalConnectivity(revNodArr,revNodIArr);
const int *revNod(revNodArr->begin()),*revNodI(revNodIArr->begin()),*nodal(_conn->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2Arr(DataArrayInt::New()),di2Arr(DataArrayInt::New()),rd2Arr(DataArrayInt::New()),rdi2Arr(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> edges(thisu->buildDescendingConnectivity(d2Arr,di2Arr,rd2Arr,rdi2Arr)); thisu=0;
+ MCAuto<DataArrayInt> d2Arr(DataArrayInt::New()),di2Arr(DataArrayInt::New()),rd2Arr(DataArrayInt::New()),rdi2Arr(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> edges(thisu->buildDescendingConnectivity(d2Arr,di2Arr,rd2Arr,rdi2Arr)); thisu=0;
const int *d2(d2Arr->begin()),*rdi2(rdi2Arr->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> edgesBaryArr(edges->getBarycenterAndOwner()),baryArr(getBarycenterAndOwner());
+ MCAuto<DataArrayDouble> edgesBaryArr(edges->computeCellCenterOfMass()),baryArr(computeCellCenterOfMass());
const int nbOfNodes(getNumberOfNodes()),offset0(nbOfNodes+edges->getNumberOfCells());
edges=0;
std::vector<const DataArrayDouble *> v(3); v[0]=getCoords(); v[1]=edgesBaryArr; v[2]=baryArr;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0;
+ MCAuto<DataArrayDouble> zeArr(DataArrayDouble::Aggregate(v)); baryArr=0; edgesBaryArr=0;
std::string name("DualOf_"); name+=getName();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name,INTERP_KERNEL::NORM_POLYGON)); ret->setCoords(zeArr);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1);
+ MCAuto<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(name,INTERP_KERNEL::NORM_POLYGON)); ret->setCoords(zeArr);
+ MCAuto<DataArrayInt> cArr(DataArrayInt::New()),ciArr(DataArrayInt::New()); ciArr->alloc(nbOfNodes+1,1); ciArr->setIJ(0,0,0); cArr->alloc(0,1);
for(int i=0;i<nbOfNodes;i++,revNodI++)
{
int nbOfCellsSharingNode(revNodI[1]-revNodI[0]);
DataArrayDouble *MEDCoupling1SGTUMesh::getBoundingBoxForBBTree(double arcDetEps) const
{
int spaceDim(getSpaceDimension()),nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes()),nbOfNodesPerCell(getNumberOfNodesPerCell());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
double *bbox(ret->getPointer());
for(int i=0;i<nbOfCells*spaceDim;i++)
{
MEDCouplingFieldDouble *MEDCoupling1SGTUMesh::computeDiameterField() const
{
checkFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME));
int nbCells(getNumberOfCells());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> arr(DataArrayDouble::New());
arr->alloc(nbCells,1);
INTERP_KERNEL::AutoCppPtr<INTERP_KERNEL::DiameterCalculator> dc(_cm->buildInstanceOfDiameterCalulator(getSpaceDimension()));
dc->computeFor1SGTUMeshFrmt(nbCells,_conn->begin(),getCoords()->begin(),arr->getPointer());
{
const DataArrayInt *c(other._conn);
if(c)
- _conn=c->deepCpy();
+ _conn=c->deepCopy();
c=other._conn_indx;
if(c)
- _conn_indx=c->deepCpy();
+ _conn_indx=c->deepCopy();
}
}
}
/*!
- * This method behaves mostly like MEDCoupling1DGTUMesh::deepCpy method, except that only nodal connectivity arrays are deeply copied.
+ * This method behaves mostly like MEDCoupling1DGTUMesh::deepCopy method, except that only nodal connectivity arrays are deeply copied.
* The coordinates are shared between \a this and the returned instance.
*
* \return MEDCoupling1DGTUMesh * - A new object instance holding the copy of \a this (deep for connectivity, shallow for coordiantes)
- * \sa MEDCoupling1DGTUMesh::deepCpy
+ * \sa MEDCoupling1DGTUMesh::deepCopy
*/
-MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::deepCpyConnectivityOnly() const
+MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::deepCopyConnectivityOnly() const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(clone(false));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(_conn->deepCpy()),ci(_conn_indx->deepCpy());
+ checkConsistencyLight();
+ MCAuto<MEDCoupling1DGTUMesh> ret(clone(false));
+ MCAuto<DataArrayInt> c(_conn->deepCopy()),ci(_conn_indx->deepCopy());
ret->setNodalConnectivity(c,ci);
return ret.retn();
}
return ret;
}
-MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::deepCpy() const
+MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::deepCopy() const
{
return clone(true);
}
}
}
-void MEDCoupling1DGTUMesh::checkCoherencyOfConnectivity() const
+void MEDCoupling1DGTUMesh::checkConsistencyOfConnectivity() const
{
const DataArrayInt *c1(_conn);
if(c1)
int szOfC1Exp=_conn_indx->back();
if(sz2<szOfC1Exp)
{
- std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::checkCoherencyOfConnectivity : The expected length of nodal connectivity array regarding index is " << szOfC1Exp << " but the actual size of it is " << c1->getNumberOfTuples() << " !";
+ std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::checkConsistencyOfConnectivity : The expected length of nodal connectivity array regarding index is " << szOfC1Exp << " but the actual size of it is " << c1->getNumberOfTuples() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
* In addition you are sure that the length of nodal connectivity index array is bigger than or equal to one.
* In addition you are also sure that length of nodal connectivity is coherent with the content of the last value in the index array.
*/
-void MEDCoupling1DGTUMesh::checkCoherency() const
+void MEDCoupling1DGTUMesh::checkConsistencyLight() const
{
- MEDCouplingPointSet::checkCoherency();
- checkCoherencyOfConnectivity();
+ MEDCouplingPointSet::checkConsistencyLight();
+ checkConsistencyOfConnectivity();
}
-void MEDCoupling1DGTUMesh::checkCoherency1(double eps) const
+void MEDCoupling1DGTUMesh::checkConsistency(double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
const DataArrayInt *c1(_conn),*c2(_conn_indx);
if(!c2->isMonotonic(true))
- throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::checkCoherency1 : the nodal connectivity index is expected to be increasing monotinic !");
+ throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::checkConsistency : the nodal connectivity index is expected to be increasing monotinic !");
//
int nbOfTuples=c1->getNumberOfTuples();
int nbOfNodes=getNumberOfNodes();
int MEDCoupling1DGTUMesh::getNumberOfCells() const
{
- checkCoherencyOfConnectivity();//do not remove
+ checkConsistencyOfConnectivity();//do not remove
return _conn_indx->getNumberOfTuples()-1;
}
*/
DataArrayInt *MEDCoupling1DGTUMesh::computeNbOfNodesPerCell() const
{
- checkCoherency();
+ checkConsistencyLight();
_conn_indx->checkMonotonic(true);
if(getCellModelEnum()!=INTERP_KERNEL::NORM_POLYHED)
return _conn_indx->deltaShiftIndex();
// for polyhedrons
int nbOfCells=_conn_indx->getNumberOfTuples()-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfCells,1);
int *retPtr=ret->getPointer();
const int *ci=_conn_indx->begin(),*c=_conn->begin();
*/
DataArrayInt *MEDCoupling1DGTUMesh::computeNbOfFacesPerCell() const
{
- checkCoherency();
+ checkConsistencyLight();
_conn_indx->checkMonotonic(true);
if(getCellModelEnum()!=INTERP_KERNEL::NORM_POLYHED && getCellModelEnum()!=INTERP_KERNEL::NORM_QPOLYG)
return _conn_indx->deltaShiftIndex();
if(getCellModelEnum()==INTERP_KERNEL::NORM_QPOLYG)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=_conn_indx->deltaShiftIndex();
+ MCAuto<DataArrayInt> ret=_conn_indx->deltaShiftIndex();
ret->applyDivideBy(2);
return ret.retn();
}
// for polyhedrons
int nbOfCells=_conn_indx->getNumberOfTuples()-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfCells,1);
int *retPtr=ret->getPointer();
const int *ci=_conn_indx->begin(),*c=_conn->begin();
*/
DataArrayInt *MEDCoupling1DGTUMesh::computeEffectiveNbOfNodesPerCell() const
{
- checkCoherency();
+ checkConsistencyLight();
_conn_indx->checkMonotonic(true);
int nbOfCells(_conn_indx->getNumberOfTuples()-1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfCells,1);
int *retPtr(ret->getPointer());
const int *ci(_conn_indx->begin()),*c(_conn->begin());
ret << msg0 << "\n";
ret << "Number of cells : ";
bool isOK=true;
- try { checkCoherency(); } catch(INTERP_KERNEL::Exception& /* e */)
+ try { checkConsistencyLight(); } catch(INTERP_KERNEL::Exception& /* e */)
{
ret << "Nodal connectivity arrays are not set or badly set !\n";
isOK=false;
ret << "\n\nNodal Connectivity : \n____________________\n\n";
//
bool isOK=true;
- try { checkCoherency1(); } catch(INTERP_KERNEL::Exception& /* e */)
+ try { checkConsistency(); } catch(INTERP_KERNEL::Exception& /* e */)
{
ret << "Nodal connectivity arrays are not set or badly set !\n";
isOK=false;
DataArrayDouble *MEDCoupling1DGTUMesh::computeIsoBarycenterOfNodesPerCell() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int spaceDim=getSpaceDimension();
- int nbOfCells=getNumberOfCells();//checkCoherency()
+ int nbOfCells=getNumberOfCells();//checkConsistencyLight()
int nbOfNodes=getNumberOfNodes();
ret->alloc(nbOfCells,spaceDim);
double *ptToFill=ret->getPointer();
void MEDCoupling1DGTUMesh::renumberCells(const int *old2NewBg, bool check)
{
int nbCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=DataArrayInt::New();
+ MCAuto<DataArrayInt> o2n=DataArrayInt::New();
o2n->useArray(old2NewBg,false,C_DEALLOC,nbCells,1);
if(check)
o2n=o2n->checkAndPreparePermutation();
//
const int *o2nPtr=o2n->getPointer();
const int *conn=_conn->begin(),*conni=_conn_indx->begin();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
newConn->alloc(_conn->getNumberOfTuples(),1); newConnI->alloc(nbCells,1);
newConn->copyStringInfoFrom(*_conn); newConnI->copyStringInfoFrom(*_conn_indx);
//
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- newConnI->computeOffsets2(); newCI=newConnI->getPointer();
+ newConnI->computeOffsetsFull(); newCI=newConnI->getPointer();
//
for(int i=0;i<nbCells;i++,conni++)
{
MEDCouplingUMesh *MEDCoupling1DGTUMesh::buildUnstructured() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
ret->setCoords(getCoords());
const int *nodalConn=_conn->begin(),*nodalConnI=_conn_indx->begin();
- int nbCells=getNumberOfCells();//checkCoherency
+ int nbCells=getNumberOfCells();//checkConsistencyLight
int geoType=(int)getCellModelEnum();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New(); c->alloc(nbCells+_conn->getNumberOfTuples(),1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cI=DataArrayInt::New(); cI->alloc(nbCells+1);
+ MCAuto<DataArrayInt> c=DataArrayInt::New(); c->alloc(nbCells+_conn->getNumberOfTuples(),1);
+ MCAuto<DataArrayInt> cI=DataArrayInt::New(); cI->alloc(nbCells+1);
int *cPtr=c->getPointer(),*ciPtr=cI->getPointer();
ciPtr[0]=0;
for(int i=0;i<nbCells;i++,ciPtr++)
DataArrayInt *MEDCoupling1DGTUMesh::simplexize(int policy)
{
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfCells,1);
ret->iota(0);
return ret.retn();
stream << " Space dimension : " << _coords->getNumberOfComponents() << "." << std::endl;
stream << "Number of nodes : " << _coords->getNumberOfTuples() << ".";
bool isOK=true;
- try { checkCoherency(); } catch(INTERP_KERNEL::Exception& /* e */)
+ try { checkConsistencyLight(); } catch(INTERP_KERNEL::Exception& /* e */)
{
stream << std::endl << "Nodal connectivity NOT set properly !\n";
isOK=false;
MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ checkConsistencyLight();
+ MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
DataArrayInt *c=0,*ci=0;
MEDCouplingUMesh::ExtractFromIndexedArrays(begin,end,_conn,_conn_indx,c,ci);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cSafe(c),ciSafe(ci);
+ MCAuto<DataArrayInt> cSafe(c),ciSafe(ci);
ret->setNodalConnectivity(c,ci);
return ret.retn();
}
-MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const
+MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ checkConsistencyLight();
+ MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
ret->setCoords(_coords);
DataArrayInt *c=0,*ci=0;
- MEDCouplingUMesh::ExtractFromIndexedArrays2(start,end,step,_conn,_conn_indx,c,ci);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cSafe(c),ciSafe(ci);
+ MEDCouplingUMesh::ExtractFromIndexedArraysSlice(start,end,step,_conn,_conn_indx,c,ci);
+ MCAuto<DataArrayInt> cSafe(c),ciSafe(ci);
ret->setNodalConnectivity(c,ci);
return ret.retn();
}
void MEDCoupling1DGTUMesh::computeNodeIdsAlg(std::vector<bool>& nodeIdsInUse) const
{
- checkCoherency1();
+ checkConsistency();
int sz((int)nodeIdsInUse.size());
for(const int *conn=_conn->begin();conn!=_conn->end();conn++)
{
std::vector<int> tinyInfo2(tinyInfo.begin()+9,tinyInfo.begin()+9+tinyInfo[6]);
std::vector<int> tinyInfo1(tinyInfo.begin()+9+tinyInfo[6],tinyInfo.begin()+9+tinyInfo[6]+tinyInfo[7]);
std::vector<int> tinyInfo12(tinyInfo.begin()+9+tinyInfo[6]+tinyInfo[7],tinyInfo.begin()+9+tinyInfo[6]+tinyInfo[7]+tinyInfo[8]);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1(DataArrayInt::New()); p1->resizeForUnserialization(tinyInfo1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p2(DataArrayInt::New()); p2->resizeForUnserialization(tinyInfo12);
+ MCAuto<DataArrayInt> p1(DataArrayInt::New()); p1->resizeForUnserialization(tinyInfo1);
+ MCAuto<DataArrayInt> p2(DataArrayInt::New()); p2->resizeForUnserialization(tinyInfo12);
std::vector<const DataArrayInt *> v(2); v[0]=p1; v[1]=p2;
p2=DataArrayInt::Aggregate(v);
a2->resizeForUnserialization(tinyInfo2);
*/
DataArrayInt *MEDCoupling1DGTUMesh::computeFetchedNodeIds() const
{
- checkCoherency1();
+ checkConsistency();
int nbNodes(getNumberOfNodes());
std::vector<bool> fetchedNodes(nbNodes,false);
computeNodeIdsAlg(fetchedNodes);
int sz((int)std::count(fetchedNodes.begin(),fetchedNodes.end(),true));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
int *retPtr(ret->getPointer());
for(int i=0;i<nbNodes;i++)
if(fetchedNodes[i])
{
nbrOfNodesInUse=-1;
int nbOfNodes=getNumberOfNodes();
- int nbOfCells=getNumberOfCells();//checkCoherency
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ int nbOfCells=getNumberOfCells();//checkConsistencyLight
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfNodes,1);
int *traducer=ret->getPointer();
std::fill(traducer,traducer+nbOfNodes,-1);
void MEDCoupling1DGTUMesh::fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const
{
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsKept=DataArrayInt::New(); cellIdsKept->alloc(0,1);
+ MCAuto<DataArrayInt> cellIdsKept=DataArrayInt::New(); cellIdsKept->alloc(0,1);
int tmp=-1;
int sz=_conn->getMaxValue(tmp); sz=std::max(sz,0)+1;
std::vector<bool> fastFinder(sz,false);
*/
MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::copyWithNodalConnectivityPacked(bool& isShallowCpyOfNodalConnn) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
DataArrayInt *nc=0,*nci=0;
isShallowCpyOfNodalConnn=retrievePackedNodalConnectivity(nc,nci);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ncs(nc),ncis(nci);
+ MCAuto<DataArrayInt> ncs(nc),ncis(nci);
ret->_conn=ncs; ret->_conn_indx=ncis;
ret->setCoords(getCoords());
return ret.retn();
* \return bool - an indication of the content of the 2 output parameters. If true, \a this looks packed (general case), if true, \a this is not packed then
* output parameters are newly created objects.
*
- * \throw if \a this does not pass MEDCoupling1DGTUMesh::checkCoherency test
+ * \throw if \a this does not pass MEDCoupling1DGTUMesh::checkConsistencyLight test
*/
bool MEDCoupling1DGTUMesh::retrievePackedNodalConnectivity(DataArrayInt *&nodalConn, DataArrayInt *&nodalConnIndx) const
{
- if(isPacked())//performs the checkCoherency
+ if(isPacked())//performs the checkConsistencyLight
{
const DataArrayInt *c0(_conn),*c1(_conn_indx);
nodalConn=const_cast<DataArrayInt *>(c0); nodalConnIndx=const_cast<DataArrayInt *>(c1);
return true;
}
int bg=_conn_indx->front(),end=_conn_indx->back();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nc(_conn->selectByTupleId2(bg,end,1));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nci(_conn_indx->deepCpy());
+ MCAuto<DataArrayInt> nc(_conn->selectByTupleIdSafeSlice(bg,end,1));
+ MCAuto<DataArrayInt> nci(_conn_indx->deepCopy());
nci->applyLin(1,-bg);
nodalConn=nc.retn(); nodalConnIndx=nci.retn();
return false;
* If nodal connectivity index points to a subpart of nodal connectivity index false will be returned.
* \return bool - true if \a this looks packed, false is not.
*
- * \throw if \a this does not pass MEDCoupling1DGTUMesh::checkCoherency test
+ * \throw if \a this does not pass MEDCoupling1DGTUMesh::checkConsistencyLight test
*/
bool MEDCoupling1DGTUMesh::isPacked() const
{
- checkCoherency();
+ checkConsistencyLight();
return _conn_indx->front()==0 && _conn_indx->back()==_conn->getNumberOfTuples();
}
for(std::size_t ii=0;ii<sz;ii++)
if(&(a[ii]->getCellModel())!=cm)
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshes : all items must have the same geo type !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> > bb(sz);
+ std::vector< MCAuto<MEDCoupling1DGTUMesh> > bb(sz);
std::vector< const MEDCoupling1DGTUMesh * > aa(sz);
int spaceDim=-3;
for(std::size_t i=0;i<sz && spaceDim==-3;i++)
std::vector<const MEDCoupling1DGTUMesh *>::const_iterator it=a.begin();
if(!(*it))
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords : null instance in the first element of input vector !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> > objs(a.size());
+ std::vector< MCAuto<MEDCoupling1DGTUMesh> > objs(a.size());
std::vector<const DataArrayInt *> ncs(a.size()),ncis(a.size());
(*it)->getNumberOfCells();//to check that all is OK
const DataArrayDouble *coords=(*it)->getCoords();
if(coords!=(*it)->getCoords())
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords : not lying on same coords !");
}
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh("merge",*cm));
+ MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh("merge",*cm));
ret->setCoords(coords);
ret->_conn=DataArrayInt::Aggregate(ncs);
ret->_conn_indx=DataArrayInt::AggregateIndexes(ncis);
{
if(a.empty())
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshes : input array must be NON EMPTY !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> > objs(a.size());
+ std::vector< MCAuto<MEDCoupling1DGTUMesh> > objs(a.size());
std::vector<const DataArrayInt *> ncs(a.size()),ncis(a.size());
std::vector<const MEDCoupling1DGTUMesh *>::const_iterator it=a.begin();
std::vector<int> nbNodesPerElt(a.size());
}
std::vector<const MEDCouplingPointSet *> aps(a.size());
std::copy(a.begin(),a.end(),aps.begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> pts=MergeNodesArray(aps);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh("merge",*cm));
+ MCAuto<DataArrayDouble> pts=MergeNodesArray(aps);
+ MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh("merge",*cm));
ret->setCoords(pts);
ret->_conn=AggregateNodalConnAndShiftNodeIds(ncs,nbNodesPerElt);
ret->_conn_indx=DataArrayInt::AggregateIndexes(ncis);
MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::buildSetInstanceFromThis(int spaceDim) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1,tmp2;
+ MCAuto<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ MCAuto<DataArrayInt> tmp1,tmp2;
const DataArrayInt *nodalConn(_conn),*nodalConnI(_conn_indx);
if(!nodalConn)
{
//
if(!_coords)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords=DataArrayDouble::New(); coords->alloc(0,spaceDim);
+ MCAuto<DataArrayDouble> coords=DataArrayDouble::New(); coords->alloc(0,spaceDim);
ret->setCoords(coords);
}
else
{
checkFullyDefined();
int spaceDim(getSpaceDimension()),nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
double *bbox(ret->getPointer());
for(int i=0;i<nbOfCells*spaceDim;i++)
{
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds : presence of array with not exactly one component !");
nbOfTuples+=(*it)->getNumberOfTuples();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbOfTuples,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbOfTuples,1);
int *pt=ret->getPointer();
int i=0;
for(std::vector<const DataArrayInt *>::const_iterator it=nodalConns.begin();it!=nodalConns.end();it++,i++)
if(gts.size()!=1)
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::New : input mesh must have exactly one geometric type !");
int geoType((int)*gts.begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(m->getName(),*gts.begin()));
+ MCAuto<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(m->getName(),*gts.begin()));
ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription());
int nbCells(m->getNumberOfCells());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
- conn->alloc(m->getMeshLength()-nbCells,1); connI->alloc(nbCells+1,1);
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
+ conn->alloc(m->getNodalConnectivityArrayLen()-nbCells,1); connI->alloc(nbCells+1,1);
int *c(conn->getPointer()),*ci(connI->getPointer()); *ci=0;
const int *cin(m->getNodalConnectivity()->begin()),*ciin(m->getNodalConnectivityIndex()->begin());
for(int i=0;i<nbCells;i++,ciin++,ci++)
#include "MEDCoupling.hxx"
#include "MEDCouplingPointSet.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "CellModel.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCoupling1GTUUMeshCellIterator;
MEDCOUPLING_EXPORT int getNodalConnectivityLength() const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const;
MEDCOUPLING_EXPORT virtual void allocateCells(int nbOfCells=0) = 0;
MEDCOUPLING_EXPORT virtual void insertNextCell(const int *nodalConnOfCellBg, const int *nodalConnOfCellEnd) = 0;
MEDCOUPLING_EXPORT virtual DataArrayInt *getNodalConnectivity() const = 0;
- MEDCOUPLING_EXPORT virtual void checkCoherencyOfConnectivity() const = 0;
+ MEDCOUPLING_EXPORT virtual void checkConsistencyOfConnectivity() const = 0;
protected:
MEDCoupling1GTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm);
MEDCoupling1GTUMesh(const MEDCoupling1GTUMesh& other, bool recDeepCpy);
MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New();
// Copy methods
MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *clone(bool recDeepCpy) const;
- MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *deepCpy() const;
- MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *deepCpyConnectivityOnly() const;
+ MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *deepCopy() const;
+ MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *deepCopyConnectivityOnly() const;
// overload of TimeLabel and RefCountObject
MEDCOUPLING_EXPORT void updateTime() const;
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
MEDCOUPLING_EXPORT int getNumberOfCells() const;
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const;
- MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const;
+ MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const;
MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector<bool>& nodeIdsInUse) const;
MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const;
MEDCOUPLING_EXPORT void checkFullyDefined() const;
MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *computeDiameterField() const;
// overload of MEDCoupling1GTUMesh
- MEDCOUPLING_EXPORT void checkCoherencyOfConnectivity() const;
+ MEDCOUPLING_EXPORT void checkConsistencyOfConnectivity() const;
MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0);
MEDCOUPLING_EXPORT void insertNextCell(const int *nodalConnOfCellBg, const int *nodalConnOfCellEnd);
public://specific
MEDCoupling1DGTUMesh *computeDualMesh3D() const;
MEDCoupling1DGTUMesh *computeDualMesh2D() const;
private:
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn;
+ MCAuto<DataArrayInt> _conn;
public:
static const int HEXA8_FACE_PAIRS[6];
};
MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New();
// Copy methods
MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *clone(bool recDeepCpy) const;
- MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *deepCpy() const;
- MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *deepCpyConnectivityOnly() const;
+ MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *deepCopy() const;
+ MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *deepCopyConnectivityOnly() const;
// overload of TimeLabel and RefCountObject
MEDCOUPLING_EXPORT void updateTime() const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
MEDCOUPLING_EXPORT int getNumberOfCells() const;
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const;
- MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const;
+ MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const;
MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector<bool>& nodeIdsInUse) const;
MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const;
MEDCOUPLING_EXPORT void checkFullyDefined() const;
MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *computeDiameterField() const;
// overload of MEDCoupling1GTUMesh
- MEDCOUPLING_EXPORT void checkCoherencyOfConnectivity() const;
+ MEDCOUPLING_EXPORT void checkConsistencyOfConnectivity() const;
MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0);
MEDCOUPLING_EXPORT void insertNextCell(const int *nodalConnOfCellBg, const int *nodalConnOfCellEnd);
public://specific
void checkDynamicGeoT2ype() const;
static MEDCoupling1DGTUMesh *Merge1DGTUMeshesLL(std::vector<const MEDCoupling1DGTUMesh *>& a);
private:
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn_indx;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _conn;
+ MCAuto<DataArrayInt> _conn_indx;
+ MCAuto<DataArrayInt> _conn;
};
}
#include <sstream>
#include <fstream>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/// @cond INTERNAL
DataArrayDoubleCollection *DataArrayDoubleCollection::New(const std::vector< std::pair<std::string,int> >& fieldNames)
return new DataArrayDoubleCollection(fieldNames);
}
-DataArrayDoubleCollection *DataArrayDoubleCollection::deepCpy() const
+DataArrayDoubleCollection *DataArrayDoubleCollection::deepCopy() const
{
return new DataArrayDoubleCollection(*this);
}
const DataArrayDouble *otherArr(other._arrs[i].first);
if(!thisArr || !otherArr)
throw INTERP_KERNEL::Exception("DataArrayDoubleCollection::copyFrom : empty DataArray !");
- thisArr->cpyFrom(*otherArr);
+ thisArr->deepCopyFrom(*otherArr);
}
}
const DataArrayDouble *DataArrayDoubleCollection::getFieldWithName(const std::string& name) const
{
std::vector<std::string> vec;
- for(std::vector< std::pair< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>, NatureOfField > >::const_iterator it=_arrs.begin();it!=_arrs.end();it++)
+ for(std::vector< std::pair< MCAuto<DataArrayDouble>, NatureOfField > >::const_iterator it=_arrs.begin();it!=_arrs.end();it++)
{
const DataArrayDouble *obj((*it).first);
if(obj)
DataArrayDouble *DataArrayDoubleCollection::getFieldWithName(const std::string& name)
{
std::vector<std::string> vec;
- for(std::vector< std::pair< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>, NatureOfField > >::iterator it=_arrs.begin();it!=_arrs.end();it++)
+ for(std::vector< std::pair< MCAuto<DataArrayDouble>, NatureOfField > >::iterator it=_arrs.begin();it!=_arrs.end();it++)
{
DataArrayDouble *obj((*it).first);
if(obj)
_arrs[i].first->alloc(0,info.second);
_arrs[i].first->setName(info.first);
names[i]=info.second;
- _arrs[i].second=ConservativeVolumic;
+ _arrs[i].second=IntensiveMaximum;
}
CheckDiscriminantNames(names);
}
_arrs[i].second=other._arrs[i].second;
const DataArrayDouble *da(other._arrs[i].first);
if(da)
- _arrs[i].first=da->deepCpy();
+ _arrs[i].first=da->deepCopy();
}
}
std::size_t DataArrayDoubleCollection::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(DataArrayDoubleCollection));
- ret+=_arrs.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>);
+ ret+=_arrs.capacity()*sizeof(MCAuto<DataArrayDouble>);
return ret;
}
std::vector<const BigMemoryObject *> DataArrayDoubleCollection::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< std::pair< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>, NatureOfField > >::const_iterator it=_arrs.begin();it!=_arrs.end();it++)
+ for(std::vector< std::pair< MCAuto<DataArrayDouble>, NatureOfField > >::const_iterator it=_arrs.begin();it!=_arrs.end();it++)
ret.push_back((const DataArrayDouble *)(*it).first);
return ret;
}
void DataArrayDoubleCollection::updateTime() const
{
- for(std::vector< std::pair< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>, NatureOfField > >::const_iterator it=_arrs.begin();it!=_arrs.end();it++)
+ for(std::vector< std::pair< MCAuto<DataArrayDouble>, NatureOfField > >::const_iterator it=_arrs.begin();it!=_arrs.end();it++)
{
const DataArrayDouble *pt((*it).first);
if(pt)
bool DataArrayDoubleCollection::IsConservativeNature(NatureOfField n)
{
CheckValidNature(n);
- return n==RevIntegral || n==IntegralGlobConstraint;
+ return n==IntensiveConservation || n==ExtensiveConservation;
}
void DataArrayDoubleCollection::CheckSameNatures(NatureOfField n1, NatureOfField n2)
void DataArrayDoubleCollection::CheckValidNature(NatureOfField n)
{
- if(n!=ConservativeVolumic && n!=Integral && n!=IntegralGlobConstraint && n!=RevIntegral)
+ if(n!=IntensiveMaximum && n!=ExtensiveMaximum && n!=ExtensiveConservation && n!=IntensiveConservation)
throw INTERP_KERNEL::Exception("DataArrayDoubleCollection::CheckValidNature : unrecognized nature !");
}
return new MEDCouplingGridCollection(ms,fieldNames);
}
-MEDCouplingGridCollection *MEDCouplingGridCollection::deepCpy(const MEDCouplingCartesianAMRMeshGen *newGf, const MEDCouplingCartesianAMRMeshGen *oldGf) const
+MEDCouplingGridCollection *MEDCouplingGridCollection::deepCopy(const MEDCouplingCartesianAMRMeshGen *newGf, const MEDCouplingCartesianAMRMeshGen *oldGf) const
{
return new MEDCouplingGridCollection(*this,newGf,oldGf);
}
void MEDCouplingGridCollection::alloc(int ghostLev)
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
{
int nbTuples((*it).first->getNumberOfCellsAtCurrentLevelGhost(ghostLev));
DataArrayDoubleCollection *dadc((*it).second);
void MEDCouplingGridCollection::dealloc()
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
{
DataArrayDoubleCollection *dadc((*it).second);
if(dadc)
void MEDCouplingGridCollection::spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames)
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
(*it).second->spillInfoOnComponents(compNames);
}
void MEDCouplingGridCollection::spillNatures(const std::vector<NatureOfField>& nfs)
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
(*it).second->spillNatures(nfs);
}
bool MEDCouplingGridCollection::presenceOf(const MEDCouplingCartesianAMRMeshGen *m, int& pos) const
{
int ret(0);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++,ret++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++,ret++)
{
if((*it).first==m)
{
*/
void MEDCouplingGridCollection::copyOverlappedZoneFrom(int ghostLev, const MEDCouplingGridCollection& other)
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
{
std::vector<int> deltaThis,deltaOther;
std::vector< std::pair<int,int> > rgThis((*it).first->positionRelativeToGodFather(deltaThis));
std::vector<int> thisSt((*it).first->getImageMesh()->getCellGridStructure());
std::transform(thisSt.begin(),thisSt.end(),thisSt.begin(),std::bind2nd(std::plus<int>(),2*ghostLev));
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it2=other._map_of_dadc.begin();it2!=other._map_of_dadc.end();it2++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it2=other._map_of_dadc.begin();it2!=other._map_of_dadc.end();it2++)
{
std::vector< std::pair<int,int> > rgOther((*it2).first->positionRelativeToGodFather(deltaOther));
if(MEDCouplingStructuredMesh::AreRangesIntersect(rgThis,rgOther))
{
const DataArrayDouble *otherArr((*it2).second->at(i));
DataArrayDouble *thisArr((*it).second->at(i));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> partOfOther(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(otherSt,otherArr,pOther));
+ MCAuto<DataArrayDouble> partOfOther(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(otherSt,otherArr,pOther));
MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(thisSt,thisArr,pThis,partOfOther);
}
}
{
if(!fine || !coarse)
throw INTERP_KERNEL::Exception("MEDCouplingGridCollection::SynchronizeFineToCoarse : one or more input pointer is NULL !");
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it0=mc.begin();it0!=mc.end() && !found;it0++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it0=mc.begin();it0!=mc.end() && !found;it0++)
{
if((*it0).first==fatherOfFineMesh)
{
{
if(!fine || !coarse)
throw INTERP_KERNEL::Exception("MEDCouplingGridCollection::SynchronizeCoarseToFine : one or more input pointer is NULL !");
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it0=mc.begin();it0!=mc.end() && !found;it0++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it0=mc.begin();it0!=mc.end() && !found;it0++)
{
if((*it0).first==fatherOfFineMesh)
{
{
std::vector< std::pair<const MEDCouplingCartesianAMRPatch *,const MEDCouplingCartesianAMRPatch *> > ret;
std::map<const MEDCouplingCartesianAMRMeshGen *,std::vector< const MEDCouplingCartesianAMRMeshGen * > > m;
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
{
if(!fine || !coarse)
throw INTERP_KERNEL::Exception("MEDCouplingGridCollection::SynchronizeCoarseToFineOnlyInGhostZone : one or more input pointer is NULL !");
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
- const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mf(fine->_map_of_dadc);
+ const std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >& mc(coarse->_map_of_dadc);
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=mf.begin();it!=mf.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *fineMesh((*it).first);
const MEDCouplingCartesianAMRMeshGen *fatherOfFineMesh(fineMesh->getFather());
bool found(false);
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it0=mc.begin();it0!=mc.end() && !found;it0++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it0=mc.begin();it0!=mc.end() && !found;it0++)
{
if((*it0).first==fatherOfFineMesh)
{
void MEDCouplingGridCollection::fillIfInTheProgenyOf(const std::string& fieldName, const MEDCouplingCartesianAMRMeshGen *head, std::vector<const DataArrayDouble *>& recurseArrs) const
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *a((*it).first);
if(head==a || head->isObjectInTheProgeny(a))
_map_of_dadc[i].first=newGf->getMeshAtPosition(pos);
const DataArrayDoubleCollection *dac(other._map_of_dadc[i].second);
if(dac)
- _map_of_dadc[i].second=dac->deepCpy();
+ _map_of_dadc[i].second=dac->deepCopy();
}
}
std::size_t MEDCouplingGridCollection::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDCouplingGridCollection));
- ret+=_map_of_dadc.capacity()*sizeof(std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> >);
+ ret+=_map_of_dadc.capacity()*sizeof(std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> >);
return ret;
}
std::vector<const BigMemoryObject *> MEDCouplingGridCollection::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
ret.push_back((const DataArrayDoubleCollection *)(*it).second);
return ret;
}
void MEDCouplingGridCollection::updateTime() const
{
- for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
+ for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
{
const MEDCouplingCartesianAMRMeshGen *a((*it).first);
if(a)
{
const MEDCouplingCartesianAMRMesh *gf(other._gf);
if(gf)
- _gf=gf->deepCpy(0);
+ _gf=gf->deepCopy(0);
_tlc.keepTrackOfNewTL(_gf);
}
}
fieldNames2[i].second=(int)fieldNames[i].second.size();
compNames[i]=fieldNames[i].second;
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingAMRAttribute> ret(New(gf,fieldNames2,ghostLev));
+ MCAuto<MEDCouplingAMRAttribute> ret(New(gf,fieldNames2,ghostLev));
ret->spillInfoOnComponents(compNames);
return ret.retn();
}
void MEDCouplingAMRAttribute::spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames)
{
_tlc.checkConst();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
(*it)->spillInfoOnComponents(compNames);
}
void MEDCouplingAMRAttribute::spillNatures(const std::vector<NatureOfField>& nfs)
{
_tlc.checkConst();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
(*it)->spillNatures(nfs);
}
-MEDCouplingAMRAttribute *MEDCouplingAMRAttribute::deepCpy() const
+MEDCouplingAMRAttribute *MEDCouplingAMRAttribute::deepCopy() const
{
return new MEDCouplingAMRAttribute(*this,true);
}
*/
std::vector<DataArrayDouble *> MEDCouplingAMRAttribute::retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
{
int tmp(-1);
if((*it)->presenceOf(mesh,tmp))
*/
const DataArrayDouble *MEDCouplingAMRAttribute::getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
{
int tmp(-1);
if((*it)->presenceOf(mesh,tmp))
DataArrayDouble *MEDCouplingAMRAttribute::getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
{
int tmp(-1);
if((*it)->presenceOf(mesh,tmp))
{
std::vector<const DataArrayDouble *> recurseArrs;
std::size_t lev(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++,lev++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++,lev++)
{
int tmp(-1);
if((*it)->presenceOf(mesh,tmp))
MEDCouplingFieldDouble *MEDCouplingAMRAttribute::buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
const DataArrayDouble *arr(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
{
int tmp(-1);
if((*it)->presenceOf(mesh,tmp))
}
if(!arr)
throw INTERP_KERNEL::Exception("MEDCouplingAMRAttribute::buildCellFieldOnWithGhost : the mesh specified is not in the progeny of this !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
+ MCAuto<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
ret->setMesh(im);
ret->setArray(const_cast<DataArrayDouble *>(arr));
ret->setName(arr->getName());
MEDCouplingFieldDouble *MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const
{
const DataArrayDouble *arr(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
{
int tmp(-1);
if((*it)->presenceOf(mesh,tmp))
if(!arr)
throw INTERP_KERNEL::Exception("MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost : the mesh specified is not in the progeny of this !");
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
+ MCAuto<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
std::vector<int> cgs(mesh->getImageMesh()->getCellGridStructure()),cgsWG(im->getCellGridStructure());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> arr2(DataArrayDouble::New());
arr2->alloc(mesh->getImageMesh()->getNumberOfCells(),arr->getNumberOfComponents());
std::vector< std::pair<int,int> > cgs2(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(cgs));
MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(cgs2,_ghost_lev);
MEDCouplingIMesh::SpreadCoarseToFine(arr,cgsWG,arr2,cgs2,fakeFactors);
arr2->copyStringInfoFrom(*arr);
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
ret->setMesh(mesh->getImageMesh());
ret->setArray(arr2);
ret->setName(arr->getName());
{
std::vector<MEDCouplingCartesianAMRPatchGen *> patches(gf->retrieveGridsAt(i));
std::size_t sz(patches.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatchGen> > patchesSafe(sz);
+ std::vector< MCAuto<MEDCouplingCartesianAMRPatchGen> > patchesSafe(sz);
for(std::size_t j=0;j<sz;j++)
patchesSafe[j]=patches[j];
if(sz==0)
const DataArrayDoubleCollection& ddc(_levs[i]->getFieldsAt(tmp));
std::vector<DataArrayDouble *> arrs(ddc.retrieveFields());
std::size_t nbFields(arrs.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrsSafe(nbFields),arrs2Safe(nbFields);
+ std::vector< MCAuto<DataArrayDouble> > arrsSafe(nbFields),arrs2Safe(nbFields);
std::vector< const MEDCouplingFieldDouble *> fields(nbFields);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> > fieldsSafe(nbFields);
+ std::vector< MCAuto<MEDCouplingFieldDouble> > fieldsSafe(nbFields);
for(std::size_t pp=0;pp<nbFields;pp++)
arrsSafe[pp]=arrs[pp];
for(std::size_t pp=0;pp<nbFields;pp++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
+ MCAuto<MEDCouplingIMesh> im(mesh->getImageMesh()->buildWithGhost(_ghost_lev));
std::vector<int> cgs(mesh->getImageMesh()->getCellGridStructure()),cgsWG(im->getCellGridStructure());
arrs2Safe[pp]=DataArrayDouble::New();
arrs2Safe[pp]->alloc(mesh->getImageMesh()->getNumberOfCells(),arrs[pp]->getNumberOfComponents());
if(!lev0)
throw INTERP_KERNEL::Exception("MEDCouplingAMRAttribute::projectTo : lev0 is NULL !");
std::vector< std::pair < std::string, std::vector<std::string> > > fieldNames(lev0->getInfoOnComponents());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingAMRAttribute> ret(MEDCouplingAMRAttribute::New(targetGF,fieldNames,_ghost_lev));
+ MCAuto<MEDCouplingAMRAttribute> ret(MEDCouplingAMRAttribute::New(targetGF,fieldNames,_ghost_lev));
ret->spillNatures(lev0->getNatures());
ret->alloc();
int nbLevs(getNumberOfLevels());
void MEDCouplingAMRAttribute::alloc()
{
_tlc.resetState();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
{
MEDCouplingGridCollection *elt(*it);
if(elt)
void MEDCouplingAMRAttribute::dealloc()
{
_tlc.checkConst();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::iterator it=_levs.begin();it!=_levs.end();it++)
{
MEDCouplingGridCollection *elt(*it);
if(elt)
std::size_t MEDCouplingAMRAttribute::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDCouplingAMRAttribute));
- ret+=_levs.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection>);
+ ret+=_levs.capacity()*sizeof(MCAuto<MEDCouplingGridCollection>);
return ret;
}
std::vector<const BigMemoryObject *> MEDCouplingAMRAttribute::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
ret.push_back((const MEDCouplingGridCollection *)*it);
return ret;
}
{
std::vector<MEDCouplingCartesianAMRPatchGen *> patches(gf->retrieveGridsAt(i));
std::size_t sz(patches.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatchGen> > patchesSafe(patches.size());
+ std::vector< MCAuto<MEDCouplingCartesianAMRPatchGen> > patchesSafe(patches.size());
for(std::size_t j=0;j<sz;j++)
patchesSafe[j]=patches[j];
std::vector<const MEDCouplingCartesianAMRMeshGen *> ms(sz);
const MEDCouplingGridCollection *elt(other._levs[i]);
if(elt)
{
- _levs[i]=other._levs[i]->deepCpy(_gf,other._gf);
+ _levs[i]=other._levs[i]->deepCopy(_gf,other._gf);
}
}
//_cross_lev_neighbors(other._cross_lev_neighbors)
const DataArrayDoubleCollection& MEDCouplingAMRAttribute::findCollectionAttachedTo(const MEDCouplingCartesianAMRMeshGen *m) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
{
const MEDCouplingGridCollection *elt(*it);
if(elt)
#include "MEDCouplingNatureOfFieldEnum"
#include "MEDCouplingCartesianAMRMesh.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/// @cond INTERNAL
class DataArrayDoubleCollection : public RefCountObject, public TimeLabel
{
public:
static DataArrayDoubleCollection *New(const std::vector< std::pair<std::string,int> >& fieldNames);
- DataArrayDoubleCollection *deepCpy() const;
+ DataArrayDoubleCollection *deepCopy() const;
void allocTuples(int nbOfTuples);
void dellocTuples();
void copyFrom(const DataArrayDoubleCollection& other);
static void CheckSameNatures(NatureOfField n1, NatureOfField n2);
static void CheckValidNature(NatureOfField n);
private:
- std::vector< std::pair< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>, NatureOfField > > _arrs;
+ std::vector< std::pair< MCAuto<DataArrayDouble>, NatureOfField > > _arrs;
};
class MEDCouplingGridCollection : public RefCountObject, public TimeLabel
{
public:
static MEDCouplingGridCollection *New(const std::vector<const MEDCouplingCartesianAMRMeshGen *>& ms, const std::vector< std::pair<std::string,int> >& fieldNames);
- MEDCouplingGridCollection *deepCpy(const MEDCouplingCartesianAMRMeshGen *newGf, const MEDCouplingCartesianAMRMeshGen *oldGf) const;
+ MEDCouplingGridCollection *deepCopy(const MEDCouplingCartesianAMRMeshGen *newGf, const MEDCouplingCartesianAMRMeshGen *oldGf) const;
void alloc(int ghostLev);
void dealloc();
void spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames);
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
void updateTime() const;
private:
- std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > > _map_of_dadc;
+ std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MCAuto<DataArrayDoubleCollection> > > _map_of_dadc;
};
/// @endcond
virtual bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
MEDCouplingDataForGodFather(const MEDCouplingDataForGodFather& other, bool deepCpyGF);
protected:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRMesh> _gf;
+ MCAuto<MEDCouplingCartesianAMRMesh> _gf;
TimeLabelConstOverseer _tlc;
};
MEDCOUPLING_EXPORT static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, const std::vector< std::pair<std::string, std::vector<std::string> > >& fieldNames, int ghostLev);
MEDCOUPLING_EXPORT void spillInfoOnComponents(const std::vector< std::vector<std::string> >& compNames);
MEDCOUPLING_EXPORT void spillNatures(const std::vector<NatureOfField>& nfs);
- MEDCOUPLING_EXPORT MEDCouplingAMRAttribute *deepCpy() const;
+ MEDCOUPLING_EXPORT MEDCouplingAMRAttribute *deepCopy() const;
MEDCOUPLING_EXPORT MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const;
MEDCOUPLING_EXPORT int getNumberOfLevels() const;
MEDCOUPLING_EXPORT std::vector<DataArrayDouble *> retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const;
void synchronizeCoarseToFineByOneLevel(int level);
private:
int _ghost_lev;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> > _levs;
+ std::vector< MCAuto<MEDCouplingGridCollection> > _levs;
std::vector< std::vector< std::pair<const MEDCouplingCartesianAMRPatch *,const MEDCouplingCartesianAMRPatch *> > > _neighbors;
std::vector< std::pair<const MEDCouplingCartesianAMRPatch *,const MEDCouplingCartesianAMRPatch *> > _mixed_lev_neighbors;
std::vector< std::vector< std::pair<const MEDCouplingCartesianAMRPatch *,const MEDCouplingCartesianAMRPatch *> > > _cross_lev_neighbors;
+++ /dev/null
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Anthony Geay (CEA/DEN)
-
-#ifndef __PARAMEDMEM_MEDCOUPLINGAUTOREFCOUNTOBJECTPTR_HXX__
-#define __PARAMEDMEM_MEDCOUPLINGAUTOREFCOUNTOBJECTPTR_HXX__
-
-#include "MEDCouplingRefCountObject.hxx"
-#include "InterpKernelException.hxx"
-
-namespace ParaMEDMEM
-{
- template<class T>
- class MEDCouplingAutoRefCountObjectPtr
- {
- public:
- MEDCouplingAutoRefCountObjectPtr(const MEDCouplingAutoRefCountObjectPtr& other):_ptr(0) { referPtr(other._ptr); }
- MEDCouplingAutoRefCountObjectPtr(T *ptr=0):_ptr(ptr) { }
- ~MEDCouplingAutoRefCountObjectPtr() { destroyPtr(); }
- bool operator==(const MEDCouplingAutoRefCountObjectPtr& other) const { return _ptr==other._ptr; }
- bool operator==(const T *other) const { return _ptr==other; }
- MEDCouplingAutoRefCountObjectPtr &operator=(const MEDCouplingAutoRefCountObjectPtr& other) { if(_ptr!=other._ptr) { destroyPtr(); referPtr(other._ptr); } return *this; }
- MEDCouplingAutoRefCountObjectPtr &operator=(T *ptr) { if(_ptr!=ptr) { destroyPtr(); _ptr=ptr; } return *this; }
- T *operator->() { return _ptr ; }
- const T *operator->() const { return _ptr; }
- T& operator*() { return *_ptr; }
- const T& operator*() const { return *_ptr; }
- operator T *() { return _ptr; }
- operator const T *() const { return _ptr; }
- T *retn() { if(_ptr) _ptr->incrRef(); return _ptr; }
- private:
- void referPtr(T *ptr) { _ptr=ptr; if(_ptr) _ptr->incrRef(); }
- void destroyPtr() { if(_ptr) _ptr->decrRef(); }
- private:
- T *_ptr;
- };
-
- template<class T, class U>
- typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<U> DynamicCast(typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<T>& autoSubPtr) throw()
- {
- T *subPtr(autoSubPtr);
- U *ptr(dynamic_cast<U *>(subPtr));
- typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<U> ret(ptr);
- if(ptr)
- ptr->incrRef();
- return ret;
- }
-
- template<class T, class U>
- typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<U> DynamicCastSafe(typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<T>& autoSubPtr)
- {
- T *subPtr(autoSubPtr);
- U *ptr(dynamic_cast<U *>(subPtr));
- if(subPtr && !ptr)
- throw INTERP_KERNEL::Exception("DynamicCastSafe : U is not a subtype of T !");
- typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<U> ret(ptr);
- if(ptr)
- ptr->incrRef();
- return ret;
- }
-}
-
-#endif
#include <sstream>
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingCMesh::MEDCouplingCMesh():_x_array(0),_y_array(0),_z_array(0)
{
if(deepCopy)
{
if(other._x_array)
- _x_array=other._x_array->deepCpy();
+ _x_array=other._x_array->deepCopy();
else
_x_array=0;
if(other._y_array)
- _y_array=other._y_array->deepCpy();
+ _y_array=other._y_array->deepCopy();
else
_y_array=0;
if(other._z_array)
- _z_array=other._z_array->deepCpy();
+ _z_array=other._z_array->deepCopy();
else
_z_array=0;
}
return ret;
}
-MEDCouplingCMesh *MEDCouplingCMesh::deepCpy() const
+MEDCouplingCMesh *MEDCouplingCMesh::deepCopy() const
{
return clone(true);
}
MEDCouplingCurveLinearMesh *MEDCouplingCMesh::buildCurveLinear() const
{
- checkCoherency();
+ checkConsistencyLight();
int dim(getSpaceDimension());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> ret(MEDCouplingCurveLinearMesh::New());
+ MCAuto<MEDCouplingCurveLinearMesh> ret(MEDCouplingCurveLinearMesh::New());
ret->MEDCouplingStructuredMesh::operator=(*this);
INTERP_KERNEL::AutoPtr<int> ngs(new int[dim]);
getNodeGridStructure(ngs);
ret->setNodeGridStructure(ngs,ngs+dim);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(getCoordinatesAndOwner());
+ MCAuto<DataArrayDouble> coo(getCoordinatesAndOwner());
ret->setCoords(coo);
return ret.retn();
}
}
/*!
- * Nothing is done here (except to check that the other is a ParaMEDMEM::MEDCouplingCMesh instance too).
- * The user intend that the nodes are the same, so by construction of ParaMEDMEM::MEDCouplingCMesh, \a this and \a other are the same !
+ * Nothing is done here (except to check that the other is a MEDCoupling::MEDCouplingCMesh instance too).
+ * The user intend that the nodes are the same, so by construction of MEDCoupling::MEDCouplingCMesh, \a this and \a other are the same !
*/
void MEDCouplingCMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
DataArrayInt *&cellCor) const
throw INTERP_KERNEL::Exception("MEDCouplingCMesh::checkDeepEquivalOnSameNodesWith : Meshes are not the same !");
}
-void MEDCouplingCMesh::checkCoherency() const
+void MEDCouplingCMesh::checkConsistencyLight() const
{
const char msg0[]="Invalid ";
const char msg1[]=" array ! Must contain more than 1 element.";
}
}
-void MEDCouplingCMesh::checkCoherency1(double eps) const
+void MEDCouplingCMesh::checkConsistency(double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
if(_x_array)
_x_array->checkMonotonic(true, eps);
if(_y_array)
MEDCouplingStructuredMesh *MEDCouplingCMesh::buildStructuredSubPart(const std::vector< std::pair<int,int> >& cellPart) const
{
- checkCoherency();
+ checkConsistencyLight();
int dim(getSpaceDimension());
if(dim!=(int)cellPart.size())
{
std::ostringstream oss; oss << "MEDCouplingCMesh::buildStructuredSubPart : the space dimension is " << dim << " and cell part size is " << cellPart.size() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> ret(dynamic_cast<MEDCouplingCMesh *>(deepCpy()));
+ MCAuto<MEDCouplingCMesh> ret(dynamic_cast<MEDCouplingCMesh *>(deepCopy()));
for(int i=0;i<dim;i++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp(ret->getCoordsAt(i)->selectByTupleId2(cellPart[i].first,cellPart[i].second+1,1));
+ MCAuto<DataArrayDouble> tmp(ret->getCoordsAt(i)->selectByTupleIdSafeSlice(cellPart[i].first,cellPart[i].second+1,1));
ret->setCoordsAt(i,tmp);
}
return ret.retn();
*/
DataArrayDouble *MEDCouplingCMesh::getCoordinatesAndOwner() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
int spaceDim(getSpaceDimension()),nbNodes(getNumberOfNodes());
ret->alloc(nbNodes,spaceDim);
double *pt(ret->getPointer());
* components. The caller is to delete this array using decrRef() as it is
* no more needed.
*/
-DataArrayDouble *MEDCouplingCMesh::getBarycenterAndOwner() const
+DataArrayDouble *MEDCouplingCMesh::computeCellCenterOfMass() const
{
DataArrayDouble *ret=DataArrayDouble::New();
int spaceDim=getSpaceDimension();
DataArrayDouble *MEDCouplingCMesh::computeIsoBarycenterOfNodesPerCell() const
{
- return MEDCouplingCMesh::getBarycenterAndOwner();
+ return MEDCouplingCMesh::computeCellCenterOfMass();
}
void MEDCouplingCMesh::renumberCells(const int *old2NewBg, bool check)
thisArr[i]->writeVTK(ofs,8,"Array",byteData);
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo=DataArrayDouble::New(); coo->alloc(1,1);
+ MCAuto<DataArrayDouble> coo=DataArrayDouble::New(); coo->alloc(1,1);
coo->setIJ(0,0,0.);
coo->writeVTK(ofs,8,"Array",byteData);
}
#include "MEDCoupling.hxx"
#include "MEDCouplingStructuredMesh.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingCurveLinearMesh;
public:
MEDCOUPLING_EXPORT static MEDCouplingCMesh *New();
MEDCOUPLING_EXPORT static MEDCouplingCMesh *New(const std::string& meshName);
- MEDCOUPLING_EXPORT MEDCouplingCMesh *deepCpy() const;
+ MEDCOUPLING_EXPORT MEDCouplingCMesh *deepCopy() const;
MEDCOUPLING_EXPORT MEDCouplingCMesh *clone(bool recDeepCpy) const;
MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *buildCurveLinear() const;
MEDCOUPLING_EXPORT void updateTime() const;
DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const;
MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
DataArrayInt *&cellCor) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
MEDCOUPLING_EXPORT int getSpaceDimension() const;
MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT void scale(const double *point, double factor);
MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
MEDCOUPLING_EXPORT DataArrayDouble *getCoordinatesAndOwner() const;
- MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true);
//some useful methods
MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
private:
MEDCouplingCMesh();
- MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy);
+ MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCopy);
~MEDCouplingCMesh();
void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
std::string getVTKDataSetType() const;
#include <sstream>
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/// @cond INTERNAL
{
const MEDCouplingCartesianAMRMeshGen *mesh(other._mesh);
if(mesh)
- _mesh=mesh->deepCpy(father);
+ _mesh=mesh->deepCopy(father);
}
const MEDCouplingCartesianAMRMeshGen *MEDCouplingCartesianAMRPatchGen::getMeshSafe() const
throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRPatch constructor : space dimension of father and input bottomLeft/topRight size mismatches !");
}
-MEDCouplingCartesianAMRPatch *MEDCouplingCartesianAMRPatch::deepCpy(MEDCouplingCartesianAMRMeshGen *father) const
+MEDCouplingCartesianAMRPatch *MEDCouplingCartesianAMRPatch::deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
{
return new MEDCouplingCartesianAMRPatch(*this,father);
}
std::vector< std::pair<int,int> > p2RefinedAbs(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(dimsP2NotRefined));
std::vector<int> dimsP2RefinedGhost(dimsP2Refined.size());
std::transform(dimsP2Refined.begin(),dimsP2Refined.end(),dimsP2RefinedGhost.begin(),std::bind2nd(std::plus<int>(),2*ghostLev));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> fineP2(DataArrayDouble::New()); fineP2->alloc(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(dimsP2RefinedGhost),dataOnP2->getNumberOfComponents());
+ MCAuto<DataArrayDouble> fineP2(DataArrayDouble::New()); fineP2->alloc(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(dimsP2RefinedGhost),dataOnP2->getNumberOfComponents());
MEDCouplingIMesh::SpreadCoarseToFineGhost(dataOnP2,dimsP2NotRefined,fineP2,p2RefinedAbs,factors,ghostLev);
if(isConservative)
{
ApplyFactorsOnCompactFrmt(dimsFine,factors);
ApplyAllGhostOnCompactFrmt(dimsFine,ghostLev);
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ghostVals(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(dimsFine),dataOnP2,tmp2));
+ MCAuto<DataArrayDouble> ghostVals(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(dimsFine),dataOnP2,tmp2));
MEDCouplingIMesh::CondenseFineToCoarse(dimsCoarse,ghostVals,interstRange,fakeFactors,dataOnP1);
}
{
}
-MEDCouplingCartesianAMRPatchGF *MEDCouplingCartesianAMRPatchGF::deepCpy(MEDCouplingCartesianAMRMeshGen *father) const
+MEDCouplingCartesianAMRPatchGF *MEDCouplingCartesianAMRPatchGF::deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
{
return new MEDCouplingCartesianAMRPatchGF(*this,father);
}
int MEDCouplingCartesianAMRMeshGen::getMaxNumberOfLevelsRelativeToThis() const
{
int ret(1);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
ret=std::max(ret,(*it)->getMaxNumberOfLevelsRelativeToThis()+1);
return ret;
}
*/
int MEDCouplingCartesianAMRMeshGen::getNumberOfCellsAtCurrentLevelGhost(int ghostLev) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> tmp(_mesh->buildWithGhost(ghostLev));
+ MCAuto<MEDCouplingIMesh> tmp(_mesh->buildWithGhost(ghostLev));
return tmp->getNumberOfCells();
}
int MEDCouplingCartesianAMRMeshGen::getNumberOfCellsRecursiveWithOverlap() const
{
int ret(_mesh->getNumberOfCells());
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
ret+=(*it)->getNumberOfCellsRecursiveWithOverlap();
}
int MEDCouplingCartesianAMRMeshGen::getNumberOfCellsRecursiveWithoutOverlap() const
{
int ret(_mesh->getNumberOfCells());
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
ret-=(*it)->getNumberOfOverlapedCellsForFather();
ret+=(*it)->getNumberOfCellsRecursiveWithoutOverlap();
void MEDCouplingCartesianAMRMeshGen::addPatch(const std::vector< std::pair<int,int> >& bottomLeftTopRight, const std::vector<int>& factors)
{
checkFactorsAndIfNotSetAssign(factors);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> mesh(static_cast<MEDCouplingIMesh *>(_mesh->buildStructuredSubPart(bottomLeftTopRight)));
+ MCAuto<MEDCouplingIMesh> mesh(static_cast<MEDCouplingIMesh *>(_mesh->buildStructuredSubPart(bottomLeftTopRight)));
mesh->refineWithFactor(factors);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRMeshSub> zeMesh(new MEDCouplingCartesianAMRMeshSub(this,mesh));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> elt(new MEDCouplingCartesianAMRPatch(zeMesh,bottomLeftTopRight));
+ MCAuto<MEDCouplingCartesianAMRMeshSub> zeMesh(new MEDCouplingCartesianAMRMeshSub(this,mesh));
+ MCAuto<MEDCouplingCartesianAMRPatch> elt(new MEDCouplingCartesianAMRPatch(zeMesh,bottomLeftTopRight));
_patches.push_back(elt);
declareAsNew();
}
double getEfficiencyPerAxis(int axisId) const { return (double)_nb_of_true/((double)(_part[axisId].second-_part[axisId].first)); }
void zipToFitOnCriterion(int minPatchLgth);
void updateNumberOfTrue() const;
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> extractPart(const std::vector< std::pair<int,int> >&partInGlobal) const;
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> deepCpy() const;
+ MCAuto<InternalPatch> extractPart(const std::vector< std::pair<int,int> >&partInGlobal) const;
+ MCAuto<InternalPatch> deepCopy() const;
protected:
~InternalPatch() { }
private:
_nb_of_true=(int)std::count(_crit.begin(),_crit.end(),true);
}
-MEDCouplingAutoRefCountObjectPtr<InternalPatch> InternalPatch::extractPart(const std::vector< std::pair<int,int> >&partInGlobal) const
+MCAuto<InternalPatch> InternalPatch::extractPart(const std::vector< std::pair<int,int> >&partInGlobal) const
{
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> ret(new InternalPatch);
+ MCAuto<InternalPatch> ret(new InternalPatch);
std::vector<int> cgs(computeCGS());
std::vector< std::pair<int,int> > newPart;
MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt(_part,partInGlobal,newPart);
return ret;
}
-MEDCouplingAutoRefCountObjectPtr<InternalPatch> InternalPatch::deepCpy() const
+MCAuto<InternalPatch> InternalPatch::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> ret(new InternalPatch);
+ MCAuto<InternalPatch> ret(new InternalPatch);
(*ret)=*this;
return ret;
}
rectH[axisId].second=patchToBeSplit->getConstPart()[axisId].first+i;
else
rectH[axisId].first=patchToBeSplit->getConstPart()[axisId].first+i;
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> p(patchToBeSplit->deepCpy());
+ MCAuto<InternalPatch> p(patchToBeSplit->deepCopy());
p->zipToFitOnCriterion(bso.getMinimumPatchLength());
efficiencyPerAxis[h]=p->getEfficiencyPerAxis(axisId);
}
return true;
}
-MEDCouplingAutoRefCountObjectPtr<InternalPatch> DealWithNoCut(const InternalPatch *patch)
+MCAuto<InternalPatch> DealWithNoCut(const InternalPatch *patch)
{
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> ret(const_cast<InternalPatch *>(patch));
+ MCAuto<InternalPatch> ret(const_cast<InternalPatch *>(patch));
ret->incrRef();
return ret;
}
-void DealWithCut(double minPatchLgth, const InternalPatch *patchToBeSplit, int axisId, int cutPlace, std::vector<MEDCouplingAutoRefCountObjectPtr<InternalPatch> >& listOfPatches)
+void DealWithCut(double minPatchLgth, const InternalPatch *patchToBeSplit, int axisId, int cutPlace, std::vector<MCAuto<InternalPatch> >& listOfPatches)
{
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> leftPart,rightPart;
+ MCAuto<InternalPatch> leftPart,rightPart;
std::vector< std::pair<int,int> > rect(patchToBeSplit->getConstPart());
std::vector< std::pair<int,int> > leftRect(rect),rightRect(rect);
leftRect[axisId].second=cutPlace+1;
{
checkPatchId(patchId);
int sz((int)_patches.size()),j(0);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> > patches(sz-1);
+ std::vector< MCAuto<MEDCouplingCartesianAMRPatch> > patches(sz-1);
for(int i=0;i<sz;i++)
if(i!=patchId)
patches[j++]=_patches[i];
throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion : the number of tuples of criterion array must be equal to the number of cells at the current level !");
_patches.clear();
std::vector<int> cgs(_mesh->getCellGridStructure());
- std::vector< MEDCouplingAutoRefCountObjectPtr<InternalPatch> > listOfPatches,listOfPatchesOK;
+ std::vector< MCAuto<InternalPatch> > listOfPatches,listOfPatchesOK;
//
- MEDCouplingAutoRefCountObjectPtr<InternalPatch> p(new InternalPatch);
+ MCAuto<InternalPatch> p(new InternalPatch);
p->setNumberOfTrue(MEDCouplingStructuredMesh::FindMinimalPartOf(bso.getMinimumPatchLength(),cgs,criterion,p->getCriterion(),p->getPart()));
if(p->presenceOfTrue())
listOfPatches.push_back(p);
while(!listOfPatches.empty())
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<InternalPatch> > listOfPatchesTmp;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<InternalPatch> >::iterator it=listOfPatches.begin();it!=listOfPatches.end();it++)
+ std::vector< MCAuto<InternalPatch> > listOfPatchesTmp;
+ for(std::vector< MCAuto<InternalPatch> >::iterator it=listOfPatches.begin();it!=listOfPatches.end();it++)
{
//
int axisId,largestLength,cutPlace;
}
listOfPatches=listOfPatchesTmp;
}
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<InternalPatch> >::const_iterator it=listOfPatchesOK.begin();it!=listOfPatchesOK.end();it++)
+ for(std::vector< MCAuto<InternalPatch> >::const_iterator it=listOfPatchesOK.begin();it!=listOfPatchesOK.end();it++)
addPatch((*it)->getConstPart(),factors);
declareAsNew();
}
int MEDCouplingCartesianAMRMeshGen::getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const
{
int ret(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++,ret++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++,ret++)
{
if((*it)->getMesh()==mesh)
return ret;
throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRMesh::createCellFieldOnPatch : the input cell field array is NULL or not allocated !");
const MEDCouplingCartesianAMRPatch *patch(getPatch(patchId));
const MEDCouplingIMesh *fine(patch->getMesh()->getImageMesh());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(fine->getNumberOfCells(),cellFieldOnThis->getNumberOfComponents());
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(fine->getNumberOfCells(),cellFieldOnThis->getNumberOfComponents());
ret->copyStringInfoFrom(*cellFieldOnThis);
MEDCouplingIMesh::SpreadCoarseToFine(cellFieldOnThis,_mesh->getCellGridStructure(),ret,patch->getBLTRRange(),getFactors());
return ret.retn();
DataArrayInt *MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const
{
int nbp(getNumberOfPatches());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
for(int i=0;i<nbp;i++)
{
if(i!=patchId)
MEDCouplingUMesh *MEDCouplingCartesianAMRMeshGen::buildUnstructured() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> part(_mesh->buildUnstructured());
+ MCAuto<MEDCouplingUMesh> part(_mesh->buildUnstructured());
std::vector<bool> bs(_mesh->getNumberOfCells(),false);
std::vector<int> cgs(_mesh->getCellGridStructure());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > msSafe(_patches.size()+1);
+ std::vector< MCAuto<MEDCouplingUMesh> > msSafe(_patches.size()+1);
std::size_t ii(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++,ii++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++,ii++)
{
MEDCouplingStructuredMesh::SwitchOnIdsFrom(cgs,(*it)->getBLTRRange(),bs);
msSafe[ii+1]=(*it)->getMesh()->buildUnstructured();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsOff(DataArrayInt::BuildListOfSwitchedOff(bs));
+ MCAuto<DataArrayInt> eltsOff(DataArrayInt::BuildListOfSwitchedOff(bs));
msSafe[0]=static_cast<MEDCouplingUMesh *>(part->buildPartOfMySelf(eltsOff->begin(),eltsOff->end(),false));
std::vector< const MEDCouplingUMesh * > ms(msSafe.size());
for(std::size_t i=0;i<msSafe.size();i++)
MEDCoupling1SGTUMesh *MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop() const
{
std::vector<const MEDCoupling1SGTUMesh *> cells;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> > cellsSafe;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ std::vector< MCAuto<MEDCoupling1SGTUMesh> > cellsSafe;
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
const MEDCouplingCartesianAMRPatch *patch(*it);
if(patch)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> cell(patch->getMesh()->getImageMesh()->asSingleCell());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> cell1SGT(cell->build1SGTUnstructured());
+ MCAuto<MEDCouplingIMesh> cell(patch->getMesh()->getImageMesh()->asSingleCell());
+ MCAuto<MEDCoupling1SGTUMesh> cell1SGT(cell->build1SGTUnstructured());
cellsSafe.push_back(cell1SGT); cells.push_back(cell1SGT);
}
}
MEDCoupling1SGTUMesh *MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly() const
{
std::vector<const MEDCoupling1SGTUMesh *> patches;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> > patchesSafe;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ std::vector< MCAuto<MEDCoupling1SGTUMesh> > patchesSafe;
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
const MEDCouplingCartesianAMRPatch *patch(*it);
if(patch)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> patchMesh(patch->getMesh()->getImageMesh()->build1SGTUnstructured());
+ MCAuto<MEDCoupling1SGTUMesh> patchMesh(patch->getMesh()->getImageMesh()->build1SGTUnstructured());
patchesSafe.push_back(patchMesh); patches.push_back(patchMesh);
}
}
//
std::vector<bool> bs(_mesh->getNumberOfCells(),false);
std::vector<int> cgs(_mesh->getCellGridStructure());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> > msSafe(_patches.size()+1);
+ std::vector< MCAuto<MEDCouplingFieldDouble> > msSafe(_patches.size()+1);
std::size_t ii(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++,ii++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++,ii++)
{
MEDCouplingStructuredMesh::SwitchOnIdsFrom(cgs,(*it)->getBLTRRange(),bs);
std::vector<const DataArrayDouble *> tmpArrs(extractSubTreeFromGlobalFlatten((*it)->getMesh(),recurseArrs));
msSafe[ii+1]=(*it)->getMesh()->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,tmpArrs);
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsOff(DataArrayInt::BuildListOfSwitchedOff(bs));
+ MCAuto<DataArrayInt> eltsOff(DataArrayInt::BuildListOfSwitchedOff(bs));
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2(extractGhostFrom(ghostSz,recurseArrs[0]));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS));
+ MCAuto<DataArrayDouble> arr2(extractGhostFrom(ghostSz,recurseArrs[0]));
arr2=arr2->selectByTupleIdSafe(eltsOff->begin(),eltsOff->end());
ret->setArray(arr2);
ret->setName(arr2->getName());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> part(_mesh->buildUnstructured());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> mesh(part->buildPartOfMySelf(eltsOff->begin(),eltsOff->end(),false));
+ MCAuto<MEDCouplingUMesh> part(_mesh->buildUnstructured());
+ MCAuto<MEDCouplingMesh> mesh(part->buildPartOfMySelf(eltsOff->begin(),eltsOff->end(),false));
ret->setMesh(mesh);
msSafe[0]=ret;
//
std::vector< std::pair<int,int> > p(MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(st));
std::transform(st.begin(),st.end(),st.begin(),std::bind2nd(std::plus<int>(),2*ghostSz));
MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(p,ghostSz);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,arr,p));
+ MCAuto<DataArrayDouble> ret(MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,arr,p));
return ret.retn();
}
{
const MEDCouplingIMesh *mesh(other._mesh);
if(mesh)
- _mesh=static_cast<MEDCouplingIMesh *>(mesh->deepCpy());
+ _mesh=static_cast<MEDCouplingIMesh *>(mesh->deepCopy());
std::size_t sz(other._patches.size());
for(std::size_t i=0;i<sz;i++)
{
const MEDCouplingCartesianAMRPatch *patch(other._patches[i]);
if(patch)
- _patches[i]=patch->deepCpy(this);
+ _patches[i]=patch->deepCopy(this);
}
}
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRMeshGen(MEDCouplingIMesh *mesh) constructor : The input mesh is null !");
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
_mesh=mesh; _mesh->incrRef();
}
}
}
-void MEDCouplingCartesianAMRMeshGen::retrieveGridsAtInternal(int lev, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatchGen> >& grids) const
+void MEDCouplingCartesianAMRMeshGen::retrieveGridsAtInternal(int lev, std::vector< MCAuto<MEDCouplingCartesianAMRPatchGen> >& grids) const
{
if(lev==0)
{
const MEDCouplingCartesianAMRMesh *thisc(dynamic_cast<const MEDCouplingCartesianAMRMesh *>(this));//tony
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatchGF> elt(new MEDCouplingCartesianAMRPatchGF(const_cast<MEDCouplingCartesianAMRMesh *>(thisc)));
+ MCAuto<MEDCouplingCartesianAMRPatchGF> elt(new MEDCouplingCartesianAMRPatchGF(const_cast<MEDCouplingCartesianAMRMesh *>(thisc)));
grids.push_back(DynamicCastSafe<MEDCouplingCartesianAMRPatchGF,MEDCouplingCartesianAMRPatchGen>(elt));
}
else if(lev==1)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
const MEDCouplingCartesianAMRPatch *pt(*it);
if(pt)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> tmp1(*it);
+ MCAuto<MEDCouplingCartesianAMRPatch> tmp1(*it);
grids.push_back(DynamicCastSafe<MEDCouplingCartesianAMRPatch,MEDCouplingCartesianAMRPatchGen>(tmp1));
}
}
}
else
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
const MEDCouplingCartesianAMRPatch *pt(*it);
if(pt)
void MEDCouplingCartesianAMRMeshGen::dumpPatchesOf(const std::string& varName, std::ostream& oss) const
{
std::size_t j(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
const MEDCouplingCartesianAMRPatch *patch(*it);
if(patch)
{
std::vector<const BigMemoryObject *> ret;
ret.push_back((const MEDCouplingIMesh *)_mesh);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
ret.push_back((const MEDCouplingCartesianAMRPatch*)*it);
return ret;
}
{
if((const MEDCouplingIMesh *)_mesh)
updateTimeWith(*_mesh);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
+ for(std::vector< MCAuto<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
{
const MEDCouplingCartesianAMRPatch *elt(*it);
if(!elt)
{
}
-MEDCouplingCartesianAMRMeshSub *MEDCouplingCartesianAMRMeshSub::deepCpy(MEDCouplingCartesianAMRMeshGen *fath) const
+MEDCouplingCartesianAMRMeshSub *MEDCouplingCartesianAMRMeshSub::deepCopy(MEDCouplingCartesianAMRMeshGen *fath) const
{
return new MEDCouplingCartesianAMRMeshSub(*this,fath);
}
std::vector<MEDCouplingCartesianAMRPatchGen *> MEDCouplingCartesianAMRMesh::retrieveGridsAt(int absoluteLev) const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatchGen> > rets;
+ std::vector< MCAuto<MEDCouplingCartesianAMRPatchGen> > rets;
retrieveGridsAtInternal(absoluteLev,rets);
std::vector< MEDCouplingCartesianAMRPatchGen * > ret(rets.size());
for(std::size_t i=0;i<rets.size();i++)
return ret;
}
-MEDCouplingCartesianAMRMesh *MEDCouplingCartesianAMRMesh::deepCpy(MEDCouplingCartesianAMRMeshGen *father) const
+MEDCouplingCartesianAMRMesh *MEDCouplingCartesianAMRMesh::deepCopy(MEDCouplingCartesianAMRMeshGen *father) const
{
if(father)
- throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRMesh::deepCpy : specifying a not null father for a God Father object !");
+ throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRMesh::deepCopy : specifying a not null father for a God Father object !");
return new MEDCouplingCartesianAMRMesh(*this);
}
//
std::vector<MEDCouplingCartesianAMRPatchGen *> elts(retrieveGridsAt((int)(i)));
std::size_t sz(elts.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatchGen> > elts2(sz);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > elts3(sz);
+ std::vector< MCAuto<MEDCouplingCartesianAMRPatchGen> > elts2(sz);
+ std::vector< MCAuto<DataArrayDouble> > elts3(sz);
for(std::size_t ii=0;ii<sz;ii++)
elts2[ii]=elts[ii];
//
static const char TMP_STR[]="TMP";
std::vector< std::pair<std::string,int> > fieldNames(1); fieldNames[0].first=TMP_STR; fieldNames[0].second=1;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingAMRAttribute> att(MEDCouplingAMRAttribute::New(this,fieldNames,0));
+ MCAuto<MEDCouplingAMRAttribute> att(MEDCouplingAMRAttribute::New(this,fieldNames,0));
att->alloc();
DataArrayDouble *tmpDa(const_cast<DataArrayDouble *>(att->getFieldOn(this,TMP_STR)));
- tmpDa->cpyFrom(*criterion);
+ tmpDa->deepCopyFrom(*criterion);
att->synchronizeCoarseToFine();
for(std::size_t ii=0;ii<sz;ii++)
{
#include "MEDCoupling.hxx"
#include "MEDCouplingTimeLabel.hxx"
#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "BoxSplittingOptions.hxx"
#include "InterpKernelException.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingIMesh;
class MEDCouplingUMesh;
class MEDCouplingCartesianAMRPatchGen : public RefCountObject
{
public:
- MEDCOUPLING_EXPORT virtual MEDCouplingCartesianAMRPatchGen *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const = 0;
+ MEDCOUPLING_EXPORT virtual MEDCouplingCartesianAMRPatchGen *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const = 0;
MEDCOUPLING_EXPORT int getNumberOfCellsRecursiveWithOverlap() const;
MEDCOUPLING_EXPORT int getNumberOfCellsRecursiveWithoutOverlap() const;
MEDCOUPLING_EXPORT int getMaxNumberOfLevelsRelativeToThis() const;
private:
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
protected:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRMeshGen> _mesh;
+ MCAuto<MEDCouplingCartesianAMRMeshGen> _mesh;
};
/*!
{
public:
MEDCouplingCartesianAMRPatch(MEDCouplingCartesianAMRMeshGen *mesh, const std::vector< std::pair<int,int> >& bottomLeftTopRight);
- MEDCouplingCartesianAMRPatch *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const;
+ MEDCouplingCartesianAMRPatch *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const;
// direct forward to _mesh
MEDCOUPLING_EXPORT void addPatch(const std::vector< std::pair<int,int> >& bottomLeftTopRight, const std::vector<int>& factors);
// end of direct forward to _mesh
{
public:
MEDCouplingCartesianAMRPatchGF(MEDCouplingCartesianAMRMesh *mesh);
- MEDCouplingCartesianAMRPatchGF *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const;
+ MEDCouplingCartesianAMRPatchGF *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const;
private:
std::size_t getHeapMemorySizeWithoutChildren() const;
private:
class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel
{
public:
- MEDCOUPLING_EXPORT virtual MEDCouplingCartesianAMRMeshGen *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const = 0;
+ MEDCOUPLING_EXPORT virtual MEDCouplingCartesianAMRMeshGen *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const = 0;
MEDCOUPLING_EXPORT int getSpaceDimension() const;
MEDCOUPLING_EXPORT const std::vector<int>& getFactors() const { return _factors; }
MEDCOUPLING_EXPORT void setFactors(const std::vector<int>& newFactors);
MEDCouplingCartesianAMRMeshGen(MEDCouplingIMesh *mesh);
void checkPatchId(int patchId) const;
void checkFactorsAndIfNotSetAssign(const std::vector<int>& factors);
- void retrieveGridsAtInternal(int lev, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatchGen> >& grids) const;
+ void retrieveGridsAtInternal(int lev, std::vector< MCAuto<MEDCouplingCartesianAMRPatchGen> >& grids) const;
static int GetGhostLevelInFineRef(int ghostLev, const std::vector<int>& factors);
std::vector<const DataArrayDouble *> extractSubTreeFromGlobalFlatten(const MEDCouplingCartesianAMRMeshGen *head, const std::vector<const DataArrayDouble *>& all) const;
void dumpPatchesOf(const std::string& varName, std::ostream& oss) const;
MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDCOUPLING_EXPORT void updateTime() const;
protected:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> _mesh;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> > _patches;
+ MCAuto<MEDCouplingIMesh> _mesh;
+ std::vector< MCAuto<MEDCouplingCartesianAMRPatch> > _patches;
std::vector<int> _factors;
};
MEDCOUPLING_EXPORT int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
private:
MEDCouplingCartesianAMRMeshSub(const MEDCouplingCartesianAMRMeshSub& other, MEDCouplingCartesianAMRMeshGen *father);
- MEDCouplingCartesianAMRMeshSub *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const;
+ MEDCouplingCartesianAMRMeshSub *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const;
void getPositionRelativeToInternal(const MEDCouplingCartesianAMRMeshGen *ref, std::vector<int>& ret) const;
protected:
MEDCouplingCartesianAMRMeshGen *_father;
MEDCOUPLING_EXPORT std::vector< std::pair<int,int> > positionRelativeToGodFather(std::vector<int>& st) const;
MEDCOUPLING_EXPORT int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const;
MEDCOUPLING_EXPORT std::vector<MEDCouplingCartesianAMRPatchGen *> retrieveGridsAt(int absoluteLev) const;
- MEDCouplingCartesianAMRMesh *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const;
+ MEDCouplingCartesianAMRMesh *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const;
MEDCOUPLING_EXPORT void createPatchesFromCriterionML(const std::vector<const INTERP_KERNEL::BoxSplittingOptions *>& bso, const DataArrayDouble *criterion, const std::vector< std::vector<int> >& factors, double eps);
private:
void getPositionRelativeToInternal(const MEDCouplingCartesianAMRMeshGen *ref, std::vector<int>& ret) const;
#include <sstream>
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingCurveLinearMesh::MEDCouplingCurveLinearMesh():_coords(0),_structure(0)
{
if(deepCopy)
{
if((const DataArrayDouble *)other._coords)
- _coords=other._coords->deepCpy();
+ _coords=other._coords->deepCopy();
}
else
_coords=other._coords;
return ret;
}
-MEDCouplingCurveLinearMesh *MEDCouplingCurveLinearMesh::deepCpy() const
+MEDCouplingCurveLinearMesh *MEDCouplingCurveLinearMesh::deepCopy() const
{
return clone(true);
}
}
/*!
- * Nothing is done here (except to check that the other is a ParaMEDMEM::MEDCouplingCurveLinearMesh instance too).
- * The user intend that the nodes are the same, so by construction of ParaMEDMEM::MEDCouplingCurveLinearMesh, \a this and \a other are the same !
+ * Nothing is done here (except to check that the other is a MEDCoupling::MEDCouplingCurveLinearMesh instance too).
+ * The user intend that the nodes are the same, so by construction of MEDCoupling::MEDCouplingCurveLinearMesh, \a this and \a other are the same !
*/
void MEDCouplingCurveLinearMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
DataArrayInt *&cellCor) const
throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkDeepEquivalOnSameNodesWith : Meshes are not the same !");
}
-void MEDCouplingCurveLinearMesh::checkCoherency() const
+void MEDCouplingCurveLinearMesh::checkConsistencyLight() const
{
std::size_t sz=_structure.size(),i=0,nbOfNodes=1;
if(sz<1)
- throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkCoherency : structure should have a lgth of size 1 at least !");
+ throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkConsistencyLight : structure should have a lgth of size 1 at least !");
for(std::vector<int>::const_iterator it=_structure.begin();it!=_structure.end();it++,i++)
{
if((*it)<1)
- { std::ostringstream oss; oss << "MEDCouplingCurveLinearMesh::checkCoherency : At pos #" << i << " of structure value is " << *it << "should be >= 1 !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
+ { std::ostringstream oss; oss << "MEDCouplingCurveLinearMesh::checkConsistencyLight : At pos #" << i << " of structure value is " << *it << "should be >= 1 !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
nbOfNodes*=*it;
}
if(!((const DataArrayDouble *)_coords))
- throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkCoherency : the array is not set !");
+ throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkConsistencyLight : the array is not set !");
if(!_coords->isAllocated())
- throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkCoherency : the array is not allocated !");
+ throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkConsistencyLight : the array is not allocated !");
if(_coords->getNumberOfComponents()<1)
- throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkCoherency : the array should have >= 1 components !");
+ throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::checkConsistencyLight : the array should have >= 1 components !");
if(_coords->getNumberOfTuples()!=(int)nbOfNodes)
{
- std::ostringstream oss; oss << "MEDCouplingCurveLinearMesh::checkCoherency : structure said that number of nodes should be equal to " << nbOfNodes << " but number of tuples in array is equal to " << _coords->getNumberOfTuples() << " !";
+ std::ostringstream oss; oss << "MEDCouplingCurveLinearMesh::checkConsistencyLight : structure said that number of nodes should be equal to " << nbOfNodes << " but number of tuples in array is equal to " << _coords->getNumberOfTuples() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
-void MEDCouplingCurveLinearMesh::checkCoherency1(double eps) const
+void MEDCouplingCurveLinearMesh::checkConsistency(double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
}
int MEDCouplingCurveLinearMesh::getNumberOfCells() const
{
- checkCoherency();
+ checkConsistencyLight();
return MEDCouplingStructuredMesh::getNumberOfCells();
}
int MEDCouplingCurveLinearMesh::getNumberOfNodes() const
{
- checkCoherency();
+ checkConsistencyLight();
return MEDCouplingStructuredMesh::getNumberOfNodes();
}
MEDCouplingStructuredMesh *MEDCouplingCurveLinearMesh::buildStructuredSubPart(const std::vector< std::pair<int,int> >& cellPart) const
{
- checkCoherency();
+ checkConsistencyLight();
int dim(getSpaceDimension());
std::vector<int> dims(getMeshDimension());
if(dim!=(int)cellPart.size())
std::vector< std::pair<int,int> > nodePartFormat(cellPart);
for(std::vector< std::pair<int,int> >::iterator it=nodePartFormat.begin();it!=nodePartFormat.end();it++)
(*it).second++;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1(BuildExplicitIdsFrom(getNodeGridStructure(),nodePartFormat));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> ret(dynamic_cast<MEDCouplingCurveLinearMesh *>(deepCpy()));
+ MCAuto<DataArrayInt> tmp1(BuildExplicitIdsFrom(getNodeGridStructure(),nodePartFormat));
+ MCAuto<MEDCouplingCurveLinearMesh> ret(dynamic_cast<MEDCouplingCurveLinearMesh *>(deepCopy()));
const DataArrayDouble *coo(ret->getCoords());
if(coo)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo2(coo->selectByTupleIdSafe(tmp1->begin(),tmp1->end()));
+ MCAuto<DataArrayDouble> coo2(coo->selectByTupleIdSafe(tmp1->begin(),tmp1->end()));
ret->setCoords(coo2);
}
for(int i=0;i<dim;i++)
MEDCouplingFieldDouble *MEDCouplingCurveLinearMesh::getMeasureField(bool isAbs) const
{
- checkCoherency();
+ checkConsistencyLight();
int meshDim=getMeshDimension();
std::string name="MeasureOfMesh_"; name+=getName();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> field=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
field->setName(name); field->setMesh(const_cast<MEDCouplingCurveLinearMesh *>(this)); field->synchronizeTimeWithMesh();
switch(meshDim)
{
{
int nbnodes=getNumberOfNodes();
int spaceDim=getSpaceDimension();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New(); field->setArray(arr);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New(); field->setArray(arr);
if(nbnodes==0)
{ arr->alloc(0,1); return; }
if(spaceDim==1)
}
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp=DataArrayDouble::New(); tmp->alloc(nbnodes-1,spaceDim);
+ MCAuto<DataArrayDouble> tmp=DataArrayDouble::New(); tmp->alloc(nbnodes-1,spaceDim);
std::transform(_coords->begin()+spaceDim,_coords->end(),_coords->begin(),tmp->getPointer(),std::minus<double>());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp2=tmp->magnitude(); field->setArray(tmp2);
+ MCAuto<DataArrayDouble> tmp2=tmp->magnitude(); field->setArray(tmp2);
}
}
int spaceDim=getSpaceDimension();
if(spaceDim!=2 && spaceDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::getMeasureFieldMeshDim2 : with meshDim 2 only space dimension 2 and 3 are possible !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New(); field->setArray(arr);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New(); field->setArray(arr);
arr->alloc(nbcells,1);
double *pt=arr->getPointer();
const double *coords=_coords->begin();
int spaceDim=getSpaceDimension();
if(spaceDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::getMeasureFieldMeshDim3 : with meshDim 3 only space dimension 3 is possible !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New(); field->setArray(arr);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New(); field->setArray(arr);
arr->alloc(nbcells,1);
double *pt=arr->getPointer();
const double *coords=_coords->begin();
/// @cond INTERNAL
-namespace ParaMEDMEM
+namespace MEDCoupling
{
template<const int SPACEDIMM>
class DummyClsMCL
int MEDCouplingCurveLinearMesh::getCellContainingPoint(const double *pos, double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
int spaceDim=getSpaceDimension();
const double *coords=_coords->getConstPointer();
int nodeId=-1;
return ret;
}
-DataArrayDouble *MEDCouplingCurveLinearMesh::getBarycenterAndOwner() const
+DataArrayDouble *MEDCouplingCurveLinearMesh::computeCellCenterOfMass() const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ checkConsistencyLight();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int spaceDim=getSpaceDimension();
int meshDim=getMeshDimension();
int nbOfCells=getNumberOfCells();
case 1:
{ getBarycenterAndOwnerMeshDim1(ret); return ret.retn(); }
default:
- throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::getBarycenterAndOwner : mesh dimension must be in [1,2,3] !");
+ throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::computeCellCenterOfMass : mesh dimension must be in [1,2,3] !");
}
}
DataArrayDouble *MEDCouplingCurveLinearMesh::computeIsoBarycenterOfNodesPerCell() const
{
- return MEDCouplingCurveLinearMesh::getBarycenterAndOwner();
+ return MEDCouplingCurveLinearMesh::computeCellCenterOfMass();
}
/*!
* \param [in,out] bary Barycenter array feeded with good values.
- * \sa MEDCouplingCurveLinearMesh::getBarycenterAndOwner
+ * \sa MEDCouplingCurveLinearMesh::computeCellCenterOfMass
*/
void MEDCouplingCurveLinearMesh::getBarycenterAndOwnerMeshDim3(DataArrayDouble *bary) const
{
/*!
* \param [in,out] bary Barycenter array feeded with good values.
- * \sa MEDCouplingCurveLinearMesh::getBarycenterAndOwner
+ * \sa MEDCouplingCurveLinearMesh::computeCellCenterOfMass
*/
void MEDCouplingCurveLinearMesh::getBarycenterAndOwnerMeshDim2(DataArrayDouble *bary) const
{
/*!
* \param [in,out] bary Barycenter array feeded with good values.
- * \sa MEDCouplingCurveLinearMesh::getBarycenterAndOwner
+ * \sa MEDCouplingCurveLinearMesh::computeCellCenterOfMass
*/
void MEDCouplingCurveLinearMesh::getBarycenterAndOwnerMeshDim1(DataArrayDouble *bary) const
{
_coords->writeVTK(ofs,8,"Points",byteData);
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo=_coords->changeNbOfComponents(3,0.);
+ MCAuto<DataArrayDouble> coo=_coords->changeNbOfComponents(3,0.);
coo->writeVTK(ofs,8,"Points",byteData);
}
ofs << " </Points>\n";
#include "MEDCoupling.hxx"
#include "MEDCouplingStructuredMesh.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingCurveLinearMesh : public MEDCouplingStructuredMesh
{
public:
MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New();
MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New(const std::string& meshName);
- MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *deepCpy() const;
+ MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *deepCopy() const;
MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
MEDCOUPLING_EXPORT void updateTime() const;
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const;
MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
DataArrayInt *&cellCor) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
MEDCOUPLING_EXPORT int getNumberOfCells() const;
MEDCOUPLING_EXPORT int getNumberOfNodes() const;
MEDCOUPLING_EXPORT int getSpaceDimension() const;
MEDCOUPLING_EXPORT void scale(const double *point, double factor);
MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
MEDCOUPLING_EXPORT DataArrayDouble *getCoordinatesAndOwner() const;
- MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true);
//some useful methods
void getBarycenterAndOwnerMeshDim1(DataArrayDouble *bary) const;
private:
MEDCouplingCurveLinearMesh();
- MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCpy);
+ MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCopy);
~MEDCouplingCurveLinearMesh();
void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
std::string getVTKDataSetType() const;
private:
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
+ MCAuto<DataArrayDouble> _coords;
std::vector<int> _structure;
};
}
#include <cmath>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const double MEDCouplingDefinitionTime::EPS_DFT=1e-15;
{
std::vector<int> ids;
int id=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++,id++)
+ for(std::vector< MCAuto<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++,id++)
if((*it)->isContaining(tm,_eps))
ids.push_back(id);
if(ids.empty())
std::vector<double> MEDCouplingDefinitionTime::getHotSpotsTime() const
{
std::vector<double> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
+ for(std::vector< MCAuto<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
{
std::vector<double> tmp;
(*it)->getHotSpotsTime(tmp);
void MEDCouplingDefinitionTime::appendRepr(std::ostream& stream) const
{
stream << "Time definition :\n";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
+ for(std::vector< MCAuto<MEDCouplingDefinitionTimeSlice> >::const_iterator it=_slices.begin();it!=_slices.end();it++)
{
stream << " - ";
(*it)->appendRepr(stream);
#define __PARAMEDMEM_MEDCOUPLINGDEFINITIONTIME_HXX__
#include "MEDCouplingRefCountObject.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelException.hxx"
#include <vector>
#include <sstream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingFieldDouble;
MEDCOUPLING_EXPORT void unserialize(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD);
private:
double _eps;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingDefinitionTimeSlice> > _slices;
+ std::vector< MCAuto<MEDCouplingDefinitionTimeSlice> > _slices;
static const double EPS_DFT;
};
}
+++ /dev/null
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Anthony Geay (CEA/DEN)
-
-#include "MEDCouplingExtrudedMesh.hxx"
-#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
-#include "CellModel.hxx"
-
-#include "InterpolationUtils.hxx"
-
-#include <limits>
-#include <algorithm>
-#include <functional>
-#include <iterator>
-#include <sstream>
-#include <cmath>
-#include <list>
-#include <set>
-
-using namespace ParaMEDMEM;
-
-/*!
- * Build an extruded mesh instance from 3D and 2D unstructured mesh lying on the \b same \b coords.
- * @param mesh3D 3D unstructured mesh.
- * @param mesh2D 2D unstructured mesh lying on the same coordinates than mesh3D. \b Warning mesh2D is \b not \b const
- * because the mesh is aggregated and potentially modified by rotate or translate method.
- * @param cell2DId Id of cell in mesh2D mesh where the computation of 1D mesh will be done.
- */
-MEDCouplingExtrudedMesh *MEDCouplingExtrudedMesh::New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId)
-{
- return new MEDCouplingExtrudedMesh(mesh3D,mesh2D,cell2DId);
-}
-
-/*!
- * This constructor is here only for unserialisation process.
- * This constructor is normally completely useless for end user.
- */
-MEDCouplingExtrudedMesh *MEDCouplingExtrudedMesh::New()
-{
- return new MEDCouplingExtrudedMesh;
-}
-
-MEDCouplingMeshType MEDCouplingExtrudedMesh::getType() const
-{
- return EXTRUDED;
-}
-
-std::size_t MEDCouplingExtrudedMesh::getHeapMemorySizeWithoutChildren() const
-{
- return MEDCouplingMesh::getHeapMemorySizeWithoutChildren();
-}
-
-std::vector<const BigMemoryObject *> MEDCouplingExtrudedMesh::getDirectChildrenWithNull() const
-{
- std::vector<const BigMemoryObject *> ret;
- ret.push_back(_mesh2D);
- ret.push_back(_mesh1D);
- ret.push_back(_mesh3D_ids);
- return ret;
-}
-
-/*!
- * This method copyies all tiny strings from other (name and components name).
- * @throw if other and this have not same mesh type.
- */
-void MEDCouplingExtrudedMesh::copyTinyStringsFrom(const MEDCouplingMesh *other)
-{
- const MEDCouplingExtrudedMesh *otherC=dynamic_cast<const MEDCouplingExtrudedMesh *>(other);
- if(!otherC)
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::copyTinyStringsFrom : meshes have not same type !");
- MEDCouplingMesh::copyTinyStringsFrom(other);
- _mesh2D->copyTinyStringsFrom(otherC->_mesh2D);
- _mesh1D->copyTinyStringsFrom(otherC->_mesh1D);
-}
-
-MEDCouplingExtrudedMesh::MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId)
-try:_mesh2D(const_cast<MEDCouplingUMesh *>(mesh2D)),_mesh1D(MEDCouplingUMesh::New()),_mesh3D_ids(0),_cell_2D_id(cell2DId)
-{
- if(_mesh2D!=0)
- _mesh2D->incrRef();
- computeExtrusion(mesh3D);
- setName(mesh3D->getName());
-}
-catch(INTERP_KERNEL::Exception& e)
-{
- if(_mesh2D)
- _mesh2D->decrRef();
- if(_mesh1D)
- _mesh1D->decrRef();
- if(_mesh3D_ids)
- _mesh3D_ids->decrRef();
- throw e;
-}
-
-MEDCouplingExtrudedMesh::MEDCouplingExtrudedMesh():_mesh2D(0),_mesh1D(0),_mesh3D_ids(0),_cell_2D_id(-1)
-{
-}
-
-MEDCouplingExtrudedMesh::MEDCouplingExtrudedMesh(const MEDCouplingExtrudedMesh& other, bool deepCopy):MEDCouplingMesh(other),_cell_2D_id(other._cell_2D_id)
-{
- if(deepCopy)
- {
- _mesh2D=other._mesh2D->clone(true);
- _mesh1D=other._mesh1D->clone(true);
- _mesh3D_ids=other._mesh3D_ids->deepCpy();
- }
- else
- {
- _mesh2D=other._mesh2D;
- if(_mesh2D)
- _mesh2D->incrRef();
- _mesh1D=other._mesh1D;
- if(_mesh1D)
- _mesh1D->incrRef();
- _mesh3D_ids=other._mesh3D_ids;
- if(_mesh3D_ids)
- _mesh3D_ids->incrRef();
- }
-}
-
-int MEDCouplingExtrudedMesh::getNumberOfCells() const
-{
- return _mesh2D->getNumberOfCells()*_mesh1D->getNumberOfCells();
-}
-
-int MEDCouplingExtrudedMesh::getNumberOfNodes() const
-{
- return _mesh2D->getNumberOfNodes();
-}
-
-int MEDCouplingExtrudedMesh::getSpaceDimension() const
-{
- return 3;
-}
-
-int MEDCouplingExtrudedMesh::getMeshDimension() const
-{
- return 3;
-}
-
-MEDCouplingExtrudedMesh *MEDCouplingExtrudedMesh::deepCpy() const
-{
- return clone(true);
-}
-
-MEDCouplingExtrudedMesh *MEDCouplingExtrudedMesh::clone(bool recDeepCpy) const
-{
- return new MEDCouplingExtrudedMesh(*this,recDeepCpy);
-}
-
-bool MEDCouplingExtrudedMesh::isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const
-{
- if(!other)
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::isEqualIfNotWhy : input other pointer is null !");
- const MEDCouplingExtrudedMesh *otherC=dynamic_cast<const MEDCouplingExtrudedMesh *>(other);
- std::ostringstream oss;
- if(!otherC)
- {
- reason="mesh given in input is not castable in MEDCouplingExtrudedMesh !";
- return false;
- }
- if(!MEDCouplingMesh::isEqualIfNotWhy(other,prec,reason))
- return false;
- if(!_mesh2D->isEqualIfNotWhy(otherC->_mesh2D,prec,reason))
- {
- reason.insert(0,"Mesh2D unstructured meshes differ : ");
- return false;
- }
- if(!_mesh1D->isEqualIfNotWhy(otherC->_mesh1D,prec,reason))
- {
- reason.insert(0,"Mesh1D unstructured meshes differ : ");
- return false;
- }
- if(!_mesh3D_ids->isEqualIfNotWhy(*otherC->_mesh3D_ids,reason))
- {
- reason.insert(0,"Mesh3D ids DataArrayInt instances differ : ");
- return false;
- }
- if(_cell_2D_id!=otherC->_cell_2D_id)
- {
- oss << "Cell 2D id of the two extruded mesh differ : this = " << _cell_2D_id << " other = " << otherC->_cell_2D_id;
- reason=oss.str();
- return false;
- }
- return true;
-}
-
-bool MEDCouplingExtrudedMesh::isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const
-{
- const MEDCouplingExtrudedMesh *otherC=dynamic_cast<const MEDCouplingExtrudedMesh *>(other);
- if(!otherC)
- return false;
- if(!_mesh2D->isEqualWithoutConsideringStr(otherC->_mesh2D,prec))
- return false;
- if(!_mesh1D->isEqualWithoutConsideringStr(otherC->_mesh1D,prec))
- return false;
- if(!_mesh3D_ids->isEqualWithoutConsideringStr(*otherC->_mesh3D_ids))
- return false;
- if(_cell_2D_id!=otherC->_cell_2D_id)
- return false;
- return true;
-}
-
-void MEDCouplingExtrudedMesh::checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
- DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const
-{
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::checkDeepEquivalWith : not implemented yet !");
-}
-
-void MEDCouplingExtrudedMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
- DataArrayInt *&cellCor) const
-{
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::checkDeepEquivalOnSameNodesWith : not implemented yet !");
-}
-
-INTERP_KERNEL::NormalizedCellType MEDCouplingExtrudedMesh::getTypeOfCell(int cellId) const
-{
- const int *ids=_mesh3D_ids->getConstPointer();
- int nbOf3DCells=_mesh3D_ids->getNumberOfTuples();
- const int *where=std::find(ids,ids+nbOf3DCells,cellId);
- if(where==ids+nbOf3DCells)
- throw INTERP_KERNEL::Exception("Invalid cellId specified >= getNumberOfCells() !");
- int nbOfCells2D=_mesh2D->getNumberOfCells();
- int locId=((int)std::distance(ids,where))%nbOfCells2D;
- INTERP_KERNEL::NormalizedCellType tmp=_mesh2D->getTypeOfCell(locId);
- return INTERP_KERNEL::CellModel::GetCellModel(tmp).getExtrudedType();
-}
-
-std::set<INTERP_KERNEL::NormalizedCellType> MEDCouplingExtrudedMesh::getAllGeoTypes() const
-{
- std::set<INTERP_KERNEL::NormalizedCellType> ret2D(_mesh2D->getAllGeoTypes());
- std::set<INTERP_KERNEL::NormalizedCellType> ret;
- for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=ret2D.begin();it!=ret2D.end();it++)
- ret.insert(INTERP_KERNEL::CellModel::GetCellModel(*it).getExtrudedType());
- return ret;
-}
-
-DataArrayInt *MEDCouplingExtrudedMesh::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
-{
- const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(type);
- INTERP_KERNEL::NormalizedCellType revExtTyp=cm.getReverseExtrudedType();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
- if(revExtTyp==INTERP_KERNEL::NORM_ERROR)
- {
- ret->alloc(0,1);
- return ret.retn();
- }
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=_mesh2D->giveCellsWithType(revExtTyp);
- int nbOfLevs=_mesh1D->getNumberOfCells();
- int nbOfCells2D=_mesh2D->getNumberOfCells();
- int nbOfTuples=tmp->getNumberOfTuples();
- ret->alloc(nbOfLevs*nbOfTuples,1);
- int *pt=ret->getPointer();
- for(int i=0;i<nbOfLevs;i++,pt+=nbOfTuples)
- std::transform(tmp->begin(),tmp->end(),pt,std::bind2nd(std::plus<int>(),i*nbOfCells2D));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2=ret->renumberR(_mesh3D_ids->begin());
- ret2->sort();
- return ret2.retn();
-}
-
-DataArrayInt *MEDCouplingExtrudedMesh::computeNbOfNodesPerCell() const
-{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2D=_mesh2D->computeNbOfNodesPerCell();
- int nbOfLevs=_mesh1D->getNumberOfCells();
- int nbOfCells2D=_mesh2D->getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret3D=DataArrayInt::New(); ret3D->alloc(nbOfLevs*nbOfCells2D,1);
- int *pt=ret3D->getPointer();
- for(int i=0;i<nbOfLevs;i++,pt+=nbOfCells2D)
- std::copy(ret2D->begin(),ret2D->end(),pt);
- ret3D->applyLin(2,0,0);
- return ret3D->renumberR(_mesh3D_ids->begin());
-}
-
-DataArrayInt *MEDCouplingExtrudedMesh::computeNbOfFacesPerCell() const
-{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2D=_mesh2D->computeNbOfNodesPerCell();
- int nbOfLevs=_mesh1D->getNumberOfCells();
- int nbOfCells2D=_mesh2D->getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret3D=DataArrayInt::New(); ret3D->alloc(nbOfLevs*nbOfCells2D,1);
- int *pt=ret3D->getPointer();
- for(int i=0;i<nbOfLevs;i++,pt+=nbOfCells2D)
- std::copy(ret2D->begin(),ret2D->end(),pt);
- ret3D->applyLin(2,2,0);
- return ret3D->renumberR(_mesh3D_ids->begin());
-}
-
-DataArrayInt *MEDCouplingExtrudedMesh::computeEffectiveNbOfNodesPerCell() const
-{
- return computeNbOfNodesPerCell();
-}
-
-int MEDCouplingExtrudedMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
-{
- int ret=0;
- int nbOfCells2D=_mesh2D->getNumberOfCells();
- for(int i=0;i<nbOfCells2D;i++)
- {
- INTERP_KERNEL::NormalizedCellType t=_mesh2D->getTypeOfCell(i);
- if(INTERP_KERNEL::CellModel::GetCellModel(t).getExtrudedType()==type)
- ret++;
- }
- return ret*_mesh1D->getNumberOfCells();
-}
-
-void MEDCouplingExtrudedMesh::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
-{
- int nbOfCells2D=_mesh2D->getNumberOfCells();
- int nbOfNodes2D=_mesh2D->getNumberOfNodes();
- int locId=cellId%nbOfCells2D;
- int lev=cellId/nbOfCells2D;
- std::vector<int> tmp,tmp2;
- _mesh2D->getNodeIdsOfCell(locId,tmp);
- tmp2=tmp;
- std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::bind2nd(std::plus<int>(),nbOfNodes2D*lev));
- std::transform(tmp2.begin(),tmp2.end(),tmp2.begin(),std::bind2nd(std::plus<int>(),nbOfNodes2D*(lev+1)));
- conn.insert(conn.end(),tmp.begin(),tmp.end());
- conn.insert(conn.end(),tmp2.begin(),tmp2.end());
-}
-
-void MEDCouplingExtrudedMesh::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const
-{
- int nbOfNodes2D=_mesh2D->getNumberOfNodes();
- int locId=nodeId%nbOfNodes2D;
- int lev=nodeId/nbOfNodes2D;
- std::vector<double> tmp,tmp2;
- _mesh2D->getCoordinatesOfNode(locId,tmp);
- tmp2=tmp;
- int spaceDim=_mesh1D->getSpaceDimension();
- const double *z=_mesh1D->getCoords()->getConstPointer();
- std::transform(tmp.begin(),tmp.end(),z+lev*spaceDim,tmp.begin(),std::plus<double>());
- std::transform(tmp2.begin(),tmp2.end(),z+(lev+1)*spaceDim,tmp2.begin(),std::plus<double>());
- coo.insert(coo.end(),tmp.begin(),tmp.end());
- coo.insert(coo.end(),tmp2.begin(),tmp2.end());
-}
-
-std::string MEDCouplingExtrudedMesh::simpleRepr() const
-{
- std::ostringstream ret;
- ret << "3D Extruded mesh from a 2D Surf Mesh with name : \"" << getName() << "\"\n";
- ret << "Description of mesh : \"" << getDescription() << "\"\n";
- int tmpp1,tmpp2;
- double tt=getTime(tmpp1,tmpp2);
- ret << "Time attached to the mesh [unit] : " << tt << " [" << getTimeUnit() << "]\n";
- ret << "Iteration : " << tmpp1 << " Order : " << tmpp2 << "\n";
- ret << "Cell id where 1D mesh has been deduced : " << _cell_2D_id << "\n";
- ret << "Number of cells : " << getNumberOfCells() << "(" << _mesh2D->getNumberOfCells() << "x" << _mesh1D->getNumberOfCells() << ")\n";
- ret << "1D Mesh info : _____________________\n\n\n";
- ret << _mesh1D->simpleRepr();
- ret << "\n\n\n2D Mesh info : _____________________\n\n\n" << _mesh2D->simpleRepr() << "\n\n\n";
- return ret.str();
-}
-
-std::string MEDCouplingExtrudedMesh::advancedRepr() const
-{
- std::ostringstream ret;
- ret << "3D Extruded mesh from a 2D Surf Mesh with name : \"" << getName() << "\"\n";
- ret << "Description of mesh : \"" << getDescription() << "\"\n";
- int tmpp1,tmpp2;
- double tt=getTime(tmpp1,tmpp2);
- ret << "Time attached to the mesh (unit) : " << tt << " (" << getTimeUnit() << ")\n";
- ret << "Iteration : " << tmpp1 << " Order : " << tmpp2 << "\n";
- ret << "Cell id where 1D mesh has been deduced : " << _cell_2D_id << "\n";
- ret << "Number of cells : " << getNumberOfCells() << "(" << _mesh2D->getNumberOfCells() << "x" << _mesh1D->getNumberOfCells() << ")\n";
- ret << "1D Mesh info : _____________________\n\n\n";
- ret << _mesh1D->advancedRepr();
- ret << "\n\n\n2D Mesh info : _____________________\n\n\n" << _mesh2D->advancedRepr() << "\n\n\n";
- ret << "3D cell ids per level :\n";
- return ret.str();
-}
-
-void MEDCouplingExtrudedMesh::checkCoherency() const
-{
-}
-
-void MEDCouplingExtrudedMesh::checkCoherency1(double eps) const
-{
- checkCoherency();
-}
-
-void MEDCouplingExtrudedMesh::getBoundingBox(double *bbox) const
-{
- double bbox2D[6];
- _mesh2D->getBoundingBox(bbox2D);
- const double *nodes1D=_mesh1D->getCoords()->getConstPointer();
- int nbOfNodes1D=_mesh1D->getNumberOfNodes();
- double bbox1DMin[3],bbox1DMax[3],tmp[3];
- std::fill(bbox1DMin,bbox1DMin+3,std::numeric_limits<double>::max());
- std::fill(bbox1DMax,bbox1DMax+3,-(std::numeric_limits<double>::max()));
- for(int i=0;i<nbOfNodes1D;i++)
- {
- std::transform(nodes1D+3*i,nodes1D+3*(i+1),bbox1DMin,bbox1DMin,static_cast<const double& (*)(const double&, const double&)>(std::min<double>));
- std::transform(nodes1D+3*i,nodes1D+3*(i+1),bbox1DMax,bbox1DMax,static_cast<const double& (*)(const double&, const double&)>(std::max<double>));
- }
- std::transform(bbox1DMax,bbox1DMax+3,bbox1DMin,tmp,std::minus<double>());
- int id=(int)std::distance(tmp,std::max_element(tmp,tmp+3));
- bbox[0]=bbox1DMin[0]; bbox[1]=bbox1DMax[0];
- bbox[2]=bbox1DMin[1]; bbox[3]=bbox1DMax[1];
- bbox[4]=bbox1DMin[2]; bbox[5]=bbox1DMax[2];
- bbox[2*id+1]+=tmp[id];
-}
-
-void MEDCouplingExtrudedMesh::updateTime() const
-{
- if(_mesh2D)
- {
- updateTimeWith(*_mesh2D);
- }
- if(_mesh1D)
- {
- updateTimeWith(*_mesh1D);
- }
-}
-
-void MEDCouplingExtrudedMesh::renumberCells(const int *old2NewBg, bool check)
-{
- throw INTERP_KERNEL::Exception("Functionnality of renumbering cells unavailable for ExtrudedMesh");
-}
-
-MEDCouplingUMesh *MEDCouplingExtrudedMesh::build3DUnstructuredMesh() const
-{
- MEDCouplingUMesh *ret=_mesh2D->buildExtrudedMesh(_mesh1D,0);
- const int *renum=_mesh3D_ids->getConstPointer();
- ret->renumberCells(renum,false);
- ret->setName(getName());
- return ret;
-}
-
-MEDCouplingUMesh *MEDCouplingExtrudedMesh::buildUnstructured() const
-{
- return build3DUnstructuredMesh();
-}
-
-MEDCouplingFieldDouble *MEDCouplingExtrudedMesh::getMeasureField(bool) const
-{
- std::string name="MeasureOfMesh_";
- name+=getName();
- MEDCouplingFieldDouble *ret2D=_mesh2D->getMeasureField(true);
- MEDCouplingFieldDouble *ret1D=_mesh1D->getMeasureField(true);
- const double *ret2DPtr=ret2D->getArray()->getConstPointer();
- const double *ret1DPtr=ret1D->getArray()->getConstPointer();
- int nbOf2DCells=_mesh2D->getNumberOfCells();
- int nbOf1DCells=_mesh1D->getNumberOfCells();
- int nbOf3DCells=nbOf2DCells*nbOf1DCells;
- const int *renum=_mesh3D_ids->getConstPointer();
- MEDCouplingFieldDouble *ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
- ret->setMesh(this);
- ret->synchronizeTimeWithMesh();
- DataArrayDouble *da=DataArrayDouble::New();
- da->alloc(nbOf3DCells,1);
- double *retPtr=da->getPointer();
- for(int i=0;i<nbOf1DCells;i++)
- for(int j=0;j<nbOf2DCells;j++)
- retPtr[renum[i*nbOf2DCells+j]]=ret2DPtr[j]*ret1DPtr[i];
- ret->setArray(da);
- da->decrRef();
- ret->setName(name);
- ret2D->decrRef();
- ret1D->decrRef();
- return ret;
-}
-
-MEDCouplingFieldDouble *MEDCouplingExtrudedMesh::getMeasureFieldOnNode(bool isAbs) const
-{
- //not implemented yet
- return 0;
-}
-
-MEDCouplingFieldDouble *MEDCouplingExtrudedMesh::buildOrthogonalField() const
-{
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::buildOrthogonalField : This method has no sense for MEDCouplingExtrudedMesh that is 3D !");
-}
-
-int MEDCouplingExtrudedMesh::getCellContainingPoint(const double *pos, double eps) const
-{
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::getCellContainingPoint : not implemented yet !");
-}
-
-MEDCouplingExtrudedMesh::~MEDCouplingExtrudedMesh()
-{
- if(_mesh2D)
- _mesh2D->decrRef();
- if(_mesh1D)
- _mesh1D->decrRef();
- if(_mesh3D_ids)
- _mesh3D_ids->decrRef();
-}
-
-void MEDCouplingExtrudedMesh::computeExtrusion(const MEDCouplingUMesh *mesh3D)
-{
- const char errMsg1[]="2D mesh is empty unable to compute extrusion !";
- const char errMsg2[]="Coords between 2D and 3D meshes are not the same ! Try MEDCouplingPointSet::tryToShareSameCoords method";
- const char errMsg3[]="No chance to find extrusion pattern in mesh3D,mesh2D couple because nbCells3D%nbCells2D!=0 !";
- if(_mesh2D==0 || mesh3D==0)
- throw INTERP_KERNEL::Exception(errMsg1);
- if(_mesh2D->getCoords()!=mesh3D->getCoords())
- throw INTERP_KERNEL::Exception(errMsg2);
- if(mesh3D->getNumberOfCells()%_mesh2D->getNumberOfCells()!=0)
- throw INTERP_KERNEL::Exception(errMsg3);
- if(!_mesh3D_ids)
- _mesh3D_ids=DataArrayInt::New();
- if(!_mesh1D)
- _mesh1D=MEDCouplingUMesh::New();
- computeExtrusionAlg(mesh3D);
-}
-
-void MEDCouplingExtrudedMesh::build1DExtrusion(int idIn3DDesc, int newId, int nbOf1DLev, MEDCouplingUMesh *subMesh,
- const int *desc3D, const int *descIndx3D,
- const int *revDesc3D, const int *revDescIndx3D,
- bool computeMesh1D)
-{
- int nbOf2DCells=_mesh2D->getNumberOfCells();
- int start=revDescIndx3D[idIn3DDesc];
- int end=revDescIndx3D[idIn3DDesc+1];
- if(end-start!=1)
- {
- std::ostringstream ost; ost << "Invalid bases 2D mesh specified : 2D cell # " << idIn3DDesc;
- ost << " shared by more than 1 3D cell !!!";
- throw INTERP_KERNEL::Exception(ost.str().c_str());
- }
- int current3DCell=revDesc3D[start];
- int current2DCell=idIn3DDesc;
- int *mesh3DIDs=_mesh3D_ids->getPointer();
- mesh3DIDs[newId]=current3DCell;
- const int *conn2D=subMesh->getNodalConnectivity()->getConstPointer();
- const int *conn2DIndx=subMesh->getNodalConnectivityIndex()->getConstPointer();
- for(int i=1;i<nbOf1DLev;i++)
- {
- std::vector<int> conn(conn2D+conn2DIndx[current2DCell]+1,conn2D+conn2DIndx[current2DCell+1]);
- std::sort(conn.begin(),conn.end());
- if(computeMesh1D)
- computeBaryCenterOfFace(conn,i-1);
- current2DCell=findOppositeFaceOf(current2DCell,current3DCell,conn,
- desc3D,descIndx3D,conn2D,conn2DIndx);
- start=revDescIndx3D[current2DCell];
- end=revDescIndx3D[current2DCell+1];
- if(end-start!=2)
- {
- std::ostringstream ost; ost << "Expecting to have 2 3D cells attached to 2D cell " << current2DCell << "!";
- ost << " : Impossible or call tryToShareSameCoords method !";
- throw INTERP_KERNEL::Exception(ost.str().c_str());
- }
- if(revDesc3D[start]!=current3DCell)
- current3DCell=revDesc3D[start];
- else
- current3DCell=revDesc3D[start+1];
- mesh3DIDs[i*nbOf2DCells+newId]=current3DCell;
- }
- if(computeMesh1D)
- {
- std::vector<int> conn(conn2D+conn2DIndx[current2DCell]+1,conn2D+conn2DIndx[current2DCell+1]);
- std::sort(conn.begin(),conn.end());
- computeBaryCenterOfFace(conn,nbOf1DLev-1);
- current2DCell=findOppositeFaceOf(current2DCell,current3DCell,conn,
- desc3D,descIndx3D,conn2D,conn2DIndx);
- conn.clear();
- conn.insert(conn.end(),conn2D+conn2DIndx[current2DCell]+1,conn2D+conn2DIndx[current2DCell+1]);
- std::sort(conn.begin(),conn.end());
- computeBaryCenterOfFace(conn,nbOf1DLev);
- }
-}
-
-int MEDCouplingExtrudedMesh::findOppositeFaceOf(int current2DCell, int current3DCell, const std::vector<int>& connSorted,
- const int *desc3D, const int *descIndx3D,
- const int *conn2D, const int *conn2DIndx)
-{
- int start=descIndx3D[current3DCell];
- int end=descIndx3D[current3DCell+1];
- bool found=false;
- for(const int *candidate2D=desc3D+start;candidate2D!=desc3D+end && !found;candidate2D++)
- {
- if(*candidate2D!=current2DCell)
- {
- std::vector<int> conn2(conn2D+conn2DIndx[*candidate2D]+1,conn2D+conn2DIndx[*candidate2D+1]);
- std::sort(conn2.begin(),conn2.end());
- std::list<int> intersect;
- std::set_intersection(connSorted.begin(),connSorted.end(),conn2.begin(),conn2.end(),
- std::insert_iterator< std::list<int> >(intersect,intersect.begin()));
- if(intersect.empty())
- return *candidate2D;
- }
- }
- std::ostringstream ost; ost << "Impossible to find an opposite 2D face of face # " << current2DCell;
- ost << " in 3D cell # " << current3DCell << " : Impossible or call tryToShareSameCoords method !";
- throw INTERP_KERNEL::Exception(ost.str().c_str());
-}
-
-void MEDCouplingExtrudedMesh::computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId)
-{
- double *zoneToUpdate=_mesh1D->getCoords()->getPointer()+lev1DId*3;
- std::fill(zoneToUpdate,zoneToUpdate+3,0.);
- const double *coords=_mesh2D->getCoords()->getConstPointer();
- for(std::vector<int>::const_iterator iter=nodalConnec.begin();iter!=nodalConnec.end();iter++)
- std::transform(zoneToUpdate,zoneToUpdate+3,coords+3*(*iter),zoneToUpdate,std::plus<double>());
- std::transform(zoneToUpdate,zoneToUpdate+3,zoneToUpdate,std::bind2nd(std::multiplies<double>(),(double)(1./(int)nodalConnec.size())));
-}
-
-int MEDCouplingExtrudedMesh::FindCorrespCellByNodalConn(const std::vector<int>& nodalConnec, const int *revNodalPtr, const int *revNodalIndxPtr)
-{
- std::vector<int>::const_iterator iter=nodalConnec.begin();
- std::set<int> s1(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1]);
- iter++;
- for(;iter!=nodalConnec.end();iter++)
- {
- std::set<int> s2(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1]);
- std::set<int> s3;
- std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(),std::insert_iterator< std::set<int> >(s3,s3.end()));
- s1=s3;
- }
- if(s1.size()==1)
- return *(s1.begin());
- std::ostringstream ostr;
- ostr << "Cell with nodal connec : ";
- std::copy(nodalConnec.begin(),nodalConnec.end(),std::ostream_iterator<int>(ostr," "));
- ostr << " is not part of mesh";
- throw INTERP_KERNEL::Exception(ostr.str().c_str());
-}
-
-/*!
- * This method is callable on 1Dmeshes (meshDim==1 && spaceDim==3) returned by MEDCouplingExtrudedMesh::getMesh1D typically.
- * These 1Dmeshes (meshDim==1 && spaceDim==3) have a special semantic because these meshes do not specify a static location but a translation along a path.
- * This method checks that 'm1' and 'm2' are compatible, if not an exception is thrown. In case these meshes ('m1' and 'm2') are compatible 2 corresponding meshes
- * are created ('m1r' and 'm2r') that can be used for interpolation.
- * @param m1 input mesh with meshDim==1 and spaceDim==3
- * @param m2 input mesh with meshDim==1 and spaceDim==3
- * @param eps tolerance acceptable to determine compatibility
- * @param m1r output mesh with ref count equal to 1 with meshDim==1 and spaceDim==1
- * @param m2r output mesh with ref count equal to 1 with meshDim==1 and spaceDim==1
- * @param v is the output normalized vector of the common direction of 'm1' and 'm2'
- * @throw in case that m1 and m2 are not compatible each other.
- */
-void MEDCouplingExtrudedMesh::Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
- MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v)
-{
- if(m1->getSpaceDimension()!=3 || m1->getSpaceDimension()!=3)
- throw INTERP_KERNEL::Exception("Input meshes are expected to have a spaceDim==3 for Projec1D !");
- m1r=m1->clone(true);
- m2r=m2->clone(true);
- m1r->changeSpaceDimension(1);
- m2r->changeSpaceDimension(1);
- std::vector<int> c;
- std::vector<double> ref,ref2;
- m1->getNodeIdsOfCell(0,c);
- m1->getCoordinatesOfNode(c[0],ref);
- m1->getCoordinatesOfNode(c[1],ref2);
- std::transform(ref2.begin(),ref2.end(),ref.begin(),v,std::minus<double>());
- double n=INTERP_KERNEL::norm<3>(v);
- std::transform(v,v+3,v,std::bind2nd(std::multiplies<double>(),1/n));
- m1->project1D(&ref[0],v,eps,m1r->getCoords()->getPointer());
- m2->project1D(&ref[0],v,eps,m2r->getCoords()->getPointer());
-}
-
-void MEDCouplingExtrudedMesh::rotate(const double *center, const double *vector, double angle)
-{
- _mesh2D->rotate(center,vector,angle);
- _mesh1D->rotate(center,vector,angle);
-}
-
-void MEDCouplingExtrudedMesh::translate(const double *vector)
-{
- _mesh2D->translate(vector);
- _mesh1D->translate(vector);
-}
-
-void MEDCouplingExtrudedMesh::scale(const double *point, double factor)
-{
- _mesh2D->scale(point,factor);
- _mesh1D->scale(point,factor);
-}
-
-std::vector<int> MEDCouplingExtrudedMesh::getDistributionOfTypes() const
-{
- throw INTERP_KERNEL::Exception("Not implemented yet !");
-}
-
-DataArrayInt *MEDCouplingExtrudedMesh::checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const
-{
- throw INTERP_KERNEL::Exception("Not implemented yet !");
-}
-
-void MEDCouplingExtrudedMesh::splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const
-{
- throw INTERP_KERNEL::Exception("Not implemented yet !");
-}
-
-MEDCouplingMesh *MEDCouplingExtrudedMesh::buildPart(const int *start, const int *end) const
-{
- // not implemented yet !
- return 0;
-}
-
-MEDCouplingMesh *MEDCouplingExtrudedMesh::buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const
-{
- // not implemented yet !
- return 0;
-}
-
-DataArrayInt *MEDCouplingExtrudedMesh::simplexize(int policy)
-{
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::simplexize : unavailable for such a type of mesh : Extruded !");
-}
-
-MEDCouplingMesh *MEDCouplingExtrudedMesh::mergeMyselfWith(const MEDCouplingMesh *other) const
-{
- // not implemented yet !
- return 0;
-}
-
-DataArrayDouble *MEDCouplingExtrudedMesh::getCoordinatesAndOwner() const
-{
- DataArrayDouble *arr2D=_mesh2D->getCoords();
- DataArrayDouble *arr1D=_mesh1D->getCoords();
- DataArrayDouble *ret=DataArrayDouble::New();
- ret->alloc(getNumberOfNodes(),3);
- int nbOf1DLev=_mesh1D->getNumberOfNodes();
- int nbOf2DNodes=_mesh2D->getNumberOfNodes();
- const double *ptSrc=arr2D->getConstPointer();
- double *pt=ret->getPointer();
- std::copy(ptSrc,ptSrc+3*nbOf2DNodes,pt);
- for(int i=1;i<nbOf1DLev;i++)
- {
- std::copy(ptSrc,ptSrc+3*nbOf2DNodes,pt+3*i*nbOf2DNodes);
- double vec[3];
- std::copy(arr1D->getConstPointer()+3*i,arr1D->getConstPointer()+3*(i+1),vec);
- std::transform(arr1D->getConstPointer()+3*(i-1),arr1D->getConstPointer()+3*i,vec,vec,std::minus<double>());
- for(int j=0;j<nbOf2DNodes;j++)
- std::transform(vec,vec+3,pt+3*(i*nbOf2DNodes+j),pt+3*(i*nbOf2DNodes+j),std::plus<double>());
- }
- return ret;
-}
-
-DataArrayDouble *MEDCouplingExtrudedMesh::getBarycenterAndOwner() const
-{
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::getBarycenterAndOwner : not yet implemented !");
-}
-
-DataArrayDouble *MEDCouplingExtrudedMesh::computeIsoBarycenterOfNodesPerCell() const
-{
- throw INTERP_KERNEL::Exception("MEDCouplingExtrudedMesh::computeIsoBarycenterOfNodesPerCell: not yet implemented !");
-}
-
-void MEDCouplingExtrudedMesh::getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const
-{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m(buildUnstructured());
- m->getReverseNodalConnectivity(revNodal,revNodalIndx);
-}
-
-void MEDCouplingExtrudedMesh::computeExtrusionAlg(const MEDCouplingUMesh *mesh3D)
-{
- _mesh3D_ids->alloc(mesh3D->getNumberOfCells(),1);
- int nbOf1DLev=mesh3D->getNumberOfCells()/_mesh2D->getNumberOfCells();
- _mesh1D->setMeshDimension(1);
- _mesh1D->allocateCells(nbOf1DLev);
- int tmpConn[2];
- for(int i=0;i<nbOf1DLev;i++)
- {
- tmpConn[0]=i;
- tmpConn[1]=i+1;
- _mesh1D->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,tmpConn);
- }
- _mesh1D->finishInsertingCells();
- DataArrayDouble *myCoords=DataArrayDouble::New();
- myCoords->alloc(nbOf1DLev+1,3);
- _mesh1D->setCoords(myCoords);
- myCoords->decrRef();
- DataArrayInt *desc,*descIndx,*revDesc,*revDescIndx;
- desc=DataArrayInt::New(); descIndx=DataArrayInt::New(); revDesc=DataArrayInt::New(); revDescIndx=DataArrayInt::New();
- MEDCouplingUMesh *subMesh=mesh3D->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- DataArrayInt *revNodal2D,*revNodalIndx2D;
- revNodal2D=DataArrayInt::New(); revNodalIndx2D=DataArrayInt::New();
- subMesh->getReverseNodalConnectivity(revNodal2D,revNodalIndx2D);
- const int *nodal2D=_mesh2D->getNodalConnectivity()->getConstPointer();
- const int *nodal2DIndx=_mesh2D->getNodalConnectivityIndex()->getConstPointer();
- const int *revNodal2DPtr=revNodal2D->getConstPointer();
- const int *revNodalIndx2DPtr=revNodalIndx2D->getConstPointer();
- const int *descP=desc->getConstPointer();
- const int *descIndxP=descIndx->getConstPointer();
- const int *revDescP=revDesc->getConstPointer();
- const int *revDescIndxP=revDescIndx->getConstPointer();
- //
- int nbOf2DCells=_mesh2D->getNumberOfCells();
- for(int i=0;i<nbOf2DCells;i++)
- {
- int idInSubMesh;
- std::vector<int> nodalConnec(nodal2D+nodal2DIndx[i]+1,nodal2D+nodal2DIndx[i+1]);
- try
- {
- idInSubMesh=FindCorrespCellByNodalConn(nodalConnec,revNodal2DPtr,revNodalIndx2DPtr);
- }
- catch(INTERP_KERNEL::Exception& e)
- {
- std::ostringstream ostr; ostr << "mesh2D cell # " << i << " is not part of any cell of 3D mesh !\n";
- ostr << e.what();
- throw INTERP_KERNEL::Exception(ostr.str().c_str());
- }
- build1DExtrusion(idInSubMesh,i,nbOf1DLev,subMesh,descP,descIndxP,revDescP,revDescIndxP,i==_cell_2D_id);
- }
- //
- revNodal2D->decrRef();
- revNodalIndx2D->decrRef();
- subMesh->decrRef();
- desc->decrRef();
- descIndx->decrRef();
- revDesc->decrRef();
- revDescIndx->decrRef();
-}
-
-void MEDCouplingExtrudedMesh::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
-{
- std::vector<int> tinyInfo1;
- std::vector<std::string> ls1;
- std::vector<double> ls3;
- _mesh2D->getTinySerializationInformation(ls3,tinyInfo1,ls1);
- std::vector<int> tinyInfo2;
- std::vector<std::string> ls2;
- std::vector<double> ls4;
- _mesh1D->getTinySerializationInformation(ls4,tinyInfo2,ls2);
- tinyInfo.clear(); littleStrings.clear();
- tinyInfo.insert(tinyInfo.end(),tinyInfo1.begin(),tinyInfo1.end());
- littleStrings.insert(littleStrings.end(),ls1.begin(),ls1.end());
- tinyInfo.insert(tinyInfo.end(),tinyInfo2.begin(),tinyInfo2.end());
- littleStrings.insert(littleStrings.end(),ls2.begin(),ls2.end());
- tinyInfo.push_back(_cell_2D_id);
- tinyInfo.push_back((int)tinyInfo1.size());
- tinyInfo.push_back(_mesh3D_ids->getNbOfElems());
- littleStrings.push_back(getName());
- littleStrings.push_back(getDescription());
-}
-
-void MEDCouplingExtrudedMesh::resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const
-{
- std::size_t sz=tinyInfo.size();
- int sz1=tinyInfo[sz-2];
- std::vector<int> ti1(tinyInfo.begin(),tinyInfo.begin()+sz1);
- std::vector<int> ti2(tinyInfo.begin()+sz1,tinyInfo.end()-3);
- MEDCouplingUMesh *um=MEDCouplingUMesh::New();
- DataArrayInt *a1tmp=DataArrayInt::New();
- DataArrayDouble *a2tmp=DataArrayDouble::New();
- int la1=0,la2=0;
- std::vector<std::string> ls1,ls2;
- um->resizeForUnserialization(ti1,a1tmp,a2tmp,ls1);
- la1+=a1tmp->getNbOfElems(); la2+=a2tmp->getNbOfElems();
- a1tmp->decrRef(); a2tmp->decrRef();
- a1tmp=DataArrayInt::New(); a2tmp=DataArrayDouble::New();
- um->resizeForUnserialization(ti2,a1tmp,a2tmp,ls2);
- la1+=a1tmp->getNbOfElems(); la2+=a2tmp->getNbOfElems();
- a1tmp->decrRef(); a2tmp->decrRef();
- um->decrRef();
- //
- a1->alloc(la1+tinyInfo[sz-1],1);
- a2->alloc(la2,1);
- littleStrings.resize(ls1.size()+ls2.size()+2);
-}
-
-void MEDCouplingExtrudedMesh::serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const
-{
- a1=DataArrayInt::New(); a2=DataArrayDouble::New();
- DataArrayInt *a1_1=0,*a1_2=0;
- DataArrayDouble *a2_1=0,*a2_2=0;
- _mesh2D->serialize(a1_1,a2_1);
- _mesh1D->serialize(a1_2,a2_2);
- a1->alloc(a1_1->getNbOfElems()+a1_2->getNbOfElems()+_mesh3D_ids->getNbOfElems(),1);
- int *ptri=a1->getPointer();
- ptri=std::copy(a1_1->getConstPointer(),a1_1->getConstPointer()+a1_1->getNbOfElems(),ptri);
- a1_1->decrRef();
- ptri=std::copy(a1_2->getConstPointer(),a1_2->getConstPointer()+a1_2->getNbOfElems(),ptri);
- a1_2->decrRef();
- std::copy(_mesh3D_ids->getConstPointer(),_mesh3D_ids->getConstPointer()+_mesh3D_ids->getNbOfElems(),ptri);
- a2->alloc(a2_1->getNbOfElems()+a2_2->getNbOfElems(),1);
- double *ptrd=a2->getPointer();
- ptrd=std::copy(a2_1->getConstPointer(),a2_1->getConstPointer()+a2_1->getNbOfElems(),ptrd);
- a2_1->decrRef();
- std::copy(a2_2->getConstPointer(),a2_2->getConstPointer()+a2_2->getNbOfElems(),ptrd);
- a2_2->decrRef();
-}
-
-void MEDCouplingExtrudedMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
-{
- setName(littleStrings[littleStrings.size()-2]);
- setDescription(littleStrings.back());
- std::size_t sz=tinyInfo.size();
- int sz1=tinyInfo[sz-2];
- _cell_2D_id=tinyInfo[sz-3];
- std::vector<int> ti1(tinyInfo.begin(),tinyInfo.begin()+sz1);
- std::vector<int> ti2(tinyInfo.begin()+sz1,tinyInfo.end()-3);
- DataArrayInt *a1tmp=DataArrayInt::New();
- DataArrayDouble *a2tmp=DataArrayDouble::New();
- const int *a1Ptr=a1->getConstPointer();
- const double *a2Ptr=a2->getConstPointer();
- _mesh2D=MEDCouplingUMesh::New();
- std::vector<std::string> ls1,ls2;
- _mesh2D->resizeForUnserialization(ti1,a1tmp,a2tmp,ls1);
- std::copy(a2Ptr,a2Ptr+a2tmp->getNbOfElems(),a2tmp->getPointer());
- std::copy(a1Ptr,a1Ptr+a1tmp->getNbOfElems(),a1tmp->getPointer());
- a2Ptr+=a2tmp->getNbOfElems();
- a1Ptr+=a1tmp->getNbOfElems();
- ls2.insert(ls2.end(),littleStrings.begin(),littleStrings.begin()+ls1.size());
- std::vector<double> d1(1);
- _mesh2D->unserialization(d1,ti1,a1tmp,a2tmp,ls2);
- a1tmp->decrRef(); a2tmp->decrRef();
- //
- ls2.clear();
- ls2.insert(ls2.end(),littleStrings.begin()+ls1.size(),littleStrings.end()-2);
- _mesh1D=MEDCouplingUMesh::New();
- a1tmp=DataArrayInt::New(); a2tmp=DataArrayDouble::New();
- _mesh1D->resizeForUnserialization(ti2,a1tmp,a2tmp,ls1);
- std::copy(a2Ptr,a2Ptr+a2tmp->getNbOfElems(),a2tmp->getPointer());
- std::copy(a1Ptr,a1Ptr+a1tmp->getNbOfElems(),a1tmp->getPointer());
- a1Ptr+=a1tmp->getNbOfElems();
- _mesh1D->unserialization(d1,ti2,a1tmp,a2tmp,ls2);
- a1tmp->decrRef(); a2tmp->decrRef();
- //
- _mesh3D_ids=DataArrayInt::New();
- int szIds=(int)std::distance(a1Ptr,a1->getConstPointer()+a1->getNbOfElems());
- _mesh3D_ids->alloc(szIds,1);
- std::copy(a1Ptr,a1Ptr+szIds,_mesh3D_ids->getPointer());
-}
-
-void MEDCouplingExtrudedMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const
-{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=buildUnstructured();
- m->writeVTKLL(ofs,cellData,pointData,byteData);
-}
-
-void MEDCouplingExtrudedMesh::reprQuickOverview(std::ostream& stream) const
-{
- stream << "MEDCouplingExtrudedMesh C++ instance at " << this << ". Name : \"" << getName() << "\".";
-}
-
-std::string MEDCouplingExtrudedMesh::getVTKFileExtension() const
-{
- return _mesh2D->getVTKFileExtension();
-}
-
-std::string MEDCouplingExtrudedMesh::getVTKDataSetType() const
-{
- return _mesh2D->getVTKDataSetType();
-}
+++ /dev/null
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Anthony Geay (CEA/DEN)
-
-#ifndef __PARAMEDMEM_MEDCOUPLINGEXTRUDEDMESH_HXX__
-#define __PARAMEDMEM_MEDCOUPLINGEXTRUDEDMESH_HXX__
-
-#include "MEDCoupling.hxx"
-#include "MEDCouplingMesh.hxx"
-
-#include <vector>
-
-namespace ParaMEDMEM
-{
- class DataArrayInt;
- class DataArrayDouble;
- class MEDCouplingUMesh;
- class MEDCouplingFieldDouble;
-
- class MEDCouplingExtrudedMesh : public MEDCouplingMesh
- {
- public:
- MEDCOUPLING_EXPORT static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
- MEDCOUPLING_EXPORT static MEDCouplingExtrudedMesh *New();
- MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const;
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
- MEDCOUPLING_EXPORT int getNumberOfCells() const;
- MEDCOUPLING_EXPORT int getNumberOfNodes() const;
- MEDCOUPLING_EXPORT int getSpaceDimension() const;
- MEDCOUPLING_EXPORT int getMeshDimension() const;
- MEDCOUPLING_EXPORT MEDCouplingExtrudedMesh *deepCpy() const;
- MEDCouplingExtrudedMesh *clone(bool recDeepCpy) const;
- MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
- MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
- MEDCOUPLING_EXPORT void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
- DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const;
- MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
- DataArrayInt *&cellCor) const;
- MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
- MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
- MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
- MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const;
- MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
- MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
- MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
- MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
- MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
- MEDCOUPLING_EXPORT std::string simpleRepr() const;
- MEDCOUPLING_EXPORT std::string advancedRepr() const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
- MEDCOUPLING_EXPORT void getBoundingBox(double *bbox) const;
- MEDCOUPLING_EXPORT void updateTime() const;
- MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true);
- MEDCOUPLING_EXPORT MEDCouplingUMesh *getMesh2D() const { return _mesh2D; }
- MEDCOUPLING_EXPORT MEDCouplingUMesh *getMesh1D() const { return _mesh1D; }
- MEDCOUPLING_EXPORT DataArrayInt *getMesh3DIds() const { return _mesh3D_ids; }
- MEDCOUPLING_EXPORT MEDCouplingUMesh *build3DUnstructuredMesh() const;
- MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const;
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool) const;
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool) const;
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const;
- MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const;
- MEDCOUPLING_EXPORT static int FindCorrespCellByNodalConn(const std::vector<int>& nodalConnec,
- const int *revNodalPtr, const int *revNodalIndxPtr);
- MEDCOUPLING_EXPORT static void Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
- MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v);
- MEDCOUPLING_EXPORT void rotate(const double *center, const double *vector, double angle);
- MEDCOUPLING_EXPORT void translate(const double *vector);
- MEDCOUPLING_EXPORT void scale(const double *point, double factor);
- MEDCOUPLING_EXPORT std::vector<int> getDistributionOfTypes() const;
- MEDCOUPLING_EXPORT DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const;
- MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const;
- MEDCOUPLING_EXPORT MEDCouplingMesh *buildPart(const int *start, const int *end) const;
- MEDCOUPLING_EXPORT MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
- MEDCOUPLING_EXPORT DataArrayInt *simplexize(int policy);
- MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
- MEDCOUPLING_EXPORT DataArrayDouble *getCoordinatesAndOwner() const;
- MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
- MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
- MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const;
- //Serialization unserialisation
- MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
- MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
- MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
- MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
- const std::vector<std::string>& littleStrings);
- MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
- MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
- private:
- MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
- MEDCouplingExtrudedMesh(const MEDCouplingExtrudedMesh& other, bool deepCopy);
- MEDCouplingExtrudedMesh();
- void computeExtrusion(const MEDCouplingUMesh *mesh3D);
- void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D);
- void build1DExtrusion(int idIn3DDesc, int newId, int nbOf1DLev, MEDCouplingUMesh *subMesh,
- const int *desc3D, const int *descIndx3D,
- const int *revDesc3D, const int *revDescIndx3D,
- bool computeMesh1D);
- int findOppositeFaceOf(int current2DCell, int current3DCell, const std::vector<int>& connSorted,
- const int *desc3D, const int *descIndx3D,
- const int *conn2D, const int *conn2DIndx);
- void computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId);
- ~MEDCouplingExtrudedMesh();
- void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
- std::string getVTKDataSetType() const;
- private:
- MEDCouplingUMesh *_mesh2D;
- MEDCouplingUMesh *_mesh1D;
- //! New to old 3D cell Ids Array
- DataArrayInt *_mesh3D_ids;
- int _cell_2D_id;
- };
-}
-
-#endif
#include <sstream>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
bool MEDCouplingField::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const
{
/*!
* Returns a type of \ref MEDCouplingSpatialDisc "spatial discretization" of \a this
- * field in terms of enum ParaMEDMEM::TypeOfField.
- * \return ParaMEDMEM::TypeOfField - the type of \a this field.
+ * field in terms of enum MEDCoupling::TypeOfField.
+ * \return MEDCoupling::TypeOfField - the type of \a this field.
* \throw If the geometric type is empty.
*/
TypeOfField MEDCouplingField::getTypeOfField() const
/*!
* Returns the nature of \a this field. This information is very important during
- * interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC.
+ * interpolation process using MEDCoupling::MEDCouplingRemapper or MEDCoupling::InterpKernelDEC.
* In other context than the two mentioned above, this attribute is unimportant. This
* attribute is not stored in the MED file.
* For more information of the semantics and the influence of this attribute to the
/*!
* Sets the nature of \a this field. This information is very important during
- * interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC.
+ * interpolation process using MEDCoupling::MEDCouplingRemapper or MEDCoupling::InterpKernelDEC.
* In other context than the two mentioned above, this attribute is unimportant. This
* attribute is not stored in the MED file.
* For more information of the semantics and the influence of this attribute to the
* problem.
* \param [in] locId - the id of the Gauss localization object of interest.
* It must be in range <em> 0 <= locId < getNbOfGaussLocalization() </em>.
- * \return \ref ParaMEDMEM::MEDCouplingGaussLocalization "MEDCouplingGaussLocalization" & - the
+ * \return \ref MEDCoupling::MEDCouplingGaussLocalization "MEDCouplingGaussLocalization" & - the
* Gauss localization object.
* \throw If \a this field is not on Gauss points.
* \throw If \a locId is not within the valid range.
#include "MEDCouplingNatureOfField.hxx"
#include "MEDCouplingRefCountObject.hxx"
#include "NormalizedUnstructuredMesh.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
#include "InterpKernelException.hxx"
#include <string>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayInt;
class DataArrayDouble;
class MEDCouplingField : public RefCountObject, public TimeLabel
{
public:
- MEDCOUPLING_EXPORT virtual void checkCoherency() const = 0;
+ MEDCOUPLING_EXPORT virtual void checkConsistencyLight() const = 0;
MEDCOUPLING_EXPORT virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
MEDCOUPLING_EXPORT virtual bool areStrictlyCompatible(const MEDCouplingField *other) const;
MEDCOUPLING_EXPORT virtual bool areStrictlyCompatibleForMulDiv(const MEDCouplingField *other) const;
MEDCOUPLING_EXPORT virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const;
MEDCOUPLING_EXPORT virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const;
MEDCOUPLING_EXPORT virtual void copyTinyStringsFrom(const MEDCouplingField *other);
- MEDCOUPLING_EXPORT void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh);
- MEDCOUPLING_EXPORT const ParaMEDMEM::MEDCouplingMesh *getMesh() const { return _mesh; }
- MEDCOUPLING_EXPORT ParaMEDMEM::MEDCouplingMesh *getMesh() { return const_cast<ParaMEDMEM::MEDCouplingMesh *>(_mesh); }
+ MEDCOUPLING_EXPORT void setMesh(const MEDCoupling::MEDCouplingMesh *mesh);
+ MEDCOUPLING_EXPORT const MEDCoupling::MEDCouplingMesh *getMesh() const { return _mesh; }
+ MEDCOUPLING_EXPORT MEDCoupling::MEDCouplingMesh *getMesh() { return const_cast<MEDCoupling::MEDCouplingMesh *>(_mesh); }
MEDCOUPLING_EXPORT void setName(const std::string& name) { _name=name; }
MEDCOUPLING_EXPORT std::string getDescription() const { return _desc; }
MEDCOUPLING_EXPORT void setDescription(const std::string& desc) { _desc=desc; }
std::string _desc;
NatureOfField _nature;
const MEDCouplingMesh *_mesh;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretization> _type;
+ MCAuto<MEDCouplingFieldDiscretization> _type;
};
}
#include "MEDCouplingCMesh.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "CellModel.hxx"
#include "InterpolationUtils.hxx"
#include <algorithm>
#include <functional>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const double MEDCouplingFieldDiscretization::DFLT_PRECISION=1.e-12;
* This method is an alias of MEDCouplingFieldDiscretization::clone. It is only here for coherency with all the remaining of MEDCoupling.
* \sa MEDCouplingFieldDiscretization::clone.
*/
-MEDCouplingFieldDiscretization *MEDCouplingFieldDiscretization::deepCpy() const
+MEDCouplingFieldDiscretization *MEDCouplingFieldDiscretization::deepCopy() const
{
return clone();
}
*/
void MEDCouplingFieldDiscretization::normL1(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, double *res) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=getMeasureField(mesh,true);
+ MCAuto<MEDCouplingFieldDouble> vol=getMeasureField(mesh,true);
int nbOfCompo=arr->getNumberOfComponents();
int nbOfElems=getNumberOfTuples(mesh);
std::fill(res,res+nbOfCompo,0.);
*/
void MEDCouplingFieldDiscretization::normL2(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, double *res) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=getMeasureField(mesh,true);
+ MCAuto<MEDCouplingFieldDouble> vol=getMeasureField(mesh,true);
int nbOfCompo=arr->getNumberOfComponents();
int nbOfElems=getNumberOfTuples(mesh);
std::fill(res,res+nbOfCompo,0.);
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::integral : mesh is NULL !");
if(!arr)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::integral : input array is NULL !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=getMeasureField(mesh,isWAbs);
+ MCAuto<MEDCouplingFieldDouble> vol=getMeasureField(mesh,isWAbs);
int nbOfCompo=arr->getNumberOfComponents();
int nbOfElems=getNumberOfTuples(mesh);
if(nbOfElems!=arr->getNumberOfTuples())
*/
MEDCouplingMesh *MEDCouplingFieldDiscretization::buildSubMeshDataRange(const MEDCouplingMesh *mesh, int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt *&di) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::Range(beginCellIds,endCellIds,stepCellIds);
+ MCAuto<DataArrayInt> da=DataArrayInt::Range(beginCellIds,endCellIds,stepCellIds);
return buildSubMeshData(mesh,da->begin(),da->end(),di);
}
int oldNbOfElems=arr->getNumberOfTuples();
int nbOfComp=arr->getNumberOfComponents();
int newNbOfTuples=newNbOfEntity;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arrCpy=arr->deepCpy();
+ MCAuto<DataArrayDouble> arrCpy=arr->deepCopy();
const double *ptSrc=arrCpy->getConstPointer();
arr->reAlloc(newNbOfTuples);
double *ptToFill=arr->getPointer();
void MEDCouplingFieldDiscretization::RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const std::string& msg)
{
int nbOfComp=arr->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arrCpy=arr->deepCpy();
+ MCAuto<DataArrayDouble> arrCpy=arr->deepCopy();
const double *ptSrc=arrCpy->getConstPointer();
arr->reAlloc(new2OldSz);
double *ptToFill=arr->getPointer();
}
/*!
- * This method is simply called by MEDCouplingFieldDiscretization::deepCpy. It performs the deep copy of \a this.
+ * This method is simply called by MEDCouplingFieldDiscretization::deepCopy. It performs the deep copy of \a this.
*
- * \sa MEDCouplingFieldDiscretization::deepCpy.
+ * \sa MEDCouplingFieldDiscretization::deepCopy.
*/
MEDCouplingFieldDiscretization *MEDCouplingFieldDiscretizationP0::clone() const
{
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP0::getLocalizationOfDiscValues : NULL input mesh !");
- return mesh->getBarycenterAndOwner();
+ return mesh->computeCellCenterOfMass();
}
void MEDCouplingFieldDiscretizationP0::computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *tupleIdsBg, const int *tupleIdsEnd,
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP0::computeMeshRestrictionFromTupleIds : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=DataArrayInt::New();
+ MCAuto<DataArrayInt> tmp=DataArrayInt::New();
tmp->alloc((int)std::distance(tupleIdsBg,tupleIdsEnd),1);
std::copy(tupleIdsBg,tupleIdsEnd,tmp->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp2(tmp->deepCpy());
+ MCAuto<DataArrayInt> tmp2(tmp->deepCopy());
cellRestriction=tmp.retn();
trueTupleRestriction=tmp2.retn();
}
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP0::getValueOnMulti : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsArr,eltsIndexArr;
+ MCAuto<DataArrayInt> eltsArr,eltsIndexArr;
mesh->getCellsContainingPoints(loc,nbOfPoints,_precision,eltsArr,eltsIndexArr);
const int *elts(eltsArr->begin()),*eltsIndex(eltsIndexArr->begin());
int spaceDim=mesh->getSpaceDimension();
int nbOfComponents=arr->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfPoints,nbOfComponents);
double *ptToFill=ret->getPointer();
for(int i=0;i<nbOfPoints;i++,ptToFill+=nbOfComponents)
*/
DataArrayInt *MEDCouplingFieldDiscretizationP0::computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc((int)std::distance(startCellIds,endCellIds),1);
std::copy(startCellIds,endCellIds,ret->getPointer());
return ret.retn();
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP0::buildSubMeshData : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPart(start,end);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diSafe=DataArrayInt::New();
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPart(start,end);
+ MCAuto<DataArrayInt> diSafe=DataArrayInt::New();
diSafe->alloc((int)std::distance(start,end),1);
std::copy(start,end,diSafe->getPointer());
di=diSafe.retn();
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP0::buildSubMeshDataRange : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPartRange(beginCellIds,endCellIds,stepCellIds);
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPartRange(beginCellIds,endCellIds,stepCellIds);
di=0; beginOut=beginCellIds; endOut=endCellIds; stepOut=stepCellIds;
return ret.retn();
}
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationOnNodes::computeMeshRestrictionFromTupleIds : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1=mesh->getCellIdsFullyIncludedInNodeIds(tupleIdsBg,tupleIdsEnd);
+ MCAuto<DataArrayInt> ret1=mesh->getCellIdsFullyIncludedInNodeIds(tupleIdsBg,tupleIdsEnd);
const MEDCouplingUMesh *meshc=dynamic_cast<const MEDCouplingUMesh *>(mesh);
if(!meshc)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationOnNodes::computeMeshRestrictionFromTupleIds : trying to subpart field on nodes by node ids ! Your mesh has to be unstructured !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> meshPart=static_cast<MEDCouplingUMesh *>(meshc->buildPartOfMySelf(ret1->begin(),ret1->end(),true));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2=meshPart->computeFetchedNodeIds();
+ MCAuto<MEDCouplingUMesh> meshPart=static_cast<MEDCouplingUMesh *>(meshc->buildPartOfMySelf(ret1->begin(),ret1->end(),true));
+ MCAuto<DataArrayInt> ret2=meshPart->computeFetchedNodeIds();
cellRestriction=ret1.retn();
trueTupleRestriction=ret2.retn();
}
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationNodes::buildSubMeshData : NULL input mesh !");
DataArrayInt *diTmp=0;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPartAndReduceNodes(start,end,diTmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diTmpSafe(diTmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> di2=diTmpSafe->invertArrayO2N2N2O(ret->getNumberOfNodes());
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPartAndReduceNodes(start,end,diTmp);
+ MCAuto<DataArrayInt> diTmpSafe(diTmp);
+ MCAuto<DataArrayInt> di2=diTmpSafe->invertArrayO2N2N2O(ret->getNumberOfNodes());
di=di2.retn();
return ret.retn();
}
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationOnNodes::buildSubMeshDataRange : NULL input mesh !");
DataArrayInt *diTmp=0;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,beginOut,endOut,stepOut,diTmp);
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPartRangeAndReduceNodes(beginCellIds,endCellIds,stepCellIds,beginOut,endOut,stepOut,diTmp);
if(diTmp)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diTmpSafe(diTmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> di2=diTmpSafe->invertArrayO2N2N2O(ret->getNumberOfNodes());
+ MCAuto<DataArrayInt> diTmpSafe(diTmp);
+ MCAuto<DataArrayInt> di2=diTmpSafe->invertArrayO2N2N2O(ret->getNumberOfNodes());
di=di2.retn();
}
return ret.retn();
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP1::computeTupleIdsToSelectFromCellIds : NULL input mesh !");
- const MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> umesh=mesh->buildUnstructured();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> umesh2=static_cast<MEDCouplingUMesh *>(umesh->buildPartOfMySelf(startCellIds,endCellIds,true));
+ const MCAuto<MEDCouplingUMesh> umesh=mesh->buildUnstructured();
+ MCAuto<MEDCouplingUMesh> umesh2=static_cast<MEDCouplingUMesh *>(umesh->buildPartOfMySelf(startCellIds,endCellIds,true));
return umesh2->computeFetchedNodeIds();
}
}
/*!
- * This method is simply called by MEDCouplingFieldDiscretization::deepCpy. It performs the deep copy of \a this.
+ * This method is simply called by MEDCouplingFieldDiscretization::deepCopy. It performs the deep copy of \a this.
*
- * \sa MEDCouplingFieldDiscretization::deepCpy.
+ * \sa MEDCouplingFieldDiscretization::deepCopy.
*/
MEDCouplingFieldDiscretization *MEDCouplingFieldDiscretizationP1::clone() const
{
void MEDCouplingFieldDiscretizationP1::checkCompatibilityWithNature(NatureOfField nat) const
{
- if(nat!=ConservativeVolumic)
- throw INTERP_KERNEL::Exception("Invalid nature for P1 field : expected ConservativeVolumic !");
+ if(nat!=IntensiveMaximum)
+ throw INTERP_KERNEL::Exception("Invalid nature for P1 field : expected IntensiveMaximum !");
}
MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationP1::getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP1::getValueOnMulti : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsArr,eltsIndexArr;
+ MCAuto<DataArrayInt> eltsArr,eltsIndexArr;
mesh->getCellsContainingPoints(loc,nbOfPoints,_precision,eltsArr,eltsIndexArr);
const int *elts(eltsArr->begin()),*eltsIndex(eltsIndexArr->begin());
int spaceDim=mesh->getSpaceDimension();
int nbOfComponents=arr->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfPoints,nbOfComponents);
double *ptToFill=ret->getPointer();
for(int i=0;i<nbOfPoints;i++)
}
/*!
- * This constructor deep copies ParaMEDMEM::DataArrayInt instance from other (if any).
+ * This constructor deep copies MEDCoupling::DataArrayInt instance from other (if any).
*/
MEDCouplingFieldDiscretizationPerCell::MEDCouplingFieldDiscretizationPerCell(const MEDCouplingFieldDiscretizationPerCell& other, const int *startCellIds, const int *endCellIds):_discr_per_cell(0)
{
if(arr)
{
if(startCellIds==0 && endCellIds==0)
- _discr_per_cell=arr->deepCpy();
+ _discr_per_cell=arr->deepCopy();
else
_discr_per_cell=arr->selectByTupleIdSafe(startCellIds,endCellIds);
}
DataArrayInt *arr=other._discr_per_cell;
if(arr)
{
- _discr_per_cell=arr->selectByTupleId2(beginCellIds,endCellIds,stepCellIds);
+ _discr_per_cell=arr->selectByTupleIdSafeSlice(beginCellIds,endCellIds,stepCellIds);
}
}
{
if(!_discr_per_cell)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationPerCell::checkNoOrphanCells : no discretization defined !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> test=_discr_per_cell->getIdsEqual(DFT_INVALID_LOCID_VALUE);
+ MCAuto<DataArrayInt> test=_discr_per_cell->findIdsEqual(DFT_INVALID_LOCID_VALUE);
if(test->getNumberOfTuples()!=0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationPerCell::checkNoOrphanCells : presence of orphan cells !");
}
}
/*!
- * This method is simply called by MEDCouplingFieldDiscretization::deepCpy. It performs the deep copy of \a this.
+ * This method is simply called by MEDCouplingFieldDiscretization::deepCopy. It performs the deep copy of \a this.
*
- * \sa MEDCouplingFieldDiscretization::deepCpy.
+ * \sa MEDCouplingFieldDiscretization::deepCopy.
*/
MEDCouplingFieldDiscretization *MEDCouplingFieldDiscretizationGauss::clone() const
{
/*!
* This method is redevelopped for performance reasons, but it is equivalent to a call to MEDCouplingFieldDiscretizationGauss::buildNbOfGaussPointPerCellField
- * and a call to DataArrayDouble::computeOffsets2 on the returned array.
+ * and a call to DataArrayDouble::computeOffsetsFull on the returned array.
*/
DataArrayInt *MEDCouplingFieldDiscretizationGauss::getOffsetArr(const MEDCouplingMesh *mesh) const
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getOffsetArr : NULL input mesh !");
int nbOfTuples=mesh->getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples+1,1);
int *retPtr=ret->getPointer();
const int *start=_discr_per_cell->getConstPointer();
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getLocalizationOfDiscValues : NULL input mesh !");
checkNoOrphanCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> umesh=mesh->buildUnstructured();//in general do nothing
+ MCAuto<MEDCouplingUMesh> umesh=mesh->buildUnstructured();//in general do nothing
int nbOfTuples=getNumberOfTuples(mesh);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int spaceDim=mesh->getSpaceDimension();
ret->alloc(nbOfTuples,spaceDim);
std::vector< int > locIds;
std::vector<DataArrayInt *> parts=splitIntoSingleGaussDicrPerCellType(locIds);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > parts2(parts.size());
+ std::vector< MCAuto<DataArrayInt> > parts2(parts.size());
std::copy(parts.begin(),parts.end(),parts2.begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> offsets=buildNbOfGaussPointPerCellField();
+ MCAuto<DataArrayInt> offsets=buildNbOfGaussPointPerCellField();
offsets->computeOffsets();
const int *ptrOffsets=offsets->getConstPointer();
const double *coords=umesh->getCoords()->getConstPointer();
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::computeMeshRestrictionFromTupleIds : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=DataArrayInt::New(); tmp->alloc((int)std::distance(tupleIdsBg,tupleIdsEnd),1);
+ MCAuto<DataArrayInt> tmp=DataArrayInt::New(); tmp->alloc((int)std::distance(tupleIdsBg,tupleIdsEnd),1);
std::copy(tupleIdsBg,tupleIdsEnd,tmp->getPointer());
tmp->sort(true);
tmp=tmp->buildUnique();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nbOfNodesPerCell=buildNbOfGaussPointPerCellField();
- nbOfNodesPerCell->computeOffsets2();
- nbOfNodesPerCell->searchRangesInListOfIds(tmp,cellRestriction,trueTupleRestriction);
+ MCAuto<DataArrayInt> nbOfNodesPerCell=buildNbOfGaussPointPerCellField();
+ nbOfNodesPerCell->computeOffsetsFull();
+ nbOfNodesPerCell->findIdsRangesInListOfIds(tmp,cellRestriction,trueTupleRestriction);
}
/*!
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::checkCoherencyBetween : NULL input mesh or DataArray !");
MEDCouplingFieldDiscretizationPerCell::checkCoherencyBetween(mesh,da);
for(std::vector<MEDCouplingGaussLocalization>::const_iterator iter=_loc.begin();iter!=_loc.end();iter++)
- (*iter).checkCoherency();
+ (*iter).checkConsistencyLight();
int nbOfDesc=(int)_loc.size();
int nbOfCells=mesh->getNumberOfCells();
const int *dc=_discr_per_cell->getConstPointer();
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : mesh instance specified is NULL !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=mesh->getMeasureField(isAbs);
+ MCAuto<MEDCouplingFieldDouble> vol=mesh->getMeasureField(isAbs);
const double *volPtr=vol->getArray()->begin();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_GAUSS_PT);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_GAUSS_PT);
ret->setMesh(mesh);
ret->setDiscretization(const_cast<MEDCouplingFieldDiscretizationGauss *>(this));
if(!_discr_per_cell)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but with nb of components different from 1 !");
if(_discr_per_cell->getNumberOfTuples()!=vol->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but mismatch between nb of cells of mesh and size of spatial disr array !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> offset=getOffsetArr(mesh);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New(); arr->alloc(getNumberOfTuples(mesh),1);
+ MCAuto<DataArrayInt> offset=getOffsetArr(mesh);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New(); arr->alloc(getNumberOfTuples(mesh),1);
ret->setArray(arr);
double *arrPtr=arr->getPointer();
const int *offsetPtr=offset->getConstPointer();
int maxGaussLoc=(int)_loc.size();
std::vector<int> locIds;
std::vector<DataArrayInt *> ids=splitIntoSingleGaussDicrPerCellType(locIds);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > ids2(ids.size()); std::copy(ids.begin(),ids.end(),ids2.begin());
+ std::vector< MCAuto<DataArrayInt> > ids2(ids.size()); std::copy(ids.begin(),ids.end(),ids2.begin());
for(std::size_t i=0;i<locIds.size();i++)
{
const DataArrayInt *curIds=ids[i];
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::buildSubMeshData : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diSafe=computeTupleIdsToSelectFromCellIds(mesh,start,end);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPart(start,end);
+ MCAuto<DataArrayInt> diSafe=computeTupleIdsToSelectFromCellIds(mesh,start,end);
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPart(start,end);
di=diSafe.retn();
return ret.retn();
}
else
{ std::ostringstream oss; oss << msg << i << " is detected as orphan !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPartRange(beginCellIds,endCellIds,stepCellIds);
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPartRange(beginCellIds,endCellIds,stepCellIds);
return ret.retn();
}
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::computeTupleIdsToSelectFromCellIds : null mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nbOfNodesPerCell=buildNbOfGaussPointPerCellField();//check of _discr_per_cell not NULL pointer
+ MCAuto<DataArrayInt> nbOfNodesPerCell=buildNbOfGaussPointPerCellField();//check of _discr_per_cell not NULL pointer
int nbOfCells=mesh->getNumberOfCells();
if(_discr_per_cell->getNumberOfTuples()!=nbOfCells)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::computeTupleIdsToSelectFromCellIds : mismatch of nb of tuples of cell ids array and number of cells !");
- nbOfNodesPerCell->computeOffsets2();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
+ nbOfNodesPerCell->computeOffsetsFull();
+ MCAuto<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
return sel->buildExplicitArrByRanges(nbOfNodesPerCell);
}
if(!_discr_per_cell)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::buildNbOfGaussPointPerCellField : no discretization array set !");
int nbOfTuples=_discr_per_cell->getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
const int *w=_discr_per_cell->begin();
ret->alloc(nbOfTuples,1);
int *valsToFill=ret->getPointer();
}
/*!
- * This method is simply called by MEDCouplingFieldDiscretization::deepCpy. It performs the deep copy of \a this.
+ * This method is simply called by MEDCouplingFieldDiscretization::deepCopy. It performs the deep copy of \a this.
*
- * \sa MEDCouplingFieldDiscretization::deepCpy.
+ * \sa MEDCouplingFieldDiscretization::deepCopy.
*/
MEDCouplingFieldDiscretization *MEDCouplingFieldDiscretizationGaussNE::clone() const
{
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGaussNE::getLocalizationOfDiscValues : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> umesh=mesh->buildUnstructured();//in general do nothing
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<MEDCouplingUMesh> umesh=mesh->buildUnstructured();//in general do nothing
int nbOfTuples=getNumberOfTuples(umesh);
int spaceDim=mesh->getSpaceDimension();
ret->alloc(nbOfTuples,spaceDim);
int nbOfCompo=arr->getNumberOfComponents();
std::fill(res,res+nbOfCompo,0.);
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=mesh->getMeasureField(isWAbs);
+ MCAuto<MEDCouplingFieldDouble> vol=mesh->getMeasureField(isWAbs);
std::set<INTERP_KERNEL::NormalizedCellType> types=mesh->getAllGeoTypes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
- nbOfNodesPerCell->computeOffsets2();
+ MCAuto<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
+ nbOfNodesPerCell->computeOffsetsFull();
const double *arrPtr=arr->begin(),*volPtr=vol->getArray()->begin();
for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=types.begin();it!=types.end();it++)
{
INTERP_KERNEL::AutoPtr<double> wArr2=new double[wArrSz];
double sum=std::accumulate(wArr,wArr+wArrSz,0.);
std::transform(wArr,wArr+wArrSz,(double *)wArr2,std::bind2nd(std::multiplies<double>(),1./sum));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=mesh->giveCellsWithType(*it);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids2=ids->buildExplicitArrByRanges(nbOfNodesPerCell);
+ MCAuto<DataArrayInt> ids=mesh->giveCellsWithType(*it);
+ MCAuto<DataArrayInt> ids2=ids->buildExplicitArrByRanges(nbOfNodesPerCell);
const int *ptIds2=ids2->begin(),*ptIds=ids->begin();
int nbOfCellsWithCurGeoType=ids->getNumberOfTuples();
for(int i=0;i<nbOfCellsWithCurGeoType;i++,ptIds++,ptIds2+=wArrSz)
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGaussNE::computeMeshRestrictionFromTupleIds : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=DataArrayInt::New(); tmp->alloc((int)std::distance(tupleIdsBg,tupleIdsEnd),1);
+ MCAuto<DataArrayInt> tmp=DataArrayInt::New(); tmp->alloc((int)std::distance(tupleIdsBg,tupleIdsEnd),1);
std::copy(tupleIdsBg,tupleIdsEnd,tmp->getPointer());
tmp->sort(true);
tmp=tmp->buildUnique();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
- nbOfNodesPerCell->computeOffsets2();
- nbOfNodesPerCell->searchRangesInListOfIds(tmp,cellRestriction,trueTupleRestriction);
+ MCAuto<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
+ nbOfNodesPerCell->computeOffsetsFull();
+ nbOfNodesPerCell->findIdsRangesInListOfIds(tmp,cellRestriction,trueTupleRestriction);
}
void MEDCouplingFieldDiscretizationGaussNE::checkCompatibilityWithNature(NatureOfField nat) const
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGaussNE::getMeasureField : mesh instance specified is NULL !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=mesh->getMeasureField(isAbs);
+ MCAuto<MEDCouplingFieldDouble> vol=mesh->getMeasureField(isAbs);
const double *volPtr=vol->getArray()->begin();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_GAUSS_NE);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_GAUSS_NE);
ret->setMesh(mesh);
//
std::set<INTERP_KERNEL::NormalizedCellType> types=mesh->getAllGeoTypes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
+ MCAuto<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
int nbTuples=nbOfNodesPerCell->accumulate(0);
- nbOfNodesPerCell->computeOffsets2();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New(); arr->alloc(nbTuples,1);
+ nbOfNodesPerCell->computeOffsetsFull();
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New(); arr->alloc(nbTuples,1);
ret->setArray(arr);
double *arrPtr=arr->getPointer();
for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=types.begin();it!=types.end();it++)
INTERP_KERNEL::AutoPtr<double> wArr2=new double[wArrSz];
double sum=std::accumulate(wArr,wArr+wArrSz,0.);
std::transform(wArr,wArr+wArrSz,(double *)wArr2,std::bind2nd(std::multiplies<double>(),1./sum));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=mesh->giveCellsWithType(*it);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids2=ids->buildExplicitArrByRanges(nbOfNodesPerCell);
+ MCAuto<DataArrayInt> ids=mesh->giveCellsWithType(*it);
+ MCAuto<DataArrayInt> ids2=ids->buildExplicitArrByRanges(nbOfNodesPerCell);
const int *ptIds2=ids2->begin(),*ptIds=ids->begin();
int nbOfCellsWithCurGeoType=ids->getNumberOfTuples();
for(int i=0;i<nbOfCellsWithCurGeoType;i++,ptIds++)
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGaussNE::buildSubMeshData : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diSafe=computeTupleIdsToSelectFromCellIds(mesh,start,end);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPart(start,end);
+ MCAuto<DataArrayInt> diSafe=computeTupleIdsToSelectFromCellIds(mesh,start,end);
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPart(start,end);
di=diSafe.retn();
return ret.retn();
}
if(i>=endCellIds)
break;
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> ret=mesh->buildPartRange(beginCellIds,endCellIds,stepCellIds);
+ MCAuto<MEDCouplingMesh> ret=mesh->buildPartRange(beginCellIds,endCellIds,stepCellIds);
return ret.retn();
}
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGaussNE::computeTupleIdsToSelectFromCellIds : null mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
- nbOfNodesPerCell->computeOffsets2();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
+ MCAuto<DataArrayInt> nbOfNodesPerCell=mesh->computeNbOfNodesPerCell();
+ nbOfNodesPerCell->computeOffsetsFull();
+ MCAuto<DataArrayInt> sel=DataArrayInt::New(); sel->useArray(startCellIds,false,CPP_DEALLOC,(int)std::distance(startCellIds,endCellIds),1);
return sel->buildExplicitArrByRanges(nbOfNodesPerCell);
}
}
/*!
- * This method is simply called by MEDCouplingFieldDiscretization::deepCpy. It performs the deep copy of \a this.
+ * This method is simply called by MEDCouplingFieldDiscretization::deepCopy. It performs the deep copy of \a this.
*
- * \sa MEDCouplingFieldDiscretization::deepCpy.
+ * \sa MEDCouplingFieldDiscretization::deepCopy.
*/
MEDCouplingFieldDiscretization *MEDCouplingFieldDiscretizationKriging::clone() const
{
void MEDCouplingFieldDiscretizationKriging::checkCompatibilityWithNature(NatureOfField nat) const
{
- if(nat!=ConservativeVolumic)
- throw INTERP_KERNEL::Exception("Invalid nature for Kriging field : expected ConservativeVolumic !");
+ if(nat!=IntensiveMaximum)
+ throw INTERP_KERNEL::Exception("Invalid nature for Kriging field : expected IntensiveMaximum !");
}
bool MEDCouplingFieldDiscretizationKriging::isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const
void MEDCouplingFieldDiscretizationKriging::getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> res2=MEDCouplingFieldDiscretizationKriging::getValueOnMulti(arr,mesh,loc,1);
+ MCAuto<DataArrayDouble> res2=MEDCouplingFieldDiscretizationKriging::getValueOnMulti(arr,mesh,loc,1);
std::copy(res2->begin(),res2->end(),res);
}
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
int nbCols(-1),nbCompo(arr->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> m(computeEvaluationMatrixOnGivenPts(mesh,loc,nbOfTargetPoints,nbCols));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> m(computeEvaluationMatrixOnGivenPts(mesh,loc,nbOfTargetPoints,nbCols));
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
ret->alloc(nbOfTargetPoints,nbCompo);
INTERP_KERNEL::matrixProduct(m->begin(),nbOfTargetPoints,nbCols,arr->begin(),nbOfRows,nbCompo,ret->getPointer());
return ret.retn();
DataArrayDouble *MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts(const MEDCouplingMesh *mesh, const double *loc, int nbOfTargetPoints, int& nbCols) const
{
int isDrift(-1),nbRows(-1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrixInv(computeInverseMatrix(mesh,isDrift,nbRows));
+ MCAuto<DataArrayDouble> matrixInv(computeInverseMatrix(mesh,isDrift,nbRows));
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords=getLocalizationOfDiscValues(mesh);
+ MCAuto<DataArrayDouble> coords=getLocalizationOfDiscValues(mesh);
int nbOfPts(coords->getNumberOfTuples()),dimension(coords->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> locArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> locArr=DataArrayDouble::New();
locArr->useArray(loc,false,CPP_DEALLOC,nbOfTargetPoints,dimension);
nbCols=nbOfPts;
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrix2=coords->buildEuclidianDistanceDenseMatrixWith(locArr);
+ MCAuto<DataArrayDouble> matrix2=coords->buildEuclidianDistanceDenseMatrixWith(locArr);
operateOnDenseMatrix(mesh->getSpaceDimension(),nbOfTargetPoints*nbOfPts,matrix2->getPointer());
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrix3=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> matrix3=DataArrayDouble::New();
matrix3->alloc(nbOfTargetPoints*nbRows,1);
double *work=matrix3->getPointer();
const double *workCst(matrix2->begin()),*workCst2(loc);
for(int j=0;j<isDrift-1;j++)
work[i*nbRows+(nbOfPts+1+j)]=workCst2[j];
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
ret->alloc(nbOfTargetPoints,nbRows);
INTERP_KERNEL::matrixProduct(matrix3->begin(),nbOfTargetPoints,nbRows,matrixInv->begin(),nbRows,nbRows,ret->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret2(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> ret2(DataArrayDouble::New());
ret2->alloc(nbOfTargetPoints*nbOfPts,1);
workCst=ret->begin(); work=ret2->getPointer();
for(int i=0;i<nbOfTargetPoints;i++,workCst+=nbRows)
*/
DataArrayDouble *MEDCouplingFieldDiscretizationKriging::computeInverseMatrix(const MEDCouplingMesh *mesh, int& isDrift, int& matSz) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrixWithDrift(computeMatrix(mesh,isDrift,matSz));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrixInv(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> matrixWithDrift(computeMatrix(mesh,isDrift,matSz));
+ MCAuto<DataArrayDouble> matrixInv(DataArrayDouble::New());
matrixInv->alloc(matSz*matSz,1);
INTERP_KERNEL::inverseMatrix(matrixWithDrift->getConstPointer(),matSz,matrixInv->getPointer());
return matrixInv.retn();
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::computeMatrix : NULL input mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords(getLocalizationOfDiscValues(mesh));
+ MCAuto<DataArrayDouble> coords(getLocalizationOfDiscValues(mesh));
int nbOfPts(coords->getNumberOfTuples());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrix(coords->buildEuclidianDistanceDenseMatrix());
+ MCAuto<DataArrayDouble> matrix(coords->buildEuclidianDistanceDenseMatrix());
operateOnDenseMatrix(mesh->getSpaceDimension(),nbOfPts*nbOfPts,matrix->getPointer());
// Drift
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrixWithDrift(performDrift(matrix,coords,isDrift));
+ MCAuto<DataArrayDouble> matrixWithDrift(performDrift(matrix,coords,isDrift));
matSz=nbOfPts+isDrift;
return matrixWithDrift.retn();
}
DataArrayDouble *MEDCouplingFieldDiscretizationKriging::computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, int& isDrift) const
{
int nbRows(-1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> matrixInv(computeInverseMatrix(mesh,isDrift,nbRows));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> KnewiK(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> matrixInv(computeInverseMatrix(mesh,isDrift,nbRows));
+ MCAuto<DataArrayDouble> KnewiK(DataArrayDouble::New());
KnewiK->alloc(nbRows*1,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2(PerformDriftOfVec(arr,isDrift));
+ MCAuto<DataArrayDouble> arr2(PerformDriftOfVec(arr,isDrift));
INTERP_KERNEL::matrixProduct(matrixInv->getConstPointer(),nbRows,nbRows,arr2->getConstPointer(),arr2->getNumberOfTuples(),1,KnewiK->getPointer());
return KnewiK.retn();
}
int nbOfCols(nbOfEltInMatrx/nbOfPts);
if(nbOfEltInMatrx%nbOfPts!=0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::PerformDriftRect : size of input dense matrix and input arrays mismatch ! NbOfElems in matrix % nb of tuples in array must be equal to 0 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfPts*(nbOfCols+delta));
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfPts*(nbOfCols+delta));
double *retPtr(ret->getPointer());
const double *mPtr(matr->begin()),*aPtr(arr->begin());
for(int i=0;i<nbOfPts;i++,aPtr+=spaceDimension,mPtr+=nbOfCols)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec : input array must be not NULL allocated and with one component !");
if(isDrift<0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec : isDrift parameter must be >=0 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> arr2(DataArrayDouble::New());
arr2->alloc((arr->getNumberOfTuples()+isDrift)*1,1);
double *work(std::copy(arr->begin(),arr->end(),arr2->getPointer()));
std::fill(work,work+isDrift,0.);
int szOfMatrix=arr->getNumberOfTuples();
if(szOfMatrix*szOfMatrix!=matr->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::performDrift : invalid size");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc((szOfMatrix+delta)*(szOfMatrix+delta),1);
const double *srcWork=matr->getConstPointer();
const double *srcWork2=arr->getConstPointer();
}
std::fill(destWork,destWork+szOfMatrix,1.); destWork+=szOfMatrix;
std::fill(destWork,destWork+spaceDimension+1,0.); destWork+=spaceDimension+1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arrNoI=arr->toNoInterlace();
+ MCAuto<DataArrayDouble> arrNoI=arr->toNoInterlace();
srcWork2=arrNoI->getConstPointer();
for(int i=0;i<spaceDimension;i++)
{
#include "MEDCouplingTimeLabel.hxx"
#include "MEDCouplingNatureOfField.hxx"
#include "MEDCouplingGaussLocalization.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <set>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArray;
class DataArrayInt;
MEDCOUPLING_EXPORT virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const;
MEDCOUPLING_EXPORT virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const = 0;
MEDCOUPLING_EXPORT virtual bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingFieldDiscretization *deepCpy() const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingFieldDiscretization *deepCopy() const;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDiscretization *clone() const = 0;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDiscretization *clonePart(const int *startCellIds, const int *endCellIds) const;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDiscretization *clonePartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingTimeDiscretization.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingNatureOfField.hxx"
#include "InterpKernelAutoPtr.hxx"
#include <algorithm>
#include <functional>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/*!
* Creates a new MEDCouplingFieldDouble, of given spatial type and time discretization.
* For more info, see \ref MEDCouplingFirstSteps3.
* \param [in] type - the type of spatial discretization of the created field, one of
- * (\ref ParaMEDMEM::ON_CELLS "ON_CELLS",
- * \ref ParaMEDMEM::ON_NODES "ON_NODES",
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT",
- * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE",
- * \ref ParaMEDMEM::ON_NODES_KR "ON_NODES_KR").
+ * (\ref MEDCoupling::ON_CELLS "ON_CELLS",
+ * \ref MEDCoupling::ON_NODES "ON_NODES",
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT",
+ * \ref MEDCoupling::ON_GAUSS_NE "ON_GAUSS_NE",
+ * \ref MEDCoupling::ON_NODES_KR "ON_NODES_KR").
* \param [in] td - the type of time discretization of the created field, one of
- * (\ref ParaMEDMEM::NO_TIME "NO_TIME",
- * \ref ParaMEDMEM::ONE_TIME "ONE_TIME",
- * \ref ParaMEDMEM::LINEAR_TIME "LINEAR_TIME",
- * \ref ParaMEDMEM::CONST_ON_TIME_INTERVAL "CONST_ON_TIME_INTERVAL").
+ * (\ref MEDCoupling::NO_TIME "NO_TIME",
+ * \ref MEDCoupling::ONE_TIME "ONE_TIME",
+ * \ref MEDCoupling::LINEAR_TIME "LINEAR_TIME",
+ * \ref MEDCoupling::CONST_ON_TIME_INTERVAL "CONST_ON_TIME_INTERVAL").
* \return MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The
* caller is to delete this field using decrRef() as it is no more needed.
*/
* \param [in] ft - the \ref MEDCouplingFieldTemplatesPage "field template" defining
* the spatial discretization and the supporting mesh.
* \param [in] td - the type of time discretization of the created field, one of
- * (\ref ParaMEDMEM::NO_TIME "NO_TIME",
- * \ref ParaMEDMEM::ONE_TIME "ONE_TIME",
- * \ref ParaMEDMEM::LINEAR_TIME "LINEAR_TIME",
- * \ref ParaMEDMEM::CONST_ON_TIME_INTERVAL "CONST_ON_TIME_INTERVAL").
+ * (\ref MEDCoupling::NO_TIME "NO_TIME",
+ * \ref MEDCoupling::ONE_TIME "ONE_TIME",
+ * \ref MEDCoupling::LINEAR_TIME "LINEAR_TIME",
+ * \ref MEDCoupling::CONST_ON_TIME_INTERVAL "CONST_ON_TIME_INTERVAL").
* \return MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The
* caller is to delete this field using decrRef() as it is no more needed.
*/
* \c clone(false) is rather dedicated for advanced users that want to limit the amount
* of memory. It allows the user to perform methods like operator+(), operator*()
* etc. with \a this and the returned field. If the user wants to duplicate deeply the
- * underlying mesh he should call cloneWithMesh() method or deepCpy() instead.
+ * underlying mesh he should call cloneWithMesh() method or deepCopy() instead.
* \warning The underlying \b mesh of the returned field is **always the same**
* (pointer) as \a this one **whatever the value** of \a recDeepCpy parameter.
* \param [in] recDeepCpy - if \c true, the copy of the underlying data arrays is
*
* This method behaves exactly like clone() except that here the underlying **mesh is
* always deeply duplicated**, whatever the value \a recDeepCpy parameter.
- * The result of \c cloneWithMesh(true) is exactly the same as that of deepCpy().
+ * The result of \c cloneWithMesh(true) is exactly the same as that of deepCopy().
* So the resulting field can not be used together with \a this one in the methods
* like operator+(), operator*() etc. To avoid deep copying the underlying mesh,
* the user can call clone().
*/
MEDCouplingFieldDouble *MEDCouplingFieldDouble::cloneWithMesh(bool recDeepCpy) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=clone(recDeepCpy);
+ MCAuto<MEDCouplingFieldDouble> ret=clone(recDeepCpy);
if(_mesh)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> mCpy=_mesh->deepCpy();
+ MCAuto<MEDCouplingMesh> mCpy=_mesh->deepCopy();
ret->setMesh(mCpy);
}
return ret.retn();
* caller is to delete this field using decrRef() as it is no more needed.
* \sa cloneWithMesh()
*/
-MEDCouplingFieldDouble *MEDCouplingFieldDouble::deepCpy() const
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::deepCopy() const
{
return cloneWithMesh(true);
}
* shares the data array(s) with \a this field, or holds a deep copy of it, depending on
* \a deepCopy parameter. But the underlying \b mesh is always **shallow copied**.
* \param [in] td - the type of time discretization of the created field, one of
- * (\ref ParaMEDMEM::NO_TIME "NO_TIME",
- * \ref ParaMEDMEM::ONE_TIME "ONE_TIME",
- * \ref ParaMEDMEM::LINEAR_TIME "LINEAR_TIME",
- * \ref ParaMEDMEM::CONST_ON_TIME_INTERVAL "CONST_ON_TIME_INTERVAL").
+ * (\ref MEDCoupling::NO_TIME "NO_TIME",
+ * \ref MEDCoupling::ONE_TIME "ONE_TIME",
+ * \ref MEDCoupling::LINEAR_TIME "LINEAR_TIME",
+ * \ref MEDCoupling::CONST_ON_TIME_INTERVAL "CONST_ON_TIME_INTERVAL").
* \param [in] deepCopy - if \c true, the copy of the underlying data arrays is
* deep, else all data arrays of \a this field are shared by the new field.
* \return MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The
MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const
{
MEDCouplingTimeDiscretization *tdo=_time_discr->buildNewTimeReprFromThis(td,deepCopy);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretization> disc;
+ MCAuto<MEDCouplingFieldDiscretization> disc;
if(_type)
disc=_type->clone();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),tdo,disc.retn());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),tdo,disc.retn());
ret->setMesh(getMesh());
ret->setName(getName());
ret->setDescription(getDescription());
* \return MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The
* caller is to delete this field using decrRef() as it is no more needed. The returned field will share the same mesh object object than those in \a this.
* \throw If \a this spatial discretization is empty or not ON_NODES.
- * \throw If \a this is not coherent (see MEDCouplingFieldDouble::checkCoherency).
+ * \throw If \a this is not coherent (see MEDCouplingFieldDouble::checkConsistencyLight).
*
* \warning This method is a \b non \b conservative method of remapping from node spatial discretization to cell spatial discretization.
- * If a conservative method of interpolation is required ParaMEDMEM::MEDCouplingRemapper class should be used instead with "P1P0" method.
+ * If a conservative method of interpolation is required MEDCoupling::MEDCouplingRemapper class should be used instead with "P1P0" method.
*/
MEDCouplingFieldDouble *MEDCouplingFieldDouble::nodeToCellDiscretization() const
{
- checkCoherency();
+ checkConsistencyLight();
TypeOfField tf(getTypeOfField());
if(tf!=ON_NODES)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::nodeToCellDiscretization : this field is expected to be on ON_NODES !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(clone(false));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretizationP0> nsp(new MEDCouplingFieldDiscretizationP0);
+ MCAuto<MEDCouplingFieldDouble> ret(clone(false));
+ MCAuto<MEDCouplingFieldDiscretizationP0> nsp(new MEDCouplingFieldDiscretizationP0);
ret->setDiscretization(nsp);
- const MEDCouplingMesh *m(getMesh());//m is non empty thanks to checkCoherency call
+ const MEDCouplingMesh *m(getMesh());//m is non empty thanks to checkConsistencyLight call
int nbCells(m->getNumberOfCells());
std::vector<DataArrayDouble *> arrs(getArrays());
std::size_t sz(arrs.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > outArrsSafe(sz); std::vector<DataArrayDouble *> outArrs(sz);
+ std::vector< MCAuto<DataArrayDouble> > outArrsSafe(sz); std::vector<DataArrayDouble *> outArrs(sz);
for(std::size_t j=0;j<sz;j++)
{
int nbCompo(arrs[j]->getNumberOfComponents());
* \return MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The
* caller is to delete this field using decrRef() as it is no more needed. The returned field will share the same mesh object object than those in \a this.
* \throw If \a this spatial discretization is empty or not ON_CELLS.
- * \throw If \a this is not coherent (see MEDCouplingFieldDouble::checkCoherency).
+ * \throw If \a this is not coherent (see MEDCouplingFieldDouble::checkConsistencyLight).
*
* \warning This method is a \b non \b conservative method of remapping from cell spatial discretization to node spatial discretization.
- * If a conservative method of interpolation is required ParaMEDMEM::MEDCouplingRemapper class should be used instead with "P0P1" method.
+ * If a conservative method of interpolation is required MEDCoupling::MEDCouplingRemapper class should be used instead with "P0P1" method.
*/
MEDCouplingFieldDouble *MEDCouplingFieldDouble::cellToNodeDiscretization() const
{
- checkCoherency();
+ checkConsistencyLight();
TypeOfField tf(getTypeOfField());
if(tf!=ON_CELLS)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::cellToNodeDiscretization : this field is expected to be on ON_CELLS !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(clone(false));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretizationP1> nsp(new MEDCouplingFieldDiscretizationP1);
+ MCAuto<MEDCouplingFieldDouble> ret(clone(false));
+ MCAuto<MEDCouplingFieldDiscretizationP1> nsp(new MEDCouplingFieldDiscretizationP1);
ret->setDiscretization(nsp);
- const MEDCouplingMesh *m(getMesh());//m is non empty thanks to checkCoherency call
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rn(DataArrayInt::New()),rni(DataArrayInt::New());
+ const MEDCouplingMesh *m(getMesh());//m is non empty thanks to checkConsistencyLight call
+ MCAuto<DataArrayInt> rn(DataArrayInt::New()),rni(DataArrayInt::New());
m->getReverseNodalConnectivity(rn,rni);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rni2(rni->deltaShiftIndex());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> rni3(rni2->convertToDblArr()); rni2=0;
+ MCAuto<DataArrayInt> rni2(rni->deltaShiftIndex());
+ MCAuto<DataArrayDouble> rni3(rni2->convertToDblArr()); rni2=0;
std::vector<DataArrayDouble *> arrs(getArrays());
std::size_t sz(arrs.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > outArrsSafe(sz); std::vector<DataArrayDouble *> outArrs(sz);
+ std::vector< MCAuto<DataArrayDouble> > outArrsSafe(sz); std::vector<DataArrayDouble *> outArrs(sz);
for(std::size_t j=0;j<sz;j++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp(arrs[j]->selectByTupleIdSafe(rn->begin(),rn->end()));
+ MCAuto<DataArrayDouble> tmp(arrs[j]->selectByTupleIdSafe(rn->begin(),rn->end()));
outArrsSafe[j]=(tmp->accumulatePerChunck(rni->begin(),rni->end())); tmp=0;
outArrsSafe[j]->divideEqual(rni3);
outArrsSafe[j]->copyStringInfoFrom(*arrs[j]);
void MEDCouplingFieldDouble::renumberCells(const int *old2NewBg, bool check)
{
renumberCellsWithoutMesh(old2NewBg,check);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=_mesh->deepCpy();
+ MCAuto<MEDCouplingMesh> m=_mesh->deepCopy();
m->renumberCells(old2NewBg,check);
setMesh(m);
updateTime();
if(!meshC)
throw INTERP_KERNEL::Exception("Invalid mesh to apply renumberNodes on it !");
int nbOfNodes=meshC->getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCpy());
+ MCAuto<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCopy());
int newNbOfNodes=*std::max_element(old2NewBg,old2NewBg+nbOfNodes)+1;
renumberNodesWithoutMesh(old2NewBg,newNbOfNodes,eps);
meshC2->renumberNodes(old2NewBg,newNbOfNodes);
/*!
* Returns all tuple ids of \a this scalar field that fit the range [\a vmin,
- * \a vmax]. This method calls DataArrayDouble::getIdsInRange().
+ * \a vmax]. This method calls DataArrayDouble::findIdsInRange().
* \param [in] vmin - a lower boundary of the range. Tuples with values less than \a
* vmin are not included in the result array.
* \param [in] vmax - an upper boundary of the range. Tuples with values more than \a
* \throw If the data array is not set.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *MEDCouplingFieldDouble::getIdsInRange(double vmin, double vmax) const
+DataArrayInt *MEDCouplingFieldDouble::findIdsInRange(double vmin, double vmax) const
{
if(getArray()==0)
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::getIdsInRange : no default array set !");
- return getArray()->getIdsInRange(vmin,vmax);
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::findIdsInRange : no default array set !");
+ return getArray()->findIdsInRange(vmin,vmax);
}
/*!
* This method makes the assumption that the field is correctly defined when this method is called, no check of this will be done.
* This method returns a restriction of \a this so that only tuples with ids specified in \a part will be contained in the returned field.
* Parameter \a part specifies **cell ids whatever the spatial discretization of this** (
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS",
- * \ref ParaMEDMEM::ON_NODES "ON_NODES",
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT",
- * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE",
- * \ref ParaMEDMEM::ON_NODES_KR "ON_NODES_KR").
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS",
+ * \ref MEDCoupling::ON_NODES "ON_NODES",
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT",
+ * \ref MEDCoupling::ON_GAUSS_NE "ON_GAUSS_NE",
+ * \ref MEDCoupling::ON_NODES_KR "ON_NODES_KR").
*
* For example, \a this is a field on cells lying on a mesh that have 10 cells, \a part contains following cell ids [3,7,6].
* Then the returned field will lie on mesh having 3 cells and the returned field will contain 3 tuples.<br>
/*!
* Builds a newly created field, that the caller will have the responsability to deal with.
- * \n This method makes the assumption that \a this field is correctly defined when this method is called (\a this->checkCoherency() returns without any exception thrown), **no check of this will be done**.
+ * \n This method makes the assumption that \a this field is correctly defined when this method is called (\a this->checkConsistencyLight() returns without any exception thrown), **no check of this will be done**.
* \n This method returns a restriction of \a this so that only tuple ids specified in [ \a partBg , \a partEnd ) will be contained in the returned field.
* \n Parameter [\a partBg, \a partEnd ) specifies **cell ids whatever the spatial discretization** of \a this (
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS",
- * \ref ParaMEDMEM::ON_NODES "ON_NODES",
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT",
- * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE",
- * \ref ParaMEDMEM::ON_NODES_KR "ON_NODES_KR").
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS",
+ * \ref MEDCoupling::ON_NODES "ON_NODES",
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT",
+ * \ref MEDCoupling::ON_GAUSS_NE "ON_GAUSS_NE",
+ * \ref MEDCoupling::ON_NODES_KR "ON_NODES_KR").
*
* For example, \a this is a field on cells lying on a mesh that have 10 cells, \a partBg contains the following cell ids [3,7,6].
* Then the returned field will lie on mesh having 3 cells and will contain 3 tuples.
* \ref cpp_mcfielddouble_subpart1 "Here a C++ example."<br>
* \ref py_mcfielddouble_subpart1 "Here a Python example."
* \endif
- * \sa ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart(const DataArrayInt *) const, MEDCouplingFieldDouble::buildSubPartRange
+ * \sa MEDCoupling::MEDCouplingFieldDouble::buildSubPart(const DataArrayInt *) const, MEDCouplingFieldDouble::buildSubPartRange
*/
MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const int *partBg, const int *partEnd) const
{
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : Expecting a not NULL spatial discretization !");
DataArrayInt *arrSelect;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=_type->buildSubMeshData(_mesh,partBg,partEnd,arrSelect);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrSelect2(arrSelect);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=clone(false);//quick shallow copy.
+ MCAuto<MEDCouplingMesh> m=_type->buildSubMeshData(_mesh,partBg,partEnd,arrSelect);
+ MCAuto<DataArrayInt> arrSelect2(arrSelect);
+ MCAuto<MEDCouplingFieldDouble> ret=clone(false);//quick shallow copy.
const MEDCouplingFieldDiscretization *disc=getDiscretization();
if(disc)
- ret->setDiscretization(MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretization>(disc->clonePart(partBg,partEnd)));
+ ret->setDiscretization(MCAuto<MEDCouplingFieldDiscretization>(disc->clonePart(partBg,partEnd)));
ret->setMesh(m);
std::vector<DataArrayDouble *> arrays;
_time_discr->getArrays(arrays);
std::vector<DataArrayDouble *> arrs;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrsSafe;
+ std::vector< MCAuto<DataArrayDouble> > arrsSafe;
const int *arrSelBg=arrSelect->begin();
const int *arrSelEnd=arrSelect->end();
for(std::vector<DataArrayDouble *>::const_iterator iter=arrays.begin();iter!=arrays.end();iter++)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : Expecting a not NULL spatial discretization !");
DataArrayInt *arrSelect;
int beginOut,endOut,stepOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=_type->buildSubMeshDataRange(_mesh,begin,end,step,beginOut,endOut,stepOut,arrSelect);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrSelect2(arrSelect);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=clone(false);//quick shallow copy.
+ MCAuto<MEDCouplingMesh> m=_type->buildSubMeshDataRange(_mesh,begin,end,step,beginOut,endOut,stepOut,arrSelect);
+ MCAuto<DataArrayInt> arrSelect2(arrSelect);
+ MCAuto<MEDCouplingFieldDouble> ret=clone(false);//quick shallow copy.
const MEDCouplingFieldDiscretization *disc=getDiscretization();
if(disc)
- ret->setDiscretization(MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretization>(disc->clonePartRange(begin,end,step)));
+ ret->setDiscretization(MCAuto<MEDCouplingFieldDiscretization>(disc->clonePartRange(begin,end,step)));
ret->setMesh(m);
std::vector<DataArrayDouble *> arrays;
_time_discr->getArrays(arrays);
std::vector<DataArrayDouble *> arrs;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrsSafe;
+ std::vector< MCAuto<DataArrayDouble> > arrsSafe;
for(std::vector<DataArrayDouble *>::const_iterator iter=arrays.begin();iter!=arrays.end();iter++)
{
DataArrayDouble *arr=0;
arr=(*iter)->selectByTupleIdSafe(arrSelBg,arrSelEnd);
}
else
- arr=(*iter)->selectByTupleId2(beginOut,endOut,stepOut);
+ arr=(*iter)->selectByTupleIdSafeSlice(beginOut,endOut,stepOut);
}
arrs.push_back(arr); arrsSafe.push_back(arr);
}
/*!
* Returns a type of \ref MEDCouplingTemporalDisc "time discretization" of \a this field.
- * \return ParaMEDMEM::TypeOfTimeDiscretization - an enum item describing the time
+ * \return MEDCoupling::TypeOfTimeDiscretization - an enum item describing the time
* discretization type.
*/
TypeOfTimeDiscretization MEDCouplingFieldDouble::getTimeDiscretization() const
}
MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCopy):MEDCouplingField(other,deepCopy),
- _time_discr(other._time_discr->performCpy(deepCopy))
+ _time_discr(other._time_discr->performCopyOrIncrRef(deepCopy))
{
}
* \throw If the temporal discretization data is incorrect.
* \throw If mesh data does not correspond to field data.
*/
-void MEDCouplingFieldDouble::checkCoherency() const
+void MEDCouplingFieldDouble::checkConsistencyLight() const
{
if(!_mesh)
throw INTERP_KERNEL::Exception("Field invalid because no mesh specified !");
if(!((const MEDCouplingFieldDiscretization *)_type))
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::checkCoherency : no spatial discretization !");
- _time_discr->checkCoherency();
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::checkConsistencyLight : no spatial discretization !");
+ _time_discr->checkConsistencyLight();
_type->checkCoherencyBetween(_mesh,getArray());
}
double ret=-std::numeric_limits<double>::max();
bool isExistingArr=false;
tupleIds=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1;
+ MCAuto<DataArrayInt> ret1;
for(std::vector<DataArrayDouble *>::const_iterator iter=arrays.begin();iter!=arrays.end();iter++)
{
if(*iter)
isExistingArr=true;
DataArrayInt *tmp;
ret=std::max(ret,(*iter)->getMaxValue2(tmp));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmpSafe(tmp);
+ MCAuto<DataArrayInt> tmpSafe(tmp);
if(!((const DataArrayInt *)ret1))
ret1=tmpSafe;
}
double ret=-std::numeric_limits<double>::max();
bool isExistingArr=false;
tupleIds=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1;
+ MCAuto<DataArrayInt> ret1;
for(std::vector<DataArrayDouble *>::const_iterator iter=arrays.begin();iter!=arrays.end();iter++)
{
if(*iter)
isExistingArr=true;
DataArrayInt *tmp;
ret=std::max(ret,(*iter)->getMinValue2(tmp));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmpSafe(tmp);
+ MCAuto<DataArrayInt> tmpSafe(tmp);
if(!((const DataArrayInt *)ret1))
ret1=tmpSafe;
}
{
if(getArray()==0)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::getWeightedAverageValue : no default array defined !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> w=buildMeasureField(isWAbs);
+ MCAuto<MEDCouplingFieldDouble> w=buildMeasureField(isWAbs);
double deno=w->getArray()->accumulate(0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=getArray()->deepCpy();
+ MCAuto<DataArrayDouble> arr=getArray()->deepCopy();
arr->multiplyEqual(w->getArray());
arr->accumulate(res);
int nCompo = getArray()->getNumberOfComponents();
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic : no mesh defined !");
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform fillFromAnalytic !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
+ MCAuto<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
_time_discr->fillFromAnalytic(loc,nbOfComp,func);
}
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic : no mesh defined !");
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform fillFromAnalytic !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
+ MCAuto<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
_time_discr->fillFromAnalytic(loc,nbOfComp,func);
}
* The function is applied to coordinates of value location points. For example, if
* \a this field is on cells, the function is applied to cell barycenters.<br>
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
+ * \ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
* by the way how variable
* names, used in the function, are associated with components of coordinates of field
* location points; here, a variable name corresponding to a component is retrieved from
* \ref py_mcfielddouble_fillFromAnalytic2 "Here is a Python example".
* \endif
*/
-void MEDCouplingFieldDouble::fillFromAnalytic2(int nbOfComp, const std::string& func)
+void MEDCouplingFieldDouble::fillFromAnalyticCompo(int nbOfComp, const std::string& func)
{
if(!_mesh)
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic2 : no mesh defined !");
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalyticCompo : no mesh defined !");
if(!((const MEDCouplingFieldDiscretization *)_type))
- throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform fillFromAnalytic2 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
- _time_discr->fillFromAnalytic2(loc,nbOfComp,func);
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform fillFromAnalyticCompo !");
+ MCAuto<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
+ _time_discr->fillFromAnalyticCompo(loc,nbOfComp,func);
}
/*!
* The function is applied to coordinates of value location points. For example, if
* \a this field is on cells, the function is applied to cell barycenters.<br>
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
+ * \ref MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic(int nbOfComp, const std::string& func) "fillFromAnalytic()"
* by the way how variable
* names, used in the function, are associated with components of coordinates of field
* location points; here, a component index of a variable is defined by a
* \ref py_mcfielddouble_fillFromAnalytic3 "Here is a Python example".
* \endif
*/
-void MEDCouplingFieldDouble::fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
+void MEDCouplingFieldDouble::fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
if(!_mesh)
- throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalytic2 : no mesh defined !");
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::fillFromAnalyticCompo : no mesh defined !");
if(!((const MEDCouplingFieldDiscretization *)_type))
- throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform fillFromAnalytic3 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
- _time_discr->fillFromAnalytic3(loc,nbOfComp,varsOrder,func);
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform fillFromAnalyticNamedCompo !");
+ MCAuto<DataArrayDouble> loc=_type->getLocalizationOfDiscValues(_mesh);
+ _time_discr->fillFromAnalyticNamedCompo(loc,nbOfComp,varsOrder,func);
}
/*!
/*!
* Fill \a this field with a given value.<br>
* This method is a specialization of other overloaded methods. When \a nbOfComp == 1
- * this method is equivalent to ParaMEDMEM::MEDCouplingFieldDouble::operator=().
+ * this method is equivalent to MEDCoupling::MEDCouplingFieldDouble::operator=().
* \param [in] nbOfComp - the number of components for \a this field to have.
* \param [in] val - the value to assign to every atomic value of \a this field.
* \throw If the spatial discretization of \a this field is NULL.
* For more info on supported expressions that can be used in the function, see \ref
* MEDCouplingArrayApplyFuncExpr. <br>
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()"
+ * \ref MEDCoupling::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()"
* by the way how variable
* names, used in the function, are associated with components of field values;
* here, a variable name corresponding to a component is retrieved from
* \ref py_mcfielddouble_applyFunc2 "Here is a Python example".
* \endif
*/
-void MEDCouplingFieldDouble::applyFunc2(int nbOfComp, const std::string& func)
+void MEDCouplingFieldDouble::applyFuncCompo(int nbOfComp, const std::string& func)
{
- _time_discr->applyFunc2(nbOfComp,func);
+ _time_discr->applyFuncCompo(nbOfComp,func);
}
/*!
* Modifies values of \a this field by applying a function to each tuple of all
* data arrays.
* This method differs from
- * \ref ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()"
+ * \ref MEDCoupling::MEDCouplingFieldDouble::applyFunc(int nbOfComp, const std::string& func) "applyFunc()"
* by the way how variable
* names, used in the function, are associated with components of field values;
* here, a component index of a variable is defined by a
* \ref py_mcfielddouble_applyFunc3 "Here is a Python example".
* \endif
*/
-void MEDCouplingFieldDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
+void MEDCouplingFieldDouble::applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
- _time_discr->applyFunc3(nbOfComp,varsOrder,func);
+ _time_discr->applyFuncNamedCompo(nbOfComp,varsOrder,func);
}
/*!
* - the number of entities in the underlying mesh
* - \ref MEDCouplingSpatialDisc "spatial discretization" of \a this field (e.g. number
* of Gauss points if \a this->getTypeOfField() ==
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT").
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT").
*
* The returned value does \b not \b depend on the number of tuples in the data array
* (which has to be equal to the returned value), \b contrary to
* data array (Sorry, it is confusing !).
* So \b this \b method \b behaves \b exactly \b as MEDCouplingField::getNumberOfTuplesExpected \b method.
*
- * \warning No checkCoherency() is done here.
+ * \warning No checkConsistencyLight() is done here.
* For more info on the data arrays, see \ref arrays.
* \return int - the number of tuples.
* \throw If the mesh is not set.
/*!
* Sets \ref NatureOfField.
- * \param [in] nat - an item of enum ParaMEDMEM::NatureOfField.
+ * \param [in] nat - an item of enum MEDCoupling::NatureOfField.
*/
void MEDCouplingFieldDouble::setNature(NatureOfField nat)
{
/*!
* Returns a value of \a this field of type either
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT" or
- * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE".
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT" or
+ * \ref MEDCoupling::ON_GAUSS_NE "ON_GAUSS_NE".
* \param [in] cellId - an id of cell of interest.
* \param [in] nodeIdInCell - a node index within the cell.
* \param [in] compoId - an index of component.
* \throw If the mesh is not set.
* \throw If the spatial discretization of \a this field is NULL.
* \throw If \a this field if of type other than
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT" or
- * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE".
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT" or
+ * \ref MEDCoupling::ON_GAUSS_NE "ON_GAUSS_NE".
*/
double MEDCouplingFieldDouble::getIJK(int cellId, int nodeIdInCell, int compoId) const
{
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::changeUnderlyingMesh : is expected to operate on not null meshes !");
DataArrayInt *cellCor=0,*nodeCor=0;
other->checkGeoEquivalWith(_mesh,levOfCheck,precOnMesh,cellCor,nodeCor);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellCor2(cellCor),nodeCor2(nodeCor);
+ MCAuto<DataArrayInt> cellCor2(cellCor),nodeCor2(nodeCor);
if(cellCor)
renumberCellsWithoutMesh(cellCor->getConstPointer(),false);
if(nodeCor)
* The job of this method consists in calling
* \a this->changeUnderlyingMesh() with \a f->getMesh() as the first parameter, and then
* \a this -= \a f.<br>
- * This method requires that \a f and \a this are coherent (checkCoherency()) and that \a f
+ * This method requires that \a f and \a this are coherent (checkConsistencyLight()) and that \a f
* and \a this are coherent for a merge.<br>
* "DM" in the method name stands for "different meshes".
* \param [in] f - the field to subtract from this.
*/
void MEDCouplingFieldDouble::substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps)
{
- checkCoherency();
+ checkConsistencyLight();
if(!f)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::substractInPlaceDM : input field is NULL !");
- f->checkCoherency();
+ f->checkConsistencyLight();
if(!areCompatibleForMerge(f))
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::substractInPlaceDM : Fields are not compatible ; unable to apply mergeFields on them !");
changeUnderlyingMesh(f->getMesh(),levOfCheck,precOnMesh,eps);
throw INTERP_KERNEL::Exception("Invalid support mesh to apply mergeNodes on it : must be a MEDCouplingPointSet one !");
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform mergeNodes !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCpy());
+ MCAuto<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCopy());
bool ret;
int ret2;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=meshC2->mergeNodes(eps,ret,ret2);
+ MCAuto<DataArrayInt> arr=meshC2->mergeNodes(eps,ret,ret2);
if(!ret)//no nodes have been merged.
return ret;
std::vector<DataArrayDouble *> arrays;
* \throw If the data array is not set.
* \throw If field values at merged nodes (if any) deffer more than \a epsOnVals.
*/
-bool MEDCouplingFieldDouble::mergeNodes2(double eps, double epsOnVals)
+bool MEDCouplingFieldDouble::mergeNodesCenter(double eps, double epsOnVals)
{
const MEDCouplingPointSet *meshC=dynamic_cast<const MEDCouplingPointSet *>(_mesh);
if(!meshC)
throw INTERP_KERNEL::Exception("Invalid support mesh to apply mergeNodes on it : must be a MEDCouplingPointSet one !");
if(!((const MEDCouplingFieldDiscretization *)_type))
- throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform mergeNodes2 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCpy());
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform mergeNodesCenter !");
+ MCAuto<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCopy());
bool ret;
int ret2;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=meshC2->mergeNodes2(eps,ret,ret2);
+ MCAuto<DataArrayInt> arr=meshC2->mergeNodesCenter(eps,ret,ret2);
if(!ret)//no nodes have been merged.
return ret;
std::vector<DataArrayDouble *> arrays;
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::zipCoords : Invalid support mesh to apply zipCoords on it : must be a MEDCouplingPointSet one !");
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform zipCoords !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCpy());
+ MCAuto<MEDCouplingPointSet> meshC2((MEDCouplingPointSet *)meshC->deepCopy());
int oldNbOfNodes=meshC2->getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=meshC2->zipCoordsTraducer();
+ MCAuto<DataArrayInt> arr=meshC2->zipCoordsTraducer();
if(meshC2->getNumberOfNodes()!=oldNbOfNodes)
{
std::vector<DataArrayDouble *> arrays;
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::zipConnectivity : Invalid support mesh to apply zipCoords on it : must be a MEDCouplingPointSet one !");
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform zipConnectivity !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> meshC2((MEDCouplingUMesh *)meshC->deepCpy());
+ MCAuto<MEDCouplingUMesh> meshC2((MEDCouplingUMesh *)meshC->deepCopy());
int oldNbOfCells=meshC2->getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=meshC2->zipConnectivityTraducer(compType);
+ MCAuto<DataArrayInt> arr=meshC2->zipConnectivityTraducer(compType);
if(meshC2->getNumberOfCells()!=oldNbOfCells)
{
std::vector<DataArrayDouble *> arrays;
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::extractSlice3D : underlying mesh is null !");
if(getTypeOfField()!=ON_CELLS)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::extractSlice3D : only implemented for fields on cells !");
- const MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> umesh(mesh->buildUnstructured());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=clone(false);
+ const MCAuto<MEDCouplingUMesh> umesh(mesh->buildUnstructured());
+ MCAuto<MEDCouplingFieldDouble> ret=clone(false);
ret->setMesh(umesh);
DataArrayInt *cellIds=0;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh2=umesh->buildSlice3D(origin,vec,eps,cellIds);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds2=cellIds;
+ MCAuto<MEDCouplingUMesh> mesh2=umesh->buildSlice3D(origin,vec,eps,cellIds);
+ MCAuto<DataArrayInt> cellIds2=cellIds;
ret->setMesh(mesh2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tupleIds=computeTupleIdsToSelectFromCellIds(cellIds->begin(),cellIds->end());
+ MCAuto<DataArrayInt> tupleIds=computeTupleIdsToSelectFromCellIds(cellIds->begin(),cellIds->end());
std::vector<DataArrayDouble *> arrays;
_time_discr->getArrays(arrays);
int i=0;
std::vector<DataArrayDouble *> newArr(arrays.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > newArr2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > newArr2(arrays.size());
for(std::vector<DataArrayDouble *>::const_iterator iter=arrays.begin();iter!=arrays.end();iter++,i++)
{
if(*iter)
if(!((const MEDCouplingFieldDiscretization *)_type))
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform simplexize !");
int oldNbOfCells=_mesh->getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> meshC2(_mesh->deepCpy());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=meshC2->simplexize(policy);
+ MCAuto<MEDCouplingMesh> meshC2(_mesh->deepCopy());
+ MCAuto<DataArrayInt> arr=meshC2->simplexize(policy);
int newNbOfCells=meshC2->getNumberOfCells();
if(oldNbOfCells==newNbOfCells)
return false;
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform doublyContractedProduct !");
MEDCouplingTimeDiscretization *td=_time_discr->doublyContractedProduct();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("DoublyContractedProduct");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform determinant !");
MEDCouplingTimeDiscretization *td=_time_discr->determinant();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("Determinant");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform eigenValues !");
MEDCouplingTimeDiscretization *td=_time_discr->eigenValues();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("EigenValues");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform eigenVectors !");
MEDCouplingTimeDiscretization *td=_time_discr->eigenVectors();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("EigenVectors");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform inverse !");
MEDCouplingTimeDiscretization *td=_time_discr->inverse();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("Inversion");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform trace !");
MEDCouplingTimeDiscretization *td=_time_discr->trace();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("Trace");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform deviator !");
MEDCouplingTimeDiscretization *td=_time_discr->deviator();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("Deviator");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform magnitude !");
MEDCouplingTimeDiscretization *td=_time_discr->magnitude();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName("Magnitude");
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform maxPerTuple !");
MEDCouplingTimeDiscretization *td=_time_discr->maxPerTuple();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
std::ostringstream oss;
oss << "Max_" << getName();
ret->setName(oss.str());
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform keepSelectedComponents !");
MEDCouplingTimeDiscretization *td=_time_discr->keepSelectedComponents(compoIds);
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setName(getName());
ret->setMesh(getMesh());
return ret.retn();
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::MergeFields : no spatial discr of f1 !");
MEDCouplingTimeDiscretization *td=f1->_time_discr->aggregate(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
ret->setName(f1->getName());
ret->setDescription(f1->getDescription());
if(m1)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=m1->mergeMyselfWith(m2);
+ MCAuto<MEDCouplingMesh> m=m1->mergeMyselfWith(m2);
ret->setMesh(m);
}
return ret.retn();
{
if(a.size()<1)
throw INTERP_KERNEL::Exception("FieldDouble::MergeFields : size of array must be >= 1 !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > ms(a.size());
+ std::vector< MCAuto<MEDCouplingUMesh> > ms(a.size());
std::vector< const MEDCouplingUMesh *> ms2(a.size());
std::vector< const MEDCouplingTimeDiscretization *> tds(a.size());
std::vector<const MEDCouplingFieldDouble *>::const_iterator it=a.begin();
}
MEDCouplingTimeDiscretization *td=tds[0]->aggregate(tds);
td->copyTinyAttrFrom(*(a[0]->_time_discr));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone());
ret->setName(a[0]->getName());
ret->setDescription(a[0]->getDescription());
if(ms2[0])
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MEDCouplingUMesh::MergeUMeshes(ms2);
+ MCAuto<MEDCouplingUMesh> m=MEDCouplingUMesh::MergeUMeshes(ms2);
m->copyTinyInfoFrom(ms2[0]);
ret->setMesh(m);
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply MeldFields on them ! Check support mesh, field nature, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->meld(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply CrossProductFields on them! Check support mesh, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->crossProduct(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply MaxFields on them! Check support mesh, field nature, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->max(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply MinFields on them! Check support mesh, field nature, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->min(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform negate !");
MEDCouplingTimeDiscretization *td=_time_discr->negate();
td->copyTinyAttrFrom(*_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
ret->setMesh(getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply AddFields on them! Check support mesh, field nature, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->add(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply SubstractFields on them! Check support mesh, field nature, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->substract(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply MultiplyFields on them! Check support mesh, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->multiply(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply DivideFields on them! Check support mesh, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->divide(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
throw INTERP_KERNEL::Exception("Fields are not compatible. Unable to apply PowFields on them! Check support mesh, and spatial and time discretisation.");
MEDCouplingTimeDiscretization *td=f1->_time_discr->pow(f2->_time_discr);
td->copyTinyAttrFrom(*f1->_time_discr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
+ MCAuto<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(NoNature,td,f1->_type->clone());
ret->setMesh(f1->getMesh());
return ret.retn();
}
if(!m)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::WriteVTK : Fields are lying on a same mesh but it is empty !");
std::string ret(m->getVTKFileNameOf(fileName));
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> byteArr;
+ MCAuto<DataArrayByte> byteArr;
if(isBinary)
{ byteArr=DataArrayByte::New(); byteArr->alloc(0,1); }
std::ostringstream coss,noss;
#include "MEDCouplingTimeDiscretization.hxx"
#include "MEDCouplingMemArray.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingFieldTemplate;
MEDCOUPLING_EXPORT void renumberCellsWithoutMesh(const int *old2NewBg, bool check=true);
MEDCOUPLING_EXPORT void renumberNodes(const int *old2NewBg, double eps=1e-15);
MEDCOUPLING_EXPORT void renumberNodesWithoutMesh(const int *old2NewBg, int newNbOfNodes, double eps=1e-15);
- MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(double vmin, double vmax) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsInRange(double vmin, double vmax) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildSubPart(const DataArrayInt *part) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildSubPart(const int *partBg, const int *partEnd) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const;
- MEDCOUPLING_EXPORT MEDCouplingFieldDouble *deepCpy() const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *deepCopy() const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *nodeToCellDiscretization() const;
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *cellToNodeDiscretization() const;
MEDCOUPLING_EXPORT TypeOfTimeDiscretization getTimeDiscretization() const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
MEDCOUPLING_EXPORT void setNature(NatureOfField nat);
MEDCOUPLING_EXPORT void setTimeTolerance(double val) { _time_discr->setTimeTolerance(val); }
MEDCOUPLING_EXPORT double getTimeTolerance() const { return _time_discr->getTimeTolerance(); }
MEDCOUPLING_EXPORT MEDCouplingFieldDouble &operator=(double value);
MEDCOUPLING_EXPORT void fillFromAnalytic(int nbOfComp, FunctionToEvaluate func);
MEDCOUPLING_EXPORT void fillFromAnalytic(int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT void fillFromAnalytic2(int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ MEDCOUPLING_EXPORT void fillFromAnalyticCompo(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
MEDCOUPLING_EXPORT void applyFunc(int nbOfComp, FunctionToEvaluate func);
MEDCOUPLING_EXPORT void applyFunc(int nbOfComp, double val);
MEDCOUPLING_EXPORT void applyFunc(int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT void applyFunc2(int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ MEDCOUPLING_EXPORT void applyFuncCompo(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
MEDCOUPLING_EXPORT void applyFunc(const std::string& func);
MEDCOUPLING_EXPORT void applyFuncFast32(const std::string& func);
MEDCOUPLING_EXPORT void applyFuncFast64(const std::string& func);
MEDCOUPLING_EXPORT void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15);
MEDCOUPLING_EXPORT void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15);
MEDCOUPLING_EXPORT bool mergeNodes(double eps, double epsOnVals=1e-15);
- MEDCOUPLING_EXPORT bool mergeNodes2(double eps, double epsOnVals=1e-15);
+ MEDCOUPLING_EXPORT bool mergeNodesCenter(double eps, double epsOnVals=1e-15);
MEDCOUPLING_EXPORT bool zipCoords(double epsOnVals=1e-15);
MEDCOUPLING_EXPORT bool zipConnectivity(int compType, double epsOnVals=1e-15);
MEDCOUPLING_EXPORT MEDCouplingFieldDouble *extractSlice3D(const double *origin, const double *vec, double eps) const;
#include <cmath>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingFieldOverTime *MEDCouplingFieldOverTime::New(const std::vector<MEDCouplingFieldDouble *>& fs)
{
double MEDCouplingFieldOverTime::getTimeTolerance() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
if(_fs.empty())
throw INTERP_KERNEL::Exception("MEDCouplingFieldOverTime::getTimeTolerance : empty set !");
for(;it!=_fs.end();it++)
throw INTERP_KERNEL::Exception("MEDCouplingFieldOverTime::getTimeTolerance : only empty fields in this !");
}
-void MEDCouplingFieldOverTime::checkCoherency() const
+void MEDCouplingFieldOverTime::checkConsistencyLight() const
{
- MEDCouplingMultiFields::checkCoherency();
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ MEDCouplingMultiFields::checkConsistencyLight();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
if((*it)->getTimeDiscretization()==NO_TIME)
{
- std::ostringstream oss; oss << "MEDCouplingFieldOverTime::checkCoherency : At rank #" << std::distance(_fs.begin(),it) << " the field has no time !";
+ std::ostringstream oss; oss << "MEDCouplingFieldOverTime::checkConsistencyLight : At rank #" << std::distance(_fs.begin(),it) << " the field has no time !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
if(_fs.empty())
}
double curt=(*it)->getStartTime(tt1,tt2);
if(curt<reft-eps)
- throw INTERP_KERNEL::Exception("MEDCouplingFieldOverTime::checkCoherency : fields are NOT sorted properly in ascending time !");
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldOverTime::checkConsistencyLight : fields are NOT sorted properly in ascending time !");
reft=(*it)->getEndTime(tt1,tt2);
}
}
std::vector<MEDCouplingMesh *> MEDCouplingFieldOverTime::getMeshes() const
{
- checkCoherency();
+ checkConsistencyLight();
return MEDCouplingMultiFields::getMeshes();
}
std::vector<MEDCouplingMesh *> MEDCouplingFieldOverTime::getDifferentMeshes(std::vector<int>& refs) const
{
- checkCoherency();
+ checkConsistencyLight();
return MEDCouplingMultiFields::getDifferentMeshes(refs);
}
std::vector<DataArrayDouble *> MEDCouplingFieldOverTime::getArrays() const
{
- checkCoherency();
+ checkConsistencyLight();
return MEDCouplingMultiFields::getArrays();
}
std::vector<DataArrayDouble *> MEDCouplingFieldOverTime::getDifferentArrays(std::vector< std::vector<int> >& refs) const
{
- checkCoherency();
+ checkConsistencyLight();
return MEDCouplingMultiFields::getDifferentArrays(refs);
}
MEDCouplingFieldOverTime::MEDCouplingFieldOverTime(const std::vector<MEDCouplingFieldDouble *>& fs):MEDCouplingMultiFields(fs)
{
- checkCoherency();
+ checkConsistencyLight();
}
MEDCouplingFieldOverTime::MEDCouplingFieldOverTime()
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingFieldOverTime : public MEDCouplingMultiFields
{
public:
MEDCOUPLING_EXPORT static MEDCouplingFieldOverTime *New(const std::vector<MEDCouplingFieldDouble *>& fs);
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
MEDCOUPLING_EXPORT double getTimeTolerance() const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
#include <sstream>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::New(const MEDCouplingFieldDouble& f)
{
MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f):MEDCouplingField(f,false)
{
forceTimeOfThis(f);
- checkCoherency();
+ checkConsistencyLight();
}
MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(TypeOfField type):MEDCouplingField(type)
{
}
-void MEDCouplingFieldTemplate::checkCoherency() const
+void MEDCouplingFieldTemplate::checkConsistencyLight() const
{
if(_mesh==0)
- throw INTERP_KERNEL::Exception("MEDCouplingFieldTemplate::checkCoherency : Empty mesh !");
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldTemplate::checkConsistencyLight : Empty mesh !");
}
std::string MEDCouplingFieldTemplate::simpleRepr() const
#include "MEDCouplingField.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingFieldDouble;
/*!
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(TypeOfField type);
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
//
MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
MEDCOUPLING_EXPORT void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
#include <iterator>
#include <algorithm>
-ParaMEDMEM::MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
+MEDCoupling::MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
const std::vector<double>& gsCoo, const std::vector<double>& w)
try:_type(type),_ref_coord(refCoo),_gauss_coord(gsCoo),_weight(w)
{
- checkCoherency();
+ checkConsistencyLight();
}
catch(INTERP_KERNEL::Exception& e)
{
throw e;
}
-ParaMEDMEM::MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ)
+MEDCoupling::MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ)
try:_type(typ)
{
INTERP_KERNEL::CellModel::GetCellModel(_type);
throw e;
}
-void ParaMEDMEM::MEDCouplingGaussLocalization::setType(INTERP_KERNEL::NormalizedCellType typ)
+void MEDCoupling::MEDCouplingGaussLocalization::setType(INTERP_KERNEL::NormalizedCellType typ)
{
INTERP_KERNEL::CellModel::GetCellModel(typ);//throws if not found. This is a check
_type=typ;
}
-void ParaMEDMEM::MEDCouplingGaussLocalization::checkCoherency() const
+void MEDCoupling::MEDCouplingGaussLocalization::checkConsistencyLight() const
{
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_type);
int nbNodes=cm.getNumberOfNodes();
}
}
-int ParaMEDMEM::MEDCouplingGaussLocalization::getDimension() const
+int MEDCoupling::MEDCouplingGaussLocalization::getDimension() const
{
if(_weight.empty())
return -1;
return (int)_gauss_coord.size()/(int)_weight.size();
}
-int ParaMEDMEM::MEDCouplingGaussLocalization::getNumberOfPtsInRefCell() const
+int MEDCoupling::MEDCouplingGaussLocalization::getNumberOfPtsInRefCell() const
{
int dim=getDimension();
if(dim==0)
return (int)_ref_coord.size()/dim;
}
-std::string ParaMEDMEM::MEDCouplingGaussLocalization::getStringRepr() const
+std::string MEDCoupling::MEDCouplingGaussLocalization::getStringRepr() const
{
std::ostringstream oss;
oss << "CellType : " << INTERP_KERNEL::CellModel::GetCellModel(_type).getRepr() << std::endl;
return oss.str();
}
-std::size_t ParaMEDMEM::MEDCouplingGaussLocalization::getMemorySize() const
+std::size_t MEDCoupling::MEDCouplingGaussLocalization::getMemorySize() const
{
std::size_t ret=0;
ret+=_ref_coord.capacity()*sizeof(double);
return ret;
}
-bool ParaMEDMEM::MEDCouplingGaussLocalization::isEqual(const MEDCouplingGaussLocalization& other, double eps) const
+bool MEDCoupling::MEDCouplingGaussLocalization::isEqual(const MEDCouplingGaussLocalization& other, double eps) const
{
if(_type!=other._type)
return false;
return true;
}
-double ParaMEDMEM::MEDCouplingGaussLocalization::getRefCoord(int ptIdInCell, int comp) const
+double MEDCoupling::MEDCouplingGaussLocalization::getRefCoord(int ptIdInCell, int comp) const
{
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_type);
int nbNodes=cm.getNumberOfNodes();
return _ref_coord[ptIdInCell*dim+comp];
}
-double ParaMEDMEM::MEDCouplingGaussLocalization::getGaussCoord(int gaussPtIdInCell, int comp) const
+double MEDCoupling::MEDCouplingGaussLocalization::getGaussCoord(int gaussPtIdInCell, int comp) const
{
int dim=checkCoherencyOfRequest(gaussPtIdInCell,comp);
return _gauss_coord[gaussPtIdInCell*dim+comp];
}
-double ParaMEDMEM::MEDCouplingGaussLocalization::getWeight(int gaussPtIdInCell, double newVal) const
+double MEDCoupling::MEDCouplingGaussLocalization::getWeight(int gaussPtIdInCell, double newVal) const
{
checkCoherencyOfRequest(gaussPtIdInCell,0);
return _weight[gaussPtIdInCell];
* push at the end of tinyInfo its basic serialization info. The size of pushed data is always the same.
* @param tinyInfo inout parameter.
*/
-void ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo(std::vector<int>& tinyInfo) const
+void MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo(std::vector<int>& tinyInfo) const
{
tinyInfo.push_back((int)_type);
tinyInfo.push_back(getNumberOfPtsInRefCell());
* push at the end of tinyInfo its basic serialization info. The size of pushed data is \b NOT always the same contrary to pushTinySerializationIntInfo.
* @param tinyInfo inout parameter.
*/
-void ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo(std::vector<double>& tinyInfo) const
+void MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo(std::vector<double>& tinyInfo) const
{
tinyInfo.insert(tinyInfo.end(),_ref_coord.begin(),_ref_coord.end());
tinyInfo.insert(tinyInfo.end(),_gauss_coord.begin(),_gauss_coord.end());
}
/*!
- * This method operates the exact inverse operation than ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo method. This is one of the last step of unserialization process.
+ * This method operates the exact inverse operation than MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo method. This is one of the last step of unserialization process.
* This method should be called on an object resized by buildNewInstanceFromTinyInfo static method.
* This method takes in argument a pointer 'vals' that point to the begin of double data pushed remotely by pushTinySerializationDblInfo method.
* This method returns the pointer 'vals' with an offset of size what it has been read in this method.
*/
-const double *ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues(const double *vals)
+const double *MEDCoupling::MEDCouplingGaussLocalization::fillWithValues(const double *vals)
{
const double *work=vals;
std::copy(work,work+_ref_coord.size(),_ref_coord.begin());
* This method sets the comp_th component of ptIdInCell_th point coordinate of reference element of type this->_type.
* @throw if not 0<=ptIdInCell<nbOfNodePerCell or if not 0<=comp<dim
*/
-void ParaMEDMEM::MEDCouplingGaussLocalization::setRefCoord(int ptIdInCell, int comp, double newVal)
+void MEDCoupling::MEDCouplingGaussLocalization::setRefCoord(int ptIdInCell, int comp, double newVal)
{
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_type);
int nbNodes=cm.getNumberOfNodes();
_ref_coord[ptIdInCell*dim+comp]=newVal;
}
-void ParaMEDMEM::MEDCouplingGaussLocalization::setGaussCoord(int gaussPtIdInCell, int comp, double newVal)
+void MEDCoupling::MEDCouplingGaussLocalization::setGaussCoord(int gaussPtIdInCell, int comp, double newVal)
{
int dim=checkCoherencyOfRequest(gaussPtIdInCell,comp);
_gauss_coord[gaussPtIdInCell*dim+comp]=newVal;
}
-void ParaMEDMEM::MEDCouplingGaussLocalization::setWeight(int gaussPtIdInCell, double newVal)
+void MEDCoupling::MEDCouplingGaussLocalization::setWeight(int gaussPtIdInCell, double newVal)
{
checkCoherencyOfRequest(gaussPtIdInCell,0);
_weight[gaussPtIdInCell]=newVal;
}
-void ParaMEDMEM::MEDCouplingGaussLocalization::setRefCoords(const std::vector<double>& refCoo)
+void MEDCoupling::MEDCouplingGaussLocalization::setRefCoords(const std::vector<double>& refCoo)
{
_ref_coord=refCoo;
}
-void ParaMEDMEM::MEDCouplingGaussLocalization::setGaussCoords(const std::vector<double>& gsCoo)
+void MEDCoupling::MEDCouplingGaussLocalization::setGaussCoords(const std::vector<double>& gsCoo)
{
_gauss_coord=gsCoo;
}
-void ParaMEDMEM::MEDCouplingGaussLocalization::setWeights(const std::vector<double>& w)
+void MEDCoupling::MEDCouplingGaussLocalization::setWeights(const std::vector<double>& w)
{
_weight=w;
}
/*!
- * The format of 'tinyData' parameter is the same than pushed in method ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo.
+ * The format of 'tinyData' parameter is the same than pushed in method MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo.
*/
-ParaMEDMEM::MEDCouplingGaussLocalization ParaMEDMEM::MEDCouplingGaussLocalization::BuildNewInstanceFromTinyInfo(int dim, const std::vector<int>& tinyData)
+MEDCoupling::MEDCouplingGaussLocalization MEDCoupling::MEDCouplingGaussLocalization::BuildNewInstanceFromTinyInfo(int dim, const std::vector<int>& tinyData)
{
std::vector<double> v1(dim*tinyData[1]),v2(dim*tinyData[2]),v3(tinyData[2]);
- return ParaMEDMEM::MEDCouplingGaussLocalization((INTERP_KERNEL::NormalizedCellType)tinyData[0],v1,v2,v3);
+ return MEDCoupling::MEDCouplingGaussLocalization((INTERP_KERNEL::NormalizedCellType)tinyData[0],v1,v2,v3);
}
-int ParaMEDMEM::MEDCouplingGaussLocalization::checkCoherencyOfRequest(int gaussPtIdInCell, int comp) const
+int MEDCoupling::MEDCouplingGaussLocalization::checkCoherencyOfRequest(int gaussPtIdInCell, int comp) const
{
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_type);
int dim=cm.getDimension();
return dim;
}
-bool ParaMEDMEM::MEDCouplingGaussLocalization::AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps)
+bool MEDCoupling::MEDCouplingGaussLocalization::AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps)
{
std::size_t sz=v1.size();
if(sz!=v2.size())
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingMesh;
MEDCOUPLING_EXPORT int getNumberOfPtsInRefCell() const;
MEDCOUPLING_EXPORT std::string getStringRepr() const;
MEDCOUPLING_EXPORT std::size_t getMemorySize() const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
MEDCOUPLING_EXPORT bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
MEDCOUPLING_EXPORT void pushTinySerializationIntInfo(std::vector<int>& tinyInfo) const;
MEDCOUPLING_EXPORT void pushTinySerializationDblInfo(std::vector<double>& tinyInfo) const;
#include <sstream>
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingIMesh::MEDCouplingIMesh():_space_dim(-1)
{
MEDCouplingIMesh *MEDCouplingIMesh::New(const std::string& meshName, int spaceDim, const int *nodeStrctStart, const int *nodeStrctStop,
const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> ret(new MEDCouplingIMesh);
+ MCAuto<MEDCouplingIMesh> ret(new MEDCouplingIMesh);
ret->setName(meshName);
ret->setSpaceDimension(spaceDim);
ret->setNodeStruct(nodeStrctStart,nodeStrctStop);
return ret.retn();
}
-MEDCouplingIMesh *MEDCouplingIMesh::deepCpy() const
+MEDCouplingIMesh *MEDCouplingIMesh::deepCopy() const
{
return clone(true);
}
{
if(ghostLev<0)
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::buildWithGhost : the ghostLev must be >= 0 !");
- checkCoherency();
+ checkConsistencyLight();
int spaceDim(getSpaceDimension());
double origin[3],dxyz[3];
int structure[3];
dxyz[i]=_dxyz[i];
structure[i]=_structure[i]+2*ghostLev;
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> ret(MEDCouplingIMesh::New(getName(),spaceDim,structure,structure+spaceDim,origin,origin+spaceDim,dxyz,dxyz+spaceDim));
+ MCAuto<MEDCouplingIMesh> ret(MEDCouplingIMesh::New(getName(),spaceDim,structure,structure+spaceDim,origin,origin+spaceDim,dxyz,dxyz+spaceDim));
ret->copyTinyInfoFrom(this);
return ret.retn();
}
*/
double MEDCouplingIMesh::getMeasureOfAnyCell() const
{
- checkCoherency();
+ checkConsistencyLight();
int dim(getSpaceDimension());
double ret(1.);
for(int i=0;i<dim;i++)
*/
MEDCouplingCMesh *MEDCouplingIMesh::convertToCartesian() const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> ret(MEDCouplingCMesh::New());
+ checkConsistencyLight();
+ MCAuto<MEDCouplingCMesh> ret(MEDCouplingCMesh::New());
try
{ ret->copyTinyInfoFrom(this); }
catch(INTERP_KERNEL::Exception& ) { }
std::vector<std::string> infos(buildInfoOnComponents());
for(int i=0;i<spaceDim;i++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(DataArrayDouble::New()); arr->alloc(_structure[i],1); arr->setInfoOnComponent(0,infos[i]);
+ MCAuto<DataArrayDouble> arr(DataArrayDouble::New()); arr->alloc(_structure[i],1); arr->setInfoOnComponent(0,infos[i]);
arr->iota(); arr->applyLin(_dxyz[i],_origin[i]);
ret->setCoordsAt(i,arr);
}
{
if((int)factors.size()!=_space_dim)
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::refineWithFactor : refinement factors must have size equal to spaceDim !");
- checkCoherency();
+ checkConsistencyLight();
std::vector<int> structure(_structure,_structure+3);
std::vector<double> dxyz(_dxyz,_dxyz+3);
for(int i=0;i<_space_dim;i++)
*
* \return MEDCouplingIMesh * - A newly created object (to be managed by the caller with decrRef) containing simply one cell.
*
- * \throw if \a this does not pass the \c checkCoherency test.
+ * \throw if \a this does not pass the \c checkConsistencyLight test.
*/
MEDCouplingIMesh *MEDCouplingIMesh::asSingleCell() const
{
- checkCoherency();
+ checkConsistencyLight();
int spaceDim(getSpaceDimension()),nodeSt[3];
double dxyz[3];
for(int i=0;i<spaceDim;i++)
dxyz[i]=_dxyz[i];
}
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> ret(MEDCouplingIMesh::New(getName(),getSpaceDimension(),nodeSt,nodeSt+spaceDim,_origin,_origin+spaceDim,dxyz,dxyz+spaceDim));
+ MCAuto<MEDCouplingIMesh> ret(MEDCouplingIMesh::New(getName(),getSpaceDimension(),nodeSt,nodeSt+spaceDim,_origin,_origin+spaceDim,dxyz,dxyz+spaceDim));
ret->copyTinyInfoFrom(this);
return ret.retn();
}
}
/*!
- * Nothing is done here (except to check that the other is a ParaMEDMEM::MEDCouplingIMesh instance too).
- * The user intend that the nodes are the same, so by construction of ParaMEDMEM::MEDCouplingIMesh, \a this and \a other are the same !
+ * Nothing is done here (except to check that the other is a MEDCoupling::MEDCouplingIMesh instance too).
+ * The user intend that the nodes are the same, so by construction of MEDCoupling::MEDCouplingIMesh, \a this and \a other are the same !
*/
void MEDCouplingIMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
DataArrayInt *&cellCor) const
throw INTERP_KERNEL::Exception("MEDCouplingIMesh::checkDeepEquivalOnSameNodesWith : Meshes are not the same !");
}
-void MEDCouplingIMesh::checkCoherency() const
+void MEDCouplingIMesh::checkConsistencyLight() const
{
checkSpaceDimension();
for(int i=0;i<_space_dim;i++)
if(_structure[i]<1)
{
- std::ostringstream oss; oss << "MEDCouplingIMesh::checkCoherency : On axis " << i << "/" << _space_dim << ", number of nodes is equal to " << _structure[i] << " ! must be >=1 !";
+ std::ostringstream oss; oss << "MEDCouplingIMesh::checkConsistencyLight : On axis " << i << "/" << _space_dim << ", number of nodes is equal to " << _structure[i] << " ! must be >=1 !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
-void MEDCouplingIMesh::checkCoherency1(double eps) const
+void MEDCouplingIMesh::checkConsistency(double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
}
void MEDCouplingIMesh::getNodeGridStructure(int *res) const
MEDCouplingStructuredMesh *MEDCouplingIMesh::buildStructuredSubPart(const std::vector< std::pair<int,int> >& cellPart) const
{
- checkCoherency();
+ checkConsistencyLight();
int dim(getSpaceDimension());
if(dim!=(int)cellPart.size())
{
}
double retOrigin[3]={0.,0.,0.};
int retStruct[3]={0,0,0};
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> ret(dynamic_cast<MEDCouplingIMesh *>(deepCpy()));
+ MCAuto<MEDCouplingIMesh> ret(dynamic_cast<MEDCouplingIMesh *>(deepCopy()));
for(int i=0;i<dim;i++)
{
int startNode(cellPart[i].first),endNode(cellPart[i].second+1);
}
ret->setNodeStruct(retStruct,retStruct+dim);
ret->setOrigin(retOrigin,retOrigin+dim);
- ret->checkCoherency();
+ ret->checkConsistencyLight();
return ret.retn();
}
void MEDCouplingIMesh::getBoundingBox(double *bbox) const
{
- checkCoherency();
+ checkConsistencyLight();
int dim(getSpaceDimension());
for(int idim=0; idim<dim; idim++)
{
*/
MEDCouplingFieldDouble *MEDCouplingIMesh::getMeasureField(bool isAbs) const
{
- checkCoherency();
+ checkConsistencyLight();
std::string name="MeasureOfMesh_";
name+=getName();
int nbelem(getNumberOfCells());
*/
DataArrayDouble *MEDCouplingIMesh::getCoordinatesAndOwner() const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ checkConsistencyLight();
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
int spaceDim(getSpaceDimension()),nbNodes(getNumberOfNodes());
ret->alloc(nbNodes,spaceDim);
double *pt(ret->getPointer());
* components. The caller is to delete this array using decrRef() as it is
* no more needed.
*/
-DataArrayDouble *MEDCouplingIMesh::getBarycenterAndOwner() const
+DataArrayDouble *MEDCouplingIMesh::computeCellCenterOfMass() const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ checkConsistencyLight();
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
int spaceDim(getSpaceDimension()),nbCells(getNumberOfCells()),tmp[3],tmp2[3];
ret->alloc(nbCells,spaceDim);
double *pt(ret->getPointer()),shiftOrigin[3];
DataArrayDouble *MEDCouplingIMesh::computeIsoBarycenterOfNodesPerCell() const
{
- return MEDCouplingIMesh::getBarycenterAndOwner();
+ return MEDCouplingIMesh::computeCellCenterOfMass();
}
void MEDCouplingIMesh::renumberCells(const int *old2NewBg, bool check)
void MEDCouplingIMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const
{
- checkCoherency();
+ checkConsistencyLight();
std::ostringstream extent,origin,spacing;
for(int i=0;i<3;i++)
{
#include "MEDCoupling.hxx"
#include "MEDCouplingStructuredMesh.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingCMesh;
MEDCOUPLING_EXPORT static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, const std::vector< std::pair<int,int> >& fineLocInCoarse, const std::vector<int>& facts, int ghostSize);
MEDCOUPLING_EXPORT static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, const std::vector< std::pair<int,int> >& fineLocInCoarse, const std::vector<int>& facts, int ghostSize);
//
- MEDCOUPLING_EXPORT MEDCouplingIMesh *deepCpy() const;
+ MEDCOUPLING_EXPORT MEDCouplingIMesh *deepCopy() const;
MEDCOUPLING_EXPORT MEDCouplingIMesh *clone(bool recDeepCpy) const;
MEDCOUPLING_EXPORT MEDCouplingIMesh *buildWithGhost(int ghostLev) const;
MEDCOUPLING_EXPORT void updateTime() const;
DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const;
MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
DataArrayInt *&cellCor) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
MEDCOUPLING_EXPORT int getSpaceDimension() const;
MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT void scale(const double *point, double factor);
MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
MEDCOUPLING_EXPORT DataArrayDouble *getCoordinatesAndOwner() const;
- MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true);
//some useful methods
MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
private:
MEDCouplingIMesh();
- MEDCouplingIMesh(const MEDCouplingIMesh& other, bool deepCpy);
+ MEDCouplingIMesh(const MEDCouplingIMesh& other, bool deepCopy);
~MEDCouplingIMesh();
void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
std::string getVTKDataSetType() const;
--- /dev/null
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (CEA/DEN)
+
+#include "MEDCouplingMappedExtrudedMesh.hxx"
+#include "MEDCouplingUMesh.hxx"
+#include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingFieldDouble.hxx"
+#include "MCAuto.hxx"
+#include "CellModel.hxx"
+
+#include "InterpolationUtils.hxx"
+
+#include <limits>
+#include <algorithm>
+#include <functional>
+#include <iterator>
+#include <sstream>
+#include <cmath>
+#include <list>
+#include <set>
+
+using namespace MEDCoupling;
+
+/*!
+ * Build an extruded mesh instance from 3D and 2D unstructured mesh lying on the \b same \b coords.
+ * @param mesh3D 3D unstructured mesh.
+ * @param mesh2D 2D unstructured mesh lying on the same coordinates than mesh3D. \b Warning mesh2D is \b not \b const
+ * because the mesh is aggregated and potentially modified by rotate or translate method.
+ * @param cell2DId Id of cell in mesh2D mesh where the computation of 1D mesh will be done.
+ */
+MEDCouplingMappedExtrudedMesh *MEDCouplingMappedExtrudedMesh::New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId)
+{
+ return new MEDCouplingMappedExtrudedMesh(mesh3D,mesh2D,cell2DId);
+}
+
+/*!
+ * This constructor is here only for unserialisation process.
+ * This constructor is normally completely useless for end user.
+ */
+MEDCouplingMappedExtrudedMesh *MEDCouplingMappedExtrudedMesh::New()
+{
+ return new MEDCouplingMappedExtrudedMesh;
+}
+
+MEDCouplingMeshType MEDCouplingMappedExtrudedMesh::getType() const
+{
+ return EXTRUDED;
+}
+
+std::size_t MEDCouplingMappedExtrudedMesh::getHeapMemorySizeWithoutChildren() const
+{
+ return MEDCouplingMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<const BigMemoryObject *> MEDCouplingMappedExtrudedMesh::getDirectChildrenWithNull() const
+{
+ std::vector<const BigMemoryObject *> ret;
+ ret.push_back(_mesh2D);
+ ret.push_back(_mesh1D);
+ ret.push_back(_mesh3D_ids);
+ return ret;
+}
+
+/*!
+ * This method copyies all tiny strings from other (name and components name).
+ * @throw if other and this have not same mesh type.
+ */
+void MEDCouplingMappedExtrudedMesh::copyTinyStringsFrom(const MEDCouplingMesh *other)
+{
+ const MEDCouplingMappedExtrudedMesh *otherC=dynamic_cast<const MEDCouplingMappedExtrudedMesh *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::copyTinyStringsFrom : meshes have not same type !");
+ MEDCouplingMesh::copyTinyStringsFrom(other);
+ _mesh2D->copyTinyStringsFrom(otherC->_mesh2D);
+ _mesh1D->copyTinyStringsFrom(otherC->_mesh1D);
+}
+
+MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId)
+try:_mesh2D(const_cast<MEDCouplingUMesh *>(mesh2D)),_mesh1D(MEDCouplingUMesh::New()),_mesh3D_ids(0),_cell_2D_id(cell2DId)
+{
+ if(_mesh2D!=0)
+ _mesh2D->incrRef();
+ computeExtrusion(mesh3D);
+ setName(mesh3D->getName());
+}
+catch(INTERP_KERNEL::Exception& e)
+{
+ if(_mesh2D)
+ _mesh2D->decrRef();
+ if(_mesh1D)
+ _mesh1D->decrRef();
+ if(_mesh3D_ids)
+ _mesh3D_ids->decrRef();
+ throw e;
+}
+
+MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh():_mesh2D(0),_mesh1D(0),_mesh3D_ids(0),_cell_2D_id(-1)
+{
+}
+
+MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCopy):MEDCouplingMesh(other),_cell_2D_id(other._cell_2D_id)
+{
+ if(deepCopy)
+ {
+ _mesh2D=other._mesh2D->clone(true);
+ _mesh1D=other._mesh1D->clone(true);
+ _mesh3D_ids=other._mesh3D_ids->deepCopy();
+ }
+ else
+ {
+ _mesh2D=other._mesh2D;
+ if(_mesh2D)
+ _mesh2D->incrRef();
+ _mesh1D=other._mesh1D;
+ if(_mesh1D)
+ _mesh1D->incrRef();
+ _mesh3D_ids=other._mesh3D_ids;
+ if(_mesh3D_ids)
+ _mesh3D_ids->incrRef();
+ }
+}
+
+int MEDCouplingMappedExtrudedMesh::getNumberOfCells() const
+{
+ return _mesh2D->getNumberOfCells()*_mesh1D->getNumberOfCells();
+}
+
+int MEDCouplingMappedExtrudedMesh::getNumberOfNodes() const
+{
+ return _mesh2D->getNumberOfNodes();
+}
+
+int MEDCouplingMappedExtrudedMesh::getSpaceDimension() const
+{
+ return 3;
+}
+
+int MEDCouplingMappedExtrudedMesh::getMeshDimension() const
+{
+ return 3;
+}
+
+MEDCouplingMappedExtrudedMesh *MEDCouplingMappedExtrudedMesh::deepCopy() const
+{
+ return clone(true);
+}
+
+MEDCouplingMappedExtrudedMesh *MEDCouplingMappedExtrudedMesh::clone(bool recDeepCpy) const
+{
+ return new MEDCouplingMappedExtrudedMesh(*this,recDeepCpy);
+}
+
+bool MEDCouplingMappedExtrudedMesh::isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const
+{
+ if(!other)
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::isEqualIfNotWhy : input other pointer is null !");
+ const MEDCouplingMappedExtrudedMesh *otherC=dynamic_cast<const MEDCouplingMappedExtrudedMesh *>(other);
+ std::ostringstream oss;
+ if(!otherC)
+ {
+ reason="mesh given in input is not castable in MEDCouplingMappedExtrudedMesh !";
+ return false;
+ }
+ if(!MEDCouplingMesh::isEqualIfNotWhy(other,prec,reason))
+ return false;
+ if(!_mesh2D->isEqualIfNotWhy(otherC->_mesh2D,prec,reason))
+ {
+ reason.insert(0,"Mesh2D unstructured meshes differ : ");
+ return false;
+ }
+ if(!_mesh1D->isEqualIfNotWhy(otherC->_mesh1D,prec,reason))
+ {
+ reason.insert(0,"Mesh1D unstructured meshes differ : ");
+ return false;
+ }
+ if(!_mesh3D_ids->isEqualIfNotWhy(*otherC->_mesh3D_ids,reason))
+ {
+ reason.insert(0,"Mesh3D ids DataArrayInt instances differ : ");
+ return false;
+ }
+ if(_cell_2D_id!=otherC->_cell_2D_id)
+ {
+ oss << "Cell 2D id of the two extruded mesh differ : this = " << _cell_2D_id << " other = " << otherC->_cell_2D_id;
+ reason=oss.str();
+ return false;
+ }
+ return true;
+}
+
+bool MEDCouplingMappedExtrudedMesh::isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const
+{
+ const MEDCouplingMappedExtrudedMesh *otherC=dynamic_cast<const MEDCouplingMappedExtrudedMesh *>(other);
+ if(!otherC)
+ return false;
+ if(!_mesh2D->isEqualWithoutConsideringStr(otherC->_mesh2D,prec))
+ return false;
+ if(!_mesh1D->isEqualWithoutConsideringStr(otherC->_mesh1D,prec))
+ return false;
+ if(!_mesh3D_ids->isEqualWithoutConsideringStr(*otherC->_mesh3D_ids))
+ return false;
+ if(_cell_2D_id!=otherC->_cell_2D_id)
+ return false;
+ return true;
+}
+
+void MEDCouplingMappedExtrudedMesh::checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
+ DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::checkDeepEquivalWith : not implemented yet !");
+}
+
+void MEDCouplingMappedExtrudedMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
+ DataArrayInt *&cellCor) const
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::checkDeepEquivalOnSameNodesWith : not implemented yet !");
+}
+
+INTERP_KERNEL::NormalizedCellType MEDCouplingMappedExtrudedMesh::getTypeOfCell(int cellId) const
+{
+ const int *ids=_mesh3D_ids->getConstPointer();
+ int nbOf3DCells=_mesh3D_ids->getNumberOfTuples();
+ const int *where=std::find(ids,ids+nbOf3DCells,cellId);
+ if(where==ids+nbOf3DCells)
+ throw INTERP_KERNEL::Exception("Invalid cellId specified >= getNumberOfCells() !");
+ int nbOfCells2D=_mesh2D->getNumberOfCells();
+ int locId=((int)std::distance(ids,where))%nbOfCells2D;
+ INTERP_KERNEL::NormalizedCellType tmp=_mesh2D->getTypeOfCell(locId);
+ return INTERP_KERNEL::CellModel::GetCellModel(tmp).getExtrudedType();
+}
+
+std::set<INTERP_KERNEL::NormalizedCellType> MEDCouplingMappedExtrudedMesh::getAllGeoTypes() const
+{
+ std::set<INTERP_KERNEL::NormalizedCellType> ret2D(_mesh2D->getAllGeoTypes());
+ std::set<INTERP_KERNEL::NormalizedCellType> ret;
+ for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=ret2D.begin();it!=ret2D.end();it++)
+ ret.insert(INTERP_KERNEL::CellModel::GetCellModel(*it).getExtrudedType());
+ return ret;
+}
+
+DataArrayInt *MEDCouplingMappedExtrudedMesh::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
+{
+ const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(type);
+ INTERP_KERNEL::NormalizedCellType revExtTyp=cm.getReverseExtrudedType();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
+ if(revExtTyp==INTERP_KERNEL::NORM_ERROR)
+ {
+ ret->alloc(0,1);
+ return ret.retn();
+ }
+ MCAuto<DataArrayInt> tmp=_mesh2D->giveCellsWithType(revExtTyp);
+ int nbOfLevs=_mesh1D->getNumberOfCells();
+ int nbOfCells2D=_mesh2D->getNumberOfCells();
+ int nbOfTuples=tmp->getNumberOfTuples();
+ ret->alloc(nbOfLevs*nbOfTuples,1);
+ int *pt=ret->getPointer();
+ for(int i=0;i<nbOfLevs;i++,pt+=nbOfTuples)
+ std::transform(tmp->begin(),tmp->end(),pt,std::bind2nd(std::plus<int>(),i*nbOfCells2D));
+ MCAuto<DataArrayInt> ret2=ret->renumberR(_mesh3D_ids->begin());
+ ret2->sort();
+ return ret2.retn();
+}
+
+DataArrayInt *MEDCouplingMappedExtrudedMesh::computeNbOfNodesPerCell() const
+{
+ MCAuto<DataArrayInt> ret2D=_mesh2D->computeNbOfNodesPerCell();
+ int nbOfLevs=_mesh1D->getNumberOfCells();
+ int nbOfCells2D=_mesh2D->getNumberOfCells();
+ MCAuto<DataArrayInt> ret3D=DataArrayInt::New(); ret3D->alloc(nbOfLevs*nbOfCells2D,1);
+ int *pt=ret3D->getPointer();
+ for(int i=0;i<nbOfLevs;i++,pt+=nbOfCells2D)
+ std::copy(ret2D->begin(),ret2D->end(),pt);
+ ret3D->applyLin(2,0,0);
+ return ret3D->renumberR(_mesh3D_ids->begin());
+}
+
+DataArrayInt *MEDCouplingMappedExtrudedMesh::computeNbOfFacesPerCell() const
+{
+ MCAuto<DataArrayInt> ret2D=_mesh2D->computeNbOfNodesPerCell();
+ int nbOfLevs=_mesh1D->getNumberOfCells();
+ int nbOfCells2D=_mesh2D->getNumberOfCells();
+ MCAuto<DataArrayInt> ret3D=DataArrayInt::New(); ret3D->alloc(nbOfLevs*nbOfCells2D,1);
+ int *pt=ret3D->getPointer();
+ for(int i=0;i<nbOfLevs;i++,pt+=nbOfCells2D)
+ std::copy(ret2D->begin(),ret2D->end(),pt);
+ ret3D->applyLin(2,2,0);
+ return ret3D->renumberR(_mesh3D_ids->begin());
+}
+
+DataArrayInt *MEDCouplingMappedExtrudedMesh::computeEffectiveNbOfNodesPerCell() const
+{
+ return computeNbOfNodesPerCell();
+}
+
+int MEDCouplingMappedExtrudedMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
+{
+ int ret=0;
+ int nbOfCells2D=_mesh2D->getNumberOfCells();
+ for(int i=0;i<nbOfCells2D;i++)
+ {
+ INTERP_KERNEL::NormalizedCellType t=_mesh2D->getTypeOfCell(i);
+ if(INTERP_KERNEL::CellModel::GetCellModel(t).getExtrudedType()==type)
+ ret++;
+ }
+ return ret*_mesh1D->getNumberOfCells();
+}
+
+void MEDCouplingMappedExtrudedMesh::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
+{
+ int nbOfCells2D=_mesh2D->getNumberOfCells();
+ int nbOfNodes2D=_mesh2D->getNumberOfNodes();
+ int locId=cellId%nbOfCells2D;
+ int lev=cellId/nbOfCells2D;
+ std::vector<int> tmp,tmp2;
+ _mesh2D->getNodeIdsOfCell(locId,tmp);
+ tmp2=tmp;
+ std::transform(tmp.begin(),tmp.end(),tmp.begin(),std::bind2nd(std::plus<int>(),nbOfNodes2D*lev));
+ std::transform(tmp2.begin(),tmp2.end(),tmp2.begin(),std::bind2nd(std::plus<int>(),nbOfNodes2D*(lev+1)));
+ conn.insert(conn.end(),tmp.begin(),tmp.end());
+ conn.insert(conn.end(),tmp2.begin(),tmp2.end());
+}
+
+void MEDCouplingMappedExtrudedMesh::getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const
+{
+ int nbOfNodes2D=_mesh2D->getNumberOfNodes();
+ int locId=nodeId%nbOfNodes2D;
+ int lev=nodeId/nbOfNodes2D;
+ std::vector<double> tmp,tmp2;
+ _mesh2D->getCoordinatesOfNode(locId,tmp);
+ tmp2=tmp;
+ int spaceDim=_mesh1D->getSpaceDimension();
+ const double *z=_mesh1D->getCoords()->getConstPointer();
+ std::transform(tmp.begin(),tmp.end(),z+lev*spaceDim,tmp.begin(),std::plus<double>());
+ std::transform(tmp2.begin(),tmp2.end(),z+(lev+1)*spaceDim,tmp2.begin(),std::plus<double>());
+ coo.insert(coo.end(),tmp.begin(),tmp.end());
+ coo.insert(coo.end(),tmp2.begin(),tmp2.end());
+}
+
+std::string MEDCouplingMappedExtrudedMesh::simpleRepr() const
+{
+ std::ostringstream ret;
+ ret << "3D Extruded mesh from a 2D Surf Mesh with name : \"" << getName() << "\"\n";
+ ret << "Description of mesh : \"" << getDescription() << "\"\n";
+ int tmpp1,tmpp2;
+ double tt=getTime(tmpp1,tmpp2);
+ ret << "Time attached to the mesh [unit] : " << tt << " [" << getTimeUnit() << "]\n";
+ ret << "Iteration : " << tmpp1 << " Order : " << tmpp2 << "\n";
+ ret << "Cell id where 1D mesh has been deduced : " << _cell_2D_id << "\n";
+ ret << "Number of cells : " << getNumberOfCells() << "(" << _mesh2D->getNumberOfCells() << "x" << _mesh1D->getNumberOfCells() << ")\n";
+ ret << "1D Mesh info : _____________________\n\n\n";
+ ret << _mesh1D->simpleRepr();
+ ret << "\n\n\n2D Mesh info : _____________________\n\n\n" << _mesh2D->simpleRepr() << "\n\n\n";
+ return ret.str();
+}
+
+std::string MEDCouplingMappedExtrudedMesh::advancedRepr() const
+{
+ std::ostringstream ret;
+ ret << "3D Extruded mesh from a 2D Surf Mesh with name : \"" << getName() << "\"\n";
+ ret << "Description of mesh : \"" << getDescription() << "\"\n";
+ int tmpp1,tmpp2;
+ double tt=getTime(tmpp1,tmpp2);
+ ret << "Time attached to the mesh (unit) : " << tt << " (" << getTimeUnit() << ")\n";
+ ret << "Iteration : " << tmpp1 << " Order : " << tmpp2 << "\n";
+ ret << "Cell id where 1D mesh has been deduced : " << _cell_2D_id << "\n";
+ ret << "Number of cells : " << getNumberOfCells() << "(" << _mesh2D->getNumberOfCells() << "x" << _mesh1D->getNumberOfCells() << ")\n";
+ ret << "1D Mesh info : _____________________\n\n\n";
+ ret << _mesh1D->advancedRepr();
+ ret << "\n\n\n2D Mesh info : _____________________\n\n\n" << _mesh2D->advancedRepr() << "\n\n\n";
+ ret << "3D cell ids per level :\n";
+ return ret.str();
+}
+
+void MEDCouplingMappedExtrudedMesh::checkConsistencyLight() const
+{
+}
+
+void MEDCouplingMappedExtrudedMesh::checkConsistency(double eps) const
+{
+ checkConsistencyLight();
+}
+
+void MEDCouplingMappedExtrudedMesh::getBoundingBox(double *bbox) const
+{
+ double bbox2D[6];
+ _mesh2D->getBoundingBox(bbox2D);
+ const double *nodes1D=_mesh1D->getCoords()->getConstPointer();
+ int nbOfNodes1D=_mesh1D->getNumberOfNodes();
+ double bbox1DMin[3],bbox1DMax[3],tmp[3];
+ std::fill(bbox1DMin,bbox1DMin+3,std::numeric_limits<double>::max());
+ std::fill(bbox1DMax,bbox1DMax+3,-(std::numeric_limits<double>::max()));
+ for(int i=0;i<nbOfNodes1D;i++)
+ {
+ std::transform(nodes1D+3*i,nodes1D+3*(i+1),bbox1DMin,bbox1DMin,static_cast<const double& (*)(const double&, const double&)>(std::min<double>));
+ std::transform(nodes1D+3*i,nodes1D+3*(i+1),bbox1DMax,bbox1DMax,static_cast<const double& (*)(const double&, const double&)>(std::max<double>));
+ }
+ std::transform(bbox1DMax,bbox1DMax+3,bbox1DMin,tmp,std::minus<double>());
+ int id=(int)std::distance(tmp,std::max_element(tmp,tmp+3));
+ bbox[0]=bbox1DMin[0]; bbox[1]=bbox1DMax[0];
+ bbox[2]=bbox1DMin[1]; bbox[3]=bbox1DMax[1];
+ bbox[4]=bbox1DMin[2]; bbox[5]=bbox1DMax[2];
+ bbox[2*id+1]+=tmp[id];
+}
+
+void MEDCouplingMappedExtrudedMesh::updateTime() const
+{
+ if(_mesh2D)
+ {
+ updateTimeWith(*_mesh2D);
+ }
+ if(_mesh1D)
+ {
+ updateTimeWith(*_mesh1D);
+ }
+}
+
+void MEDCouplingMappedExtrudedMesh::renumberCells(const int *old2NewBg, bool check)
+{
+ throw INTERP_KERNEL::Exception("Functionnality of renumbering cells unavailable for ExtrudedMesh");
+}
+
+MEDCouplingUMesh *MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh() const
+{
+ MEDCouplingUMesh *ret=_mesh2D->buildExtrudedMesh(_mesh1D,0);
+ const int *renum=_mesh3D_ids->getConstPointer();
+ ret->renumberCells(renum,false);
+ ret->setName(getName());
+ return ret;
+}
+
+MEDCouplingUMesh *MEDCouplingMappedExtrudedMesh::buildUnstructured() const
+{
+ return build3DUnstructuredMesh();
+}
+
+MEDCouplingFieldDouble *MEDCouplingMappedExtrudedMesh::getMeasureField(bool) const
+{
+ std::string name="MeasureOfMesh_";
+ name+=getName();
+ MEDCouplingFieldDouble *ret2D=_mesh2D->getMeasureField(true);
+ MEDCouplingFieldDouble *ret1D=_mesh1D->getMeasureField(true);
+ const double *ret2DPtr=ret2D->getArray()->getConstPointer();
+ const double *ret1DPtr=ret1D->getArray()->getConstPointer();
+ int nbOf2DCells=_mesh2D->getNumberOfCells();
+ int nbOf1DCells=_mesh1D->getNumberOfCells();
+ int nbOf3DCells=nbOf2DCells*nbOf1DCells;
+ const int *renum=_mesh3D_ids->getConstPointer();
+ MEDCouplingFieldDouble *ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ ret->setMesh(this);
+ ret->synchronizeTimeWithMesh();
+ DataArrayDouble *da=DataArrayDouble::New();
+ da->alloc(nbOf3DCells,1);
+ double *retPtr=da->getPointer();
+ for(int i=0;i<nbOf1DCells;i++)
+ for(int j=0;j<nbOf2DCells;j++)
+ retPtr[renum[i*nbOf2DCells+j]]=ret2DPtr[j]*ret1DPtr[i];
+ ret->setArray(da);
+ da->decrRef();
+ ret->setName(name);
+ ret2D->decrRef();
+ ret1D->decrRef();
+ return ret;
+}
+
+MEDCouplingFieldDouble *MEDCouplingMappedExtrudedMesh::getMeasureFieldOnNode(bool isAbs) const
+{
+ //not implemented yet
+ return 0;
+}
+
+MEDCouplingFieldDouble *MEDCouplingMappedExtrudedMesh::buildOrthogonalField() const
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::buildOrthogonalField : This method has no sense for MEDCouplingMappedExtrudedMesh that is 3D !");
+}
+
+int MEDCouplingMappedExtrudedMesh::getCellContainingPoint(const double *pos, double eps) const
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::getCellContainingPoint : not implemented yet !");
+}
+
+MEDCouplingMappedExtrudedMesh::~MEDCouplingMappedExtrudedMesh()
+{
+ if(_mesh2D)
+ _mesh2D->decrRef();
+ if(_mesh1D)
+ _mesh1D->decrRef();
+ if(_mesh3D_ids)
+ _mesh3D_ids->decrRef();
+}
+
+void MEDCouplingMappedExtrudedMesh::computeExtrusion(const MEDCouplingUMesh *mesh3D)
+{
+ const char errMsg1[]="2D mesh is empty unable to compute extrusion !";
+ const char errMsg2[]="Coords between 2D and 3D meshes are not the same ! Try MEDCouplingPointSet::tryToShareSameCoords method";
+ const char errMsg3[]="No chance to find extrusion pattern in mesh3D,mesh2D couple because nbCells3D%nbCells2D!=0 !";
+ if(_mesh2D==0 || mesh3D==0)
+ throw INTERP_KERNEL::Exception(errMsg1);
+ if(_mesh2D->getCoords()!=mesh3D->getCoords())
+ throw INTERP_KERNEL::Exception(errMsg2);
+ if(mesh3D->getNumberOfCells()%_mesh2D->getNumberOfCells()!=0)
+ throw INTERP_KERNEL::Exception(errMsg3);
+ if(!_mesh3D_ids)
+ _mesh3D_ids=DataArrayInt::New();
+ if(!_mesh1D)
+ _mesh1D=MEDCouplingUMesh::New();
+ computeExtrusionAlg(mesh3D);
+}
+
+void MEDCouplingMappedExtrudedMesh::build1DExtrusion(int idIn3DDesc, int newId, int nbOf1DLev, MEDCouplingUMesh *subMesh,
+ const int *desc3D, const int *descIndx3D,
+ const int *revDesc3D, const int *revDescIndx3D,
+ bool computeMesh1D)
+{
+ int nbOf2DCells=_mesh2D->getNumberOfCells();
+ int start=revDescIndx3D[idIn3DDesc];
+ int end=revDescIndx3D[idIn3DDesc+1];
+ if(end-start!=1)
+ {
+ std::ostringstream ost; ost << "Invalid bases 2D mesh specified : 2D cell # " << idIn3DDesc;
+ ost << " shared by more than 1 3D cell !!!";
+ throw INTERP_KERNEL::Exception(ost.str().c_str());
+ }
+ int current3DCell=revDesc3D[start];
+ int current2DCell=idIn3DDesc;
+ int *mesh3DIDs=_mesh3D_ids->getPointer();
+ mesh3DIDs[newId]=current3DCell;
+ const int *conn2D=subMesh->getNodalConnectivity()->getConstPointer();
+ const int *conn2DIndx=subMesh->getNodalConnectivityIndex()->getConstPointer();
+ for(int i=1;i<nbOf1DLev;i++)
+ {
+ std::vector<int> conn(conn2D+conn2DIndx[current2DCell]+1,conn2D+conn2DIndx[current2DCell+1]);
+ std::sort(conn.begin(),conn.end());
+ if(computeMesh1D)
+ computeBaryCenterOfFace(conn,i-1);
+ current2DCell=findOppositeFaceOf(current2DCell,current3DCell,conn,
+ desc3D,descIndx3D,conn2D,conn2DIndx);
+ start=revDescIndx3D[current2DCell];
+ end=revDescIndx3D[current2DCell+1];
+ if(end-start!=2)
+ {
+ std::ostringstream ost; ost << "Expecting to have 2 3D cells attached to 2D cell " << current2DCell << "!";
+ ost << " : Impossible or call tryToShareSameCoords method !";
+ throw INTERP_KERNEL::Exception(ost.str().c_str());
+ }
+ if(revDesc3D[start]!=current3DCell)
+ current3DCell=revDesc3D[start];
+ else
+ current3DCell=revDesc3D[start+1];
+ mesh3DIDs[i*nbOf2DCells+newId]=current3DCell;
+ }
+ if(computeMesh1D)
+ {
+ std::vector<int> conn(conn2D+conn2DIndx[current2DCell]+1,conn2D+conn2DIndx[current2DCell+1]);
+ std::sort(conn.begin(),conn.end());
+ computeBaryCenterOfFace(conn,nbOf1DLev-1);
+ current2DCell=findOppositeFaceOf(current2DCell,current3DCell,conn,
+ desc3D,descIndx3D,conn2D,conn2DIndx);
+ conn.clear();
+ conn.insert(conn.end(),conn2D+conn2DIndx[current2DCell]+1,conn2D+conn2DIndx[current2DCell+1]);
+ std::sort(conn.begin(),conn.end());
+ computeBaryCenterOfFace(conn,nbOf1DLev);
+ }
+}
+
+int MEDCouplingMappedExtrudedMesh::findOppositeFaceOf(int current2DCell, int current3DCell, const std::vector<int>& connSorted,
+ const int *desc3D, const int *descIndx3D,
+ const int *conn2D, const int *conn2DIndx)
+{
+ int start=descIndx3D[current3DCell];
+ int end=descIndx3D[current3DCell+1];
+ bool found=false;
+ for(const int *candidate2D=desc3D+start;candidate2D!=desc3D+end && !found;candidate2D++)
+ {
+ if(*candidate2D!=current2DCell)
+ {
+ std::vector<int> conn2(conn2D+conn2DIndx[*candidate2D]+1,conn2D+conn2DIndx[*candidate2D+1]);
+ std::sort(conn2.begin(),conn2.end());
+ std::list<int> intersect;
+ std::set_intersection(connSorted.begin(),connSorted.end(),conn2.begin(),conn2.end(),
+ std::insert_iterator< std::list<int> >(intersect,intersect.begin()));
+ if(intersect.empty())
+ return *candidate2D;
+ }
+ }
+ std::ostringstream ost; ost << "Impossible to find an opposite 2D face of face # " << current2DCell;
+ ost << " in 3D cell # " << current3DCell << " : Impossible or call tryToShareSameCoords method !";
+ throw INTERP_KERNEL::Exception(ost.str().c_str());
+}
+
+void MEDCouplingMappedExtrudedMesh::computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId)
+{
+ double *zoneToUpdate=_mesh1D->getCoords()->getPointer()+lev1DId*3;
+ std::fill(zoneToUpdate,zoneToUpdate+3,0.);
+ const double *coords=_mesh2D->getCoords()->getConstPointer();
+ for(std::vector<int>::const_iterator iter=nodalConnec.begin();iter!=nodalConnec.end();iter++)
+ std::transform(zoneToUpdate,zoneToUpdate+3,coords+3*(*iter),zoneToUpdate,std::plus<double>());
+ std::transform(zoneToUpdate,zoneToUpdate+3,zoneToUpdate,std::bind2nd(std::multiplies<double>(),(double)(1./(int)nodalConnec.size())));
+}
+
+int MEDCouplingMappedExtrudedMesh::FindCorrespCellByNodalConn(const std::vector<int>& nodalConnec, const int *revNodalPtr, const int *revNodalIndxPtr)
+{
+ std::vector<int>::const_iterator iter=nodalConnec.begin();
+ std::set<int> s1(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1]);
+ iter++;
+ for(;iter!=nodalConnec.end();iter++)
+ {
+ std::set<int> s2(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1]);
+ std::set<int> s3;
+ std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(),std::insert_iterator< std::set<int> >(s3,s3.end()));
+ s1=s3;
+ }
+ if(s1.size()==1)
+ return *(s1.begin());
+ std::ostringstream ostr;
+ ostr << "Cell with nodal connec : ";
+ std::copy(nodalConnec.begin(),nodalConnec.end(),std::ostream_iterator<int>(ostr," "));
+ ostr << " is not part of mesh";
+ throw INTERP_KERNEL::Exception(ostr.str().c_str());
+}
+
+/*!
+ * This method is callable on 1Dmeshes (meshDim==1 && spaceDim==3) returned by MEDCouplingMappedExtrudedMesh::getMesh1D typically.
+ * These 1Dmeshes (meshDim==1 && spaceDim==3) have a special semantic because these meshes do not specify a static location but a translation along a path.
+ * This method checks that 'm1' and 'm2' are compatible, if not an exception is thrown. In case these meshes ('m1' and 'm2') are compatible 2 corresponding meshes
+ * are created ('m1r' and 'm2r') that can be used for interpolation.
+ * @param m1 input mesh with meshDim==1 and spaceDim==3
+ * @param m2 input mesh with meshDim==1 and spaceDim==3
+ * @param eps tolerance acceptable to determine compatibility
+ * @param m1r output mesh with ref count equal to 1 with meshDim==1 and spaceDim==1
+ * @param m2r output mesh with ref count equal to 1 with meshDim==1 and spaceDim==1
+ * @param v is the output normalized vector of the common direction of 'm1' and 'm2'
+ * @throw in case that m1 and m2 are not compatible each other.
+ */
+void MEDCouplingMappedExtrudedMesh::Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
+ MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v)
+{
+ if(m1->getSpaceDimension()!=3 || m1->getSpaceDimension()!=3)
+ throw INTERP_KERNEL::Exception("Input meshes are expected to have a spaceDim==3 for Projec1D !");
+ m1r=m1->clone(true);
+ m2r=m2->clone(true);
+ m1r->changeSpaceDimension(1);
+ m2r->changeSpaceDimension(1);
+ std::vector<int> c;
+ std::vector<double> ref,ref2;
+ m1->getNodeIdsOfCell(0,c);
+ m1->getCoordinatesOfNode(c[0],ref);
+ m1->getCoordinatesOfNode(c[1],ref2);
+ std::transform(ref2.begin(),ref2.end(),ref.begin(),v,std::minus<double>());
+ double n=INTERP_KERNEL::norm<3>(v);
+ std::transform(v,v+3,v,std::bind2nd(std::multiplies<double>(),1/n));
+ m1->project1D(&ref[0],v,eps,m1r->getCoords()->getPointer());
+ m2->project1D(&ref[0],v,eps,m2r->getCoords()->getPointer());
+}
+
+void MEDCouplingMappedExtrudedMesh::rotate(const double *center, const double *vector, double angle)
+{
+ _mesh2D->rotate(center,vector,angle);
+ _mesh1D->rotate(center,vector,angle);
+}
+
+void MEDCouplingMappedExtrudedMesh::translate(const double *vector)
+{
+ _mesh2D->translate(vector);
+ _mesh1D->translate(vector);
+}
+
+void MEDCouplingMappedExtrudedMesh::scale(const double *point, double factor)
+{
+ _mesh2D->scale(point,factor);
+ _mesh1D->scale(point,factor);
+}
+
+std::vector<int> MEDCouplingMappedExtrudedMesh::getDistributionOfTypes() const
+{
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
+}
+
+DataArrayInt *MEDCouplingMappedExtrudedMesh::checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const
+{
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
+}
+
+void MEDCouplingMappedExtrudedMesh::splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const
+{
+ throw INTERP_KERNEL::Exception("Not implemented yet !");
+}
+
+MEDCouplingMesh *MEDCouplingMappedExtrudedMesh::buildPart(const int *start, const int *end) const
+{
+ // not implemented yet !
+ return 0;
+}
+
+MEDCouplingMesh *MEDCouplingMappedExtrudedMesh::buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const
+{
+ // not implemented yet !
+ return 0;
+}
+
+DataArrayInt *MEDCouplingMappedExtrudedMesh::simplexize(int policy)
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::simplexize : unavailable for such a type of mesh : Extruded !");
+}
+
+MEDCouplingMesh *MEDCouplingMappedExtrudedMesh::mergeMyselfWith(const MEDCouplingMesh *other) const
+{
+ // not implemented yet !
+ return 0;
+}
+
+DataArrayDouble *MEDCouplingMappedExtrudedMesh::getCoordinatesAndOwner() const
+{
+ DataArrayDouble *arr2D=_mesh2D->getCoords();
+ DataArrayDouble *arr1D=_mesh1D->getCoords();
+ DataArrayDouble *ret=DataArrayDouble::New();
+ ret->alloc(getNumberOfNodes(),3);
+ int nbOf1DLev=_mesh1D->getNumberOfNodes();
+ int nbOf2DNodes=_mesh2D->getNumberOfNodes();
+ const double *ptSrc=arr2D->getConstPointer();
+ double *pt=ret->getPointer();
+ std::copy(ptSrc,ptSrc+3*nbOf2DNodes,pt);
+ for(int i=1;i<nbOf1DLev;i++)
+ {
+ std::copy(ptSrc,ptSrc+3*nbOf2DNodes,pt+3*i*nbOf2DNodes);
+ double vec[3];
+ std::copy(arr1D->getConstPointer()+3*i,arr1D->getConstPointer()+3*(i+1),vec);
+ std::transform(arr1D->getConstPointer()+3*(i-1),arr1D->getConstPointer()+3*i,vec,vec,std::minus<double>());
+ for(int j=0;j<nbOf2DNodes;j++)
+ std::transform(vec,vec+3,pt+3*(i*nbOf2DNodes+j),pt+3*(i*nbOf2DNodes+j),std::plus<double>());
+ }
+ return ret;
+}
+
+DataArrayDouble *MEDCouplingMappedExtrudedMesh::computeCellCenterOfMass() const
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::computeCellCenterOfMass : not yet implemented !");
+}
+
+DataArrayDouble *MEDCouplingMappedExtrudedMesh::computeIsoBarycenterOfNodesPerCell() const
+{
+ throw INTERP_KERNEL::Exception("MEDCouplingMappedExtrudedMesh::computeIsoBarycenterOfNodesPerCell: not yet implemented !");
+}
+
+void MEDCouplingMappedExtrudedMesh::getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const
+{
+ MCAuto<MEDCouplingUMesh> m(buildUnstructured());
+ m->getReverseNodalConnectivity(revNodal,revNodalIndx);
+}
+
+void MEDCouplingMappedExtrudedMesh::computeExtrusionAlg(const MEDCouplingUMesh *mesh3D)
+{
+ _mesh3D_ids->alloc(mesh3D->getNumberOfCells(),1);
+ int nbOf1DLev=mesh3D->getNumberOfCells()/_mesh2D->getNumberOfCells();
+ _mesh1D->setMeshDimension(1);
+ _mesh1D->allocateCells(nbOf1DLev);
+ int tmpConn[2];
+ for(int i=0;i<nbOf1DLev;i++)
+ {
+ tmpConn[0]=i;
+ tmpConn[1]=i+1;
+ _mesh1D->insertNextCell(INTERP_KERNEL::NORM_SEG2,2,tmpConn);
+ }
+ _mesh1D->finishInsertingCells();
+ DataArrayDouble *myCoords=DataArrayDouble::New();
+ myCoords->alloc(nbOf1DLev+1,3);
+ _mesh1D->setCoords(myCoords);
+ myCoords->decrRef();
+ DataArrayInt *desc,*descIndx,*revDesc,*revDescIndx;
+ desc=DataArrayInt::New(); descIndx=DataArrayInt::New(); revDesc=DataArrayInt::New(); revDescIndx=DataArrayInt::New();
+ MEDCouplingUMesh *subMesh=mesh3D->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
+ DataArrayInt *revNodal2D,*revNodalIndx2D;
+ revNodal2D=DataArrayInt::New(); revNodalIndx2D=DataArrayInt::New();
+ subMesh->getReverseNodalConnectivity(revNodal2D,revNodalIndx2D);
+ const int *nodal2D=_mesh2D->getNodalConnectivity()->getConstPointer();
+ const int *nodal2DIndx=_mesh2D->getNodalConnectivityIndex()->getConstPointer();
+ const int *revNodal2DPtr=revNodal2D->getConstPointer();
+ const int *revNodalIndx2DPtr=revNodalIndx2D->getConstPointer();
+ const int *descP=desc->getConstPointer();
+ const int *descIndxP=descIndx->getConstPointer();
+ const int *revDescP=revDesc->getConstPointer();
+ const int *revDescIndxP=revDescIndx->getConstPointer();
+ //
+ int nbOf2DCells=_mesh2D->getNumberOfCells();
+ for(int i=0;i<nbOf2DCells;i++)
+ {
+ int idInSubMesh;
+ std::vector<int> nodalConnec(nodal2D+nodal2DIndx[i]+1,nodal2D+nodal2DIndx[i+1]);
+ try
+ {
+ idInSubMesh=FindCorrespCellByNodalConn(nodalConnec,revNodal2DPtr,revNodalIndx2DPtr);
+ }
+ catch(INTERP_KERNEL::Exception& e)
+ {
+ std::ostringstream ostr; ostr << "mesh2D cell # " << i << " is not part of any cell of 3D mesh !\n";
+ ostr << e.what();
+ throw INTERP_KERNEL::Exception(ostr.str().c_str());
+ }
+ build1DExtrusion(idInSubMesh,i,nbOf1DLev,subMesh,descP,descIndxP,revDescP,revDescIndxP,i==_cell_2D_id);
+ }
+ //
+ revNodal2D->decrRef();
+ revNodalIndx2D->decrRef();
+ subMesh->decrRef();
+ desc->decrRef();
+ descIndx->decrRef();
+ revDesc->decrRef();
+ revDescIndx->decrRef();
+}
+
+void MEDCouplingMappedExtrudedMesh::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
+{
+ std::vector<int> tinyInfo1;
+ std::vector<std::string> ls1;
+ std::vector<double> ls3;
+ _mesh2D->getTinySerializationInformation(ls3,tinyInfo1,ls1);
+ std::vector<int> tinyInfo2;
+ std::vector<std::string> ls2;
+ std::vector<double> ls4;
+ _mesh1D->getTinySerializationInformation(ls4,tinyInfo2,ls2);
+ tinyInfo.clear(); littleStrings.clear();
+ tinyInfo.insert(tinyInfo.end(),tinyInfo1.begin(),tinyInfo1.end());
+ littleStrings.insert(littleStrings.end(),ls1.begin(),ls1.end());
+ tinyInfo.insert(tinyInfo.end(),tinyInfo2.begin(),tinyInfo2.end());
+ littleStrings.insert(littleStrings.end(),ls2.begin(),ls2.end());
+ tinyInfo.push_back(_cell_2D_id);
+ tinyInfo.push_back((int)tinyInfo1.size());
+ tinyInfo.push_back(_mesh3D_ids->getNbOfElems());
+ littleStrings.push_back(getName());
+ littleStrings.push_back(getDescription());
+}
+
+void MEDCouplingMappedExtrudedMesh::resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const
+{
+ std::size_t sz=tinyInfo.size();
+ int sz1=tinyInfo[sz-2];
+ std::vector<int> ti1(tinyInfo.begin(),tinyInfo.begin()+sz1);
+ std::vector<int> ti2(tinyInfo.begin()+sz1,tinyInfo.end()-3);
+ MEDCouplingUMesh *um=MEDCouplingUMesh::New();
+ DataArrayInt *a1tmp=DataArrayInt::New();
+ DataArrayDouble *a2tmp=DataArrayDouble::New();
+ int la1=0,la2=0;
+ std::vector<std::string> ls1,ls2;
+ um->resizeForUnserialization(ti1,a1tmp,a2tmp,ls1);
+ la1+=a1tmp->getNbOfElems(); la2+=a2tmp->getNbOfElems();
+ a1tmp->decrRef(); a2tmp->decrRef();
+ a1tmp=DataArrayInt::New(); a2tmp=DataArrayDouble::New();
+ um->resizeForUnserialization(ti2,a1tmp,a2tmp,ls2);
+ la1+=a1tmp->getNbOfElems(); la2+=a2tmp->getNbOfElems();
+ a1tmp->decrRef(); a2tmp->decrRef();
+ um->decrRef();
+ //
+ a1->alloc(la1+tinyInfo[sz-1],1);
+ a2->alloc(la2,1);
+ littleStrings.resize(ls1.size()+ls2.size()+2);
+}
+
+void MEDCouplingMappedExtrudedMesh::serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const
+{
+ a1=DataArrayInt::New(); a2=DataArrayDouble::New();
+ DataArrayInt *a1_1=0,*a1_2=0;
+ DataArrayDouble *a2_1=0,*a2_2=0;
+ _mesh2D->serialize(a1_1,a2_1);
+ _mesh1D->serialize(a1_2,a2_2);
+ a1->alloc(a1_1->getNbOfElems()+a1_2->getNbOfElems()+_mesh3D_ids->getNbOfElems(),1);
+ int *ptri=a1->getPointer();
+ ptri=std::copy(a1_1->getConstPointer(),a1_1->getConstPointer()+a1_1->getNbOfElems(),ptri);
+ a1_1->decrRef();
+ ptri=std::copy(a1_2->getConstPointer(),a1_2->getConstPointer()+a1_2->getNbOfElems(),ptri);
+ a1_2->decrRef();
+ std::copy(_mesh3D_ids->getConstPointer(),_mesh3D_ids->getConstPointer()+_mesh3D_ids->getNbOfElems(),ptri);
+ a2->alloc(a2_1->getNbOfElems()+a2_2->getNbOfElems(),1);
+ double *ptrd=a2->getPointer();
+ ptrd=std::copy(a2_1->getConstPointer(),a2_1->getConstPointer()+a2_1->getNbOfElems(),ptrd);
+ a2_1->decrRef();
+ std::copy(a2_2->getConstPointer(),a2_2->getConstPointer()+a2_2->getNbOfElems(),ptrd);
+ a2_2->decrRef();
+}
+
+void MEDCouplingMappedExtrudedMesh::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
+{
+ setName(littleStrings[littleStrings.size()-2]);
+ setDescription(littleStrings.back());
+ std::size_t sz=tinyInfo.size();
+ int sz1=tinyInfo[sz-2];
+ _cell_2D_id=tinyInfo[sz-3];
+ std::vector<int> ti1(tinyInfo.begin(),tinyInfo.begin()+sz1);
+ std::vector<int> ti2(tinyInfo.begin()+sz1,tinyInfo.end()-3);
+ DataArrayInt *a1tmp=DataArrayInt::New();
+ DataArrayDouble *a2tmp=DataArrayDouble::New();
+ const int *a1Ptr=a1->getConstPointer();
+ const double *a2Ptr=a2->getConstPointer();
+ _mesh2D=MEDCouplingUMesh::New();
+ std::vector<std::string> ls1,ls2;
+ _mesh2D->resizeForUnserialization(ti1,a1tmp,a2tmp,ls1);
+ std::copy(a2Ptr,a2Ptr+a2tmp->getNbOfElems(),a2tmp->getPointer());
+ std::copy(a1Ptr,a1Ptr+a1tmp->getNbOfElems(),a1tmp->getPointer());
+ a2Ptr+=a2tmp->getNbOfElems();
+ a1Ptr+=a1tmp->getNbOfElems();
+ ls2.insert(ls2.end(),littleStrings.begin(),littleStrings.begin()+ls1.size());
+ std::vector<double> d1(1);
+ _mesh2D->unserialization(d1,ti1,a1tmp,a2tmp,ls2);
+ a1tmp->decrRef(); a2tmp->decrRef();
+ //
+ ls2.clear();
+ ls2.insert(ls2.end(),littleStrings.begin()+ls1.size(),littleStrings.end()-2);
+ _mesh1D=MEDCouplingUMesh::New();
+ a1tmp=DataArrayInt::New(); a2tmp=DataArrayDouble::New();
+ _mesh1D->resizeForUnserialization(ti2,a1tmp,a2tmp,ls1);
+ std::copy(a2Ptr,a2Ptr+a2tmp->getNbOfElems(),a2tmp->getPointer());
+ std::copy(a1Ptr,a1Ptr+a1tmp->getNbOfElems(),a1tmp->getPointer());
+ a1Ptr+=a1tmp->getNbOfElems();
+ _mesh1D->unserialization(d1,ti2,a1tmp,a2tmp,ls2);
+ a1tmp->decrRef(); a2tmp->decrRef();
+ //
+ _mesh3D_ids=DataArrayInt::New();
+ int szIds=(int)std::distance(a1Ptr,a1->getConstPointer()+a1->getNbOfElems());
+ _mesh3D_ids->alloc(szIds,1);
+ std::copy(a1Ptr,a1Ptr+szIds,_mesh3D_ids->getPointer());
+}
+
+void MEDCouplingMappedExtrudedMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const
+{
+ MCAuto<MEDCouplingUMesh> m=buildUnstructured();
+ m->writeVTKLL(ofs,cellData,pointData,byteData);
+}
+
+void MEDCouplingMappedExtrudedMesh::reprQuickOverview(std::ostream& stream) const
+{
+ stream << "MEDCouplingMappedExtrudedMesh C++ instance at " << this << ". Name : \"" << getName() << "\".";
+}
+
+std::string MEDCouplingMappedExtrudedMesh::getVTKFileExtension() const
+{
+ return _mesh2D->getVTKFileExtension();
+}
+
+std::string MEDCouplingMappedExtrudedMesh::getVTKDataSetType() const
+{
+ return _mesh2D->getVTKDataSetType();
+}
--- /dev/null
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (CEA/DEN)
+
+#ifndef __PARAMEDMEM_MEDCOUPLINGEXTRUDEDMESH_HXX__
+#define __PARAMEDMEM_MEDCOUPLINGEXTRUDEDMESH_HXX__
+
+#include "MEDCoupling.hxx"
+#include "MEDCouplingMesh.hxx"
+
+#include <vector>
+
+namespace MEDCoupling
+{
+ class DataArrayInt;
+ class DataArrayDouble;
+ class MEDCouplingUMesh;
+ class MEDCouplingFieldDouble;
+
+ class MEDCouplingMappedExtrudedMesh : public MEDCouplingMesh
+ {
+ public:
+ MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
+ MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New();
+ MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+ MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
+ MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
+ MEDCOUPLING_EXPORT int getNumberOfCells() const;
+ MEDCOUPLING_EXPORT int getNumberOfNodes() const;
+ MEDCOUPLING_EXPORT int getSpaceDimension() const;
+ MEDCOUPLING_EXPORT int getMeshDimension() const;
+ MEDCOUPLING_EXPORT MEDCouplingMappedExtrudedMesh *deepCopy() const;
+ MEDCouplingMappedExtrudedMesh *clone(bool recDeepCpy) const;
+ MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
+ MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
+ MEDCOUPLING_EXPORT void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
+ DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const;
+ MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
+ DataArrayInt *&cellCor) const;
+ MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
+ MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
+ MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
+ MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const;
+ MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
+ MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
+ MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
+ MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
+ MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
+ MEDCOUPLING_EXPORT std::string simpleRepr() const;
+ MEDCOUPLING_EXPORT std::string advancedRepr() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
+ MEDCOUPLING_EXPORT void getBoundingBox(double *bbox) const;
+ MEDCOUPLING_EXPORT void updateTime() const;
+ MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true);
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *getMesh2D() const { return _mesh2D; }
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *getMesh1D() const { return _mesh1D; }
+ MEDCOUPLING_EXPORT DataArrayInt *getMesh3DIds() const { return _mesh3D_ids; }
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *build3DUnstructuredMesh() const;
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool) const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool) const;
+ MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const;
+ MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const;
+ MEDCOUPLING_EXPORT static int FindCorrespCellByNodalConn(const std::vector<int>& nodalConnec,
+ const int *revNodalPtr, const int *revNodalIndxPtr);
+ MEDCOUPLING_EXPORT static void Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
+ MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v);
+ MEDCOUPLING_EXPORT void rotate(const double *center, const double *vector, double angle);
+ MEDCOUPLING_EXPORT void translate(const double *vector);
+ MEDCOUPLING_EXPORT void scale(const double *point, double factor);
+ MEDCOUPLING_EXPORT std::vector<int> getDistributionOfTypes() const;
+ MEDCOUPLING_EXPORT DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const;
+ MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const;
+ MEDCOUPLING_EXPORT MEDCouplingMesh *buildPart(const int *start, const int *end) const;
+ MEDCOUPLING_EXPORT MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
+ MEDCOUPLING_EXPORT DataArrayInt *simplexize(int policy);
+ MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *getCoordinatesAndOwner() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
+ MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const;
+ //Serialization unserialisation
+ MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+ MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
+ MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
+ MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+ const std::vector<std::string>& littleStrings);
+ MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
+ MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
+ private:
+ MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
+ MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCopy);
+ MEDCouplingMappedExtrudedMesh();
+ void computeExtrusion(const MEDCouplingUMesh *mesh3D);
+ void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D);
+ void build1DExtrusion(int idIn3DDesc, int newId, int nbOf1DLev, MEDCouplingUMesh *subMesh,
+ const int *desc3D, const int *descIndx3D,
+ const int *revDesc3D, const int *revDescIndx3D,
+ bool computeMesh1D);
+ int findOppositeFaceOf(int current2DCell, int current3DCell, const std::vector<int>& connSorted,
+ const int *desc3D, const int *descIndx3D,
+ const int *conn2D, const int *conn2DIndx);
+ void computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId);
+ ~MEDCouplingMappedExtrudedMesh();
+ void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
+ std::string getVTKDataSetType() const;
+ private:
+ MEDCouplingUMesh *_mesh2D;
+ MEDCouplingUMesh *_mesh1D;
+ //! New to old 3D cell Ids Array
+ DataArrayInt *_mesh3D_ids;
+ int _cell_2D_id;
+ };
+}
+
+#endif
#include "InterpKernelMatrixTools.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
DenseMatrix *DenseMatrix::New(int nbRows, int nbCols)
{
return new DenseMatrix(array,nbRows,nbCols);
}
-DenseMatrix *DenseMatrix::deepCpy() const
+DenseMatrix *DenseMatrix::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(getData()->deepCpy());
- MEDCouplingAutoRefCountObjectPtr<DenseMatrix> ret(DenseMatrix::New(arr,getNumberOfRows(),getNumberOfCols()));
+ MCAuto<DataArrayDouble> arr(getData()->deepCopy());
+ MCAuto<DenseMatrix> ret(DenseMatrix::New(arr,getNumberOfRows(),getNumberOfCols()));
return ret.retn();
}
DenseMatrix *DenseMatrix::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<DenseMatrix> ret(DenseMatrix::New(const_cast<DataArrayDouble *>(getData()),getNumberOfRows(),getNumberOfCols()));
+ MCAuto<DenseMatrix> ret(DenseMatrix::New(const_cast<DataArrayDouble *>(getData()),getNumberOfRows(),getNumberOfCols()));
return ret.retn();
}
throw INTERP_KERNEL::Exception("DenseMatrix::MatVecMult : input vector must have only one component !");
if(vec->getNumberOfTuples()!=mat->getNumberOfCols())
throw INTERP_KERNEL::Exception("DenseMatrix::MatVecMult : Number of columns of this must be equal to number of tuples of vec !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(mat->getNumberOfRows(),1);
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(mat->getNumberOfRows(),1);
INTERP_KERNEL::matrixProduct(mat->getData()->begin(),mat->getNumberOfRows(),mat->getNumberOfCols(),vec->begin(),vec->getNumberOfTuples(),1,ret->getPointer());
return ret.retn();
}
if(!a1 || !a2)
throw INTERP_KERNEL::Exception("DenseMatrix::Add : input matrices must be not NULL !");
CheckSameSize(a1,a2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> data(DataArrayDouble::Add(a1->getData(),a2->getData()));
- MEDCouplingAutoRefCountObjectPtr<DenseMatrix> ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols()));
+ MCAuto<DataArrayDouble> data(DataArrayDouble::Add(a1->getData(),a2->getData()));
+ MCAuto<DenseMatrix> ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols()));
return ret.retn();
}
if(!a1 || !a2)
throw INTERP_KERNEL::Exception("DenseMatrix::Substract : input matrices must be not NULL !");
CheckSameSize(a1,a2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> data(DataArrayDouble::Substract(a1->getData(),a2->getData()));
- MEDCouplingAutoRefCountObjectPtr<DenseMatrix> ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols()));
+ MCAuto<DataArrayDouble> data(DataArrayDouble::Substract(a1->getData(),a2->getData()));
+ MCAuto<DenseMatrix> ret(DenseMatrix::New(data,a1->getNumberOfRows(),a1->getNumberOfCols()));
return ret.retn();
}
throw INTERP_KERNEL::Exception("DenseMatrix::Multiply : input matrices must be not NULL !");
CheckCompatibleSizeForMul(a1,a2);
int nbr(a1->getNumberOfRows()),nbc(a2->getNumberOfCols());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> data(DataArrayDouble::New()); data->alloc(nbr*nbc,1);
- MEDCouplingAutoRefCountObjectPtr<DenseMatrix> ret(DenseMatrix::New(data,a1->getNumberOfRows(),a2->getNumberOfCols()));
+ MCAuto<DataArrayDouble> data(DataArrayDouble::New()); data->alloc(nbr*nbc,1);
+ MCAuto<DenseMatrix> ret(DenseMatrix::New(data,a1->getNumberOfRows(),a2->getNumberOfCols()));
INTERP_KERNEL::matrixProduct(a1->getData()->begin(),a1->getNumberOfRows(),a1->getNumberOfCols(),a2->getData()->begin(),a2->getNumberOfRows(),a2->getNumberOfCols(),data->getPointer());
return ret.retn();
}
throw INTERP_KERNEL::Exception("DenseMatrix::Multiply #2 : input matrices must be not NULL and a2 allocated !");
if(a2->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DenseMatrix::Multiply #2 : The 2nd member must have exactly one component !");
- MEDCouplingAutoRefCountObjectPtr<DenseMatrix> a2Bis(DenseMatrix::New(const_cast<DataArrayDouble *>(a2),a2->getNumberOfTuples(),1));
+ MCAuto<DenseMatrix> a2Bis(DenseMatrix::New(const_cast<DataArrayDouble *>(a2),a2->getNumberOfTuples(),1));
return DenseMatrix::Multiply(a1,a2Bis);
}
#include "MEDCouplingTimeLabel.hxx"
#include "MEDCouplingRefCountObject.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelException.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* The aim of this class is \b NOT to reimplement all linear algebra but only to store a dense matrix.
public:
MEDCOUPLING_EXPORT static DenseMatrix *New(int nbRows, int nbCols);
MEDCOUPLING_EXPORT static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols);
- MEDCOUPLING_EXPORT DenseMatrix *deepCpy() const;
+ MEDCOUPLING_EXPORT DenseMatrix *deepCopy() const;
MEDCOUPLING_EXPORT DenseMatrix *shallowCpy() const;
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
private:
int _nb_rows;
int _nb_cols;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _data;
+ MCAuto<DataArrayDouble> _data;
};
}
// Author : Anthony Geay (CEA/DEN)
#include "MEDCouplingMemArray.txx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "BBTree.txx"
#include "GenMathFormulae.hxx"
typedef double (*MYFUNCPTR)(double);
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
template<int SPACEDIM>
void DataArrayDouble::findCommonTuplesAlg(const double *bbox, int nbNodes, int limitNodeId, double prec, DataArrayInt *c, DataArrayInt *cI) const
return oss.str();
}
-std::string DataArray::GetAxTypeRepr(MEDCouplingAxisType at)
+std::string DataArray::GetAxisTypeRepr(MEDCouplingAxisType at)
{
switch(at)
{
case AX_SPHER:
return std::string("AX_SPHER");
default:
- throw INTERP_KERNEL::Exception("DataArray::GetAxTypeRepr : unrecognized axis type enum !");
+ throw INTERP_KERNEL::Exception("DataArray::GetAxisTypeRepr : unrecognized axis type enum !");
}
}
* \return DataArrayDouble * - a new instance of DataArrayDouble. The caller is to
* delete this array using decrRef() as it is no more needed.
*/
-DataArrayDouble *DataArrayDouble::deepCpy() const
+DataArrayDouble *DataArrayDouble::deepCopy() const
{
return new DataArrayDouble(*this);
}
* \return DataArrayDouble * - either a new instance of DataArrayDouble (if \a dCpy
* == \a true) or \a this instance (if \a dCpy == \a false).
*/
-DataArrayDouble *DataArrayDouble::performCpy(bool dCpy) const
+DataArrayDouble *DataArrayDouble::performCopyOrIncrRef(bool dCpy) const
{
if(dCpy)
- return deepCpy();
+ return deepCopy();
else
{
incrRef();
* \param [in] other - another instance of DataArrayDouble to copy data from.
* \throw If the \a other is not allocated.
*/
-void DataArrayDouble::cpyFrom(const DataArrayDouble& other)
+void DataArrayDouble::deepCopyFrom(const DataArrayDouble& other)
{
other.checkAllocated();
int nbOfTuples=other.getNumberOfTuples();
* Permutes values of \a this array as required by \a old2New array. The values are
* permuted so that \c new[ \a old2New[ i ]] = \c old[ i ]. Number of tuples remains
* the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
* For more info on renumbering see \ref numbering.
* \param [in] old2New - C array of length equal to \a this->getNumberOfTuples()
* giving a new position for i-th old value.
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbTuples,nbOfCompo);
ret->copyStringInfoFrom(*this);
const double *iptr=getConstPointer();
* Returns a copy of \a this array with values permuted as required by \a new2Old array.
* The values are permuted so that \c new[ i ] = \c old[ \a new2Old[ i ]]. Number of
* tuples in the result array remains the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
* For more info on renumbering see \ref numbering.
* \param [in] new2Old - C array of length equal to \a this->getNumberOfTuples()
* giving a previous position of i-th new value.
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbTuples,nbOfCompo);
ret->copyStringInfoFrom(*this);
const double *iptr=getConstPointer();
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(newNbOfTuple,nbOfCompo);
const double *iptr=getConstPointer();
double *optr=ret->getPointer();
DataArrayDouble *DataArrayDouble::selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int nbComp=getNumberOfComponents();
ret->alloc((int)std::distance(new2OldBg,new2OldEnd),nbComp);
ret->copyStringInfoFrom(*this);
DataArrayDouble *DataArrayDouble::selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int nbComp=getNumberOfComponents();
int oldNbOfTuples=getNumberOfTuples();
ret->alloc((int)std::distance(new2OldBg,new2OldEnd),nbComp);
* \param [in] step - index increment to get index of the next tuple to copy.
* \return DataArrayDouble * - the new instance of DataArrayDouble that the caller
* is to delete using decrRef() as it is no more needed.
- * \sa DataArrayDouble::substr.
+ * \sa DataArrayDouble::subArray.
*/
-DataArrayDouble *DataArrayDouble::selectByTupleId2(int bg, int end2, int step) const
+DataArrayDouble *DataArrayDouble::selectByTupleIdSafeSlice(int bg, int end2, int step) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int nbComp=getNumberOfComponents();
- int newNbOfTuples=GetNumberOfItemGivenBESRelative(bg,end2,step,"DataArrayDouble::selectByTupleId2 : ");
+ int newNbOfTuples=GetNumberOfItemGivenBESRelative(bg,end2,step,"DataArrayDouble::selectByTupleIdSafeSlice : ");
ret->alloc(newNbOfTuples,nbComp);
double *pt=ret->getPointer();
const double *srcPt=getConstPointer()+bg*nbComp;
}
}
if(isIncreasing && nbOfTuplesThis==nbOfTuples)
- return deepCpy();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ return deepCopy();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuples,nbOfComp);
ret->copyStringInfoFrom(*this);
const double *src=getConstPointer();
* Returns a shorten copy of \a this array. The new DataArrayDouble contains all
* tuples starting from the \a tupleIdBg-th tuple and including all tuples located before
* the \a tupleIdEnd-th one. This methods has a similar behavior as std::string::substr().
- * This method is a specialization of selectByTupleId2().
+ * This method is a specialization of selectByTupleIdSafeSlice().
* \param [in] tupleIdBg - index of the first tuple to copy from \a this array.
* \param [in] tupleIdEnd - index of the tuple before which the tuples to copy are located.
* If \a tupleIdEnd == -1, all the tuples till the end of \a this array are copied.
* \throw If \a tupleIdBg < 0.
* \throw If \a tupleIdBg > \a this->getNumberOfTuples().
\throw If \a tupleIdEnd != -1 && \a tupleIdEnd < \a this->getNumberOfTuples().
- * \sa DataArrayDouble::selectByTupleId2
+ * \sa DataArrayDouble::selectByTupleIdSafeSlice
*/
-DataArrayDouble *DataArrayDouble::substr(int tupleIdBg, int tupleIdEnd) const
+DataArrayDouble *DataArrayDouble::subArray(int tupleIdBg, int tupleIdEnd) const
{
checkAllocated();
int nbt=getNumberOfTuples();
if(tupleIdBg<0)
- throw INTERP_KERNEL::Exception("DataArrayDouble::substr : The tupleIdBg parameter must be greater than 0 !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::subArray : The tupleIdBg parameter must be greater than 0 !");
if(tupleIdBg>nbt)
- throw INTERP_KERNEL::Exception("DataArrayDouble::substr : The tupleIdBg parameter is greater than number of tuples !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::subArray : The tupleIdBg parameter is greater than number of tuples !");
int trueEnd=tupleIdEnd;
if(tupleIdEnd!=-1)
{
if(tupleIdEnd>nbt)
- throw INTERP_KERNEL::Exception("DataArrayDouble::substr : The tupleIdBg parameter is greater or equal than number of tuples !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::subArray : The tupleIdBg parameter is greater or equal than number of tuples !");
}
else
trueEnd=nbt;
int nbComp=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(trueEnd-tupleIdBg,nbComp);
ret->copyStringInfoFrom(*this);
std::copy(getConstPointer()+tupleIdBg*nbComp,getConstPointer()+trueEnd*nbComp,ret->getPointer());
DataArrayDouble *DataArrayDouble::changeNbOfComponents(int newNbOfComp, double dftValue) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(getNumberOfTuples(),newNbOfComp);
const double *oldc=getConstPointer();
double *nc=ret->getPointer();
DataArrayDouble *DataArrayDouble::keepSelectedComponents(const std::vector<int>& compoIds) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
std::size_t newNbOfCompo=compoIds.size();
int oldNbOfCompo=getNumberOfComponents();
for(std::vector<int>::const_iterator it=compoIds.begin();it!=compoIds.end();it++)
checkAllocated(); other->checkAllocated();
if(getNumberOfComponents()!=other->getNumberOfComponents())
throw INTERP_KERNEL::Exception("DataArrayDouble::areIncludedInMe : the number of components does not match !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a=DataArrayDouble::Aggregate(this,other);
+ MCAuto<DataArrayDouble> a=DataArrayDouble::Aggregate(this,other);
DataArrayInt *c=0,*ci=0;
a->findCommonTuples(prec,getNumberOfTuples(),c,ci);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cSafe(c),ciSafe(ci);
+ MCAuto<DataArrayInt> cSafe(c),ciSafe(ci);
int newNbOfTuples=-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(a->getNumberOfTuples(),c->begin(),ci->begin(),ci->end(),newNbOfTuples);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1=ids->selectByTupleId2(getNumberOfTuples(),a->getNumberOfTuples(),1);
+ MCAuto<DataArrayInt> ids=DataArrayInt::ConvertIndexArrayToO2N(a->getNumberOfTuples(),c->begin(),ci->begin(),ci->end(),newNbOfTuples);
+ MCAuto<DataArrayInt> ret1=ids->selectByTupleIdSafeSlice(getNumberOfTuples(),a->getNumberOfTuples(),1);
tupleIds=ret1.retn();
return newNbOfTuples==getNumberOfTuples();
}
*
* \ref py_mcdataarraydouble_findcommontuples "Here is a Python example".
* \endif
- * \sa DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(), DataArrayDouble::areIncludedInMe
+ * \sa DataArrayInt::ConvertIndexArrayToO2N(), DataArrayDouble::areIncludedInMe
*/
void DataArrayDouble::findCommonTuples(double prec, int limitTupleId, DataArrayInt *&comm, DataArrayInt *&commIndex) const
{
int nbOfTuples=getNumberOfTuples();
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(DataArrayInt::New()),cI(DataArrayInt::New()); c->alloc(0,1); cI->pushBackSilent(0);
+ MCAuto<DataArrayInt> c(DataArrayInt::New()),cI(DataArrayInt::New()); c->alloc(0,1); cI->pushBackSilent(0);
switch(nbOfCompo)
{
case 4:
throw INTERP_KERNEL::Exception("DataArrayDouble::duplicateEachTupleNTimes : nb times should be >= 1 !");
int nbTuples=getNumberOfTuples();
const double *inPtr=getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New(); ret->alloc(nbTimes*nbTuples,1);
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New(); ret->alloc(nbTimes*nbTuples,1);
double *retPtr=ret->getPointer();
for(int i=0;i<nbTuples;i++,inPtr++)
{
*/
double DataArrayDouble::minimalDistanceTo(const DataArrayDouble *other, int& thisTupleId, int& otherTupleId) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> part1=findClosestTupleId(other);
+ MCAuto<DataArrayInt> part1=findClosestTupleId(other);
int nbOfCompo(getNumberOfComponents());
int otherNbTuples(other->getNumberOfTuples());
const double *thisPt(begin()),*otherPt(other->begin());
}
int nbOfTuples=other->getNumberOfTuples();
int thisNbOfTuples=getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbOfTuples,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbOfTuples,1);
double bounds[6];
getMinMaxPerComponent(bounds);
switch(nbOfCompo)
std::ostringstream oss; oss << "DataArrayDouble::computeNbOfInteractionsWith : Number of components (" << nbOfComp << ") is not even ! It should be to be compatible with bbox format !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfTuples,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfTuples,1);
const double *thisBBPtr(begin());
int *retPtr(ret->getPointer());
switch(nbOfComp/2)
checkAllocated();
DataArrayInt *c0=0,*cI0=0;
findCommonTuples(prec,limitTupleId,c0,cI0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(c0),cI(cI0);
+ MCAuto<DataArrayInt> c(c0),cI(cI0);
int newNbOfTuples=-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(getNumberOfTuples(),c0->begin(),cI0->begin(),cI0->end(),newNbOfTuples);
+ MCAuto<DataArrayInt> o2n=DataArrayInt::ConvertIndexArrayToO2N(getNumberOfTuples(),c0->begin(),cI0->begin(),cI0->end(),newNbOfTuples);
return renumberAndReduce(o2n->getConstPointer(),newNbOfTuples);
}
* non-empty range of increasing indices or indices are out of a valid range
* for the array \a aBase.
*/
-void DataArrayDouble::setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step)
+void DataArrayDouble::setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step)
{
if(!aBase)
- throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValues2 : input DataArray is NULL !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValuesSlice : input DataArray is NULL !");
const DataArrayDouble *a=dynamic_cast<const DataArrayDouble *>(aBase);
if(!a)
- throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValues2 : input DataArray aBase is not a DataArrayDouble !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValuesSlice : input DataArray aBase is not a DataArrayDouble !");
checkAllocated();
a->checkAllocated();
int nbOfComp=getNumberOfComponents();
- const char msg[]="DataArrayDouble::setContigPartOfSelectedValues2";
+ const char msg[]="DataArrayDouble::setContigPartOfSelectedValuesSlice";
int nbOfTupleToWrite=DataArray::GetNumberOfItemGivenBES(bg,end2,step,msg);
if(nbOfComp!=a->getNumberOfComponents())
- throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValues2 : This and a do not have the same number of components !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValuesSlice : This and a do not have the same number of components !");
int thisNt=getNumberOfTuples();
int aNt=a->getNumberOfTuples();
double *valsToSet=getPointer()+tupleIdStart*nbOfComp;
if(tupleIdStart+nbOfTupleToWrite>thisNt)
- throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValues2 : invalid number range of values to write !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValuesSlice : invalid number range of values to write !");
if(end2>aNt)
- throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValues2 : invalid range of values to read !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::setContigPartOfSelectedValuesSlice : invalid range of values to read !");
const double *valsSrc=a->getConstPointer()+bg*nbOfComp;
for(int i=0;i<nbOfTupleToWrite;i++,valsToSet+=nbOfComp,valsSrc+=step*nbOfComp)
{
* For more info see \ref MEDCouplingArraySteps1.
* \param [in] array - the C array to be used as raw data of \a this.
* \param [in] ownership - if \a true, \a array will be deallocated at destruction of \a this.
- * \param [in] type - specifies how to deallocate \a array. If \a type == ParaMEDMEM::CPP_DEALLOC,
- * \c delete [] \c array; will be called. If \a type == ParaMEDMEM::C_DEALLOC,
+ * \param [in] type - specifies how to deallocate \a array. If \a type == MEDCoupling::CPP_DEALLOC,
+ * \c delete [] \c array; will be called. If \a type == MEDCoupling::C_DEALLOC,
* \c free(\c array ) will be called.
* \param [in] nbOfTuple - new number of tuples in \a this.
* \param [in] nbOfCompo - new number of components in \a this.
const double *dataPtr=getConstPointer();
int nbOfCompo=getNumberOfComponents();
int nbTuples=getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bbox=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> bbox=DataArrayDouble::New();
bbox->alloc(nbTuples,2*nbOfCompo);
double *bboxPtr=bbox->getPointer();
for(int i=0;i<nbTuples;i++)
if(nbOfCompo!=otherNbOfCompo)
throw INTERP_KERNEL::Exception("DataArrayDouble::computeTupleIdsNearTuples : number of components should be equal between this and other !");
int nbOfTuplesOther=other->getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cArr(DataArrayInt::New()),cIArr(DataArrayInt::New()); cArr->alloc(0,1); cIArr->pushBackSilent(0);
+ MCAuto<DataArrayInt> cArr(DataArrayInt::New()),cIArr(DataArrayInt::New()); cArr->alloc(0,1); cIArr->pushBackSilent(0);
switch(nbOfCompo)
{
case 3:
int tmp;
tupleIds=0;
double ret=getMaxValue(tmp);
- tupleIds=getIdsInRange(ret,ret);
+ tupleIds=findIdsInRange(ret,ret);
return ret;
}
int tmp;
tupleIds=0;
double ret=getMinValue(tmp);
- tupleIds=getIdsInRange(ret,ret);
+ tupleIds=findIdsInRange(ret,ret);
return ret;
}
if(sz<1)
throw INTERP_KERNEL::Exception("DataArrayDouble::accumulatePerChunck : invalid size of input index array !");
sz--;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New(); ret->alloc(sz,nbCompo);
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New(); ret->alloc(sz,nbCompo);
const int *w=bgOfIndex;
if(*w<0 || *w>=nbOfTuples)
throw INTERP_KERNEL::Exception("DataArrayDouble::accumulatePerChunck : The first element of the input index not in [0,nbOfTuples) !");
{
checkAllocated();
int nbOfComp(getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
+ MCAuto<DataArrayDouble> ret;
switch(atOfThis)
{
case AX_CART:
- ret=deepCpy();
+ ret=deepCopy();
case AX_CYL:
if(nbOfComp==3)
{
{
checkAllocated();
int nbOfComp(getNumberOfComponents()),nbOfTuple(getNumberOfTuples());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
ret->alloc(nbOfTuple,1);
const double *src(getConstPointer());
double *dest(ret->getPointer());
{
checkAllocated();
int nbOfComp=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int nbOfTuple=getNumberOfTuples();
ret->alloc(nbOfTuple,1);
const double *src=getConstPointer();
{
checkAllocated();
int nbOfComp=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret0=DataArrayDouble::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1=DataArrayInt::New();
+ MCAuto<DataArrayDouble> ret0=DataArrayDouble::New();
+ MCAuto<DataArrayInt> ret1=DataArrayInt::New();
int nbOfTuple=getNumberOfTuples();
ret0->alloc(nbOfTuple,1); ret1->alloc(nbOfTuple,1);
const double *src=getConstPointer();
*
* \warning use this method with care because it can leads to big amount of consumed memory !
*
- * \return A newly allocated (huge) ParaMEDMEM::DataArrayDouble instance that the caller should deal with.
+ * \return A newly allocated (huge) MEDCoupling::DataArrayDouble instance that the caller should deal with.
*
* \throw If \a this is not allocated.
*
int nbOfComp=getNumberOfComponents();
int nbOfTuples=getNumberOfTuples();
const double *inData=getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuples*nbOfTuples,1);
double *outData=ret->getPointer();
for(int i=0;i<nbOfTuples;i++)
* \warning use this method with care because it can leads to big amount of consumed memory !
*
* \param [in] other DataArrayDouble instance having same number of components than \a this.
- * \return A newly allocated (huge) ParaMEDMEM::DataArrayDouble instance that the caller should deal with.
+ * \return A newly allocated (huge) MEDCoupling::DataArrayDouble instance that the caller should deal with.
*
* \throw If \a this is not allocated, or if \a other is null or if \a other is not allocated, or if number of components of \a other and \a this differs.
*
int otherNbOfTuples=other->getNumberOfTuples();
const double *inData=getConstPointer();
const double *inDataOther=other->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(otherNbOfTuples*nbOfTuples,1);
double *outData=ret->getPointer();
for(int i=0;i<otherNbOfTuples;i++,inDataOther+=nbOfComp)
std::set<std::string> vars;
expr.getTrueSetOfVars(vars);
std::vector<std::string> varsV(vars.begin(),vars.end());
- return applyFunc3(nbOfComp,varsV,func,isSafe);
+ return applyFuncNamedCompo(nbOfComp,varsV,func,isSafe);
}
/*!
throw INTERP_KERNEL::Exception("DataArrayDouble::applyFunc : output number of component must be > 0 !");
checkAllocated();
int nbOfTuples(getNumberOfTuples());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newArr(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> newArr(DataArrayDouble::New());
newArr->alloc(nbOfTuples,nbOfComp);
INTERP_KERNEL::ExprParser expr(func);
expr.parse();
expr.getTrueSetOfVars(vars);
if((int)vars.size()>1)
{
- std::ostringstream oss; oss << "DataArrayDouble::applyFunc : this method works only with at most one var func expression ! If you need to map comps on variables please use applyFunc2 or applyFunc3 instead ! Vars in expr are : ";
+ std::ostringstream oss; oss << "DataArrayDouble::applyFunc : this method works only with at most one var func expression ! If you need to map comps on variables please use applyFuncCompo or applyFuncNamedCompo instead ! Vars in expr are : ";
std::copy(vars.begin(),vars.end(),std::ostream_iterator<std::string>(oss," "));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
expr.getTrueSetOfVars(vars);
if((int)vars.size()>1)
{
- std::ostringstream oss; oss << "DataArrayDouble::applyFuncOnThis : this method works only with at most one var func expression ! If you need to map comps on variables please use applyFunc2 or applyFunc3 instead ! Vars in expr are : ";
+ std::ostringstream oss; oss << "DataArrayDouble::applyFuncOnThis : this method works only with at most one var func expression ! If you need to map comps on variables please use applyFuncCompo or applyFuncNamedCompo instead ! Vars in expr are : ";
std::copy(vars.begin(),vars.end(),std::ostream_iterator<std::string>(oss," "));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
* \throw If \a func contains vars that are not in \a this->getInfoOnComponent().
* \throw If computing \a func fails.
*/
-DataArrayDouble *DataArrayDouble::applyFunc2(int nbOfComp, const std::string& func, bool isSafe) const
+DataArrayDouble *DataArrayDouble::applyFuncCompo(int nbOfComp, const std::string& func, bool isSafe) const
{
- return applyFunc3(nbOfComp,getVarsOnComponent(),func,isSafe);
+ return applyFuncNamedCompo(nbOfComp,getVarsOnComponent(),func,isSafe);
}
/*!
* \throw If \a func contains vars not in \a varsOrder.
* \throw If computing \a func fails.
*/
-DataArrayDouble *DataArrayDouble::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe) const
+DataArrayDouble *DataArrayDouble::applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe) const
{
if(nbOfComp<=0)
- throw INTERP_KERNEL::Exception("DataArrayDouble::applyFunc3 : output number of component must be > 0 !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::applyFuncNamedCompo : output number of component must be > 0 !");
std::vector<std::string> varsOrder2(varsOrder);
int oldNbOfComp(getNumberOfComponents());
for(int i=(int)varsOrder.size();i<oldNbOfComp;i++)
std::copy(vars.begin(),vars.end(),std::ostream_iterator<std::string>(oss," "));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newArr(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> newArr(DataArrayDouble::New());
newArr->alloc(nbOfTuples,nbOfComp);
INTERP_KERNEL::AutoPtr<double> buff(new double[oldNbOfComp]);
double *buffPtr(buff),*ptrToFill;
* needed.
* \throw If \a this->getNumberOfComponents() != 1.
*
- * \sa DataArrayDouble::getIdsNotInRange
+ * \sa DataArrayDouble::findIdsNotInRange
*
* \if ENABLE_EXAMPLES
* \ref cpp_mcdataarraydouble_getidsinrange "Here is a C++ example".<br>
* \ref py_mcdataarraydouble_getidsinrange "Here is a Python example".
* \endif
*/
-DataArrayInt *DataArrayDouble::getIdsInRange(double vmin, double vmax) const
+DataArrayInt *DataArrayDouble::findIdsInRange(double vmin, double vmax) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayDouble::getIdsInRange : this must have exactly one component !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::findIdsInRange : this must have exactly one component !");
const double *cptr(begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples(getNumberOfTuples());
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr>=vmin && *cptr<=vmax)
* needed.
* \throw If \a this->getNumberOfComponents() != 1.
*
- * \sa DataArrayDouble::getIdsInRange
+ * \sa DataArrayDouble::findIdsInRange
*/
-DataArrayInt *DataArrayDouble::getIdsNotInRange(double vmin, double vmax) const
+DataArrayInt *DataArrayDouble::findIdsNotInRange(double vmin, double vmax) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayDouble::getIdsNotInRange : this must have exactly one component !");
+ throw INTERP_KERNEL::Exception("DataArrayDouble::findIdsNotInRange : this must have exactly one component !");
const double *cptr(begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples(getNumberOfTuples());
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr<vmin || *cptr>vmax)
throw INTERP_KERNEL::Exception("DataArrayDouble::Aggregate : Nb of components mismatch for array aggregation !");
nbt+=(*it)->getNumberOfTuples();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbt,nbOfComp);
double *pt=ret->getPointer();
for(it=a.begin();it!=a.end();it++)
int nbOfTuple2=a2->getNumberOfTuples();
int nbOfComp=a1->getNumberOfComponents();
int nbOfComp2=a2->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=0;
+ MCAuto<DataArrayDouble> ret=0;
if(nbOfTuple==nbOfTuple2)
{
if(nbOfComp==nbOfComp2)
{
if(nbOfComp1==nbOfComp2)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuple2,nbOfComp1);
std::transform(a1->begin(),a1->end(),a2->begin(),ret->getPointer(),std::minus<double>());
ret->copyStringInfoFrom(*a1);
}
else if(nbOfComp2==1)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const double *a2Ptr=a2->getConstPointer();
const double *a1Ptr=a1->getConstPointer();
else if(nbOfTuple2==1)
{
a1->checkNbOfComps(nbOfComp2,"Nb of components mismatch for array Substract !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const double *a1ptr=a1->getConstPointer(),*a2ptr=a2->getConstPointer();
double *pt=ret->getPointer();
int nbOfTuple2=a2->getNumberOfTuples();
int nbOfComp=a1->getNumberOfComponents();
int nbOfComp2=a2->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=0;
+ MCAuto<DataArrayDouble> ret=0;
if(nbOfTuple==nbOfTuple2)
{
if(nbOfComp==nbOfComp2)
{
if(nbOfComp1==nbOfComp2)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuple2,nbOfComp1);
std::transform(a1->begin(),a1->end(),a2->begin(),ret->getPointer(),std::divides<double>());
ret->copyStringInfoFrom(*a1);
}
else if(nbOfComp2==1)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const double *a2Ptr=a2->getConstPointer();
const double *a1Ptr=a1->getConstPointer();
else if(nbOfTuple2==1)
{
a1->checkNbOfComps(nbOfComp2,"Nb of components mismatch for array Divide !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const double *a1ptr=a1->getConstPointer(),*a2ptr=a2->getConstPointer();
double *pt=ret->getPointer();
throw INTERP_KERNEL::Exception("DataArrayDouble::Pow : number of tuples mismatches !");
if(nbOfComp!=1 || nbOfComp2!=1)
throw INTERP_KERNEL::Exception("DataArrayDouble::Pow : number of components of both arrays must be equal to 1 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New(); ret->alloc(nbOfTuple,1);
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New(); ret->alloc(nbOfTuple,1);
const double *ptr1(a1->begin()),*ptr2(a2->begin());
double *ptr=ret->getPointer();
for(int i=0;i<nbOfTuple;i++,ptr1++,ptr2++,ptr++)
}
/*!
- * This method returns a newly allocated instance the caller should dealed with by a ParaMEDMEM::DataArrayDouble::decrRef.
- * This method performs \b no copy of data. The content is only referenced using ParaMEDMEM::DataArrayDouble::useArray with ownership set to \b false.
+ * This method returns a newly allocated instance the caller should dealed with by a MEDCoupling::DataArrayDouble::decrRef.
+ * This method performs \b no copy of data. The content is only referenced using MEDCoupling::DataArrayDouble::useArray with ownership set to \b false.
* This method throws an INTERP_KERNEL::Exception is it is impossible to match sizes of \b this that is too say \b nbOfCompo=this->_nb_of_elem and \bnbOfTuples==1 or
* \b nbOfCompo=1 and \bnbOfTuples==this->_nb_of_elem.
*/
* \ref MEDCouplingArrayBasicsCopyDeep.
* \return DataArrayInt * - a new instance of DataArrayInt.
*/
-DataArrayInt *DataArrayInt::deepCpy() const
+DataArrayInt *DataArrayInt::deepCopy() const
{
return new DataArrayInt(*this);
}
* \return DataArrayInt * - either a new instance of DataArrayInt (if \a dCpy
* == \a true) or \a this instance (if \a dCpy == \a false).
*/
-DataArrayInt *DataArrayInt::performCpy(bool dCpy) const
+DataArrayInt *DataArrayInt::performCopyOrIncrRef(bool dCpy) const
{
if(dCpy)
- return deepCpy();
+ return deepCopy();
else
{
incrRef();
* \param [in] other - another instance of DataArrayInt to copy data from.
* \throw If the \a other is not allocated.
*/
-void DataArrayInt::cpyFrom(const DataArrayInt& other)
+void DataArrayInt::deepCopyFrom(const DataArrayInt& other)
{
other.checkAllocated();
int nbOfTuples=other.getNumberOfTuples();
typedef std::reverse_iterator<const int *> rintstart;
rintstart bg(arrEnd);//OK no problem because size of 'arr' is greater or equal 2
rintstart end2(arrBg);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret3=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret1=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret2=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret3=DataArrayInt::New();
ret1->alloc(nbOfTuples,1);
ret2->alloc(nbOfTuples,1);
int *ret1Ptr=ret1->getPointer();
int nbElemsIn=(int)std::distance(indArrBg,indArrEnd);
int nbOfTuples=getNumberOfTuples();
const int *pt=getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples,1);
ret->fillWithValue(-1);
int *tmp=ret->getPointer();
*/
DataArrayInt *DataArrayInt::invertArrayO2N2N2O(int newNbOfElem) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(newNbOfElem,1);
int nbOfOldNodes=getNumberOfTuples();
const int *old2New=getConstPointer();
*/
DataArrayInt *DataArrayInt::invertArrayO2N2N2OBis(int newNbOfElem) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(newNbOfElem,1);
int nbOfOldNodes=getNumberOfTuples();
const int *old2New=getConstPointer();
DataArrayInt *DataArrayInt::invertArrayN2O2O2N(int oldNbOfElem) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(oldNbOfElem,1);
const int *new2Old=getConstPointer();
int *pt=ret->getPointer();
*/
bool DataArrayInt::isEqualWithoutConsideringStrAndOrder(const DataArrayInt& other) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a=deepCpy();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> b=other.deepCpy();
+ MCAuto<DataArrayInt> a=deepCopy();
+ MCAuto<DataArrayInt> b=other.deepCopy();
a->sort();
b->sort();
return a->isEqualWithoutConsideringStr(*b);
{
checkAllocated();
int nbOfComp(getNumberOfComponents()),nbOfTuple(getNumberOfTuples());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
ret->alloc(nbOfTuple,1);
const int *src(getConstPointer());
int *dest(ret->getPointer());
other.checkAllocated();
if(nbTuple!=other.getNumberOfTuples())
throw INTERP_KERNEL::Exception("DataArrayInt::buildPermutationArr : 'this' and 'other' must have the same number of tuple !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbTuple,1);
ret->fillWithValue(-1);
const int *pt=getConstPointer();
* For more info see \ref MEDCouplingArraySteps1.
* \param [in] array - the C array to be used as raw data of \a this.
* \param [in] ownership - if \a true, \a array will be deallocated at destruction of \a this.
- * \param [in] type - specifies how to deallocate \a array. If \a type == ParaMEDMEM::CPP_DEALLOC,
- * \c delete [] \c array; will be called. If \a type == ParaMEDMEM::C_DEALLOC,
+ * \param [in] type - specifies how to deallocate \a array. If \a type == MEDCoupling::CPP_DEALLOC,
+ * \c delete [] \c array; will be called. If \a type == MEDCoupling::C_DEALLOC,
* \c free(\c array ) will be called.
* \param [in] nbOfTuple - new number of tuples in \a this.
* \param [in] nbOfCompo - new number of components in \a this.
* Permutes values of \a this array as required by \a old2New array. The values are
* permuted so that \c new[ \a old2New[ i ]] = \c old[ i ]. Number of tuples remains
* the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
* For more info on renumbering see \ref numbering.
* \param [in] old2New - C array of length equal to \a this->getNumberOfTuples()
* giving a new position for i-th old value.
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbTuples,nbOfCompo);
ret->copyStringInfoFrom(*this);
const int *iptr=getConstPointer();
* Returns a copy of \a this array with values permuted as required by \a new2Old array.
* The values are permuted so that \c new[ i ] = \c old[ \a new2Old[ i ]]. Number of
* tuples in the result array remains the same as in \c this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
* For more info on renumbering see \ref numbering.
* \param [in] new2Old - C array of length equal to \a this->getNumberOfTuples()
* giving a previous position of i-th new value.
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbTuples,nbOfCompo);
ret->copyStringInfoFrom(*this);
const int *iptr=getConstPointer();
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(newNbOfTuple,nbOfCompo);
const int *iptr=getConstPointer();
int *optr=ret->getPointer();
DataArrayInt *DataArrayInt::selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbComp=getNumberOfComponents();
ret->alloc((int)std::distance(new2OldBg,new2OldEnd),nbComp);
ret->copyStringInfoFrom(*this);
DataArrayInt *DataArrayInt::selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbComp=getNumberOfComponents();
int oldNbOfTuples=getNumberOfTuples();
ret->alloc((int)std::distance(new2OldBg,new2OldEnd),nbComp);
* \param [in] step - index increment to get index of the next tuple to copy.
* \return DataArrayInt * - the new instance of DataArrayInt that the caller
* is to delete using decrRef() as it is no more needed.
- * \sa DataArrayInt::substr.
+ * \sa DataArrayInt::subArray.
*/
-DataArrayInt *DataArrayInt::selectByTupleId2(int bg, int end2, int step) const
+DataArrayInt *DataArrayInt::selectByTupleIdSafeSlice(int bg, int end2, int step) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbComp=getNumberOfComponents();
- int newNbOfTuples=GetNumberOfItemGivenBESRelative(bg,end2,step,"DataArrayInt::selectByTupleId2 : ");
+ int newNbOfTuples=GetNumberOfItemGivenBESRelative(bg,end2,step,"DataArrayInt::selectByTupleIdSafeSlice : ");
ret->alloc(newNbOfTuples,nbComp);
int *pt=ret->getPointer();
const int *srcPt=getConstPointer()+bg*nbComp;
int nbOfTuplesThis=getNumberOfTuples();
if(ranges.empty())
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(0,nbOfComp);
ret->copyStringInfoFrom(*this);
return ret.retn();
}
}
if(isIncreasing && nbOfTuplesThis==nbOfTuples)
- return deepCpy();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ return deepCopy();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples,nbOfComp);
ret->copyStringInfoFrom(*this);
const int *src=getConstPointer();
std::ostringstream oss; oss << "DataArrayInt::FindPermutationFromFirstToSecond : first array has " << ids1->getNumberOfTuples() << " tuples and the second one " << ids2->getNumberOfTuples() << " tuples ! No chance to find a permutation between the 2 arrays !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1(ids1->deepCpy());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p2(ids2->deepCpy());
+ MCAuto<DataArrayInt> p1(ids1->deepCopy());
+ MCAuto<DataArrayInt> p2(ids2->deepCopy());
p1->sort(true); p2->sort(true);
if(!p1->isEqualWithoutConsideringStr(*p2))
throw INTERP_KERNEL::Exception("DataArrayInt::FindPermutationFromFirstToSecond : the two arrays are not lying on same ids ! Impossible to find a permutation between the 2 arrays !");
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::changeSurjectiveFormat : number of components must == 1 !");
int nbOfTuples=getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> retI(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
+ MCAuto<DataArrayInt> retI(DataArrayInt::New());
retI->alloc(targetNb+1,1);
const int *input=getConstPointer();
std::vector< std::vector<int> > tmp(targetNb);
/*!
* Returns a new DataArrayInt containing a renumbering map in "Old to New" mode computed
* from a zip representation of a surjective format (returned e.g. by
- * \ref ParaMEDMEM::DataArrayDouble::findCommonTuples() "DataArrayDouble::findCommonTuples()"
+ * \ref MEDCoupling::DataArrayDouble::findCommonTuples() "DataArrayDouble::findCommonTuples()"
* for example). The result array minimizes the permutation. <br>
* For more info on renumbering see \ref numbering. <br>
* \b Example: <br>
* array using decrRef() as it is no more needed.
* \throw If any value of \a arr breaks condition ( 0 <= \a arr[ i ] < \a nbOfOldTuples ).
*/
-DataArrayInt *DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples)
+DataArrayInt *DataArrayInt::ConvertIndexArrayToO2N(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfOldTuples,1);
int *pt=ret->getPointer();
std::fill(pt,pt+nbOfOldTuples,-1);
pt[arr[j]]=newNb;
else
{
- std::ostringstream oss; oss << "DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2 : With element #" << j << " value is " << arr[j] << " should be in [0," << nbOfOldTuples << ") !";
+ std::ostringstream oss; oss << "DataArrayInt::ConvertIndexArrayToO2N : With element #" << j << " value is " << arr[j] << " should be in [0," << nbOfOldTuples << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
int nbOfTuples=getNumberOfTuples();
const int *pt=getConstPointer();
std::map<int,int> m;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples,1);
int *opt=ret->getPointer();
for(int i=0;i<nbOfTuples;i++,pt++,opt++)
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-bool DataArrayInt::isIdentity2(int sizeExpected) const
+bool DataArrayInt::isIota(int sizeExpected) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
* Returns a shorten copy of \a this array. The new DataArrayInt contains all
* tuples starting from the \a tupleIdBg-th tuple and including all tuples located before
* the \a tupleIdEnd-th one. This methods has a similar behavior as std::string::substr().
- * This method is a specialization of selectByTupleId2().
+ * This method is a specialization of selectByTupleIdSafeSlice().
* \param [in] tupleIdBg - index of the first tuple to copy from \a this array.
* \param [in] tupleIdEnd - index of the tuple before which the tuples to copy are located.
* If \a tupleIdEnd == -1, all the tuples till the end of \a this array are copied.
* \throw If \a tupleIdBg < 0.
* \throw If \a tupleIdBg > \a this->getNumberOfTuples().
\throw If \a tupleIdEnd != -1 && \a tupleIdEnd < \a this->getNumberOfTuples().
- * \sa DataArrayInt::selectByTupleId2
+ * \sa DataArrayInt::selectByTupleIdSafeSlice
*/
-DataArrayInt *DataArrayInt::substr(int tupleIdBg, int tupleIdEnd) const
+DataArrayInt *DataArrayInt::subArray(int tupleIdBg, int tupleIdEnd) const
{
checkAllocated();
int nbt=getNumberOfTuples();
if(tupleIdBg<0)
- throw INTERP_KERNEL::Exception("DataArrayInt::substr : The tupleIdBg parameter must be greater than 0 !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::subArray : The tupleIdBg parameter must be greater than 0 !");
if(tupleIdBg>nbt)
- throw INTERP_KERNEL::Exception("DataArrayInt::substr : The tupleIdBg parameter is greater than number of tuples !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::subArray : The tupleIdBg parameter is greater than number of tuples !");
int trueEnd=tupleIdEnd;
if(tupleIdEnd!=-1)
{
if(tupleIdEnd>nbt)
- throw INTERP_KERNEL::Exception("DataArrayInt::substr : The tupleIdBg parameter is greater or equal than number of tuples !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::subArray : The tupleIdBg parameter is greater or equal than number of tuples !");
}
else
trueEnd=nbt;
int nbComp=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(trueEnd-tupleIdBg,nbComp);
ret->copyStringInfoFrom(*this);
std::copy(getConstPointer()+tupleIdBg*nbComp,getConstPointer()+trueEnd*nbComp,ret->getPointer());
DataArrayInt *DataArrayInt::changeNbOfComponents(int newNbOfComp, int dftValue) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(getNumberOfTuples(),newNbOfComp);
const int *oldc=getConstPointer();
int *nc=ret->getPointer();
DataArrayInt *DataArrayInt::keepSelectedComponents(const std::vector<int>& compoIds) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
int newNbOfCompo=(int)compoIds.size();
int oldNbOfCompo=getNumberOfComponents();
for(std::vector<int>::const_iterator it=compoIds.begin();it!=compoIds.end();it++)
* non-empty range of increasing indices or indices are out of a valid range
* for the array \a aBase.
*/
-void DataArrayInt::setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step)
+void DataArrayInt::setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step)
{
if(!aBase)
- throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValues2 : input DataArray is NULL !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValuesSlice : input DataArray is NULL !");
const DataArrayInt *a=dynamic_cast<const DataArrayInt *>(aBase);
if(!a)
- throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValues2 : input DataArray aBase is not a DataArrayInt !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValuesSlice : input DataArray aBase is not a DataArrayInt !");
checkAllocated();
a->checkAllocated();
int nbOfComp=getNumberOfComponents();
- const char msg[]="DataArrayInt::setContigPartOfSelectedValues2";
+ const char msg[]="DataArrayInt::setContigPartOfSelectedValuesSlice";
int nbOfTupleToWrite=DataArray::GetNumberOfItemGivenBES(bg,end2,step,msg);
if(nbOfComp!=a->getNumberOfComponents())
- throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValues2 : This and a do not have the same number of components !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValuesSlice : This and a do not have the same number of components !");
int thisNt=getNumberOfTuples();
int aNt=a->getNumberOfTuples();
int *valsToSet=getPointer()+tupleIdStart*nbOfComp;
if(tupleIdStart+nbOfTupleToWrite>thisNt)
- throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValues2 : invalid number range of values to write !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValuesSlice : invalid number range of values to write !");
if(end2>aNt)
- throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValues2 : invalid range of values to read !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::setContigPartOfSelectedValuesSlice : invalid range of values to read !");
const int *valsSrc=a->getConstPointer()+bg*nbOfComp;
for(int i=0;i<nbOfTupleToWrite;i++,valsToSet+=nbOfComp,valsSrc+=step*nbOfComp)
{
* array using decrRef() as it is no more needed.
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
- * \sa DataArrayInt::getIdsEqualTuple
+ * \sa DataArrayInt::findIdsEqualTuple
*/
-DataArrayInt *DataArrayInt::getIdsEqual(int val) const
+DataArrayInt *DataArrayInt::findIdsEqual(int val) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
const int *cptr(getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples=getNumberOfTuples();
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr==val)
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *DataArrayInt::getIdsNotEqual(int val) const
+DataArrayInt *DataArrayInt::findIdsNotEqual(int val) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqual : the array must have only one component, you can call 'rearrange' method before !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsNotEqual : the array must have only one component, you can call 'rearrange' method before !");
const int *cptr(getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples=getNumberOfTuples();
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr!=val)
/*!
* Creates a new DataArrayInt containing IDs (indices) of tuples holding tuple equal to those defined by [ \a tupleBg , \a tupleEnd )
- * This method is an extension of DataArrayInt::getIdsEqual method.
+ * This method is an extension of DataArrayInt::findIdsEqual method.
*
* \param [in] tupleBg - the begin (included) of the input tuple to find within \a this.
* \param [in] tupleEnd - the end (excluded) of the input tuple to find within \a this.
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != std::distance(tupleBg,tupleEnd).
* \throw If \a this->getNumberOfComponents() is equal to 0.
- * \sa DataArrayInt::getIdsEqual
+ * \sa DataArrayInt::findIdsEqual
*/
-DataArrayInt *DataArrayInt::getIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const
+DataArrayInt *DataArrayInt::findIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const
{
std::size_t nbOfCompoExp(std::distance(tupleBg,tupleEnd));
checkAllocated();
if(getNumberOfComponents()!=(int)nbOfCompoExp)
{
- std::ostringstream oss; oss << "DataArrayInt::getIdsEqualTuple : mismatch of number of components. Input tuple has " << nbOfCompoExp << " whereas this array has " << getNumberOfComponents() << " components !";
+ std::ostringstream oss; oss << "DataArrayInt::findIdsEqualTuple : mismatch of number of components. Input tuple has " << nbOfCompoExp << " whereas this array has " << getNumberOfComponents() << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
if(nbOfCompoExp==0)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualTuple : number of components should be > 0 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqualTuple : number of components should be > 0 !");
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
const int *bg(begin()),*end2(end()),*work(begin());
while(work!=end2)
{
* array using decrRef() as it is no more needed.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *DataArrayInt::getIdsEqualList(const int *valsBg, const int *valsEnd) const
+DataArrayInt *DataArrayInt::findIdsEqualList(const int *valsBg, const int *valsEnd) const
{
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : the array must have only one component, you can call 'rearrange' method before !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqualList : the array must have only one component, you can call 'rearrange' method before !");
std::set<int> vals2(valsBg,valsEnd);
const int *cptr(getConstPointer());
std::vector<int> res;
int nbOfTuples(getNumberOfTuples());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
for(int i=0;i<nbOfTuples;i++,cptr++)
if(vals2.find(*cptr)!=vals2.end())
ret->pushBackSilent(i);
* array using decrRef() as it is no more needed.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *DataArrayInt::getIdsNotEqualList(const int *valsBg, const int *valsEnd) const
+DataArrayInt *DataArrayInt::findIdsNotEqualList(const int *valsBg, const int *valsEnd) const
{
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : the array must have only one component, you can call 'rearrange' method before !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsNotEqualList : the array must have only one component, you can call 'rearrange' method before !");
std::set<int> vals2(valsBg,valsEnd);
const int *cptr=getConstPointer();
std::vector<int> res;
int nbOfTuples=getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
for(int i=0;i<nbOfTuples;i++,cptr++)
if(vals2.find(*cptr)==vals2.end())
ret->pushBackSilent(i);
}
/*!
- * This method is an extension of DataArrayInt::locateValue method because this method works for DataArrayInt with
+ * This method is an extension of DataArrayInt::findIdFirstEqual method because this method works for DataArrayInt with
* any number of components excepted 0 (an INTERP_KERNEL::Exception is thrown in this case).
* This method searches in \b this is there is a tuple that matched the input parameter \b tupl.
* If any the tuple id is returned. If not -1 is returned.
* the input vector. An INTERP_KERNEL::Exception is thrown too if \b this is not allocated.
*
* \return tuple id where \b tupl is. -1 if no such tuple exists in \b this.
- * \sa DataArrayInt::search, DataArrayInt::presenceOfTuple.
+ * \sa DataArrayInt::findIdSequence, DataArrayInt::presenceOfTuple.
*/
-int DataArrayInt::locateTuple(const std::vector<int>& tupl) const
+int DataArrayInt::findIdFirstEqualTuple(const std::vector<int>& tupl) const
{
checkAllocated();
int nbOfCompo=getNumberOfComponents();
if(nbOfCompo==0)
- throw INTERP_KERNEL::Exception("DataArrayInt::locateTuple : 0 components in 'this' !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdFirstEqualTuple : 0 components in 'this' !");
if(nbOfCompo!=(int)tupl.size())
{
- std::ostringstream oss; oss << "DataArrayInt::locateTuple : 'this' contains " << nbOfCompo << " components and searching for a tuple of length " << tupl.size() << " !";
+ std::ostringstream oss; oss << "DataArrayInt::findIdFirstEqualTuple : 'this' contains " << nbOfCompo << " components and searching for a tuple of length " << tupl.size() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
const int *cptr=getConstPointer();
/*!
* This method searches the sequence specified in input parameter \b vals in \b this.
* This works only for DataArrayInt having number of components equal to one (if not an INTERP_KERNEL::Exception will be thrown).
- * This method differs from DataArrayInt::locateTuple in that the position is internal raw data is not considered here contrary to DataArrayInt::locateTuple.
- * \sa DataArrayInt::locateTuple
+ * This method differs from DataArrayInt::findIdFirstEqualTuple in that the position is internal raw data is not considered here contrary to DataArrayInt::findIdFirstEqualTuple.
+ * \sa DataArrayInt::findIdFirstEqualTuple
*/
-int DataArrayInt::search(const std::vector<int>& vals) const
+int DataArrayInt::findIdSequence(const std::vector<int>& vals) const
{
checkAllocated();
int nbOfCompo=getNumberOfComponents();
if(nbOfCompo!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::search : works only for DataArrayInt instance with one component !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdSequence : works only for DataArrayInt instance with one component !");
const int *cptr=getConstPointer();
std::size_t nbOfVals=getNbOfElems();
const int *loc=std::search(cptr,cptr+nbOfVals,vals.begin(),vals.end());
* If not any tuple contains \b value -1 is returned.
* \sa DataArrayInt::presenceOfValue
*/
-int DataArrayInt::locateValue(int value) const
+int DataArrayInt::findIdFirstEqual(int value) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
* If not any tuple contains one of the values contained in 'vals' -1 is returned.
* \sa DataArrayInt::presenceOfValue
*/
-int DataArrayInt::locateValue(const std::vector<int>& vals) const
+int DataArrayInt::findIdFirstEqual(const std::vector<int>& vals) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
* This method searches in \b this is there is a tuple that matched the input parameter \b tupl.
* This method throws an INTERP_KERNEL::Exception if the number of components in \b this mismatches with the size of
* the input vector. An INTERP_KERNEL::Exception is thrown too if \b this is not allocated.
- * \sa DataArrayInt::locateTuple
+ * \sa DataArrayInt::findIdFirstEqualTuple
*/
bool DataArrayInt::presenceOfTuple(const std::vector<int>& tupl) const
{
- return locateTuple(tupl)!=-1;
+ return findIdFirstEqualTuple(tupl)!=-1;
}
* \return bool - \a true in case if \a value is present within \a this array.
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
- * \sa locateValue()
+ * \sa findIdFirstEqual()
*/
bool DataArrayInt::presenceOfValue(int value) const
{
- return locateValue(value)!=-1;
+ return findIdFirstEqual(value)!=-1;
}
/*!
* This method expects to be called when number of components of this is equal to one.
* This method returns true if it exists a tuple so that the value is contained in \b vals.
* If not any tuple contains one of the values contained in 'vals' false is returned.
- * \sa DataArrayInt::locateValue
+ * \sa DataArrayInt::findIdFirstEqual
*/
bool DataArrayInt::presenceOfValue(const std::vector<int>& vals) const
{
- return locateValue(vals)!=-1;
+ return findIdFirstEqual(vals)!=-1;
}
/*!
if(sz<1)
throw INTERP_KERNEL::Exception("DataArrayInt::accumulatePerChunck : invalid size of input index array !");
sz--;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(sz,nbCompo);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(sz,nbCompo);
const int *w=bgOfIndex;
if(*w<0 || *w>=nbOfTuples)
throw INTERP_KERNEL::Exception("DataArrayInt::accumulatePerChunck : The first element of the input index not in [0,nbOfTuples) !");
throw INTERP_KERNEL::Exception("DataArrayInt::Aggregate : Nb of components mismatch for array aggregation !");
nbt+=(*it)->getNumberOfTuples();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbt,nbOfComp);
int *pt=ret->getPointer();
for(it=a.begin();it!=a.end();it++)
}
if(arrs.empty())
throw INTERP_KERNEL::Exception("DataArrayInt::AggregateIndexes : input list must be NON EMPTY !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(retSz,1);
int *pt=ret->getPointer(); *pt++=0;
for(std::vector<const DataArrayInt *>::const_iterator it=arrs.begin();it!=arrs.end();it++)
* \param [in] vmax end of range. This value is \b not included in range (excluded).
* \return a newly allocated data array that the caller should deal with.
*
- * \sa DataArrayInt::getIdsNotInRange , DataArrayInt::getIdsStrictlyNegative
+ * \sa DataArrayInt::findIdsNotInRange , DataArrayInt::findIdsStricltyNegative
*/
-DataArrayInt *DataArrayInt::getIdsInRange(int vmin, int vmax) const
+DataArrayInt *DataArrayInt::findIdsInRange(int vmin, int vmax) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsInRange : this must have exactly one component !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsInRange : this must have exactly one component !");
const int *cptr(begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples(getNumberOfTuples());
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr>=vmin && *cptr<vmax)
* \param [in] vmax end of range. This value is included in range (included).
* \return a newly allocated data array that the caller should deal with.
*
- * \sa DataArrayInt::getIdsInRange , DataArrayInt::getIdsStrictlyNegative
+ * \sa DataArrayInt::findIdsInRange , DataArrayInt::findIdsStricltyNegative
*/
-DataArrayInt *DataArrayInt::getIdsNotInRange(int vmin, int vmax) const
+DataArrayInt *DataArrayInt::findIdsNotInRange(int vmin, int vmax) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotInRange : this must have exactly one component !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsNotInRange : this must have exactly one component !");
const int *cptr(getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples(getNumberOfTuples());
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr<vmin || *cptr>=vmax)
* This method works only on data array with one component. This method returns a newly allocated array storing stored ascendantly of tuple ids in \a this so that this[id]<0.
*
* \return a newly allocated data array that the caller should deal with.
- * \sa DataArrayInt::getIdsInRange
+ * \sa DataArrayInt::findIdsInRange
*/
-DataArrayInt *DataArrayInt::getIdsStrictlyNegative() const
+DataArrayInt *DataArrayInt::findIdsStricltyNegative() const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsStrictlyNegative : this must have exactly one component !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsStricltyNegative : this must have exactly one component !");
const int *cptr(getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples(getNumberOfTuples());
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr<0)
for(std::vector<const DataArrayInt *>::const_iterator it4=groups.begin();it4!=groups.end();it4++)
if(*it4)
groups2.push_back(*it4);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(newNb,1);
int *retPtr=ret->getPointer();
std::fill(retPtr,retPtr+newNb,0);
}
/// @cond INTERNAL
-namespace ParaMEDMEMImpl
+namespace MEDCouplingImpl
{
class OpSwitchedOn
{
DataArrayInt *DataArrayInt::BuildListOfSwitchedOn(const std::vector<bool>& v)
{
int sz((int)std::count(v.begin(),v.end(),true));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
- std::for_each(v.begin(),v.end(),ParaMEDMEMImpl::OpSwitchedOn(ret->getPointer()));
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
+ std::for_each(v.begin(),v.end(),MEDCouplingImpl::OpSwitchedOn(ret->getPointer()));
return ret.retn();
}
DataArrayInt *DataArrayInt::BuildListOfSwitchedOff(const std::vector<bool>& v)
{
int sz((int)std::count(v.begin(),v.end(),false));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
- std::for_each(v.begin(),v.end(),ParaMEDMEMImpl::OpSwitchedOff(ret->getPointer()));
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
+ std::for_each(v.begin(),v.end(),MEDCouplingImpl::OpSwitchedOff(ret->getPointer()));
return ret.retn();
}
void DataArrayInt::PutIntoToSkylineFrmt(const std::vector< std::vector<int> >& v, DataArrayInt *& data, DataArrayInt *& dataIndex)
{
int sz((int)v.size());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret0(DataArrayInt::New()),ret1(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret0(DataArrayInt::New()),ret1(DataArrayInt::New());
ret1->alloc(sz+1,1);
int *pt(ret1->getPointer()); *pt=0;
for(int i=0;i<sz;i++,pt++)
if(other->getNumberOfComponents()!=1) throw INTERP_KERNEL::Exception(MSG);
const int *pt1Bg(begin()),*pt1End(end()),*pt2Bg(other->begin()),*pt2End(other->end());
const int *work1(pt1Bg),*work2(pt2Bg);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
for(;work1!=pt1End;work1++)
{
if(work2!=pt2End && *work1==*work2)
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::buildUnique : only single component allowed !");
int nbOfTuples=getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=deepCpy();
+ MCAuto<DataArrayInt> tmp=deepCopy();
int *data=tmp->getPointer();
int *last=std::unique(data,data+nbOfTuples);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(std::distance(data,last),1);
std::copy(data,last,ret->getPointer());
return ret.retn();
getMinMaxValues(minVal,maxVal);
std::vector<bool> b(maxVal-minVal+1,false);
const int *ptBg(begin()),*endBg(end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
for(const int *pt=ptBg;pt!=endBg;pt++)
{
if(!b[*pt-minVal])
/*!
* Returns a new DataArrayInt which contains size of every of groups described by \a this
* "index" array. Such "index" array is returned for example by
- * \ref ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity
+ * \ref MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity
* "MEDCouplingUMesh::buildDescendingConnectivity" and
- * \ref ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex
+ * \ref MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex
* "MEDCouplingUMesh::getNodalConnectivityIndex" etc.
- * This method preforms the reverse operation of DataArrayInt::computeOffsets2.
+ * This method preforms the reverse operation of DataArrayInt::computeOffsetsFull.
* \return DataArrayInt * - a new instance of DataArrayInt, whose number of tuples
* equals to \a this->getNumberOfComponents() - 1, and number of components is 1.
* The caller is to delete this array using decrRef() as it is no more needed.
* - result array contains [2,3,1,0,2,6],
* where 2 = 3 - 1, 3 = 6 - 3, 1 = 7 - 6 etc.
*
- * \sa DataArrayInt::computeOffsets2
+ * \sa DataArrayInt::computeOffsetsFull
*/
DataArrayInt *DataArrayInt::deltaShiftIndex() const
{
* Or: for each i>0 new[i]=new[i-1]+old[i-1] for i==0 new[i]=0. Number of tuples
* and components remains the same.<br>
* This method is useful for allToAllV in MPI with contiguous policy. This method
- * differs from computeOffsets2() in that the number of tuples is \b not changed by
+ * differs from computeOffsetsFull() in that the number of tuples is \b not changed by
* this one.
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
* - After \a this contains [0,3,8,9,11,11,19]<br>
* \sa DataArrayInt::deltaShiftIndex
*/
-void DataArrayInt::computeOffsets2()
+void DataArrayInt::computeOffsetsFull()
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::computeOffsets2 : only single component allowed !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::computeOffsetsFull : only single component allowed !");
int nbOfTuples=getNumberOfTuples();
int *ret=(int *)malloc((nbOfTuples+1)*sizeof(int));
const int *work=getConstPointer();
/*!
* Returns two new DataArrayInt instances whose contents is computed from that of \a this and \a listOfIds arrays as follows.
- * \a this is expected to be an offset format ( as returned by DataArrayInt::computeOffsets2 ) that is to say with one component
+ * \a this is expected to be an offset format ( as returned by DataArrayInt::computeOffsetsFull ) that is to say with one component
* and ** sorted strictly increasingly **. \a listOfIds is expected to be sorted ascendingly (not strictly needed for \a listOfIds).
* This methods searches in \a this, considered as a set of contiguous \c this->getNumberOfComponents() ranges, all ids in \a listOfIds
* filling completely one of the ranges in \a this.
* \param [out] idsInInputListThatFetch contains the list of ids in \a listOfIds that are \b fully included in a range in \a this. So
* \a idsInInputListThatFetch is a part of input \a listOfIds.
*
- * \sa DataArrayInt::computeOffsets2
+ * \sa DataArrayInt::computeOffsetsFull
*
* \b Example: <br>
* - \a this : [0,3,7,9,15,18]
* In this example id 3 in input \a listOfIds is alone so it do not appear in output \a idsInInputListThatFetch.
* <br>
*/
-void DataArrayInt::searchRangesInListOfIds(const DataArrayInt *listOfIds, DataArrayInt *& rangeIdsFetched, DataArrayInt *& idsInInputListThatFetch) const
+void DataArrayInt::findIdsRangesInListOfIds(const DataArrayInt *listOfIds, DataArrayInt *& rangeIdsFetched, DataArrayInt *& idsInInputListThatFetch) const
{
if(!listOfIds)
- throw INTERP_KERNEL::Exception("DataArrayInt::searchRangesInListOfIds : input list of ids is null !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsRangesInListOfIds : input list of ids is null !");
listOfIds->checkAllocated(); checkAllocated();
if(listOfIds->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::searchRangesInListOfIds : input list of ids must have exactly one component !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsRangesInListOfIds : input list of ids must have exactly one component !");
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayInt::searchRangesInListOfIds : this must have exactly one component !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret0=DataArrayInt::New(); ret0->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1=DataArrayInt::New(); ret1->alloc(0,1);
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsRangesInListOfIds : this must have exactly one component !");
+ MCAuto<DataArrayInt> ret0=DataArrayInt::New(); ret0->alloc(0,1);
+ MCAuto<DataArrayInt> ret1=DataArrayInt::New(); ret1->alloc(0,1);
const int *tupEnd(listOfIds->end()),*offBg(begin()),*offEnd(end()-1);
const int *tupPtr(listOfIds->begin()),*offPtr(offBg);
while(tupPtr!=tupEnd && offPtr!=offEnd)
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(retNbOftuples,1);
int *retPtr=ret->getPointer();
for(int i=0;i<nbOfTuples;i++)
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(sz,1);
int *retPtr(ret->getPointer());
pos=bg;
for(int i=0;i<nbOfEltsInSlc;i++,pos+=step)
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::findRangeIdForEachTuple : this should have only one component !");
int nbTuples=getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbTuples,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbTuples,1);
int nbOfRanges=ranges->getNumberOfTuples();
const int *rangesPtr=ranges->getConstPointer();
int *retPtr=ret->getPointer();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::findIdInRangeForEachTuple : this should have only one component !");
int nbTuples=getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbTuples,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbTuples,1);
int nbOfRanges=ranges->getNumberOfTuples();
const int *rangesPtr=ranges->getConstPointer();
int *retPtr=ret->getPointer();
throw INTERP_KERNEL::Exception("DataArrayInt::duplicateEachTupleNTimes : nb times should be >= 1 !");
int nbTuples=getNumberOfTuples();
const int *inPtr=getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbTimes*nbTuples,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbTimes*nbTuples,1);
int *retPtr=ret->getPointer();
for(int i=0;i<nbTuples;i++,inPtr++)
{
checkAllocated();
std::set<int> ret;
ret.insert(begin(),end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2=DataArrayInt::New(); ret2->alloc((int)ret.size(),1);
+ MCAuto<DataArrayInt> ret2=DataArrayInt::New(); ret2->alloc((int)ret.size(),1);
std::copy(ret.begin(),ret.end(),ret2->getPointer());
return ret2.retn();
}
int nbOfTuple2=a2->getNumberOfTuples();
int nbOfComp=a1->getNumberOfComponents();
int nbOfComp2=a2->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=0;
+ MCAuto<DataArrayInt> ret=0;
if(nbOfTuple==nbOfTuple2)
{
if(nbOfComp==nbOfComp2)
{
if(nbOfComp1==nbOfComp2)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple2,nbOfComp1);
std::transform(a1->begin(),a1->end(),a2->begin(),ret->getPointer(),std::minus<int>());
ret->copyStringInfoFrom(*a1);
}
else if(nbOfComp2==1)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const int *a2Ptr=a2->getConstPointer();
const int *a1Ptr=a1->getConstPointer();
else if(nbOfTuple2==1)
{
a1->checkNbOfComps(nbOfComp2,"Nb of components mismatch for array Substract !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const int *a1ptr=a1->getConstPointer(),*a2ptr=a2->getConstPointer();
int *pt=ret->getPointer();
int nbOfTuple2=a2->getNumberOfTuples();
int nbOfComp=a1->getNumberOfComponents();
int nbOfComp2=a2->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=0;
+ MCAuto<DataArrayInt> ret=0;
if(nbOfTuple==nbOfTuple2)
{
if(nbOfComp==nbOfComp2)
{
if(nbOfComp1==nbOfComp2)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple2,nbOfComp1);
std::transform(a1->begin(),a1->end(),a2->begin(),ret->getPointer(),std::divides<int>());
ret->copyStringInfoFrom(*a1);
}
else if(nbOfComp2==1)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const int *a2Ptr=a2->getConstPointer();
const int *a1Ptr=a1->getConstPointer();
else if(nbOfTuple2==1)
{
a1->checkNbOfComps(nbOfComp2,"Nb of components mismatch for array Divide !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const int *a1ptr=a1->getConstPointer(),*a2ptr=a2->getConstPointer();
int *pt=ret->getPointer();
{
if(nbOfComp1==nbOfComp2)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple2,nbOfComp1);
std::transform(a1->begin(),a1->end(),a2->begin(),ret->getPointer(),std::modulus<int>());
ret->copyStringInfoFrom(*a1);
}
else if(nbOfComp2==1)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const int *a2Ptr=a2->getConstPointer();
const int *a1Ptr=a1->getConstPointer();
else if(nbOfTuple2==1)
{
a1->checkNbOfComps(nbOfComp2,"Nb of components mismatch for array Modulus !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuple1,nbOfComp1);
const int *a1ptr=a1->getConstPointer(),*a2ptr=a2->getConstPointer();
int *pt=ret->getPointer();
throw INTERP_KERNEL::Exception("DataArrayInt::Pow : number of tuples mismatches !");
if(nbOfComp!=1 || nbOfComp2!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::Pow : number of components of both arrays must be equal to 1 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbOfTuple,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(nbOfTuple,1);
const int *ptr1(a1->begin()),*ptr2(a2->begin());
int *ptr=ret->getPointer();
for(int i=0;i<nbOfTuple;i++,ptr1++,ptr2++,ptr++)
DataArrayInt *DataArrayInt::Range(int begin, int end, int step)
{
int nbOfTuples=GetNumberOfItemGivenBESRelative(begin,end,step,"DataArrayInt::Range");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples,1);
int *ptr=ret->getPointer();
if(step>0)
}
/*!
- * This method returns a newly allocated instance the caller should dealed with by a ParaMEDMEM::DataArrayInt::decrRef.
- * This method performs \b no copy of data. The content is only referenced using ParaMEDMEM::DataArrayInt::useArray with ownership set to \b false.
+ * This method returns a newly allocated instance the caller should dealed with by a MEDCoupling::DataArrayInt::decrRef.
+ * This method performs \b no copy of data. The content is only referenced using MEDCoupling::DataArrayInt::useArray with ownership set to \b false.
* This method throws an INTERP_KERNEL::Exception is it is impossible to match sizes of \b this that is too say \b nbOfCompo=this->_nb_of_elem and \bnbOfTuples==1 or
* \b nbOfCompo=1 and \bnbOfTuples==this->_nb_of_elem.
*/
#include <vector>
#include <iterator>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
MEDCOUPLING_EXPORT void setInfoOnComponent(int i, const std::string& info);
MEDCOUPLING_EXPORT int getNumberOfComponents() const { return (int)_info_on_compo.size(); }
MEDCOUPLING_EXPORT void setPartOfValuesBase3(const DataArray *aBase, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
- MEDCOUPLING_EXPORT virtual DataArray *deepCpy() const = 0;
+ MEDCOUPLING_EXPORT virtual DataArray *deepCopy() const = 0;
MEDCOUPLING_EXPORT virtual bool isAllocated() const = 0;
MEDCOUPLING_EXPORT virtual void checkAllocated() const = 0;
MEDCOUPLING_EXPORT virtual void desallocate() = 0;
MEDCOUPLING_EXPORT virtual void renumberInPlace(const int *old2New) = 0;
MEDCOUPLING_EXPORT virtual void renumberInPlaceR(const int *new2Old) = 0;
MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec) = 0;
- MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step) = 0;
+ MEDCOUPLING_EXPORT virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step) = 0;
MEDCOUPLING_EXPORT virtual DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const = 0;
MEDCOUPLING_EXPORT virtual DataArray *keepSelectedComponents(const std::vector<int>& compoIds) const = 0;
MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const = 0;
MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const = 0;
- MEDCOUPLING_EXPORT virtual DataArray *selectByTupleId2(int bg, int end2, int step) const = 0;
+ MEDCOUPLING_EXPORT virtual DataArray *selectByTupleIdSafeSlice(int bg, int end2, int step) const = 0;
MEDCOUPLING_EXPORT virtual void rearrange(int newNbOfCompo) = 0;
MEDCOUPLING_EXPORT void checkNbOfTuples(int nbOfTuples, const std::string& msg) const;
MEDCOUPLING_EXPORT void checkNbOfComps(int nbOfCompo, const std::string& msg) const;
MEDCOUPLING_EXPORT static std::string GetVarNameFromInfo(const std::string& info);
MEDCOUPLING_EXPORT static std::string GetUnitFromInfo(const std::string& info);
MEDCOUPLING_EXPORT static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit);
- MEDCOUPLING_EXPORT static std::string GetAxTypeRepr(MEDCouplingAxisType at);
+ MEDCOUPLING_EXPORT static std::string GetAxisTypeRepr(MEDCouplingAxisType at);
MEDCOUPLING_EXPORT static DataArray *Aggregate(const std::vector<const DataArray *>& arrs);
MEDCOUPLING_EXPORT virtual void reprStream(std::ostream& stream) const = 0;
MEDCOUPLING_EXPORT virtual void reprZipStream(std::ostream& stream) const = 0;
#include "MEDCouplingMemArray.txx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayInt;
class DataArrayDoubleIterator;
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT double doubleValue() const;
MEDCOUPLING_EXPORT bool empty() const;
- MEDCOUPLING_EXPORT DataArrayDouble *deepCpy() const;
- MEDCOUPLING_EXPORT DataArrayDouble *performCpy(bool deepCpy) const;
- MEDCOUPLING_EXPORT void cpyFrom(const DataArrayDouble& other);
+ MEDCOUPLING_EXPORT DataArrayDouble *deepCopy() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *performCopyOrIncrRef(bool deepCopy) const;
+ MEDCOUPLING_EXPORT void deepCopyFrom(const DataArrayDouble& other);
MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
MEDCOUPLING_EXPORT void pushBackSilent(double val);
MEDCOUPLING_EXPORT void pushBackValsSilent(const double *valsBg, const double *valsEnd);
MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId(const DataArrayInt & di) const;
MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
- MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleId2(int bg, int end2, int step) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *selectByTupleIdSafeSlice(int bg, int end2, int step) const;
MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
- MEDCOUPLING_EXPORT DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
MEDCOUPLING_EXPORT void transpose();
MEDCOUPLING_EXPORT DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const;
MEDCOUPLING_EXPORT void setPartOfValuesSimple4(double a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
MEDCOUPLING_EXPORT void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayInt *tuplesSelec);
MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec);
- MEDCOUPLING_EXPORT void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
+ MEDCOUPLING_EXPORT void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
MEDCOUPLING_EXPORT void getTuple(int tupleId, double *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); }
MEDCOUPLING_EXPORT double getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
MEDCOUPLING_EXPORT double front() const;
MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const;
MEDCOUPLING_EXPORT DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const;
MEDCOUPLING_EXPORT void applyFuncOnThis(const std::string& func, bool isSafe=true);
- MEDCOUPLING_EXPORT DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func, bool isSafe=true) const;
- MEDCOUPLING_EXPORT DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *applyFuncCompo(int nbOfComp, const std::string& func, bool isSafe=true) const;
+ MEDCOUPLING_EXPORT DataArrayDouble *applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const;
MEDCOUPLING_EXPORT void applyFuncFast32(const std::string& func);
MEDCOUPLING_EXPORT void applyFuncFast64(const std::string& func);
- MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(double vmin, double vmax) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsNotInRange(double vmin, double vmax) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsInRange(double vmin, double vmax) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsNotInRange(double vmin, double vmax) const;
MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2);
MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const std::vector<const DataArrayDouble *>& arr);
MEDCOUPLING_EXPORT static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2);
MEDCOUPLING_EXPORT int intValue() const;
MEDCOUPLING_EXPORT int getHashCode() const;
MEDCOUPLING_EXPORT bool empty() const;
- MEDCOUPLING_EXPORT DataArrayInt *deepCpy() const;
- MEDCOUPLING_EXPORT DataArrayInt *performCpy(bool deepCpy) const;
- MEDCOUPLING_EXPORT void cpyFrom(const DataArrayInt& other);
+ MEDCOUPLING_EXPORT DataArrayInt *deepCopy() const;
+ MEDCOUPLING_EXPORT DataArrayInt *performCopyOrIncrRef(bool deepCopy) const;
+ MEDCOUPLING_EXPORT void deepCopyFrom(const DataArrayInt& other);
MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
MEDCOUPLING_EXPORT void pushBackSilent(int val);
MEDCOUPLING_EXPORT void pushBackValsSilent(const int *valsBg, const int *valsEnd);
MEDCOUPLING_EXPORT DataArrayInt *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const;
MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
- MEDCOUPLING_EXPORT DataArrayInt *selectByTupleId2(int bg, int end, int step) const;
+ MEDCOUPLING_EXPORT DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const;
MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
MEDCOUPLING_EXPORT DataArrayInt *checkAndPreparePermutation() const;
MEDCOUPLING_EXPORT static DataArrayInt *FindPermutationFromFirstToSecond(const DataArrayInt *ids1, const DataArrayInt *ids2);
MEDCOUPLING_EXPORT void changeSurjectiveFormat(int targetNb, DataArrayInt *&arr, DataArrayInt *&arrI) const;
- MEDCOUPLING_EXPORT static DataArrayInt *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples);
+ MEDCOUPLING_EXPORT static DataArrayInt *ConvertIndexArrayToO2N(int nbOfOldTuples, const int *arr, const int *arrIBg, const int *arrIEnd, int &newNbOfTuples);
MEDCOUPLING_EXPORT DataArrayInt *buildPermArrPerLevel() const;
- MEDCOUPLING_EXPORT bool isIdentity2(int sizeExpected) const;
+ MEDCOUPLING_EXPORT bool isIota(int sizeExpected) const;
MEDCOUPLING_EXPORT bool isUniform(int val) const;
- MEDCOUPLING_EXPORT DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const;
+ MEDCOUPLING_EXPORT DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
MEDCOUPLING_EXPORT void transpose();
MEDCOUPLING_EXPORT DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const;
MEDCOUPLING_EXPORT void setPartOfValuesSimple4(int a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
MEDCOUPLING_EXPORT void setPartOfValuesAdv(const DataArrayInt *a, const DataArrayInt *tuplesSelec);
MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec);
- MEDCOUPLING_EXPORT void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
+ MEDCOUPLING_EXPORT void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
MEDCOUPLING_EXPORT void getTuple(int tupleId, int *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); }
MEDCOUPLING_EXPORT int getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
MEDCOUPLING_EXPORT int getIJSafe(int tupleId, int compoId) const;
MEDCOUPLING_EXPORT DataArrayIntIterator *iterator();
MEDCOUPLING_EXPORT const int *begin() const { return getConstPointer(); }
MEDCOUPLING_EXPORT const int *end() const { return getConstPointer()+getNbOfElems(); }
- MEDCOUPLING_EXPORT DataArrayInt *getIdsEqual(int val) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqual(int val) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsEqualList(const int *valsBg, const int *valsEnd) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqualList(const int *valsBg, const int *valsEnd) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsEqual(int val) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsNotEqual(int val) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsEqualList(const int *valsBg, const int *valsEnd) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsNotEqualList(const int *valsBg, const int *valsEnd) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const;
MEDCOUPLING_EXPORT int changeValue(int oldValue, int newValue);
- MEDCOUPLING_EXPORT int locateTuple(const std::vector<int>& tupl) const;
- MEDCOUPLING_EXPORT int locateValue(int value) const;
- MEDCOUPLING_EXPORT int locateValue(const std::vector<int>& vals) const;
- MEDCOUPLING_EXPORT int search(const std::vector<int>& vals) const;
+ MEDCOUPLING_EXPORT int findIdFirstEqualTuple(const std::vector<int>& tupl) const;
+ MEDCOUPLING_EXPORT int findIdFirstEqual(int value) const;
+ MEDCOUPLING_EXPORT int findIdFirstEqual(const std::vector<int>& vals) const;
+ MEDCOUPLING_EXPORT int findIdSequence(const std::vector<int>& vals) const;
MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector<int>& tupl) const;
MEDCOUPLING_EXPORT bool presenceOfValue(int value) const;
MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector<int>& vals) const;
MEDCOUPLING_EXPORT void applyRModulus(int val);
MEDCOUPLING_EXPORT void applyPow(int val);
MEDCOUPLING_EXPORT void applyRPow(int val);
- MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(int vmin, int vmax) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsNotInRange(int vmin, int vmax) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsStrictlyNegative() const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsInRange(int vmin, int vmax) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsNotInRange(int vmin, int vmax) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsStricltyNegative() const;
MEDCOUPLING_EXPORT bool checkAllIdsInRange(int vmin, int vmax) const;
MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2);
MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const std::vector<const DataArrayInt *>& arr);
MEDCOUPLING_EXPORT DataArrayInt *buildUniqueNotSorted() const;
MEDCOUPLING_EXPORT DataArrayInt *deltaShiftIndex() const;
MEDCOUPLING_EXPORT void computeOffsets();
- MEDCOUPLING_EXPORT void computeOffsets2();
- MEDCOUPLING_EXPORT void searchRangesInListOfIds(const DataArrayInt *listOfIds, DataArrayInt *& rangeIdsFetched, DataArrayInt *& idsInInputListThatFetch) const;
+ MEDCOUPLING_EXPORT void computeOffsetsFull();
+ MEDCOUPLING_EXPORT void findIdsRangesInListOfIds(const DataArrayInt *listOfIds, DataArrayInt *& rangeIdsFetched, DataArrayInt *& idsInInputListThatFetch) const;
MEDCOUPLING_EXPORT DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const;
MEDCOUPLING_EXPORT DataArrayInt *buildExplicitArrOfSliceOnScaledArr(int begin, int stop, int step) const;
MEDCOUPLING_EXPORT DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const;
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT int getHashCode() const;
MEDCOUPLING_EXPORT bool empty() const;
- MEDCOUPLING_EXPORT void cpyFrom(const DataArrayChar& other);
+ MEDCOUPLING_EXPORT void deepCopyFrom(const DataArrayChar& other);
MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
MEDCOUPLING_EXPORT void pushBackSilent(char val);
MEDCOUPLING_EXPORT void pushBackValsSilent(const char *valsBg, const char *valsEnd);
MEDCOUPLING_EXPORT DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const;
MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const int *new2OldBg, const int *new2OldEnd) const;
MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const;
- MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId2(int bg, int end, int step) const;
+ MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafeSlice(int bg, int end, int step) const;
MEDCOUPLING_EXPORT bool isUniform(char val) const;
MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
- MEDCOUPLING_EXPORT DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const;
+ MEDCOUPLING_EXPORT DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
MEDCOUPLING_EXPORT DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const;
MEDCOUPLING_EXPORT DataArrayChar *keepSelectedComponents(const std::vector<int>& compoIds) const;
MEDCOUPLING_EXPORT void meldWith(const DataArrayChar *other);
MEDCOUPLING_EXPORT void setPartOfValuesSimple4(char a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
MEDCOUPLING_EXPORT void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec);
MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt *tuplesSelec);
- MEDCOUPLING_EXPORT void setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
+ MEDCOUPLING_EXPORT void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
MEDCOUPLING_EXPORT DataArray *selectByTupleRanges(const std::vector<std::pair<int,int> >& ranges) const;
MEDCOUPLING_EXPORT void getTuple(int tupleId, char *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); }
MEDCOUPLING_EXPORT char getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
MEDCOUPLING_EXPORT const char *getConstPointer() const { return _mem.getConstPointer(); }
MEDCOUPLING_EXPORT const char *begin() const { return getConstPointer(); }
MEDCOUPLING_EXPORT const char *end() const { return getConstPointer()+getNbOfElems(); }
- MEDCOUPLING_EXPORT DataArrayInt *getIdsEqual(char val) const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqual(char val) const;
- MEDCOUPLING_EXPORT int search(const std::vector<char>& vals) const;
- MEDCOUPLING_EXPORT int locateTuple(const std::vector<char>& tupl) const;
- MEDCOUPLING_EXPORT int locateValue(char value) const;
- MEDCOUPLING_EXPORT int locateValue(const std::vector<char>& vals) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsEqual(char val) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsNotEqual(char val) const;
+ MEDCOUPLING_EXPORT int findIdSequence(const std::vector<char>& vals) const;
+ MEDCOUPLING_EXPORT int findIdFirstEqualTuple(const std::vector<char>& tupl) const;
+ MEDCOUPLING_EXPORT int findIdFirstEqual(char value) const;
+ MEDCOUPLING_EXPORT int findIdFirstEqual(const std::vector<char>& vals) const;
MEDCOUPLING_EXPORT bool presenceOfTuple(const std::vector<char>& tupl) const;
MEDCOUPLING_EXPORT bool presenceOfValue(char value) const;
MEDCOUPLING_EXPORT bool presenceOfValue(const std::vector<char>& vals) const;
MEDCOUPLING_EXPORT char getMaxValueInArray() const;
MEDCOUPLING_EXPORT char getMinValue(int& tupleId) const;
MEDCOUPLING_EXPORT char getMinValueInArray() const;
- MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(char vmin, char vmax) const;
+ MEDCOUPLING_EXPORT DataArrayInt *findIdsInRange(char vmin, char vmax) const;
MEDCOUPLING_EXPORT static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2);
MEDCOUPLING_EXPORT static DataArrayChar *Aggregate(const std::vector<const DataArrayChar *>& arr);
MEDCOUPLING_EXPORT static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2);
MEDCOUPLING_EXPORT static DataArrayByte *New();
MEDCOUPLING_EXPORT DataArrayChar *buildEmptySpecializedDAChar() const;
MEDCOUPLING_EXPORT DataArrayByteIterator *iterator();
- MEDCOUPLING_EXPORT DataArrayByte *deepCpy() const;
- MEDCOUPLING_EXPORT DataArrayByte *performCpy(bool deepCpy) const;
+ MEDCOUPLING_EXPORT DataArrayByte *deepCopy() const;
+ MEDCOUPLING_EXPORT DataArrayByte *performCopyOrIncrRef(bool deepCopy) const;
MEDCOUPLING_EXPORT char byteValue() const;
MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT static DataArrayAsciiChar *New(const std::vector<std::string>& vst, char defaultChar);
MEDCOUPLING_EXPORT DataArrayChar *buildEmptySpecializedDAChar() const;
MEDCOUPLING_EXPORT DataArrayAsciiCharIterator *iterator();
- MEDCOUPLING_EXPORT DataArrayAsciiChar *deepCpy() const;
- MEDCOUPLING_EXPORT DataArrayAsciiChar *performCpy(bool deepCpy) const;
+ MEDCOUPLING_EXPORT DataArrayAsciiChar *deepCopy() const;
+ MEDCOUPLING_EXPORT DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const;
MEDCOUPLING_EXPORT char asciiCharValue() const;
MEDCOUPLING_EXPORT void reprStream(std::ostream& stream) const;
MEDCOUPLING_EXPORT void reprZipStream(std::ostream& stream) const;
#include <cstdlib>
#include <algorithm>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
template<class T>
void MEDCouplingPointer<T>::setInternal(T *pointer)
// Author : Anthony Geay (CEA/DEN)
#include "MEDCouplingMemArray.txx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <set>
#include <cmath>
#include <algorithm>
#include <functional>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/*!
* Checks if raw data is allocated. Read more on the raw data
* \param [in] other - another instance of DataArrayChar to copy data from.
* \throw If the \a other is not allocated.
*/
-void DataArrayChar::cpyFrom(const DataArrayChar& other)
+void DataArrayChar::deepCopyFrom(const DataArrayChar& other)
{
other.checkAllocated();
int nbOfTuples=other.getNumberOfTuples();
* Permutes values of \a this array as required by \a old2New array. The values are
* permuted so that \c new[ \a old2New[ i ]] = \c old[ i ]. Number of tuples remains
* the same as in \this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
* For more info on renumbering see \ref numbering.
* \param [in] old2New - C array of length equal to \a this->getNumberOfTuples()
* giving a new position for i-th old value.
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
ret->alloc(nbTuples,nbOfCompo);
ret->copyStringInfoFrom(*this);
const char *iptr=getConstPointer();
* Returns a copy of \a this array with values permuted as required by \a new2Old array.
* The values are permuted so that \c new[ i ] = \c old[ \a new2Old[ i ]]. Number of
* tuples in the result array remains the same as in \this one.
- * If a permutation reduction is needed, substr() or selectByTupleId() should be used.
+ * If a permutation reduction is needed, subArray() or selectByTupleId() should be used.
* For more info on renumbering see \ref numbering.
* \param [in] new2Old - C array of length equal to \a this->getNumberOfTuples()
* giving a previous position of i-th new value.
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
ret->alloc(nbTuples,nbOfCompo);
ret->copyStringInfoFrom(*this);
const char *iptr=getConstPointer();
checkAllocated();
int nbTuples=getNumberOfTuples();
int nbOfCompo=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
ret->alloc(newNbOfTuple,nbOfCompo);
const char *iptr=getConstPointer();
char *optr=ret->getPointer();
DataArrayChar *DataArrayChar::selectByTupleIdSafe(const int *new2OldBg, const int *new2OldEnd) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
int nbComp=getNumberOfComponents();
int oldNbOfTuples=getNumberOfTuples();
ret->alloc((int)std::distance(new2OldBg,new2OldEnd),nbComp);
* \throw If (\a end2 < \a bg) or (\a step <= 0).
* \sa DataArrayChar::substr.
*/
-DataArrayChar *DataArrayChar::selectByTupleId2(int bg, int end2, int step) const
+DataArrayChar *DataArrayChar::selectByTupleIdSafeSlice(int bg, int end2, int step) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
int nbComp=getNumberOfComponents();
- int newNbOfTuples=GetNumberOfItemGivenBESRelative(bg,end2,step,"DataArrayInt::selectByTupleId2 : ");
+ int newNbOfTuples=GetNumberOfItemGivenBESRelative(bg,end2,step,"DataArrayInt::selectByTupleIdSafeSlice : ");
ret->alloc(newNbOfTuples,nbComp);
char *pt=ret->getPointer();
const char *srcPt=getConstPointer()+bg*nbComp;
/*!
* Returns a shorten copy of \a this array. The new DataArrayChar contains all
* tuples starting from the \a tupleIdBg-th tuple and including all tuples located before
- * the \a tupleIdEnd-th one. This methods has a similar behavior as std::string::substr().
- * This method is a specialization of selectByTupleId2().
+ * the \a tupleIdEnd-th one. This methods has a similar behavior as std::string::subArray().
+ * This method is a specialization of selectByTupleIdSafeSlice().
* \param [in] tupleIdBg - index of the first tuple to copy from \a this array.
* \param [in] tupleIdEnd - index of the tuple before which the tuples to copy are located.
* If \a tupleIdEnd == -1, all the tuples till the end of \a this array are copied.
* \throw If \a tupleIdBg < 0.
* \throw If \a tupleIdBg > \a this->getNumberOfTuples().
\throw If \a tupleIdEnd != -1 && \a tupleIdEnd < \a this->getNumberOfTuples().
- * \sa DataArrayChar::selectByTupleId2
+ * \sa DataArrayChar::selectByTupleIdSafeSlice
*/
-DataArrayChar *DataArrayChar::substr(int tupleIdBg, int tupleIdEnd) const
+DataArrayChar *DataArrayChar::subArray(int tupleIdBg, int tupleIdEnd) const
{
checkAllocated();
int nbt=getNumberOfTuples();
else
trueEnd=nbt;
int nbComp=getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
ret->alloc(trueEnd-tupleIdBg,nbComp);
ret->copyStringInfoFrom(*this);
std::copy(getConstPointer()+tupleIdBg*nbComp,getConstPointer()+trueEnd*nbComp,ret->getPointer());
DataArrayChar *DataArrayChar::changeNbOfComponents(int newNbOfComp, char dftValue) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
ret->alloc(getNumberOfTuples(),newNbOfComp);
const char *oldc=getConstPointer();
char *nc=ret->getPointer();
DataArrayChar *DataArrayChar::keepSelectedComponents(const std::vector<int>& compoIds) const
{
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret(buildEmptySpecializedDAChar());
+ MCAuto<DataArrayChar> ret(buildEmptySpecializedDAChar());
int newNbOfCompo=(int)compoIds.size();
int oldNbOfCompo=getNumberOfComponents();
for(std::vector<int>::const_iterator it=compoIds.begin();it!=compoIds.end();it++)
* non-empty range of increasing indices or indices are out of a valid range
* for the array \a aBase.
*/
-void DataArrayChar::setContigPartOfSelectedValues2(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step)
+void DataArrayChar::setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step)
{
if(!aBase)
- throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValues2 : input DataArray is NULL !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValuesSlice : input DataArray is NULL !");
const DataArrayChar *a=dynamic_cast<const DataArrayChar *>(aBase);
if(!a)
- throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValues2 : input DataArray aBase is not a DataArrayChar !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValuesSlice : input DataArray aBase is not a DataArrayChar !");
checkAllocated();
a->checkAllocated();
int nbOfComp=getNumberOfComponents();
- const char msg[]="DataArrayChar::setContigPartOfSelectedValues2";
+ const char msg[]="DataArrayChar::setContigPartOfSelectedValuesSlice";
int nbOfTupleToWrite=DataArray::GetNumberOfItemGivenBES(bg,end2,step,msg);
if(nbOfComp!=a->getNumberOfComponents())
- throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValues2 : This and a do not have the same number of components !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValuesSlice : This and a do not have the same number of components !");
int thisNt=getNumberOfTuples();
int aNt=a->getNumberOfTuples();
char *valsToSet=getPointer()+tupleIdStart*nbOfComp;
if(tupleIdStart+nbOfTupleToWrite>thisNt)
- throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValues2 : invalid number range of values to write !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValuesSlice : invalid number range of values to write !");
if(end2>aNt)
- throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValues2 : invalid range of values to read !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::setContigPartOfSelectedValuesSlice : invalid range of values to read !");
const char *valsSrc=a->getConstPointer()+bg*nbOfComp;
for(int i=0;i<nbOfTupleToWrite;i++,valsToSet+=nbOfComp,valsSrc+=step*nbOfComp)
{
int nbOfTuplesThis=getNumberOfTuples();
if(ranges.empty())
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
ret->alloc(0,nbOfComp);
ret->copyStringInfoFrom(*this);
return ret.retn();
}
}
if(isIncreasing && nbOfTuplesThis==nbOfTuples)
- return deepCpy();
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=buildEmptySpecializedDAChar();
+ return deepCopy();
+ MCAuto<DataArrayChar> ret=buildEmptySpecializedDAChar();
ret->alloc(nbOfTuples,nbOfComp);
ret->copyStringInfoFrom(*this);
const char *src=getConstPointer();
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *DataArrayChar::getIdsEqual(char val) const
+DataArrayInt *DataArrayChar::findIdsEqual(char val) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayChar::getIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::findIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
const char *cptr=getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples=getNumberOfTuples();
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr==val)
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
*/
-DataArrayInt *DataArrayChar::getIdsNotEqual(char val) const
+DataArrayInt *DataArrayChar::findIdsNotEqual(char val) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayChar::getIdsNotEqual : the array must have only one component, you can call 'rearrange' method before !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::findIdsNotEqual : the array must have only one component, you can call 'rearrange' method before !");
const char *cptr=getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
int nbOfTuples=getNumberOfTuples();
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr!=val)
/*!
* This method searches the sequence specified in input parameter \b vals in \b this.
* This works only for DataArrayChar having number of components equal to one (if not an INTERP_KERNEL::Exception will be thrown).
- * This method differs from DataArrayChar::locateTuple in that the position is internal raw data is not considered here contrary to DataArrayChar::locateTuple.
- * \sa DataArrayChar::locateTuple
+ * This method differs from DataArrayChar::findIdFirstEqualTuple in that the position is internal raw data is not considered here contrary to DataArrayChar::findIdFirstEqualTuple.
+ * \sa DataArrayChar::findIdFirstEqualTuple
*/
-int DataArrayChar::search(const std::vector<char>& vals) const
+int DataArrayChar::findIdSequence(const std::vector<char>& vals) const
{
checkAllocated();
int nbOfCompo=getNumberOfComponents();
if(nbOfCompo!=1)
- throw INTERP_KERNEL::Exception("DataArrayChar::search : works only for DataArrayChar instance with one component !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::findIdSequence : works only for DataArrayChar instance with one component !");
const char *cptr=getConstPointer();
std::size_t nbOfVals=getNbOfElems();
const char *loc=std::search(cptr,cptr+nbOfVals,vals.begin(),vals.end());
}
/*!
- * This method is an extension of DataArrayChar::locateValue method because this method works for DataArrayChar with
+ * This method is an extension of DataArrayChar::findIdFirstEqual method because this method works for DataArrayChar with
* any number of components excepted 0 (an INTERP_KERNEL::Exception is thrown in this case).
* This method searches in \b this is there is a tuple that matched the input parameter \b tupl.
* If any the tuple id is returned. If not -1 is returned.
* the input vector. An INTERP_KERNEL::Exception is thrown too if \b this is not allocated.
*
* \return tuple id where \b tupl is. -1 if no such tuple exists in \b this.
- * \sa DataArrayChar::search.
+ * \sa DataArrayChar::findIdSequence.
*/
-int DataArrayChar::locateTuple(const std::vector<char>& tupl) const
+int DataArrayChar::findIdFirstEqualTuple(const std::vector<char>& tupl) const
{
checkAllocated();
int nbOfCompo=getNumberOfComponents();
if(nbOfCompo==0)
- throw INTERP_KERNEL::Exception("DataArrayChar::locateTuple : 0 components in 'this' !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::findIdFirstEqualTuple : 0 components in 'this' !");
if(nbOfCompo!=(int)tupl.size())
{
- std::ostringstream oss; oss << "DataArrayChar::locateTuple : 'this' contains " << nbOfCompo << " components and searching for a tuple of length " << tupl.size() << " !";
+ std::ostringstream oss; oss << "DataArrayChar::findIdFirstEqualTuple : 'this' contains " << nbOfCompo << " components and searching for a tuple of length " << tupl.size() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
const char *cptr=getConstPointer();
* This method searches in \b this is there is a tuple that matched the input parameter \b tupl.
* This method throws an INTERP_KERNEL::Exception if the number of components in \b this mismatches with the size of
* the input vector. An INTERP_KERNEL::Exception is thrown too if \b this is not allocated.
- * \sa DataArrayChar::locateTuple
+ * \sa DataArrayChar::findIdFirstEqualTuple
*/
bool DataArrayChar::presenceOfTuple(const std::vector<char>& tupl) const
{
- return locateTuple(tupl)!=-1;
+ return findIdFirstEqualTuple(tupl)!=-1;
}
/*!
* \return bool - \a true in case if \a value is present within \a this array.
* \throw If \a this is not allocated.
* \throw If \a this->getNumberOfComponents() != 1.
- * \sa locateValue()
+ * \sa findIdFirstEqual()
*/
bool DataArrayChar::presenceOfValue(char value) const
{
- return locateValue(value)!=-1;
+ return findIdFirstEqual(value)!=-1;
}
/*!
* This method expects to be called when number of components of this is equal to one.
* This method returns true if it exists a tuple so that the value is contained in \b vals.
* If not any tuple contains one of the values contained in 'vals' false is returned.
- * \sa DataArrayChar::locateValue
+ * \sa DataArrayChar::findIdFirstEqual
*/
bool DataArrayChar::presenceOfValue(const std::vector<char>& vals) const
{
- return locateValue(vals)!=-1;
+ return findIdFirstEqual(vals)!=-1;
}
/*!
* If not any tuple contains \b value -1 is returned.
* \sa DataArrayChar::presenceOfValue
*/
-int DataArrayChar::locateValue(char value) const
+int DataArrayChar::findIdFirstEqual(char value) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
* If not any tuple contains one of the values contained in 'vals' false is returned.
* \sa DataArrayChar::presenceOfValue
*/
-int DataArrayChar::locateValue(const std::vector<char>& vals) const
+int DataArrayChar::findIdFirstEqual(const std::vector<char>& vals) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
* \param [in] vmax end of range. This value is \b not included in range.
* \return a newly allocated data array that the caller should deal with.
*/
-DataArrayInt *DataArrayChar::getIdsInRange(char vmin, char vmax) const
+DataArrayInt *DataArrayChar::findIdsInRange(char vmin, char vmax) const
{
checkAllocated();
if(getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("DataArrayChar::getIdsInRange : this must have exactly one component !");
+ throw INTERP_KERNEL::Exception("DataArrayChar::findIdsInRange : this must have exactly one component !");
const char *cptr=getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
int nbOfTuples=getNumberOfTuples();
for(int i=0;i<nbOfTuples;i++,cptr++)
if(*cptr>=vmin && *cptr<vmax)
throw INTERP_KERNEL::Exception("DataArrayChar::Aggregate : Nb of components mismatch for array aggregation !");
nbt+=(*it)->getNumberOfTuples();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayChar> ret=a[0]->buildEmptySpecializedDAChar();
+ MCAuto<DataArrayChar> ret=a[0]->buildEmptySpecializedDAChar();
ret->alloc(nbt,nbOfComp);
char *pt=ret->getPointer();
for(it=a.begin();it!=a.end();it++)
* For more info see \ref MEDCouplingArraySteps1.
* \param [in] array - the C array to be used as raw data of \a this.
* \param [in] ownership - if \a true, \a array will be deallocated at destruction of \a this.
- * \param [in] type - specifies how to deallocate \a array. If \a type == ParaMEDMEM::CPP_DEALLOC,
- * \c delete [] \c array; will be called. If \a type == ParaMEDMEM::C_DEALLOC,
+ * \param [in] type - specifies how to deallocate \a array. If \a type == MEDCoupling::CPP_DEALLOC,
+ * \c delete [] \c array; will be called. If \a type == MEDCoupling::C_DEALLOC,
* \c free(\c array ) will be called.
* \param [in] nbOfTuple - new number of tuples in \a this.
* \param [in] nbOfCompo - new number of components in \a this.
* \ref MEDCouplingArrayBasicsCopyDeep.
* \return DataArrayByte * - a new instance of DataArrayByte.
*/
-DataArrayByte *DataArrayByte::deepCpy() const
+DataArrayByte *DataArrayByte::deepCopy() const
{
return new DataArrayByte(*this);
}
* \return DataArrayByte * - either a new instance of DataArrayByte (if \a dCpy
* == \a true) or \a this instance (if \a dCpy == \a false).
*/
-DataArrayByte *DataArrayByte::performCpy(bool dCpy) const
+DataArrayByte *DataArrayByte::performCopyOrIncrRef(bool dCpy) const
{
if(dCpy)
- return deepCpy();
+ return deepCopy();
else
{
incrRef();
}
/*!
- * This method returns a newly allocated instance the caller should dealed with by a ParaMEDMEM::DataArrayByte::decrRef.
- * This method performs \b no copy of data. The content is only referenced using ParaMEDMEM::DataArrayByte::useArray with ownership set to \b false.
+ * This method returns a newly allocated instance the caller should dealed with by a MEDCoupling::DataArrayByte::decrRef.
+ * This method performs \b no copy of data. The content is only referenced using MEDCoupling::DataArrayByte::useArray with ownership set to \b false.
* This method throws an INTERP_KERNEL::Exception is it is impossible to match sizes of \b this that is too say \b nbOfCompo=this->_nb_of_elem and \bnbOfTuples==1 or
* \b nbOfCompo=1 and \bnbOfTuples==this->_nb_of_elem.
*/
* \ref MEDCouplingArrayBasicsCopyDeep.
* \return DataArrayAsciiChar * - a new instance of DataArrayAsciiChar.
*/
-DataArrayAsciiChar *DataArrayAsciiChar::deepCpy() const
+DataArrayAsciiChar *DataArrayAsciiChar::deepCopy() const
{
return new DataArrayAsciiChar(*this);
}
* \return DataArrayAsciiChar * - either a new instance of DataArrayAsciiChar (if \a dCpy
* == \a true) or \a this instance (if \a dCpy == \a false).
*/
-DataArrayAsciiChar *DataArrayAsciiChar::performCpy(bool dCpy) const
+DataArrayAsciiChar *DataArrayAsciiChar::performCopyOrIncrRef(bool dCpy) const
{
if(dCpy)
- return deepCpy();
+ return deepCopy();
else
{
incrRef();
}
/*!
- * This method returns a newly allocated instance the caller should dealed with by a ParaMEDMEM::DataArrayAsciiChar::decrRef.
- * This method performs \b no copy of data. The content is only referenced using ParaMEDMEM::DataArrayAsciiChar::useArray with ownership set to \b false.
+ * This method returns a newly allocated instance the caller should dealed with by a MEDCoupling::DataArrayAsciiChar::decrRef.
+ * This method performs \b no copy of data. The content is only referenced using MEDCoupling::DataArrayAsciiChar::useArray with ownership set to \b false.
* This method throws an INTERP_KERNEL::Exception is it is impossible to match sizes of \b this that is too say \b nbOfCompo=this->_nb_of_elem and \bnbOfTuples==1 or
* \b nbOfCompo=1 and \bnbOfTuples==this->_nb_of_elem.
*/
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <set>
#include <cmath>
#include <fstream>
#include <iterator>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingMesh::MEDCouplingMesh():_time(0.),_iteration(-1),_order(-1)
{
}
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds=DataArrayInt::Range(beginCellIds,endCellIds,stepCellIds);
+ MCAuto<DataArrayInt> cellIds=DataArrayInt::Range(beginCellIds,endCellIds,stepCellIds);
return buildPart(cellIds->begin(),cellIds->end());
}
}
*/
MEDCouplingMesh *MEDCouplingMesh::buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt*& arr) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds=DataArrayInt::Range(beginCellIds,endCellIds,stepCellIds);
+ MCAuto<DataArrayInt> cellIds=DataArrayInt::Range(beginCellIds,endCellIds,stepCellIds);
return buildPartAndReduceNodes(cellIds->begin(),cellIds->end(),arr);
}
*/
MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, FunctionToEvaluate func) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
ret->setMesh(this);
ret->fillFromAnalytic(nbOfComp,func);
ret->synchronizeTimeWithSupport();
* Creates a new MEDCouplingFieldDouble of a given type, one time, with given number of
* components, lying on \a this mesh, with contents got by applying a specified
* function to coordinates of field location points (defined by the given field type).
- * For example, if \a t == ParaMEDMEM::ON_CELLS, the function is applied to cell
+ * For example, if \a t == MEDCoupling::ON_CELLS, the function is applied to cell
* barycenters.<br>
* For more info on supported expressions that can be used in the function, see \ref
* MEDCouplingArrayApplyFuncExpr. The function can include arbitrary named variables
*/
MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
ret->setMesh(this);
ret->fillFromAnalytic(nbOfComp,func);
ret->synchronizeTimeWithSupport();
* Creates a new MEDCouplingFieldDouble of a given type, one time, with given number of
* components, lying on \a this mesh, with contents got by applying a specified
* function to coordinates of field location points (defined by the given field type).
- * For example, if \a t == ParaMEDMEM::ON_CELLS, the function is applied to cell
+ * For example, if \a t == MEDCoupling::ON_CELLS, the function is applied to cell
* barycenters. This method differs from
* \ref MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const "fillFromAnalytic()"
* by the way how variable
* \ref py_mcmesh_fillFromAnalytic2 "Here is a Python example".
* \endif
*/
-MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const
+MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
ret->setMesh(this);
- ret->fillFromAnalytic2(nbOfComp,func);
+ ret->fillFromAnalyticCompo(nbOfComp,func);
ret->synchronizeTimeWithSupport();
return ret.retn();
}
* Creates a new MEDCouplingFieldDouble of a given type, one time, with given number of
* components, lying on \a this mesh, with contents got by applying a specified
* function to coordinates of field location points (defined by the given field type).
- * For example, if \a t == ParaMEDMEM::ON_CELLS, the function is applied to cell
+ * For example, if \a t == MEDCoupling::ON_CELLS, the function is applied to cell
* barycenters. This method differs from \ref \ref mcmesh_fillFromAnalytic
* "fillFromAnalytic()" by the way how variable
* names, used in the function, are associated with components of coordinates of field
* \ref py_mcmesh_fillFromAnalytic3 "Here is a Python example".
* \endif
*/
-MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const
+MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(t,ONE_TIME);
ret->setMesh(this);
- ret->fillFromAnalytic3(nbOfComp,varsOrder,func);
+ ret->fillFromAnalyticNamedCompo(nbOfComp,varsOrder,func);
ret->synchronizeTimeWithSupport();
return ret.retn();
}
*/
MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(std::vector<const MEDCouplingMesh *>& meshes)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > ms1(meshes.size());
+ std::vector< MCAuto<MEDCouplingUMesh> > ms1(meshes.size());
std::vector< const MEDCouplingUMesh * > ms2(meshes.size());
for(std::size_t i=0;i<meshes.size();i++)
{
* \ref py_mcumesh_getCellsContainingPoints "Here is a Python example".
* \endif
*/
-void MEDCouplingMesh::getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& elts, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& eltsIndex) const
+void MEDCouplingMesh::getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MCAuto<DataArrayInt>& elts, MCAuto<DataArrayInt>& eltsIndex) const
{
eltsIndex=DataArrayInt::New(); elts=DataArrayInt::New(); eltsIndex->alloc(nbOfPoints+1,1); eltsIndex->setIJ(0,0,0); elts->alloc(0,1);
int *eltsIndexPtr(eltsIndex->getPointer());
std::string ret(getVTKFileNameOf(fileName));
//
std::string cda,pda;
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> byteArr;
+ MCAuto<DataArrayByte> byteArr;
if(isBinary)
{ byteArr=DataArrayByte::New(); byteArr->alloc(0,1); }
writeVTKAdvanced(ret,cda,pda,byteArr);
#include "MEDCouplingTimeLabel.hxx"
#include "MEDCouplingRefCountObject.hxx"
#include "NormalizedUnstructuredMesh.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelException.hxx"
#include <set>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
MEDCOUPLING_EXPORT virtual MEDCouplingMeshType getType() const = 0;
MEDCOUPLING_EXPORT bool isStructured() const;
// Copy methods
- MEDCOUPLING_EXPORT virtual MEDCouplingMesh *deepCpy() const = 0;
+ MEDCOUPLING_EXPORT virtual MEDCouplingMesh *deepCopy() const = 0;
MEDCOUPLING_EXPORT virtual MEDCouplingMesh *clone(bool recDeepCpy) const = 0;
MEDCOUPLING_EXPORT virtual void copyTinyStringsFrom(const MEDCouplingMesh *other);
MEDCOUPLING_EXPORT virtual void copyTinyInfoFrom(const MEDCouplingMesh *other);
MEDCOUPLING_EXPORT void checkGeoEquivalWith(const MEDCouplingMesh *other, int levOfCheck, double prec,
DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const;
//
- MEDCOUPLING_EXPORT virtual void checkCoherency() const = 0;
- MEDCOUPLING_EXPORT virtual void checkCoherency1(double eps=1e-12) const = 0;
+ MEDCOUPLING_EXPORT virtual void checkConsistencyLight() const = 0;
+ MEDCOUPLING_EXPORT virtual void checkConsistency(double eps=1e-12) const = 0;
MEDCOUPLING_EXPORT virtual int getNumberOfCells() const = 0;
MEDCOUPLING_EXPORT virtual int getNumberOfNodes() const = 0;
MEDCOUPLING_EXPORT virtual int getSpaceDimension() const = 0;
MEDCOUPLING_EXPORT virtual int getMeshDimension() const = 0;
MEDCOUPLING_EXPORT virtual DataArrayDouble *getCoordinatesAndOwner() const = 0;
- MEDCOUPLING_EXPORT virtual DataArrayDouble *getBarycenterAndOwner() const = 0;
+ MEDCOUPLING_EXPORT virtual DataArrayDouble *computeCellCenterOfMass() const = 0;
MEDCOUPLING_EXPORT virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const = 0;
MEDCOUPLING_EXPORT virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const = 0;
MEDCOUPLING_EXPORT virtual DataArrayInt *computeNbOfNodesPerCell() const = 0;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const = 0;
MEDCOUPLING_EXPORT virtual int getCellContainingPoint(const double *pos, double eps) const = 0;
MEDCOUPLING_EXPORT virtual void getCellsContainingPoint(const double *pos, double eps, std::vector<int>& elts) const;
- MEDCOUPLING_EXPORT virtual void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& elts, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& eltsIndex) const;
+ MEDCOUPLING_EXPORT virtual void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MCAuto<DataArrayInt>& elts, MCAuto<DataArrayInt>& eltsIndex) const;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, FunctionToEvaluate func) const;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const;
MEDCOUPLING_EXPORT virtual MEDCouplingFieldDouble *buildOrthogonalField() const = 0;
MEDCOUPLING_EXPORT virtual void rotate(const double *center, const double *vector, double angle) = 0;
MEDCOUPLING_EXPORT virtual void translate(const double *vector) = 0;
#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMesh.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <sstream>
#include <algorithm>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingMultiFields *MEDCouplingMultiFields::New(const std::vector<MEDCouplingFieldDouble *>& fs)
{
return new MEDCouplingMultiFields;
}
-MEDCouplingMultiFields *MEDCouplingMultiFields::deepCpy() const
+MEDCouplingMultiFields *MEDCouplingMultiFields::deepCopy() const
{
return new MEDCouplingMultiFields(*this);
}
std::string MEDCouplingMultiFields::getName() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
if((const MEDCouplingFieldDouble *)(*it))
return (*it)->getName();
std::string MEDCouplingMultiFields::getDescription() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
if((const MEDCouplingFieldDouble *)(*it))
return (*it)->getDescription();
std::string MEDCouplingMultiFields::getTimeUnit() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
if((const MEDCouplingFieldDouble *)(*it))
return (*it)->getTimeUnit();
double MEDCouplingMultiFields::getTimeResolution() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
if((const MEDCouplingFieldDouble *)(*it))
return (*it)->getTimeTolerance();
void MEDCouplingMultiFields::updateTime() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
if((const MEDCouplingFieldDouble *)(*it))
(*it)->updateTime();
std::vector<const BigMemoryObject *> MEDCouplingMultiFields::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
ret.push_back((const MEDCouplingFieldDouble *)*it);
return ret;
}
std::vector<MEDCouplingMesh *> MEDCouplingMultiFields::getMeshes() const
{
std::vector<MEDCouplingMesh *> ms;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
{
const MEDCouplingMesh *m=0;
if((const MEDCouplingFieldDouble *)(*it))
refs.resize(_fs.size());
std::vector<MEDCouplingMesh *> ms;
int id=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++,id++)
+ for(std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++,id++)
{
const MEDCouplingMesh *m=0;
if((const MEDCouplingFieldDouble *)(*it))
std::vector<DataArrayDouble *> MEDCouplingMultiFields::getArrays() const
{
std::vector<DataArrayDouble *> tmp;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
+ for(std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
{
std::vector<DataArrayDouble *> tmp2=(*it)->getArrays();
tmp.insert(tmp.end(),tmp2.begin(),tmp2.end());
refs.resize(_fs.size());
int id=0;
std::vector<DataArrayDouble *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++,id++)
+ for(std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++,id++)
{
std::vector<DataArrayDouble *> tmp2;
if((const MEDCouplingFieldDouble *)(*it))
return ret;
}
-void MEDCouplingMultiFields::checkCoherency() const
+void MEDCouplingMultiFields::checkConsistencyLight() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
+ std::vector< MCAuto<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
{
if((const MEDCouplingFieldDouble *)(*it)==0)
- throw INTERP_KERNEL::Exception("MEDCouplingMultiFields::checkCoherency : There is an empty Field in array...");
- (*it)->checkCoherency();
+ throw INTERP_KERNEL::Exception("MEDCouplingMultiFields::checkConsistencyLight : There is an empty Field in array...");
+ (*it)->checkConsistencyLight();
}
}
(*it)->incrRef();
else
throw INTERP_KERNEL::Exception("MEDCouplingMultiFields constructor : empty field found in vector !");
- (*it)->checkCoherency();
+ (*it)->checkConsistencyLight();
_fs[id]=*it;
}
}
/*!
- * Performs deepCpy.
+ * Performs deepCopy.
*/
MEDCouplingMultiFields::MEDCouplingMultiFields(const MEDCouplingMultiFields& other):RefCountObject(other)
{
std::vector< std::vector<int> > refs2;
std::vector<MEDCouplingMesh *> ms=other.getDifferentMeshes(refs);
std::size_t msLgh=ms.size();
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> > ms2(msLgh);
+ std::vector< MCAuto<MEDCouplingMesh> > ms2(msLgh);
for(std::size_t i=0;i<msLgh;i++)
- ms2[i]=ms[i]->deepCpy();
+ ms2[i]=ms[i]->deepCopy();
std::vector<DataArrayDouble *> das=other.getDifferentArrays(refs2);
std::size_t dasLgth=das.size();
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > das2(dasLgth);
+ std::vector< MCAuto<DataArrayDouble> > das2(dasLgth);
for(std::size_t i=0;i<dasLgth;i++)
- das2[i]=das[i]->deepCpy();
+ das2[i]=das[i]->deepCopy();
for(std::size_t i=0;i<sz;i++)
{
if((const MEDCouplingFieldDouble *)other._fs[i])
#include "MEDCouplingRefCountObject.hxx"
#include "MEDCouplingTimeLabel.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelException.hxx"
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingMesh;
class DataArrayDouble;
public:
MEDCOUPLING_EXPORT static MEDCouplingMultiFields *New(const std::vector<MEDCouplingFieldDouble *>& fs);
MEDCOUPLING_EXPORT static MEDCouplingMultiFields *New();
- MEDCOUPLING_EXPORT MEDCouplingMultiFields *deepCpy() const;
+ MEDCOUPLING_EXPORT MEDCouplingMultiFields *deepCopy() const;
MEDCOUPLING_EXPORT std::string getName() const;
MEDCOUPLING_EXPORT std::string getDescription() const;
MEDCOUPLING_EXPORT std::string getTimeUnit() const;
MEDCOUPLING_EXPORT void finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD,
const std::vector<MEDCouplingFieldTemplate *>& ft, const std::vector<MEDCouplingMesh *>& ms,
const std::vector<DataArrayDouble *>& das);
- MEDCOUPLING_EXPORT virtual void checkCoherency() const;
+ MEDCOUPLING_EXPORT virtual void checkConsistencyLight() const;
protected:
MEDCOUPLING_EXPORT MEDCouplingMultiFields(const std::vector<MEDCouplingFieldDouble *>& fs);
MEDCOUPLING_EXPORT MEDCouplingMultiFields(const MEDCouplingMultiFields& other);
MEDCOUPLING_EXPORT MEDCouplingMultiFields();
protected:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> > _fs;
+ std::vector< MCAuto<MEDCouplingFieldDouble> > _fs;
};
}
#include <algorithm>
#include <sstream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
const char *MEDCouplingNatureOfField::REPR_OF_NATUREOFFIELD[NB_OF_POSSIBILITIES]=
{ "NoNature",
- "ConservativeVolumic",
- "Integral",
- "IntegralGlobConstraint",
- "RevIntegral"};
+ "IntensiveMaximum",
+ "ExtensiveMaximum",
+ "ExtensiveConservation",
+ "IntensiveConservation"};
const int MEDCouplingNatureOfField::POS_OF_NATUREOFFIELD[NB_OF_POSSIBILITIES]={17,26,32,35,37};
#include "InterpKernelException.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingNatureOfField
{
#ifndef __PARAMEDMEM_MEDCOUPLINGNATUREOFFIELDENUM__
#define __PARAMEDMEM_MEDCOUPLINGNATUREOFFIELDENUM__
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
NoNature = 17,
- ConservativeVolumic = 26,
- Integral = 32,
- IntegralGlobConstraint = 35,
- RevIntegral = 37
+ IntensiveMaximum = 26,
+ ExtensiveMaximum = 32,
+ ExtensiveConservation = 35,
+ IntensiveConservation = 37
} NatureOfField;
}
#include "NormalizedUnstructuredMesh.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingCMesh;
}
typedef int MyConnType;
static const INTERP_KERNEL::NumberingPolicy My_numPol=INTERP_KERNEL::ALL_C_MODE;
public:
- MEDCouplingNormalizedCartesianMesh(const ParaMEDMEM::MEDCouplingCMesh *mesh);
+ MEDCouplingNormalizedCartesianMesh(const MEDCoupling::MEDCouplingCMesh *mesh);
//void getBoundingBox(double *boundingBox) const;
//INTERP_KERNEL::NormalizedCellType getTypeOfElement(int eltId) const;
//int getNumberOfNodesOfElement(int eltId) const;
const double * getCoordsAlongAxis(int axis) const;
~MEDCouplingNormalizedCartesianMesh();
private:
- const ParaMEDMEM::MEDCouplingCMesh *_mesh;
+ const MEDCoupling::MEDCouplingCMesh *_mesh;
};
#endif
#include "MEDCouplingCMesh.hxx"
template<int SPACEDIM>
-MEDCouplingNormalizedCartesianMesh<SPACEDIM>::MEDCouplingNormalizedCartesianMesh(const ParaMEDMEM::MEDCouplingCMesh *mesh):_mesh(mesh)
+MEDCouplingNormalizedCartesianMesh<SPACEDIM>::MEDCouplingNormalizedCartesianMesh(const MEDCoupling::MEDCouplingCMesh *mesh):_mesh(mesh)
{
if(_mesh)
_mesh->incrRef();
#include "NormalizedUnstructuredMesh.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingPointSet;
}
typedef int MyConnType;
static const INTERP_KERNEL::NumberingPolicy My_numPol=INTERP_KERNEL::ALL_C_MODE;
public:
- MEDCouplingNormalizedUnstructuredMesh(const ParaMEDMEM::MEDCouplingPointSet *mesh);
+ MEDCouplingNormalizedUnstructuredMesh(const MEDCoupling::MEDCouplingPointSet *mesh);
void getBoundingBox(double *boundingBox) const;
INTERP_KERNEL::NormalizedCellType getTypeOfElement(int eltId) const;
int getNumberOfNodesOfElement(int eltId) const;
private:
void prepare();
private:
- const ParaMEDMEM::MEDCouplingPointSet *_mesh;
+ const MEDCoupling::MEDCouplingPointSet *_mesh;
int *_conn_for_interp;
int *_conn_index_for_interp;
};
#include <limits>
template<int SPACEDIM,int MESHDIM>
-MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM>::MEDCouplingNormalizedUnstructuredMesh(const ParaMEDMEM::MEDCouplingPointSet *mesh):_mesh(mesh)
+MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM>::MEDCouplingNormalizedUnstructuredMesh(const MEDCoupling::MEDCouplingPointSet *mesh):_mesh(mesh)
{
if(_mesh)
_mesh->incrRef();
boundingBox[i]=std::numeric_limits<double>::max();
boundingBox[SPACEDIM+i]=-std::numeric_limits<double>::max();
}
- const ParaMEDMEM::DataArrayDouble *array=_mesh->getCoords();
+ const MEDCoupling::DataArrayDouble *array=_mesh->getCoords();
const double *ptr=array->getConstPointer();
int nbOfPts=array->getNbOfElems()/SPACEDIM;
for(int j=0;j<SPACEDIM;j++)
template<int SPACEDIM,int MESHDIM>
const double *MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM>::getCoordinatesPtr() const
{
- const ParaMEDMEM::DataArrayDouble *array=_mesh->getCoords();
+ const MEDCoupling::DataArrayDouble *array=_mesh->getCoords();
return array->getConstPointer();
}
template<int SPACEDIM,int MESHDIM>
void MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM>::prepare()
{
- const ParaMEDMEM::MEDCouplingUMesh *m1(dynamic_cast<const ParaMEDMEM::MEDCouplingUMesh *>(_mesh));
+ const MEDCoupling::MEDCouplingUMesh *m1(dynamic_cast<const MEDCoupling::MEDCouplingUMesh *>(_mesh));
if(m1)
{
int nbOfCell=m1->getNumberOfCells();
}
return ;
}
- const ParaMEDMEM::MEDCoupling1DGTUMesh *m2(dynamic_cast<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(_mesh));
+ const MEDCoupling::MEDCoupling1DGTUMesh *m2(dynamic_cast<const MEDCoupling::MEDCoupling1DGTUMesh *>(_mesh));
if(m2)
{
int nbOfCell(m2->getNumberOfCells());
std::copy(m2->getNodalConnectivity()->begin(),m2->getNodalConnectivity()->end(),_conn_for_interp);
return ;
}
- const ParaMEDMEM::MEDCoupling1SGTUMesh *m3(dynamic_cast<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(_mesh));
+ const MEDCoupling::MEDCoupling1SGTUMesh *m3(dynamic_cast<const MEDCoupling::MEDCoupling1SGTUMesh *>(_mesh));
if(m3)
{
int nbOfCell(m3->getNumberOfCells()),nbNodesPerCell(m3->getNumberOfNodesPerCell());
#include "MEDCouplingPartDefinition.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
PartDefinition *PartDefinition::New(int start, int stop, int step)
{
return DataArrayPartDefinition::New(listOfIds);
}
-PartDefinition *PartDefinition::Unserialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI)
+PartDefinition *PartDefinition::Unserialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI)
{
if(tinyInt.empty())
{
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> ret(DataArrayPartDefinition::New(bigArraysI.back()));
+ MCAuto<PartDefinition> ret(DataArrayPartDefinition::New(bigArraysI.back()));
bigArraysI.pop_back();
return ret.retn();
}
else if(tinyInt.size()==3)
{
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> ret(SlicePartDefinition::New(tinyInt[0],tinyInt[1],tinyInt[2]));
+ MCAuto<PartDefinition> ret(SlicePartDefinition::New(tinyInt[0],tinyInt[1],tinyInt[2]));
tinyInt.erase(tinyInt.begin(),tinyInt.begin()+3);
return ret.retn();
}
return true;
}
-DataArrayPartDefinition *DataArrayPartDefinition::deepCpy() const
+DataArrayPartDefinition *DataArrayPartDefinition::deepCopy() const
{
const DataArrayInt *arr(_arr);
if(!arr)
- throw INTERP_KERNEL::Exception("DataArrayPartDefinition::deepCpy : array is null !");
+ throw INTERP_KERNEL::Exception("DataArrayPartDefinition::deepCopy : array is null !");
return DataArrayPartDefinition::New(const_cast<DataArrayInt *>(arr));
}
{
if(!other)
throw INTERP_KERNEL::Exception("DataArrayPartDefinition::composeWith : input PartDef must be not NULL !");
- checkCoherency();
- other->checkCoherency();
+ checkConsistencyLight();
+ other->checkConsistencyLight();
const SlicePartDefinition *spd(dynamic_cast<const SlicePartDefinition *>(other));
if(spd)
{//special case for optim
spd->getSlice(a,b,c);
if(c==1)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(DataArrayInt::New());
+ MCAuto<DataArrayInt> arr(DataArrayInt::New());
arr->alloc(_arr->getNumberOfTuples(),1);
std::transform(_arr->begin(),_arr->end(),arr->getPointer(),std::bind2nd(std::plus<int>(),a));
return DataArrayPartDefinition::New(arr);
}
}
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr1(other->toDAI());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr2(arr1->selectByTupleIdSafe(_arr->begin(),_arr->end()));
+ MCAuto<DataArrayInt> arr1(other->toDAI());
+ MCAuto<DataArrayInt> arr2(arr1->selectByTupleIdSafe(_arr->begin(),_arr->end()));
return DataArrayPartDefinition::New(arr2);
}
-void DataArrayPartDefinition::checkCoherency() const
+void DataArrayPartDefinition::checkConsistencyLight() const
{
CheckInternalArrayOK(_arr);
}
*/
PartDefinition *DataArrayPartDefinition::tryToSimplify() const
{
- checkCoherency();
+ checkConsistencyLight();
int a(0),b(0),c(0);
if(_arr->isRange(a,b,c))
{
}
}
-void DataArrayPartDefinition::serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const
+void DataArrayPartDefinition::serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const
{
bigArraysI.push_back(_arr);
}
DataArrayPartDefinition *DataArrayPartDefinition::add1(const DataArrayPartDefinition *other) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a1(toDAI()),a2(other->toDAI());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
+ MCAuto<DataArrayInt> a1(toDAI()),a2(other->toDAI());
+ MCAuto<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
a3->sort();
return DataArrayPartDefinition::New(a3);
}
DataArrayPartDefinition *DataArrayPartDefinition::add2(const SlicePartDefinition *other) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a1(toDAI()),a2(other->toDAI());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
+ MCAuto<DataArrayInt> a1(toDAI()),a2(other->toDAI());
+ MCAuto<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
a3->sort();
return DataArrayPartDefinition::New(a3);
}
return true;
}
-SlicePartDefinition *SlicePartDefinition::deepCpy() const
+SlicePartDefinition *SlicePartDefinition::deepCopy() const
{
return SlicePartDefinition::New(_start,_stop,_step);
}
{
if(!other)
throw INTERP_KERNEL::Exception("SlicePartDefinition::composeWith : input PartDef must be not NULL !");
- checkCoherency();
- other->checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(other->toDAI());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr1(arr->selectByTupleId2(_start,_stop,_step));
+ checkConsistencyLight();
+ other->checkConsistencyLight();
+ MCAuto<DataArrayInt> arr(other->toDAI());
+ MCAuto<DataArrayInt> arr1(arr->selectByTupleIdSafeSlice(_start,_stop,_step));
return DataArrayPartDefinition::New(arr1);
}
/*!
* Do nothing it is not a bug.
*/
-void SlicePartDefinition::checkCoherency() const
+void SlicePartDefinition::checkConsistencyLight() const
{
}
return ret;
}
-void SlicePartDefinition::serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const
+void SlicePartDefinition::serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const
{
tinyInt.push_back(_start);
tinyInt.push_back(_stop);
DataArrayPartDefinition *SlicePartDefinition::add1(const DataArrayPartDefinition *other) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a1(toDAI()),a2(other->toDAI());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
+ MCAuto<DataArrayInt> a1(toDAI()),a2(other->toDAI());
+ MCAuto<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
a3->sort();
return DataArrayPartDefinition::New(a3);
}
}
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a1(toDAI()),a2(other->toDAI());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
+ MCAuto<DataArrayInt> a1(toDAI()),a2(other->toDAI());
+ MCAuto<DataArrayInt> a3(DataArrayInt::Aggregate(a1,a2,0));
a3->sort();
return DataArrayPartDefinition::New(a3);
}
#include "MEDCoupling.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class PartDefinition : public RefCountObject, public TimeLabel
{
public:
MEDCOUPLING_EXPORT static PartDefinition *New(int start, int stop, int step);
MEDCOUPLING_EXPORT static PartDefinition *New(DataArrayInt *listOfIds);
- MEDCOUPLING_EXPORT static PartDefinition *Unserialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI);
+ MEDCOUPLING_EXPORT static PartDefinition *Unserialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI);
MEDCOUPLING_EXPORT virtual bool isEqual(const PartDefinition *other, std::string& what) const = 0;
- MEDCOUPLING_EXPORT virtual PartDefinition *deepCpy() const = 0;
+ MEDCOUPLING_EXPORT virtual PartDefinition *deepCopy() const = 0;
MEDCOUPLING_EXPORT virtual DataArrayInt *toDAI() const = 0;
MEDCOUPLING_EXPORT virtual int getNumberOfElems() const = 0;
MEDCOUPLING_EXPORT virtual PartDefinition *operator+(const PartDefinition& other) const = 0;
MEDCOUPLING_EXPORT virtual std::string getRepr() const = 0;
MEDCOUPLING_EXPORT virtual PartDefinition *composeWith(const PartDefinition *other) const = 0;
- MEDCOUPLING_EXPORT virtual void checkCoherency() const = 0;
+ MEDCOUPLING_EXPORT virtual void checkConsistencyLight() const = 0;
MEDCOUPLING_EXPORT virtual PartDefinition *tryToSimplify() const = 0;
- MEDCOUPLING_EXPORT virtual void serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const = 0;
+ MEDCOUPLING_EXPORT virtual void serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const = 0;
protected:
virtual ~PartDefinition();
};
public:
MEDCOUPLING_EXPORT static DataArrayPartDefinition *New(DataArrayInt *listOfIds);
MEDCOUPLING_EXPORT bool isEqual(const PartDefinition *other, std::string& what) const;
- MEDCOUPLING_EXPORT DataArrayPartDefinition *deepCpy() const;
+ MEDCOUPLING_EXPORT DataArrayPartDefinition *deepCopy() const;
MEDCOUPLING_EXPORT DataArrayInt *toDAI() const;
MEDCOUPLING_EXPORT int getNumberOfElems() const;
MEDCOUPLING_EXPORT PartDefinition *operator+(const PartDefinition& other) const;
MEDCOUPLING_EXPORT std::string getRepr() const;
MEDCOUPLING_EXPORT PartDefinition *composeWith(const PartDefinition *other) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
MEDCOUPLING_EXPORT PartDefinition *tryToSimplify() const;
- MEDCOUPLING_EXPORT void serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const;
+ MEDCOUPLING_EXPORT void serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const;
private:
DataArrayPartDefinition(DataArrayInt *listOfIds);
void checkInternalArrayOK() const;
DataArrayPartDefinition *add2(const SlicePartDefinition *other) const;
virtual ~DataArrayPartDefinition();
private:
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _arr;
+ MCAuto<DataArrayInt> _arr;
};
class SlicePartDefinition : public PartDefinition
public:
MEDCOUPLING_EXPORT static SlicePartDefinition *New(int start, int stop, int step);
MEDCOUPLING_EXPORT bool isEqual(const PartDefinition *other, std::string& what) const;
- MEDCOUPLING_EXPORT SlicePartDefinition *deepCpy() const;
+ MEDCOUPLING_EXPORT SlicePartDefinition *deepCopy() const;
MEDCOUPLING_EXPORT DataArrayInt *toDAI() const;
MEDCOUPLING_EXPORT int getNumberOfElems() const;
MEDCOUPLING_EXPORT PartDefinition *operator+(const PartDefinition& other) const;
MEDCOUPLING_EXPORT std::string getRepr() const;
MEDCOUPLING_EXPORT PartDefinition *composeWith(const PartDefinition *other) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
MEDCOUPLING_EXPORT PartDefinition *tryToSimplify() const;
- MEDCOUPLING_EXPORT void serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const;
+ MEDCOUPLING_EXPORT void serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const;
//specific method
MEDCOUPLING_EXPORT int getEffectiveStop() const;
MEDCOUPLING_EXPORT void getSlice(int& start, int& stop, int& step) const;
// Author : Anthony Geay (CEA/DEN)
#include "MEDCouplingPointSet.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCoupling1GTUMesh.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingMemArray.hxx"
#include <limits>
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingPointSet::MEDCouplingPointSet():_coords(0)
{
MEDCouplingPointSet::MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCopy):MEDCouplingMesh(other),_coords(0)
{
if(other._coords)
- _coords=other._coords->performCpy(deepCopy);
+ _coords=other._coords->performCopyOrIncrRef(deepCopy);
}
MEDCouplingPointSet::~MEDCouplingPointSet()
DataArrayInt *comm,*commI;
findCommonNodes(precision,limitNodeId,comm,commI);
int oldNbOfNodes=getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=buildNewNumberingFromCommonNodesFormat(comm,commI,newNbOfNodes);
+ MCAuto<DataArrayInt> ret=buildNewNumberingFromCommonNodesFormat(comm,commI,newNbOfNodes);
areNodesMerged=(oldNbOfNodes!=newNbOfNodes);
comm->decrRef();
commI->decrRef();
{
DataArrayInt *c=0,*cI=0;
getNodeIdsNearPoints(pos,1,eps,c,cI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cITmp(cI);
+ MCAuto<DataArrayInt> cITmp(cI);
return c;
}
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::getNodeIdsNearPoint : no coordiantes set !");
int spaceDim=getSpaceDimension();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> points=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> points=DataArrayDouble::New();
points->useArray(pos,false,CPP_DEALLOC,nbOfPoints,spaceDim);
_coords->computeTupleIdsNearTuples(points,eps,c,cI);
}
{
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::buildNewNumberingFromCommonNodesFormat : no coords specified !");
- return DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(getNumberOfNodes(),comm->begin(),commIndex->begin(),commIndex->end(),newNbOfNodes);
+ return DataArrayInt::ConvertIndexArrayToO2N(getNumberOfNodes(),comm->begin(),commIndex->begin(),commIndex->end(),newNbOfNodes);
}
/*!
{
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::renumberNodes : no coords specified !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords=_coords->renumberAndReduce(newNodeNumbers,newNbOfNodes);
+ MCAuto<DataArrayDouble> newCoords=_coords->renumberAndReduce(newNodeNumbers,newNbOfNodes);
renumberNodesInConn(newNodeNumbers);
setCoords(newCoords);//let it here not before renumberNodesInConn because old number of nodes is sometimes used...
}
* \ref py_mcumesh_renumberNodes "Here is a Python example".
* \endif
*/
-void MEDCouplingPointSet::renumberNodes2(const int *newNodeNumbers, int newNbOfNodes)
+void MEDCouplingPointSet::renumberNodesCenter(const int *newNodeNumbers, int newNbOfNodes)
{
DataArrayDouble *newCoords=DataArrayDouble::New();
std::vector<int> div(newNbOfNodes);
{
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::duplicateNodesInCoords : no coords set !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords=_coords->selectByTupleIdSafe(nodeIdsToDuplicateBg,nodeIdsToDuplicateEnd);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords2=DataArrayDouble::Aggregate(_coords,newCoords);
+ MCAuto<DataArrayDouble> newCoords=_coords->selectByTupleIdSafe(nodeIdsToDuplicateBg,nodeIdsToDuplicateEnd);
+ MCAuto<DataArrayDouble> newCoords2=DataArrayDouble::Aggregate(_coords,newCoords);
setCoords(newCoords2);
}
}
}
-void MEDCouplingPointSet::checkCoherency() const
+void MEDCouplingPointSet::checkConsistencyLight() const
{
if(!_coords)
- throw INTERP_KERNEL::Exception("MEDCouplingPointSet::checkCoherency : no coordinates set !");
+ throw INTERP_KERNEL::Exception("MEDCouplingPointSet::checkConsistencyLight : no coordinates set !");
}
/*!
{
if(!srcMesh || !trgMesh)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells : the input meshes must be not NULL !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> sbbox(srcMesh->getBoundingBoxForBBTree()),tbbox(trgMesh->getBoundingBoxForBBTree());
+ MCAuto<DataArrayDouble> sbbox(srcMesh->getBoundingBoxForBBTree()),tbbox(trgMesh->getBoundingBoxForBBTree());
return tbbox->computeNbOfInteractionsWith(sbbox,eps);
}
*/
MEDCouplingMesh *MEDCouplingPointSet::buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> ret=buildPartOfMySelf(start,end,true);
+ MCAuto<MEDCouplingPointSet> ret=buildPartOfMySelf(start,end,true);
arr=ret->zipCoordsTraducer();
return ret.retn();
}
*
* \return a new ref to be managed by the caller. Warning this ref can be equal to \a this if input slice is exactly equal to the whole cells in the same order.
*
- * \sa MEDCouplingUMesh::buildPartOfMySelf2
+ * \sa MEDCouplingUMesh::buildPartOfMySelfSlice
*/
MEDCouplingMesh *MEDCouplingPointSet::buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const
{
}
else
{
- return buildPartOfMySelf2(beginCellIds,endCellIds,stepCellIds,true);
+ return buildPartOfMySelfSlice(beginCellIds,endCellIds,stepCellIds,true);
}
}
* \param [out] stepOut valid only if \a arr not NULL !
* \param [out] arr correspondance old to new in node ids.
*
- * \sa MEDCouplingUMesh::buildPartOfMySelf2
+ * \sa MEDCouplingUMesh::buildPartOfMySelfSlice
*/
MEDCouplingMesh *MEDCouplingPointSet::buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt*& arr) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> ret=buildPartOfMySelf2(beginCellIds,endCellIds,stepCellIds,true);
+ MCAuto<MEDCouplingPointSet> ret=buildPartOfMySelfSlice(beginCellIds,endCellIds,stepCellIds,true);
arr=ret->zipCoordsTraducer();
return ret.retn();
}
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::tryToShareSameCoordsPermute : No coords specified in this whereas there is any in other !");
int otherNbOfNodes=other.getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords=MergeNodesArray(&other,this);
+ MCAuto<DataArrayDouble> newCoords=MergeNodesArray(&other,this);
_coords->incrRef();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> oldCoords=_coords;
+ MCAuto<DataArrayDouble> oldCoords=_coords;
setCoords(newCoords);
bool areNodesMerged;
int newNbOfNodes;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=buildPermArrayForMergeNode(epsilon,otherNbOfNodes,areNodesMerged,newNbOfNodes);
+ MCAuto<DataArrayInt> da=buildPermArrayForMergeNode(epsilon,otherNbOfNodes,areNodesMerged,newNbOfNodes);
if(!areNodesMerged)
{
setCoords(oldCoords);
MEDCouplingPointSet *MEDCouplingPointSet::buildPartOfMySelf(const int *begin, const int *end, bool keepCoords) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> ret=buildPartOfMySelfKeepCoords(begin,end);
+ MCAuto<MEDCouplingPointSet> ret=buildPartOfMySelfKeepCoords(begin,end);
if(!keepCoords)
ret->zipCoords();
return ret.retn();
}
-MEDCouplingPointSet *MEDCouplingPointSet::buildPartOfMySelf2(int start, int end, int step, bool keepCoords) const
+MEDCouplingPointSet *MEDCouplingPointSet::buildPartOfMySelfSlice(int start, int end, int step, bool keepCoords) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> ret=buildPartOfMySelfKeepCoords2(start,end,step);
+ MCAuto<MEDCouplingPointSet> ret=buildPartOfMySelfKeepCoordsSlice(start,end,step);
if(!keepCoords)
ret->zipCoords();
return ret.retn();
{
DataArrayInt *cellIdsKept=0;
fillCellIdsToKeepFromNodeIds(begin,end,fullyIn,cellIdsKept);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsKept2(cellIdsKept);
+ MCAuto<DataArrayInt> cellIdsKept2(cellIdsKept);
return buildPartOfMySelf(cellIdsKept->begin(),cellIdsKept->end(),true);
}
{
DataArrayInt *commonCells=0,*commonCellsI=0;
findCommonCells(compType,startCellId,commonCells,commonCellsI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> commonCellsTmp(commonCells),commonCellsITmp(commonCellsI);
+ MCAuto<DataArrayInt> commonCellsTmp(commonCells),commonCellsITmp(commonCellsI);
int newNbOfCells=-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(getNumberOfCells(),commonCells->begin(),commonCellsI->begin(),
+ MCAuto<DataArrayInt> ret=DataArrayInt::ConvertIndexArrayToO2N(getNumberOfCells(),commonCells->begin(),commonCellsI->begin(),
commonCellsI->end(),newNbOfCells);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2=ret->invertArrayO2N2N2O(newNbOfCells);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> self=buildPartOfMySelf(ret2->begin(),ret2->end(),true);
+ MCAuto<DataArrayInt> ret2=ret->invertArrayO2N2N2O(newNbOfCells);
+ MCAuto<MEDCouplingPointSet> self=buildPartOfMySelf(ret2->begin(),ret2->end(),true);
shallowCopyConnectivityFrom(self);
return ret.retn();
}
const MEDCouplingPointSet *otherC=dynamic_cast<const MEDCouplingPointSet *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::checkDeepEquivalWith : other is not a PointSet mesh !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> m=dynamic_cast<MEDCouplingPointSet *>(mergeMyselfWith(otherC));
+ MCAuto<MEDCouplingPointSet> m=dynamic_cast<MEDCouplingPointSet *>(mergeMyselfWith(otherC));
bool areNodesMerged;
int newNbOfNodes;
int oldNbOfNodes=getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=m->buildPermArrayForMergeNode(prec,oldNbOfNodes,areNodesMerged,newNbOfNodes);
+ MCAuto<DataArrayInt> da=m->buildPermArrayForMergeNode(prec,oldNbOfNodes,areNodesMerged,newNbOfNodes);
//mergeNodes
if(!areNodesMerged && oldNbOfNodes != 0)
throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Nodes are incompatible ! ");
throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some nodes in other are not in this !");
m->renumberNodes(da->getConstPointer(),newNbOfNodes);
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodeCor2=da->substr(oldNbOfNodes);
+ MCAuto<DataArrayInt> nodeCor2=da->subArray(oldNbOfNodes);
da=m->mergeNodes(prec,areNodesMerged,newNbOfNodes);
//
da=m->zipConnectivityTraducer(cellCompPol);
int dan(da->getNumberOfTuples());
if (dan)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da1(DataArrayInt::New()),da2(DataArrayInt::New());
+ MCAuto<DataArrayInt> da1(DataArrayInt::New()),da2(DataArrayInt::New());
da1->alloc(dan/2,1); da2->alloc(dan/2,1);
std::copy(da->getConstPointer(), da->getConstPointer()+dan/2, da1->getPointer());
std::copy(da->getConstPointer()+dan/2, da->getConstPointer()+dan, da2->getPointer());
if (!da1->isEqualWithoutConsideringStr(*da2))
throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some cells in other are not in this !");
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellCor2=da->selectByTupleId2(nbCells,da->getNbOfElems(),1);
- nodeCor=nodeCor2->isIdentity2(nodeCor2->getNumberOfTuples())?0:nodeCor2.retn();
- cellCor=cellCor2->isIdentity2(cellCor2->getNumberOfTuples())?0:cellCor2.retn();
+ MCAuto<DataArrayInt> cellCor2=da->selectByTupleIdSafeSlice(nbCells,da->getNbOfElems(),1);
+ nodeCor=nodeCor2->isIota(nodeCor2->getNumberOfTuples())?0:nodeCor2.retn();
+ cellCor=cellCor2->isIota(cellCor2->getNumberOfTuples())?0:cellCor2.retn();
}
/*!
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::checkDeepEquivalOnSameNodesWith : other is not a PointSet mesh !");
if(_coords!=otherC->_coords)
throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : meshes do not share the same coordinates ! Use tryToShareSameCoordinates or call checkDeepEquivalWith !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> m=mergeMyselfWithOnSameCoords(otherC);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=m->zipConnectivityTraducer(cellCompPol);
+ MCAuto<MEDCouplingPointSet> m=mergeMyselfWithOnSameCoords(otherC);
+ MCAuto<DataArrayInt> da=m->zipConnectivityTraducer(cellCompPol);
int maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells());
const int *pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<int>(),maxId));
if(pt!=da->getConstPointer()+da->getNbOfElems())
{
throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : some cells in other are not in this !");
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellCor2=da->selectByTupleId2(getNumberOfCells(),da->getNbOfElems(),1);
- cellCor=cellCor2->isIdentity2(cellCor2->getNumberOfTuples())?0:cellCor2.retn();
+ MCAuto<DataArrayInt> cellCor2=da->selectByTupleIdSafeSlice(getNumberOfCells(),da->getNbOfElems(),1);
+ cellCor=cellCor2->isIota(cellCor2->getNumberOfTuples())?0:cellCor2.retn();
}
void MEDCouplingPointSet::checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const
DataArrayInt *MEDCouplingPointSet::zipCoordsTraducer()
{
int newNbOfNodes=-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> traducer=getNodeIdsInUse(newNbOfNodes);
+ MCAuto<DataArrayInt> traducer=getNodeIdsInUse(newNbOfNodes);
renumberNodes(traducer->getConstPointer(),newNbOfNodes);
return traducer.retn();
}
*/
DataArrayInt *MEDCouplingPointSet::mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=buildPermArrayForMergeNode(precision,-1,areNodesMerged,newNbOfNodes);
+ MCAuto<DataArrayInt> ret=buildPermArrayForMergeNode(precision,-1,areNodesMerged,newNbOfNodes);
if(areNodesMerged)
renumberNodes(ret->begin(),newNbOfNodes);
return ret.retn();
* \ref py_mcumesh_mergeNodes "Here is a Python example".
* \endif
*/
-DataArrayInt *MEDCouplingPointSet::mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes)
+DataArrayInt *MEDCouplingPointSet::mergeNodesCenter(double precision, bool& areNodesMerged, int& newNbOfNodes)
{
DataArrayInt *ret=buildPermArrayForMergeNode(precision,-1,areNodesMerged,newNbOfNodes);
if(areNodesMerged)
- renumberNodes2(ret->getConstPointer(),newNbOfNodes);
+ renumberNodesCenter(ret->getConstPointer(),newNbOfNodes);
return ret;
}
class DirectedBoundingBox;
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayInt;
class DataArrayDouble;
/*!
* This class is abstract and not instanciable.
- * ParaMEDMEM::MEDCouplingUMesh class inherits from this class.
+ * MEDCoupling::MEDCouplingUMesh class inherits from this class.
* This class aggregates an array '_coords' containing nodes coordinates.
* So all operations on coordinates are managed by this class.
* This is the case for example for following methods :
MEDCOUPLING_EXPORT bool areCoordsEqualIfNotWhy(const MEDCouplingPointSet& other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT bool areCoordsEqual(const MEDCouplingPointSet& other, double prec) const;
MEDCOUPLING_EXPORT bool areCoordsEqualWithoutConsideringStr(const MEDCouplingPointSet& other, double prec) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const = 0;
+ MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const = 0;
MEDCOUPLING_EXPORT virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) = 0;
MEDCOUPLING_EXPORT virtual DataArrayInt *mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes);
- MEDCOUPLING_EXPORT virtual DataArrayInt *mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes);
+ MEDCOUPLING_EXPORT virtual DataArrayInt *mergeNodesCenter(double precision, bool& areNodesMerged, int& newNbOfNodes);
MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const = 0;
MEDCOUPLING_EXPORT virtual void computeNodeIdsAlg(std::vector<bool>& nodeIdsInUse) const = 0;
MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
MEDCOUPLING_EXPORT DataArrayInt *getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const;
MEDCOUPLING_EXPORT DataArrayInt *getCellIdsLyingOnNodes(const int *begin, const int *end, bool fullyIn) const;
MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildPartOfMySelf(const int *start, const int *end, bool keepCoords=true) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step, bool keepCoords=true) const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step, bool keepCoords=true) const;
MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const = 0;
- MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const = 0;
+ MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const = 0;
MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildPartOfMySelfNode(const int *start, const int *end, bool fullyIn) const;
MEDCOUPLING_EXPORT virtual MEDCouplingPointSet *buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const = 0;
MEDCOUPLING_EXPORT virtual DataArrayInt *findBoundaryNodes() const = 0;
MEDCOUPLING_EXPORT virtual void renumberNodesInConn(const INTERP_KERNEL::HashMap<int,int>& newNodeNumbersO2N) = 0;
MEDCOUPLING_EXPORT virtual void renumberNodesWithOffsetInConn(int offset) = 0;
MEDCOUPLING_EXPORT virtual void renumberNodes(const int *newNodeNumbers, int newNbOfNodes);
- MEDCOUPLING_EXPORT virtual void renumberNodes2(const int *newNodeNumbers, int newNbOfNodes);
+ MEDCOUPLING_EXPORT virtual void renumberNodesCenter(const int *newNodeNumbers, int newNbOfNodes);
MEDCOUPLING_EXPORT virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const = 0;
MEDCOUPLING_EXPORT virtual void checkFullyDefined() const = 0;
MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
public:
MEDCOUPLING_EXPORT bool areCellsFrom2MeshEqual(const MEDCouplingPointSet *other, int cellId, double prec) const;
protected:
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
MEDCOUPLING_EXPORT static bool intersectsBoundingBox(const double* bb1, const double* bb2, int dim, double eps);
MEDCOUPLING_EXPORT static bool intersectsBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bb1, const double* bb2, int dim, double eps);
MEDCOUPLING_EXPORT void rotate2D(const double *center, double angle);
#include <sstream>
#include <algorithm>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
-const char *ParaMEDMEM::MEDCouplingVersionStr()
+const char *MEDCoupling::MEDCouplingVersionStr()
{
return MEDCOUPLING_VERSION_STR;
}
-int ParaMEDMEM::MEDCouplingVersion()
+int MEDCoupling::MEDCouplingVersion()
{
return MEDCOUPLING_VERSION;
}
-void ParaMEDMEM::MEDCouplingVersionMajMinRel(int& maj, int& minor, int& releas)
+void MEDCoupling::MEDCouplingVersionMajMinRel(int& maj, int& minor, int& releas)
{
int ver=MEDCOUPLING_VERSION;
maj=(ver & 0xFF0000) >> 16;
releas=(ver & 0xFF);
}
-int ParaMEDMEM::MEDCouplingSizeOfVoidStar()
+int MEDCoupling::MEDCouplingSizeOfVoidStar()
{
return 8*sizeof(std::size_t);
}
* If false it is a BigEndian machine.
* \return the coding mode of integers of the machine.
*/
-bool ParaMEDMEM::MEDCouplingByteOrder()
+bool MEDCoupling::MEDCouplingByteOrder()
{
unsigned int x(1);
unsigned char *xc(reinterpret_cast<unsigned char *>(&x));
return xc[0]==1;
}
-const char *ParaMEDMEM::MEDCouplingByteOrderStr()
+const char *MEDCoupling::MEDCouplingByteOrderStr()
{
static const char LITTLEENDIAN_STR[]="LittleEndian";
static const char BIGENDIAN_STR[]="BigEndian";
#include <string>
#include <cstddef>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingCMesh.hxx"
#include "MEDCouplingNormalizedUnstructuredMesh.txx"
#include "MEDCouplingNormalizedCartesianMesh.txx"
#include "InterpolationCU.txx"
#include "InterpolationCC.txx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingRemapper::MEDCouplingRemapper():_src_ft(0),_target_ft(0),_interp_matrix_pol(IK_ONLY_PREFERED),_nature_of_deno(NoNature),_time_deno_update(0)
{
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::prepare : presence of NULL input pointer !");
std::string srcMethod,targetMethod;
INTERP_KERNEL::Interpolation<INTERP_KERNEL::Interpolation3D>::CheckAndSplitInterpolationMethod(method,srcMethod,targetMethod);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> src=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(srcMethod));
+ MCAuto<MEDCouplingFieldTemplate> src=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(srcMethod));
src->setMesh(srcMesh);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> target=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(targetMethod));
+ MCAuto<MEDCouplingFieldTemplate> target=MEDCouplingFieldTemplate::New(MEDCouplingFieldDiscretization::GetTypeOfFieldFromStringRepr(targetMethod));
target->setMesh(targetMesh);
return prepareEx(src,target);
}
}
/*!
- * This method performs the operation source to target using matrix computed in ParaMEDMEM::MEDCouplingRemapper::prepare method.
- * If meshes of \b srcField and \b targetField do not match exactly those given into \ref ParaMEDMEM::MEDCouplingRemapper::prepare "prepare method" an exception will be thrown.
+ * This method performs the operation source to target using matrix computed in MEDCoupling::MEDCouplingRemapper::prepare method.
+ * If meshes of \b srcField and \b targetField do not match exactly those given into \ref MEDCoupling::MEDCouplingRemapper::prepare "prepare method" an exception will be thrown.
*
- * \param [in] srcField is the source field from which the interpolation will be done. The mesh into \b srcField should be the same than those specified on ParaMEDMEM::MEDCouplingRemapper::prepare.
+ * \param [in] srcField is the source field from which the interpolation will be done. The mesh into \b srcField should be the same than those specified on MEDCoupling::MEDCouplingRemapper::prepare.
* \param [in/out] targetField the destination field with the allocated array in which all tuples will be overwritten.
* \param [in] dftValue is the value that will be assigned in the targetField to each entity of target mesh (entity depending on the method selected on prepare invocation) that is not intercepted by any entity of source mesh.
* For example in "P0P0" case (cell-cell) if a cell in target mesh is not overlapped by any source cell the \a dftValue value will be attached on that cell in the returned \a targetField. In some cases a target
}
/*!
- * This method is equivalent to ParaMEDMEM::MEDCouplingRemapper::transfer except that here \b targetField is a in/out parameter.
+ * This method is equivalent to MEDCoupling::MEDCouplingRemapper::transfer except that here \b targetField is a in/out parameter.
* If an entity (cell for example) in targetField is not fetched by any entity (cell for example) of \b srcField, the value in targetField is
* let unchanged.
* This method requires that \b targetField was fully defined and allocated. If the array is not allocated an exception will be thrown.
*
- * \param [in] srcField is the source field from which the interpolation will be done. The mesh into \b srcField should be the same than those specified on ParaMEDMEM::MEDCouplingRemapper::prepare.
+ * \param [in] srcField is the source field from which the interpolation will be done. The mesh into \b srcField should be the same than those specified on MEDCoupling::MEDCouplingRemapper::prepare.
* \param [in,out] targetField the destination field with the allocated array in which only tuples whose entities are fetched by interpolation will be overwritten only.
*/
void MEDCouplingRemapper::partialTransfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField)
if(!srcField || !targetField)
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::reverseTransfer : input fields must be both not NULL !");
checkPrepare();
- targetField->checkCoherency();
+ targetField->checkConsistencyLight();
if(_src_ft->getDiscretization()->getStringRepr()!=srcField->getDiscretization()->getStringRepr())
throw INTERP_KERNEL::Exception("Incoherency with prepare call for source field");
if(_target_ft->getDiscretization()->getStringRepr()!=targetField->getDiscretization()->getStringRepr())
int trgNbOfCompo=targetField->getNumberOfComponents();
if(array)
{
- srcField->checkCoherency();
+ srcField->checkConsistencyLight();
if(trgNbOfCompo!=srcField->getNumberOfTuplesExpected())
throw INTERP_KERNEL::Exception("Number of components mismatch !");
}
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble > tmp(DataArrayDouble::New());
+ MCAuto<DataArrayDouble > tmp(DataArrayDouble::New());
tmp->alloc(srcField->getNumberOfTuplesExpected(),trgNbOfCompo);
srcField->setArray(tmp);
}
}
/*!
- * This method performs the operation source to target using matrix computed in ParaMEDMEM::MEDCouplingRemapper::prepare method.
- * If mesh of \b srcField does not match exactly those given into \ref ParaMEDMEM::MEDCouplingRemapper::prepare "prepare method" an exception will be thrown.
+ * This method performs the operation source to target using matrix computed in MEDCoupling::MEDCouplingRemapper::prepare method.
+ * If mesh of \b srcField does not match exactly those given into \ref MEDCoupling::MEDCouplingRemapper::prepare "prepare method" an exception will be thrown.
*
- * \param [in] srcField is the source field from which the interpolation will be done. The mesh into \b srcField should be the same than those specified on ParaMEDMEM::MEDCouplingRemapper::prepare.
+ * \param [in] srcField is the source field from which the interpolation will be done. The mesh into \b srcField should be the same than those specified on MEDCoupling::MEDCouplingRemapper::prepare.
* \param [in] dftValue is the value that will be assigned in the targetField to each entity of target mesh (entity depending on the method selected on prepare invocation) that is not intercepted by any entity of source mesh.
* For example in "P0P0" case (cell-cell) if a cell in target mesh is not overlapped by any source cell the \a dftValue value will be attached on that cell in the returned \a targetField. In some cases a target
* cell not intercepted by any source cell is a bug so in this case it is advised to set a huge value (1e300 for example) to \a dftValue to quickly point to the problem. But for users doing parallelism a target cell can
checkPrepare();
if(!srcField)
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::transferField : input srcField is NULL !");
- srcField->checkCoherency();
+ srcField->checkConsistencyLight();
if(_src_ft->getDiscretization()->getStringRepr()!=srcField->getDiscretization()->getStringRepr())
throw INTERP_KERNEL::Exception("Incoherency with prepare call for source field");
MEDCouplingFieldDouble *ret=MEDCouplingFieldDouble::New(*_target_ft,srcField->getTimeDiscretization());
{
if(!targetField)
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::transferField : input targetField is NULL !");
- targetField->checkCoherency();
+ targetField->checkConsistencyLight();
checkPrepare();
if(_target_ft->getDiscretization()->getStringRepr()!=targetField->getDiscretization()->getStringRepr())
throw INTERP_KERNEL::Exception("Incoherency with prepare call for target field");
*
* - NOT_IK_ONLY_FORCED (3) : Only \b NOT INTERP_KERNEL only method will be launched.
*
- * \input newInterpMatPol the new interpolation matrix method policy. This parameter is of type \c int and not of type \c ParaMEDMEM::InterpolationMatrixPolicy
+ * \input newInterpMatPol the new interpolation matrix method policy. This parameter is of type \c int and not of type \c MEDCoupling::InterpolationMatrixPolicy
* for automatic generation of CORBA component.
*
* \sa MEDCouplingRemapper::getInterpolationMatrixPolicy
{
std::string srcMeth,trgMeth;
std::string methC=checkAndGiveInterpolationMethodStr(srcMeth,trgMeth);
- const MEDCouplingExtrudedMesh *src_mesh=static_cast<const MEDCouplingExtrudedMesh *>(_src_ft->getMesh());
- const MEDCouplingExtrudedMesh *target_mesh=static_cast<const MEDCouplingExtrudedMesh *>(_target_ft->getMesh());
+ const MEDCouplingMappedExtrudedMesh *src_mesh=static_cast<const MEDCouplingMappedExtrudedMesh *>(_src_ft->getMesh());
+ const MEDCouplingMappedExtrudedMesh *target_mesh=static_cast<const MEDCouplingMappedExtrudedMesh *>(_target_ft->getMesh());
if(methC!="P0P0")
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::prepareInterpKernelOnlyEE : Only P0P0 method implemented for Extruded/Extruded meshes !");
MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(src_mesh->getMesh2D());
int nbCols2D=interpolation2D.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,matrix2D,methC);
MEDCouplingUMesh *s1D,*t1D;
double v[3];
- MEDCouplingExtrudedMesh::Project1DMeshes(src_mesh->getMesh1D(),target_mesh->getMesh1D(),getPrecision(),s1D,t1D,v);
+ MEDCouplingMappedExtrudedMesh::Project1DMeshes(src_mesh->getMesh1D(),target_mesh->getMesh1D(),getPrecision(),s1D,t1D,v);
MEDCouplingNormalizedUnstructuredMesh<1,1> s1DWrapper(s1D);
MEDCouplingNormalizedUnstructuredMesh<1,1> t1DWrapper(t1D);
std::vector<std::map<int,double> > matrix1D;
{
if(getIntersectionType()!=INTERP_KERNEL::PointLocator)
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::prepareNotInterpKernelOnlyGaussGauss : The intersection type is not supported ! Only PointLocator is supported for Gauss->Gauss interpolation ! Please invoke setIntersectionType(PointLocator) on the MEDCouplingRemapper instance !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> trgLoc=_target_ft->getLocalizationOfDiscr();
+ MCAuto<DataArrayDouble> trgLoc=_target_ft->getLocalizationOfDiscr();
const double *trgLocPtr=trgLoc->begin();
int trgSpaceDim=trgLoc->getNumberOfComponents();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> srcOffsetArr=_src_ft->getDiscretization()->getOffsetArr(_src_ft->getMesh());
+ MCAuto<DataArrayInt> srcOffsetArr=_src_ft->getDiscretization()->getOffsetArr(_src_ft->getMesh());
if(trgSpaceDim!=_src_ft->getMesh()->getSpaceDimension())
{
std::ostringstream oss; oss << "MEDCouplingRemapper::prepareNotInterpKernelOnlyGaussGauss : space dimensions mismatch between source and target !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
const int *srcOffsetArrPtr=srcOffsetArr->begin();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> srcLoc=_src_ft->getLocalizationOfDiscr();
+ MCAuto<DataArrayDouble> srcLoc=_src_ft->getLocalizationOfDiscr();
const double *srcLocPtr=srcLoc->begin();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsArr,eltsIndexArr;
+ MCAuto<DataArrayInt> eltsArr,eltsIndexArr;
int trgNbOfGaussPts=trgLoc->getNumberOfTuples();
_matrix.resize(trgNbOfGaussPts);
_src_ft->getMesh()->getCellsContainingPoints(trgLoc->begin(),trgNbOfGaussPts,getPrecision(),eltsArr,eltsIndexArr);
const int *elts(eltsArr->begin()),*eltsIndex(eltsIndexArr->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nbOfSrcCellsShTrgPts(eltsIndexArr->deltaShiftIndex());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids0=nbOfSrcCellsShTrgPts->getIdsNotEqual(0);
+ MCAuto<DataArrayInt> nbOfSrcCellsShTrgPts(eltsIndexArr->deltaShiftIndex());
+ MCAuto<DataArrayInt> ids0=nbOfSrcCellsShTrgPts->findIdsNotEqual(0);
for(const int *trgId=ids0->begin();trgId!=ids0->end();trgId++)
{
const double *ptTrg=trgLocPtr+trgSpaceDim*(*trgId);
}
if(ids0->getNumberOfTuples()!=trgNbOfGaussPts)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> orphanTrgIds=nbOfSrcCellsShTrgPts->getIdsEqual(0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> orphanTrg=trgLoc->selectByTupleId(orphanTrgIds->begin(),orphanTrgIds->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> srcIdPerTrg=srcLoc->findClosestTupleId(orphanTrg);
+ MCAuto<DataArrayInt> orphanTrgIds=nbOfSrcCellsShTrgPts->findIdsEqual(0);
+ MCAuto<DataArrayDouble> orphanTrg=trgLoc->selectByTupleId(orphanTrgIds->begin(),orphanTrgIds->end());
+ MCAuto<DataArrayInt> srcIdPerTrg=srcLoc->findClosestTupleId(orphanTrg);
const int *srcIdPerTrgPtr=srcIdPerTrg->begin();
for(const int *orphanTrgId=orphanTrgIds->begin();orphanTrgId!=orphanTrgIds->end();orphanTrgId++,srcIdPerTrgPtr++)
_matrix[*orphanTrgId][*srcIdPerTrgPtr]=2.;
{
if(!srcField || !targetField)
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::transferUnderground : srcField or targetField is NULL !");
- srcField->checkCoherency();
+ srcField->checkConsistencyLight();
checkPrepare();
if(_src_ft->getDiscretization()->getStringRepr()!=srcField->getDiscretization()->getStringRepr())
throw INTERP_KERNEL::Exception("Incoherency with prepare call for source field");
int srcNbOfCompo(srcField->getNumberOfComponents());
if(array)
{
- targetField->checkCoherency();
+ targetField->checkConsistencyLight();
if(srcNbOfCompo!=targetField->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Number of components mismatch !");
}
{
if(!isDftVal)
throw INTERP_KERNEL::Exception("MEDCouplingRemapper::partialTransfer : This method requires that the array of target field exists ! Allocate it or call MEDCouplingRemapper::transfer instead !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> tmp(DataArrayDouble::New());
tmp->alloc(targetField->getNumberOfTuples(),srcNbOfCompo);
targetField->setArray(tmp);
}
_time_deno_update=getTimeOfThis();
switch(_nature_of_deno)
{
- case ConservativeVolumic:
+ case IntensiveMaximum:
{
ComputeRowSumAndColSum(_matrix,_deno_multiply,_deno_reverse_multiply);
break;
}
- case Integral:
+ case ExtensiveMaximum:
{
MEDCouplingFieldDouble *deno=srcField->getDiscretization()->getMeasureField(srcField->getMesh(),getMeasureAbsStatus());
MEDCouplingFieldDouble *denoR=trgField->getDiscretization()->getMeasureField(trgField->getMesh(),getMeasureAbsStatus());
denoR->decrRef();
break;
}
- case IntegralGlobConstraint:
+ case ExtensiveConservation:
{
ComputeColSumAndRowSum(_matrix,_deno_multiply,_deno_reverse_multiply);
break;
}
- case RevIntegral:
+ case IntensiveConservation:
{
MEDCouplingFieldDouble *deno=trgField->getDiscretization()->getMeasureField(trgField->getMesh(),getMeasureAbsStatus());
MEDCouplingFieldDouble *denoR=srcField->getDiscretization()->getMeasureField(srcField->getMesh(),getMeasureAbsStatus());
#include "MEDCouplingTimeLabel.hxx"
#include "InterpolationOptions.hxx"
#include "MEDCouplingNatureOfField.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelException.hxx"
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingMesh;
class MEDCouplingFieldDouble;
class MEDCouplingFieldTemplate;
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
static void ComputeColSumAndRowSum(const std::vector<std::map<int,double> >& matrixDeno,
std::vector<std::map<int,double> >& deno, std::vector<std::map<int,double> >& denoReverse);
private:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> _src_ft;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldTemplate> _target_ft;
+ MCAuto<MEDCouplingFieldTemplate> _src_ft;
+ MCAuto<MEDCouplingFieldTemplate> _target_ft;
InterpolationMatrixPolicy _interp_matrix_pol;
NatureOfField _nature_of_deno;
unsigned int _time_deno_update;
#include "MEDCouplingSkyLineArray.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingSkyLineArray::MEDCouplingSkyLineArray():
_index( DataArrayInt::New() ), _value( DataArrayInt::New() )
#include "MEDCoupling.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCOUPLING_EXPORT MEDCouplingSkyLineArray
{
private:
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _index;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _value;
+ MCAuto<DataArrayInt> _index;
+ MCAuto<DataArrayInt> _value;
public:
MEDCouplingSkyLineArray();
MEDCouplingSkyLineArray( const MEDCouplingSkyLineArray &myArray );
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCouplingStructuredMesh::MEDCouplingStructuredMesh()
{
DataArrayInt *MEDCouplingStructuredMesh::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
if(getTypeOfCell(0)==type)
{
ret->alloc(getNumberOfCells(),1);
DataArrayInt *MEDCouplingStructuredMesh::computeNbOfNodesPerCell() const
{
int nbCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbCells,1);
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(getTypeOfCell(0));
ret->fillWithValue((int)cm.getNumberOfNodes());
DataArrayInt *MEDCouplingStructuredMesh::computeNbOfFacesPerCell() const
{
int nbCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbCells,1);
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(getTypeOfCell(0));
ret->fillWithValue((int)cm.getNumberOfSons());
code.resize(3); idsInPflPerType.resize(1);
code[0]=(int)getTypeOfCell(0); code[1]=nbOfCells;
idsInPflPerType.resize(1);
- if(profile->isIdentity2(nbOfCells))
+ if(profile->isIota(nbOfCells))
{
code[2]=-1;
- idsInPflPerType[0]=profile->deepCpy();
+ idsInPflPerType[0]=profile->deepCopy();
idsPerType.clear();
return ;
}
code[2]=0;
profile->checkAllIdsInRange(0,nbOfCells);
idsPerType.resize(1);
- idsPerType[0]=profile->deepCpy();
+ idsPerType[0]=profile->deepCopy();
idsInPflPerType[0]=DataArrayInt::Range(0,nbTuples,1);
}
int meshDim(getMeshDimension()),spaceDim(getSpaceDimensionOnNodeStruct());
if((meshDim<0 || meshDim>3) || (spaceDim<0 || spaceDim>3))
throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::build1SGTUnstructured : meshdim and spacedim must be in [1,2,3] !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords(getCoordinatesAndOwner());
+ MCAuto<DataArrayDouble> coords(getCoordinatesAndOwner());
int ns[3];
getNodeGridStructure(ns);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(Build1GTNodalConnectivity(ns,ns+spaceDim));
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),GetGeoTypeGivenMeshDimension(meshDim)));
+ MCAuto<DataArrayInt> conn(Build1GTNodalConnectivity(ns,ns+spaceDim));
+ MCAuto<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),GetGeoTypeGivenMeshDimension(meshDim)));
ret->setNodalConnectivity(conn); ret->setCoords(coords);
try
{ ret->copyTinyInfoFrom(this); }
int meshDim(getMeshDimension());
if(meshDim<1 || meshDim>3)
throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::build1SGTSubLevelMesh : meshdim must be in [2,3] !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords(getCoordinatesAndOwner());
+ MCAuto<DataArrayDouble> coords(getCoordinatesAndOwner());
int ns[3];
getNodeGridStructure(ns);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(Build1GTNodalConnectivityOfSubLevelMesh(ns,ns+meshDim));
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),GetGeoTypeGivenMeshDimension(meshDim-1)));
+ MCAuto<DataArrayInt> conn(Build1GTNodalConnectivityOfSubLevelMesh(ns,ns+meshDim));
+ MCAuto<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),GetGeoTypeGivenMeshDimension(meshDim-1)));
ret->setNodalConnectivity(conn); ret->setCoords(coords);
return ret.retn();
}
*/
MEDCouplingUMesh *MEDCouplingStructuredMesh::buildUnstructured() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret0(build1SGTUnstructured());
+ MCAuto<MEDCoupling1SGTUMesh> ret0(build1SGTUnstructured());
return ret0->buildUnstructured();
}
std::vector< std::pair<int,int> > cellPartFormat,nodePartFormat;
if(IsPartStructured(start,end,cgs,cellPartFormat))
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingStructuredMesh> ret(buildStructuredSubPart(cellPartFormat));
+ MCAuto<MEDCouplingStructuredMesh> ret(buildStructuredSubPart(cellPartFormat));
nodePartFormat=cellPartFormat;
for(std::vector< std::pair<int,int> >::iterator it=nodePartFormat.begin();it!=nodePartFormat.end();it++)
(*it).second++;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1(BuildExplicitIdsFrom(getNodeGridStructure(),nodePartFormat));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp2(DataArrayInt::New()); tmp2->alloc(getNumberOfNodes(),1);
+ MCAuto<DataArrayInt> tmp1(BuildExplicitIdsFrom(getNodeGridStructure(),nodePartFormat));
+ MCAuto<DataArrayInt> tmp2(DataArrayInt::New()); tmp2->alloc(getNumberOfNodes(),1);
tmp2->fillWithValue(-1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp3(DataArrayInt::New()); tmp3->alloc(tmp1->getNumberOfTuples(),1); tmp3->iota(0);
+ MCAuto<DataArrayInt> tmp3(DataArrayInt::New()); tmp3->alloc(tmp1->getNumberOfTuples(),1); tmp3->iota(0);
tmp2->setPartOfValues3(tmp3,tmp1->begin(),tmp1->end(),0,1,1);
arr=tmp2.retn();
return ret.retn();
{
case 0:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
conn->alloc(1,1); conn->setIJ(0,0,0);
return conn.retn();
}
if(ghostLev<0)
throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::ComputeCornersGhost : ghost lev must be >= 0 !");
std::size_t dim(st.size());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
switch(dim)
{
case 1:
DataArrayInt *MEDCouplingStructuredMesh::Build1GTNodalConnectivity1D(const int *nodeStBg)
{
int nbOfCells(*nodeStBg-1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
conn->alloc(2*nbOfCells,1);
int *cp=conn->getPointer();
for(int i=0;i<nbOfCells;i++)
{
int n1=nodeStBg[0]-1;
int n2=nodeStBg[1]-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
conn->alloc(4*n1*n2,1);
int *cp=conn->getPointer();
int pos=0;
int n1=nodeStBg[0]-1;
int n2=nodeStBg[1]-1;
int n3=nodeStBg[2]-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
conn->alloc(8*n1*n2*n3,1);
int *cp=conn->getPointer();
int pos=0;
std::vector<int> ngs(3);
int n0(nodeStBg[0]-1),n1(nodeStBg[1]-1),n2(nodeStBg[2]-1); ngs[0]=n0; ngs[1]=n1; ngs[2]=n2;
int off0(nodeStBg[0]),off1(nodeStBg[0]*nodeStBg[1]);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
conn->alloc(4*GetNumberOfCellsOfSubLevelMesh(ngs,3));
int *cp(conn->getPointer());
//X
std::vector<int> ngs(2);
int n0(nodeStBg[0]-1),n1(nodeStBg[1]-1); ngs[0]=n0; ngs[1]=n1;
int off0(nodeStBg[0]);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
conn->alloc(2*GetNumberOfCellsOfSubLevelMesh(ngs,2));
int *cp(conn->getPointer());
//X
throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom : invalid size of input array of double regarding the structure !");
std::vector<int> dims(GetDimensionsFromCompactFrmt(partCompactFormat));
int nbOfTuplesOfOutField(DeduceNumberOfGivenStructure(dims)),nbComp(fieldOfDbl->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfTuplesOfOutField,nbComp);
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfTuplesOfOutField,nbComp);
ret->copyStringInfoFrom(*fieldOfDbl);
double *ptRet(ret->getPointer());
const double *fieldOfDblPtr(fieldOfDbl->begin());
dims[i]=partCompactFormat[i].second-partCompactFormat[i].first;
nbOfItems*=dims[i];
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
ret->alloc(nbOfItems,1);
int *pt(ret->getPointer());
switch(st.size())
#include "MEDCoupling.hxx"
#include "MEDCouplingMesh.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCoupling1SGTUMesh;
static int ZipNodeStructure(const int *nodeStBg, const int *nodeStEnd, int zipNodeSt[3]);
protected:
MEDCOUPLING_EXPORT MEDCouplingStructuredMesh();
- MEDCOUPLING_EXPORT MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCpy);
+ MEDCOUPLING_EXPORT MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCopy);
MEDCOUPLING_EXPORT ~MEDCouplingStructuredMesh();
};
}
// Author : Anthony Geay (CEA/DEN)
#include "MEDCouplingTimeDiscretization.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingMesh.hxx"
#include <algorithm>
#include <functional>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const double MEDCouplingTimeDiscretization::TIME_TOLERANCE_DFT=1.e-12;
_array->copyStringInfoFrom(*other._array);
}
-void MEDCouplingTimeDiscretization::checkCoherency() const
+void MEDCouplingTimeDiscretization::checkConsistencyLight() const
{
if(!_array)
throw INTERP_KERNEL::Exception("Field invalid because no values set !");
return _array->isEqualWithoutConsideringStr(*other->_array,prec);
}
-MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCopy) const
{
MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(type);
ret->setTimeUnit(getTimeUnit());
const DataArrayDouble *arrSrc=getArray();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr;
+ MCAuto<DataArrayDouble> arr;
if(arrSrc)
- arr=arrSrc->performCpy(deepCpy);
+ arr=arrSrc->performCopyOrIncrRef(deepCopy);
ret->setArray(arr,0);
return ret;
}
{
}
-MEDCouplingTimeDiscretization::MEDCouplingTimeDiscretization(const MEDCouplingTimeDiscretization& other, bool deepCpy):_time_unit(other._time_unit),_time_tolerance(other._time_tolerance)
+MEDCouplingTimeDiscretization::MEDCouplingTimeDiscretization(const MEDCouplingTimeDiscretization& other, bool deepCopy):_time_unit(other._time_unit),_time_tolerance(other._time_tolerance)
{
if(other._array)
- _array=other._array->performCpy(deepCpy);
+ _array=other._array->performCopyOrIncrRef(deepCopy);
else
_array=0;
}
ret->setTimeUnit(getTimeUnit());
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
bool newArr=false;
for(std::size_t j=0;j<arrays.size();j++)
{
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::applyFunc2(int nbOfComp, const std::string& func)
+void MEDCouplingTimeDiscretization::applyFuncCompo(int nbOfComp, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
- arrays2[j]=arrays[j]->applyFunc2(nbOfComp,func);
+ arrays2[j]=arrays[j]->applyFuncCompo(nbOfComp,func);
else
arrays2[j]=0;
}
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
+void MEDCouplingTimeDiscretization::applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
- arrays2[j]=arrays[j]->applyFunc3(nbOfComp,varsOrder,func);
+ arrays2[j]=arrays[j]->applyFuncNamedCompo(nbOfComp,varsOrder,func);
else
arrays2[j]=0;
}
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
{
if(arrays[j])
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
arrays2[j]=loc->applyFunc(nbOfComp,func);
std::vector<DataArrayDouble *> arrays3(arrays.size());
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
arrays2[j]=loc->applyFunc(nbOfComp,func);
std::vector<DataArrayDouble *> arrays3(arrays.size());
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const std::string& func)
+void MEDCouplingTimeDiscretization::fillFromAnalyticCompo(const DataArrayDouble *loc, int nbOfComp, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
- arrays2[j]=loc->applyFunc2(nbOfComp,func);
+ arrays2[j]=loc->applyFuncCompo(nbOfComp,func);
std::vector<DataArrayDouble *> arrays3(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
arrays3[j]=arrays2[j];
setArrays(arrays3,0);
}
-void MEDCouplingTimeDiscretization::fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
+void MEDCouplingTimeDiscretization::fillFromAnalyticNamedCompo(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func)
{
std::vector<DataArrayDouble *> arrays;
getArrays(arrays);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ std::vector< MCAuto<DataArrayDouble> > arrays2(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
- arrays2[j]=loc->applyFunc3(nbOfComp,varsOrder,func);
+ arrays2[j]=loc->applyFuncNamedCompo(nbOfComp,varsOrder,func);
std::vector<DataArrayDouble *> arrays3(arrays.size());
for(std::size_t j=0;j<arrays.size();j++)
arrays3[j]=arrays2[j];
{
}
-MEDCouplingNoTimeLabel::MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCpy):MEDCouplingTimeDiscretization(other,deepCpy)
+MEDCouplingNoTimeLabel::MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCopy):MEDCouplingTimeDiscretization(other,deepCopy)
{
}
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::aggregation on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
throw INTERP_KERNEL::Exception("NoTimeLabel::aggregate on mismatched time discretization !");
a[i]=itC->getArray();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::meld on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setTimeTolerance(getTimeTolerance());
ret->setArray(arr,0);
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::dot on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::crossProduct on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::max on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::max on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::add on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
throw INTERP_KERNEL::Exception("NoTimeLabel::substract on mismatched time discretization !");
if(!getArray())
throw INTERP_KERNEL::Exception("MEDCouplingNoTimeLabel::substract : Data Array is NULL !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("NoTimeLabel::multiply on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("divide on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("pow on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
ret->setArray(arr,0);
return ret;
getArray()->powEqual(other->getArray());
}
-MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::performCpy(bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::performCopyOrIncrRef(bool deepCopy) const
{
- return new MEDCouplingNoTimeLabel(*this,deepCpy);
+ return new MEDCouplingNoTimeLabel(*this,deepCopy);
}
void MEDCouplingNoTimeLabel::checkTimePresence(double time) const
_time_tolerance=tinyInfoD[0];
}
-MEDCouplingWithTimeStep::MEDCouplingWithTimeStep(const MEDCouplingWithTimeStep& other, bool deepCpy):MEDCouplingTimeDiscretization(other,deepCpy),
+MEDCouplingWithTimeStep::MEDCouplingWithTimeStep(const MEDCouplingWithTimeStep& other, bool deepCopy):MEDCouplingTimeDiscretization(other,deepCopy),
_time(other._time),_iteration(other._iteration),_order(other._order)
{
}
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::aggregation on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
return ret;
throw INTERP_KERNEL::Exception("WithTimeStep::aggregate on mismatched time discretization !");
a[i]=itC->getArray();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
return ret;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::meld on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
return ret;
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::dot on mismatched time discretization !");
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
ret->setArray(arr,0);
return ret;
}
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::crossProduct on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
return ret;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::max on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
return ret;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::min on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
return ret;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::add on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::substract on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::multiply on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::divide on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("WithTimeStep::pow on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
ret->setArray(arr,0);
int tmp1,tmp2;
getArray()->powEqual(other->getArray());
}
-MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::performCpy(bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::performCopyOrIncrRef(bool deepCopy) const
{
- return new MEDCouplingWithTimeStep(*this,deepCpy);
+ return new MEDCouplingWithTimeStep(*this,deepCopy);
}
void MEDCouplingWithTimeStep::checkNoTimePresence() const
_end_time=tinyInfoD[2];
}
-MEDCouplingConstOnTimeInterval::MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCpy):
- MEDCouplingTimeDiscretization(other,deepCpy),_start_time(other._start_time),_end_time(other._end_time),_start_iteration(other._start_iteration),
+MEDCouplingConstOnTimeInterval::MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCopy):
+ MEDCouplingTimeDiscretization(other,deepCopy),_start_time(other._start_time),_end_time(other._end_time),_start_iteration(other._start_iteration),
_end_iteration(other._end_iteration),_start_order(other._start_order),_end_order(other._end_order)
{
}
_time_unit=tUnit;
}
-MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::performCpy(bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::performCopyOrIncrRef(bool deepCopy) const
{
- return new MEDCouplingConstOnTimeInterval(*this,deepCpy);
+ return new MEDCouplingConstOnTimeInterval(*this,deepCopy);
}
std::vector< const DataArrayDouble *> MEDCouplingConstOnTimeInterval::getArraysForTime(double time) const
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::aggregation on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
return ret;
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::aggregate on mismatched time discretization !");
a[i]=itC->getArray();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
return ret;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::meld on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Meld(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setTimeTolerance(getTimeTolerance());
ret->setArray(arr,0);
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::dot on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Dot(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
return ret;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::crossProduct on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::CrossProduct(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
return ret;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::max on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Max(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
return ret;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::min on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Min(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
return ret;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::add on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Add(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("ConstOnTimeInterval::substract on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Substract(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("multiply on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Multiply(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("divide on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Divide(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
int tmp1,tmp2;
const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("pow on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
ret->setArray(arr,0);
int tmp1,tmp2;
getArray()->powEqual(other->getArray());
}
-MEDCouplingTwoTimeSteps::MEDCouplingTwoTimeSteps(const MEDCouplingTwoTimeSteps& other, bool deepCpy):MEDCouplingTimeDiscretization(other,deepCpy),
+MEDCouplingTwoTimeSteps::MEDCouplingTwoTimeSteps(const MEDCouplingTwoTimeSteps& other, bool deepCopy):MEDCouplingTimeDiscretization(other,deepCopy),
_start_time(other._start_time),_end_time(other._end_time),
_start_iteration(other._start_iteration),_end_iteration(other._end_iteration),
_start_order(other._start_order),_end_order(other._end_order)
{
if(other._end_array)
- _end_array=other._end_array->performCpy(deepCpy);
+ _end_array=other._end_array->performCopyOrIncrRef(deepCopy);
else
_end_array=0;
}
return _end_array;
}
-void MEDCouplingTwoTimeSteps::checkCoherency() const
+void MEDCouplingTwoTimeSteps::checkConsistencyLight() const
{
- MEDCouplingTimeDiscretization::checkCoherency();
+ MEDCouplingTimeDiscretization::checkConsistencyLight();
if(!_end_array)
throw INTERP_KERNEL::Exception("No end array specified !");
if(_array->getNumberOfComponents()!=_end_array->getNumberOfComponents())
setEndArray(arrays.back(),owner);
}
-MEDCouplingLinearTime::MEDCouplingLinearTime(const MEDCouplingLinearTime& other, bool deepCpy):MEDCouplingTwoTimeSteps(other,deepCpy)
+MEDCouplingLinearTime::MEDCouplingLinearTime(const MEDCouplingLinearTime& other, bool deepCopy):MEDCouplingTwoTimeSteps(other,deepCopy)
{
}
return stream.str();
}
-void MEDCouplingLinearTime::checkCoherency() const
+void MEDCouplingLinearTime::checkConsistencyLight() const
{
- MEDCouplingTwoTimeSteps::checkCoherency();
+ MEDCouplingTwoTimeSteps::checkConsistencyLight();
if(std::fabs(_start_time-_end_time)<_time_tolerance)
throw INTERP_KERNEL::Exception("Start time and end time are equals regarding time tolerance.");
}
-MEDCouplingTimeDiscretization *MEDCouplingLinearTime::performCpy(bool deepCpy) const
+MEDCouplingTimeDiscretization *MEDCouplingLinearTime::performCopyOrIncrRef(bool deepCopy) const
{
- return new MEDCouplingLinearTime(*this,deepCpy);
+ return new MEDCouplingLinearTime(*this,deepCopy);
}
bool MEDCouplingLinearTime::areCompatible(const MEDCouplingTimeDiscretization *other) const
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::aggregation on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Aggregate(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Aggregate(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Aggregate(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Aggregate(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
a[i]=itC->getArray();
b[i]=itC->getEndArray();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Aggregate(b);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::Aggregate(a);
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Aggregate(b);
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr,0);
ret->setEndArray(arr2,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::meld on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Meld(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Meld(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Meld(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Meld(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setTimeTolerance(getTimeTolerance());
ret->setArray(arr1,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::dot on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Dot(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Dot(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Dot(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Dot(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::crossProduct on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::CrossProduct(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::CrossProduct(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::CrossProduct(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::CrossProduct(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::max on mismatched time discretization !");
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Max(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Max(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Max(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Max(getEndArray(),other->getEndArray());
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
return ret;
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::min on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Min(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Min(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Min(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Min(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::add on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Add(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Add(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Add(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Add(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::substract on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Substract(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Substract(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Substract(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Substract(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::multiply on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Multiply(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Multiply(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Multiply(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Multiply(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::divide on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Divide(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Divide(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Divide(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Divide(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
if(!otherC)
throw INTERP_KERNEL::Exception("LinearTime::pow on mismatched time discretization !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Pow(getArray(),other->getArray());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Pow(getEndArray(),other->getEndArray());
+ MCAuto<DataArrayDouble> arr1=DataArrayDouble::Pow(getArray(),other->getArray());
+ MCAuto<DataArrayDouble> arr2=DataArrayDouble::Pow(getEndArray(),other->getEndArray());
MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
ret->setArray(arr1,0);
ret->setEndArray(arr2,0);
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingMesh;
class DataArrayDouble;
{
protected:
MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization();
- MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization(const MEDCouplingTimeDiscretization& other, bool deepCpy);
+ MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization(const MEDCouplingTimeDiscretization& other, bool deepCopy);
public:
MEDCOUPLING_EXPORT void updateTime() const;
MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT std::string getTimeUnit() const { return _time_unit; }
MEDCOUPLING_EXPORT virtual void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other);
MEDCOUPLING_EXPORT virtual void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other);
- MEDCOUPLING_EXPORT virtual void checkCoherency() const;
+ MEDCOUPLING_EXPORT virtual void checkConsistencyLight() const;
MEDCOUPLING_EXPORT virtual bool areCompatible(const MEDCouplingTimeDiscretization *other) const;
MEDCOUPLING_EXPORT virtual bool areStrictlyCompatible(const MEDCouplingTimeDiscretization *other, std::string& reason) const;
MEDCOUPLING_EXPORT virtual bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const;
MEDCOUPLING_EXPORT virtual bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT virtual bool isEqual(const MEDCouplingTimeDiscretization *other, double prec) const;
MEDCOUPLING_EXPORT virtual bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const;
- MEDCOUPLING_EXPORT virtual MEDCouplingTimeDiscretization *buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCpy) const;
+ MEDCOUPLING_EXPORT virtual MEDCouplingTimeDiscretization *buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCopy) const;
MEDCOUPLING_EXPORT virtual std::string getStringRepr() const = 0;
MEDCOUPLING_EXPORT virtual TypeOfTimeDiscretization getEnum() const = 0;
MEDCOUPLING_EXPORT virtual void synchronizeTimeWith(const MEDCouplingMesh *mesh) = 0;
MEDCOUPLING_EXPORT virtual void getTinySerializationIntInformation2(std::vector<int>& tinyInfo) const = 0;
MEDCOUPLING_EXPORT virtual void getTinySerializationDbleInformation2(std::vector<double>& tinyInfo) const = 0;
MEDCOUPLING_EXPORT virtual void finishUnserialization2(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD) = 0;
- MEDCOUPLING_EXPORT virtual MEDCouplingTimeDiscretization *performCpy(bool deepCpy) const = 0;
+ MEDCOUPLING_EXPORT virtual MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const = 0;
MEDCOUPLING_EXPORT void setTimeTolerance(double val) { _time_tolerance=val; }
MEDCOUPLING_EXPORT double getTimeTolerance() const { return _time_tolerance; }
MEDCOUPLING_EXPORT virtual void checkNoTimePresence() const = 0;
MEDCOUPLING_EXPORT virtual void applyLin(double a, double b);
MEDCOUPLING_EXPORT virtual void applyFunc(int nbOfComp, FunctionToEvaluate func);
MEDCOUPLING_EXPORT virtual void applyFunc(int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT virtual void applyFunc2(int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT virtual void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void applyFuncCompo(int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
MEDCOUPLING_EXPORT virtual void applyFunc(const std::string& func);
MEDCOUPLING_EXPORT virtual void applyFuncFast32(const std::string& func);
MEDCOUPLING_EXPORT virtual void applyFuncFast64(const std::string& func);
MEDCOUPLING_EXPORT virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func);
MEDCOUPLING_EXPORT virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT virtual void fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const std::string& func);
- MEDCOUPLING_EXPORT virtual void fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void fillFromAnalyticCompo(const DataArrayDouble *loc, int nbOfComp, const std::string& func);
+ MEDCOUPLING_EXPORT virtual void fillFromAnalyticNamedCompo(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func);
//
MEDCOUPLING_EXPORT virtual ~MEDCouplingTimeDiscretization();
protected:
{
public:
MEDCOUPLING_EXPORT MEDCouplingNoTimeLabel();
- MEDCOUPLING_EXPORT MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCpy);
+ MEDCOUPLING_EXPORT MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCopy);
MEDCOUPLING_EXPORT std::string getStringRepr() const;
MEDCOUPLING_EXPORT TypeOfTimeDiscretization getEnum() const { return DISCRETIZATION; }
MEDCOUPLING_EXPORT void synchronizeTimeWith(const MEDCouplingMesh *mesh);
MEDCOUPLING_EXPORT bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const;
MEDCOUPLING_EXPORT bool areStrictlyCompatibleForDiv(const MEDCouplingTimeDiscretization *other) const;
MEDCOUPLING_EXPORT bool areCompatibleForMeld(const MEDCouplingTimeDiscretization *other) const;
- MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCpy(bool deepCpy) const;
+ MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const;
MEDCOUPLING_EXPORT void checkNoTimePresence() const { }
MEDCOUPLING_EXPORT void checkTimePresence(double time) const;
MEDCOUPLING_EXPORT std::vector< const DataArrayDouble *> getArraysForTime(double time) const;
class MEDCouplingWithTimeStep : public MEDCouplingTimeDiscretization
{
protected:
- MEDCOUPLING_EXPORT MEDCouplingWithTimeStep(const MEDCouplingWithTimeStep& other, bool deepCpy);
+ MEDCOUPLING_EXPORT MEDCouplingWithTimeStep(const MEDCouplingWithTimeStep& other, bool deepCopy);
public:
MEDCOUPLING_EXPORT MEDCouplingWithTimeStep();
MEDCOUPLING_EXPORT std::string getStringRepr() const;
MEDCOUPLING_EXPORT void getTinySerializationIntInformation2(std::vector<int>& tinyInfo) const;
MEDCOUPLING_EXPORT void getTinySerializationDbleInformation2(std::vector<double>& tinyInfo) const;
MEDCOUPLING_EXPORT void finishUnserialization2(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD);
- MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCpy(bool deepCpy) const;
+ MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const;
MEDCOUPLING_EXPORT void checkNoTimePresence() const;
MEDCOUPLING_EXPORT void checkTimePresence(double time) const;
MEDCOUPLING_EXPORT void setStartTime(double time, int iteration, int order) { _time=time; _iteration=iteration; _order=order; }
class MEDCouplingConstOnTimeInterval : public MEDCouplingTimeDiscretization
{
protected:
- MEDCOUPLING_EXPORT MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCpy);
+ MEDCOUPLING_EXPORT MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCopy);
public:
MEDCOUPLING_EXPORT MEDCouplingConstOnTimeInterval();
MEDCOUPLING_EXPORT void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other);
MEDCOUPLING_EXPORT void getTinySerializationIntInformation2(std::vector<int>& tinyInfo) const;
MEDCOUPLING_EXPORT void getTinySerializationDbleInformation2(std::vector<double>& tinyInfo) const;
MEDCOUPLING_EXPORT void finishUnserialization2(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD);
- MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCpy(bool deepCpy) const;
+ MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const;
MEDCOUPLING_EXPORT bool areCompatible(const MEDCouplingTimeDiscretization *other) const;
MEDCOUPLING_EXPORT bool areStrictlyCompatible(const MEDCouplingTimeDiscretization *other, std::string& reason) const;
MEDCOUPLING_EXPORT bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const;
class MEDCouplingTwoTimeSteps : public MEDCouplingTimeDiscretization
{
protected:
- MEDCOUPLING_EXPORT MEDCouplingTwoTimeSteps(const MEDCouplingTwoTimeSteps& other, bool deepCpy);
+ MEDCOUPLING_EXPORT MEDCouplingTwoTimeSteps(const MEDCouplingTwoTimeSteps& other, bool deepCopy);
MEDCOUPLING_EXPORT MEDCouplingTwoTimeSteps();
MEDCOUPLING_EXPORT ~MEDCouplingTwoTimeSteps();
public:
MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other);
MEDCOUPLING_EXPORT const DataArrayDouble *getEndArray() const;
MEDCOUPLING_EXPORT DataArrayDouble *getEndArray();
- MEDCOUPLING_EXPORT void checkCoherency() const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const;
MEDCOUPLING_EXPORT void checkNoTimePresence() const;
class MEDCouplingLinearTime : public MEDCouplingTwoTimeSteps
{
protected:
- MEDCOUPLING_EXPORT MEDCouplingLinearTime(const MEDCouplingLinearTime& other, bool deepCpy);
+ MEDCOUPLING_EXPORT MEDCouplingLinearTime(const MEDCouplingLinearTime& other, bool deepCopy);
public:
MEDCOUPLING_EXPORT MEDCouplingLinearTime();
MEDCOUPLING_EXPORT std::string getStringRepr() const;
MEDCOUPLING_EXPORT TypeOfTimeDiscretization getEnum() const { return DISCRETIZATION; }
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCpy(bool deepCpy) const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const;
MEDCOUPLING_EXPORT bool areCompatible(const MEDCouplingTimeDiscretization *other) const;
MEDCOUPLING_EXPORT bool areStrictlyCompatible(const MEDCouplingTimeDiscretization *other, std::string& reason) const;
MEDCOUPLING_EXPORT bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const;
#include <limits>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
std::size_t TimeLabel::GLOBAL_TIME=0;
#include <cstddef>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Class representing a label of time of the lastely modified part of this.
#include <limits>
#include <list>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
double MEDCouplingUMesh::EPS_FOR_POLYH_ORIENTATION=1.e-14;
* \return MEDCouplingUMesh * - a new instance of MEDCouplingMesh. The caller is to
* delete this mesh using decrRef() as it is no more needed.
*/
-MEDCouplingUMesh *MEDCouplingUMesh::deepCpy() const
+MEDCouplingUMesh *MEDCouplingUMesh::deepCopy() const
{
return clone(true);
}
}
/*!
- * This method behaves mostly like MEDCouplingUMesh::deepCpy method, except that only nodal connectivity arrays are deeply copied.
+ * This method behaves mostly like MEDCouplingUMesh::deepCopy method, except that only nodal connectivity arrays are deeply copied.
* The coordinates are shared between \a this and the returned instance.
*
* \return MEDCouplingUMesh * - A new object instance holding the copy of \a this (deep for connectivity, shallow for coordiantes)
- * \sa MEDCouplingUMesh::deepCpy
+ * \sa MEDCouplingUMesh::deepCopy
*/
-MEDCouplingUMesh *MEDCouplingUMesh::deepCpyConnectivityOnly() const
+MEDCouplingUMesh *MEDCouplingUMesh::deepCopyConnectivityOnly() const
{
checkConnectivityFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=clone(false);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(getNodalConnectivity()->deepCpy()),ci(getNodalConnectivityIndex()->deepCpy());
+ MCAuto<MEDCouplingUMesh> ret=clone(false);
+ MCAuto<DataArrayInt> c(getNodalConnectivity()->deepCopy()),ci(getNodalConnectivityIndex()->deepCopy());
ret->setConnectivity(c,ci);
return ret.retn();
}
* \throw If the connectivity index data array has more than one component.
* \throw If the connectivity index data array has a named component.
*/
-void MEDCouplingUMesh::checkCoherency() const
+void MEDCouplingUMesh::checkConsistencyLight() const
{
if(_mesh_dim<-1)
throw INTERP_KERNEL::Exception("No mesh dimension specified !");
if(_mesh_dim!=-1)
- MEDCouplingPointSet::checkCoherency();
+ MEDCouplingPointSet::checkConsistencyLight();
for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iter=_types.begin();iter!=_types.end();iter++)
{
if((int)INTERP_KERNEL::CellModel::GetCellModel(*iter).getDimension()!=_mesh_dim)
/*!
* Checks if \a this mesh is well defined. If no exception is thrown by this method,
* then \a this mesh is most probably is writable, exchangeable and available for all
- * algorithms. <br> In addition to the checks performed by checkCoherency(), this
+ * algorithms. <br> In addition to the checks performed by checkConsistencyLight(), this
* method thoroughly checks the nodal connectivity.
* \param [in] eps - a not used parameter.
* \throw If the mesh dimension is not set.
* \throw If number of nodes defining an element does not correspond to the type of element.
* \throw If the nodal connectivity includes an invalid node id.
*/
-void MEDCouplingUMesh::checkCoherency1(double eps) const
+void MEDCouplingUMesh::checkConsistency(double eps) const
{
- checkCoherency();
+ checkConsistencyLight();
if(_mesh_dim==-1)
return ;
int meshDim=getMeshDimension();
if((int)cm.getDimension()!=meshDim)
{
std::ostringstream oss;
- oss << "MEDCouplingUMesh::checkCoherency1 : cell << #" << i<< " with type Type " << cm.getRepr() << " in 'this' whereas meshdim == " << meshDim << " !";
+ oss << "MEDCouplingUMesh::checkConsistency : cell << #" << i<< " with type Type " << cm.getRepr() << " in 'this' whereas meshdim == " << meshDim << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
int nbOfNodesInCell=ptrI[i+1]-ptrI[i]-1;
if(nbOfNodesInCell!=(int)cm.getNumberOfNodes())
{
std::ostringstream oss;
- oss << "MEDCouplingUMesh::checkCoherency1 : cell #" << i << " with static Type '" << cm.getRepr() << "' has " << cm.getNumberOfNodes();
+ oss << "MEDCouplingUMesh::checkConsistency : cell #" << i << " with static Type '" << cm.getRepr() << "' has " << cm.getNumberOfNodes();
oss << " nodes whereas in connectivity there is " << nbOfNodesInCell << " nodes ! Looks very bad !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
if (nbOfNodesInCell % 2 || nbOfNodesInCell < 4)
{
std::ostringstream oss;
- oss << "MEDCouplingUMesh::checkCoherency1 : cell #" << i << " with quadratic type '" << cm.getRepr() << "' has " << nbOfNodesInCell;
+ oss << "MEDCouplingUMesh::checkConsistency : cell #" << i << " with quadratic type '" << cm.getRepr() << "' has " << nbOfNodesInCell;
oss << " nodes. This should be even, and greater or equal than 4!! Looks very bad!";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
int nbOfCells(getNumberOfCells());
if(nbOfCells==0)
return ret;
- if(getMeshLength()<1)
+ if(getNodalConnectivityArrayLen()<1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getAllGeoTypesSorted : the connectivity in this seems invalid !");
const int *c(_nodal_connec->begin()),*ci(_nodal_connec_index->begin());
ret.push_back((INTERP_KERNEL::NormalizedCellType)c[*ci++]);
*/
void MEDCouplingUMesh::computeNeighborsOfCells(DataArrayInt *&neighbors, DataArrayInt *&neighborsIndx) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
+ MCAuto<DataArrayInt> desc=DataArrayInt::New();
+ MCAuto<DataArrayInt> descIndx=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDesc=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDescIndx=DataArrayInt::New();
+ MCAuto<MEDCouplingUMesh> meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
meshDM1=0;
ComputeNeighborsOfCellsAdv(desc,descIndx,revDesc,revDescIndx,neighbors,neighborsIndx);
}
const int *revDescIPtr=revDescIndx->getConstPointer();
//
int nbCells=descIndx->getNumberOfTuples()-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> out0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> out1=DataArrayInt::New(); out1->alloc(nbCells+1,1);
+ MCAuto<DataArrayInt> out0=DataArrayInt::New();
+ MCAuto<DataArrayInt> out1=DataArrayInt::New(); out1->alloc(nbCells+1,1);
int *out1Ptr=out1->getPointer();
*out1Ptr++=0;
out0->reserve(desc->getNumberOfTuples());
{
checkFullyDefined();
int mdim(getMeshDimension()),nbNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc(DataArrayInt::New()),descIndx(DataArrayInt::New()),revDesc(DataArrayInt::New()),revDescIndx(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh1D;
+ MCAuto<DataArrayInt> desc(DataArrayInt::New()),descIndx(DataArrayInt::New()),revDesc(DataArrayInt::New()),revDescIndx(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> mesh1D;
switch(mdim)
{
case 3:
}
desc=DataArrayInt::New(); descIndx=DataArrayInt::New(); revDesc=0; revDescIndx=0;
mesh1D->getReverseNodalConnectivity(desc,descIndx);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret0(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret0(DataArrayInt::New());
ret0->alloc(desc->getNumberOfTuples(),1);
int *r0Pt(ret0->getPointer());
const int *c1DPtr(mesh1D->getNodalConnectivity()->begin()),*rn(desc->begin()),*rni(descIndx->begin());
checkConnectivityFullyDefined();
int nbOfCells=getNumberOfCells();
int nbOfNodes=getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revNodalIndx=DataArrayInt::New(); revNodalIndx->alloc(nbOfNodes+1,1); revNodalIndx->fillWithZero();
+ MCAuto<DataArrayInt> revNodalIndx=DataArrayInt::New(); revNodalIndx->alloc(nbOfNodes+1,1); revNodalIndx->fillWithZero();
int *revNodalIndxPtr=revNodalIndx->getPointer();
const int *conn=_nodal_connec->getConstPointer();
const int *connIndex=_nodal_connec_index->getConstPointer();
std::string name="Mesh constituent of "; name+=getName();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(name,getMeshDimension()-SonsGenerator::DELTA);
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(name,getMeshDimension()-SonsGenerator::DELTA);
ret->setCoords(getCoords());
ret->allocateCells(2*nbOfCells);
descIndx->alloc(nbOfCells+1,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc2(DataArrayInt::New()); revDesc2->reserve(2*nbOfCells);
+ MCAuto<DataArrayInt> revDesc2(DataArrayInt::New()); revDesc2->reserve(2*nbOfCells);
int *descIndxPtr=descIndx->getPointer(); *descIndxPtr++=0;
for(int eltId=0;eltId<nbOfCells;eltId++,descIndxPtr++)
{
}
int nbOfCellsM1=ret->getNumberOfCells();
std::transform(revNodalIndxPtr+1,revNodalIndxPtr+nbOfNodes+1,revNodalIndxPtr,revNodalIndxPtr+1,std::plus<int>());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revNodal=DataArrayInt::New(); revNodal->alloc(revNodalIndx->back(),1);
+ MCAuto<DataArrayInt> revNodal=DataArrayInt::New(); revNodal->alloc(revNodalIndx->back(),1);
std::fill(revNodal->getPointer(),revNodal->getPointer()+revNodalIndx->back(),-1);
int *revNodalPtr=revNodal->getPointer();
const int *connM1=ret->getNodalConnectivity()->getConstPointer();
//
DataArrayInt *commonCells=0,*commonCellsI=0;
FindCommonCellsAlg(3,0,ret->getNodalConnectivity(),ret->getNodalConnectivityIndex(),revNodal,revNodalIndx,commonCells,commonCellsI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> commonCellsTmp(commonCells),commonCellsITmp(commonCellsI);
+ MCAuto<DataArrayInt> commonCellsTmp(commonCells),commonCellsITmp(commonCellsI);
const int *commonCellsPtr(commonCells->getConstPointer()),*commonCellsIPtr(commonCellsI->getConstPointer());
int newNbOfCellsM1=-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2nM1=DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfCellsM1,commonCells->begin(),
+ MCAuto<DataArrayInt> o2nM1=DataArrayInt::ConvertIndexArrayToO2N(nbOfCellsM1,commonCells->begin(),
commonCellsI->begin(),commonCellsI->end(),newNbOfCellsM1);
std::vector<bool> isImpacted(nbOfCellsM1,false);
for(const int *work=commonCellsI->begin();work!=commonCellsI->end()-1;work++)
for(int work2=work[0];work2!=work[1];work2++)
isImpacted[commonCellsPtr[work2]]=true;
const int *o2nM1Ptr=o2nM1->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2oM1=o2nM1->invertArrayO2N2N2OBis(newNbOfCellsM1);
+ MCAuto<DataArrayInt> n2oM1=o2nM1->invertArrayO2N2N2OBis(newNbOfCellsM1);
const int *n2oM1Ptr=n2oM1->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret2=static_cast<MEDCouplingUMesh *>(ret->buildPartOfMySelf(n2oM1->begin(),n2oM1->end(),true));
+ MCAuto<MEDCouplingUMesh> ret2=static_cast<MEDCouplingUMesh *>(ret->buildPartOfMySelf(n2oM1->begin(),n2oM1->end(),true));
ret2->copyTinyInfoFrom(this);
desc->alloc(descIndx->back(),1);
int *descPtr=desc->getPointer();
{
int *connIndex(_nodal_connec_index->getPointer());
const int *connOld(_nodal_connec->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connNew(DataArrayInt::New()),connNewI(DataArrayInt::New()); connNew->alloc(0,1); connNewI->alloc(1,1); connNewI->setIJ(0,0,0);
+ MCAuto<DataArrayInt> connNew(DataArrayInt::New()),connNewI(DataArrayInt::New()); connNew->alloc(0,1); connNewI->alloc(1,1); connNewI->setIJ(0,0,0);
std::vector<bool> toBeDone(nbOfCells,false);
for(const int *iter=cellIdsToConvertBg;iter!=cellIdsToConvertEnd;iter++)
{
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertExtrudedPolyhedra works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newCi=DataArrayInt::New();
+ MCAuto<DataArrayInt> newCi=DataArrayInt::New();
newCi->alloc(nbOfCells+1,1);
int *newci=newCi->getPointer();
const int *ci=_nodal_connec_index->getConstPointer();
else
newci[i+1]=(ci[i+1]-ci[i])+newci[i];
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newC=DataArrayInt::New();
+ MCAuto<DataArrayInt> newC=DataArrayInt::New();
newC->alloc(newci[nbOfCells],1);
int *newc=newC->getPointer();
for(int i=0;i<nbOfCells;i++)
int nbOfCells=getNumberOfCells();
if(nbOfCells<1)
return false;
- int initMeshLgth=getMeshLength();
+ int initMeshLgth=getNodalConnectivityArrayLen();
int *conn=_nodal_connec->getPointer();
int *index=_nodal_connec_index->getPointer();
int posOfCurCell=0;
checkFullyDefined();
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::simplifyPolyhedra : works on meshdimension 3 and spaceDimension 3 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords=getCoords()->deepCpy();
+ MCAuto<DataArrayDouble> coords=getCoords()->deepCopy();
coords->recenterForMaxPrecision(eps);
//
int nbOfCells=getNumberOfCells();
const int *conn=_nodal_connec->getConstPointer();
const int *index=_nodal_connec_index->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connINew=DataArrayInt::New();
+ MCAuto<DataArrayInt> connINew=DataArrayInt::New();
connINew->alloc(nbOfCells+1,1);
int *connINewPtr=connINew->getPointer(); *connINewPtr++=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connNew=DataArrayInt::New(); connNew->alloc(0,1);
+ MCAuto<DataArrayInt> connNew=DataArrayInt::New(); connNew->alloc(0,1);
bool changed=false;
for(int i=0;i<nbOfCells;i++,connINewPtr++)
{
{
nbrOfNodesInUse=-1;
int nbOfNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfNodes,1);
int *traducer=ret->getPointer();
std::fill(traducer,traducer+nbOfNodes,-1);
{
checkConnectivityFullyDefined();
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfCells,1);
int *retPtr=ret->getPointer();
const int *conn=getNodalConnectivity()->getConstPointer();
{
checkConnectivityFullyDefined();
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfCells,1);
int *retPtr=ret->getPointer();
const int *conn=getNodalConnectivity()->getConstPointer();
{
checkConnectivityFullyDefined();
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfCells,1);
int *retPtr=ret->getPointer();
const int *conn=getNodalConnectivity()->getConstPointer();
switch(compType)
{
case 0:
- return AreCellsEqual0(conn,connI,cell1,cell2);
+ return AreCellsEqualPolicy0(conn,connI,cell1,cell2);
case 1:
- return AreCellsEqual1(conn,connI,cell1,cell2);
+ return AreCellsEqualPolicy1(conn,connI,cell1,cell2);
case 2:
- return AreCellsEqual2(conn,connI,cell1,cell2);
+ return AreCellsEqualPolicy2(conn,connI,cell1,cell2);
case 3:
- return AreCellsEqual3(conn,connI,cell1,cell2);
+ return AreCellsEqualPolicy2NoType(conn,connI,cell1,cell2);
case 7:
- return AreCellsEqual7(conn,connI,cell1,cell2);
+ return AreCellsEqualPolicy7(conn,connI,cell1,cell2);
}
throw INTERP_KERNEL::Exception("Unknown comparison asked ! Must be in 0,1,2,3 or 7.");
}
/*!
* This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 0.
*/
-int MEDCouplingUMesh::AreCellsEqual0(const int *conn, const int *connI, int cell1, int cell2)
+int MEDCouplingUMesh::AreCellsEqualPolicy0(const int *conn, const int *connI, int cell1, int cell2)
{
if(connI[cell1+1]-connI[cell1]==connI[cell2+1]-connI[cell2])
return std::equal(conn+connI[cell1]+1,conn+connI[cell1+1],conn+connI[cell2]+1)?1:0;
/*!
* This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 1.
*/
-int MEDCouplingUMesh::AreCellsEqual1(const int *conn, const int *connI, int cell1, int cell2)
+int MEDCouplingUMesh::AreCellsEqualPolicy1(const int *conn, const int *connI, int cell1, int cell2)
{
int sz=connI[cell1+1]-connI[cell1];
if(sz==connI[cell2+1]-connI[cell2])
return std::equal(conn+connI[cell1]+1,conn+connI[cell1+1],conn+connI[cell2]+1)?1:0;//case of SEG2 and SEG3
}
else
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::AreCellsEqual1 : not implemented yet for meshdim == 3 !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::AreCellsEqualPolicy1 : not implemented yet for meshdim == 3 !");
}
}
return 0;
/*!
* This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 2.
*/
-int MEDCouplingUMesh::AreCellsEqual2(const int *conn, const int *connI, int cell1, int cell2)
+int MEDCouplingUMesh::AreCellsEqualPolicy2(const int *conn, const int *connI, int cell1, int cell2)
{
if(connI[cell1+1]-connI[cell1]==connI[cell2+1]-connI[cell2])
{
}
/*!
- * This method is less restrictive than AreCellsEqual2. Here the geometric type is absolutely not taken into account !
+ * This method is less restrictive than AreCellsEqualPolicy2. Here the geometric type is absolutely not taken into account !
*/
-int MEDCouplingUMesh::AreCellsEqual3(const int *conn, const int *connI, int cell1, int cell2)
+int MEDCouplingUMesh::AreCellsEqualPolicy2NoType(const int *conn, const int *connI, int cell1, int cell2)
{
if(connI[cell1+1]-connI[cell1]==connI[cell2+1]-connI[cell2])
{
/*!
* This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 7.
*/
-int MEDCouplingUMesh::AreCellsEqual7(const int *conn, const int *connI, int cell1, int cell2)
+int MEDCouplingUMesh::AreCellsEqualPolicy7(const int *conn, const int *connI, int cell1, int cell2)
{
int sz=connI[cell1+1]-connI[cell1];
if(sz==connI[cell2+1]-connI[cell2])
}
}
else
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::AreCellsEqual7 : not implemented yet for meshdim == 3 !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::AreCellsEqualPolicy7 : not implemented yet for meshdim == 3 !");
}
}
return 0;
*/
void MEDCouplingUMesh::findCommonCells(int compType, int startCellId, DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revNodal=DataArrayInt::New(),revNodalI=DataArrayInt::New();
+ MCAuto<DataArrayInt> revNodal=DataArrayInt::New(),revNodalI=DataArrayInt::New();
getReverseNodalConnectivity(revNodal,revNodalI);
FindCommonCellsAlg(compType,startCellId,_nodal_connec,_nodal_connec_index,revNodal,revNodalI,commonCellsArr,commonCellsIArr);
}
void MEDCouplingUMesh::FindCommonCellsAlg(int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI,
DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> commonCells=DataArrayInt::New(),commonCellsI=DataArrayInt::New(); commonCells->alloc(0,1);
+ MCAuto<DataArrayInt> commonCells=DataArrayInt::New(),commonCellsI=DataArrayInt::New(); commonCells->alloc(0,1);
int nbOfCells=nodalI->getNumberOfTuples()-1;
commonCellsI->reserve(1); commonCellsI->pushBackSilent(0);
const int *revNodalPtr=revNodal->getConstPointer(),*revNodalIPtr=revNodalI->getConstPointer();
*/
bool MEDCouplingUMesh::areCellsIncludedIn(const MEDCouplingUMesh *other, int compType, DataArrayInt *& arr) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MergeUMeshesOnSameCoords(this,other);
+ MCAuto<MEDCouplingUMesh> mesh=MergeUMeshesOnSameCoords(this,other);
int nbOfCells=getNumberOfCells();
static const int possibleCompType[]={0,1,2};
if(std::find(possibleCompType,possibleCompType+sizeof(possibleCompType)/sizeof(int),compType)==possibleCompType+sizeof(possibleCompType)/sizeof(int))
oss << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=mesh->zipConnectivityTraducer(compType,nbOfCells);
- arr=o2n->substr(nbOfCells);
+ MCAuto<DataArrayInt> o2n=mesh->zipConnectivityTraducer(compType,nbOfCells);
+ arr=o2n->subArray(nbOfCells);
arr->setName(other->getName());
int tmp;
if(other->getNumberOfCells()==0)
* \param arr is an output parameter that returns a \b newly created instance. This array is of size 'other->getNumberOfCells()'.
* \return If \a other is fully included in 'this 'true is returned. If not false is returned.
*/
-bool MEDCouplingUMesh::areCellsIncludedIn2(const MEDCouplingUMesh *other, DataArrayInt *& arr) const
+bool MEDCouplingUMesh::areCellsIncludedInPolicy7(const MEDCouplingUMesh *other, DataArrayInt *& arr) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MergeUMeshesOnSameCoords(this,other);
+ MCAuto<MEDCouplingUMesh> mesh=MergeUMeshesOnSameCoords(this,other);
DataArrayInt *commonCells=0,*commonCellsI=0;
int thisNbCells=getNumberOfCells();
mesh->findCommonCells(7,thisNbCells,commonCells,commonCellsI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> commonCellsTmp(commonCells),commonCellsITmp(commonCellsI);
+ MCAuto<DataArrayInt> commonCellsTmp(commonCells),commonCellsITmp(commonCellsI);
const int *commonCellsPtr=commonCells->getConstPointer(),*commonCellsIPtr=commonCellsI->getConstPointer();
int otherNbCells=other->getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr2=DataArrayInt::New();
+ MCAuto<DataArrayInt> arr2=DataArrayInt::New();
arr2->alloc(otherNbCells,1);
arr2->fillWithZero();
int *arr2Ptr=arr2->getPointer();
* \param start
* \param end
* \param step
- * \param keepCoords that specifies if you want or not to keep coords as this or zip it (see ParaMEDMEM::MEDCouplingUMesh::zipCoords). If true zipCoords is \b NOT called, if false, zipCoords is called.
+ * \param keepCoords that specifies if you want or not to keep coords as this or zip it (see MEDCoupling::MEDCouplingUMesh::zipCoords). If true zipCoords is \b NOT called, if false, zipCoords is called.
* \return a newly allocated
*
* \warning This method modifies can generate an unstructured mesh whose cells are not sorted by geometric type order.
* In view of the MED file writing, a renumbering of cells of returned unstructured mesh (using MEDCouplingUMesh::sortCellsInMEDFileFrmt) should be necessary.
*/
-MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelf2(int start, int end, int step, bool keepCoords) const
+MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelfSlice(int start, int end, int step, bool keepCoords) const
{
if(getMeshDimension()!=-1)
- return static_cast<MEDCouplingUMesh *>(MEDCouplingPointSet::buildPartOfMySelf2(start,end,step,keepCoords));
+ return static_cast<MEDCouplingUMesh *>(MEDCouplingPointSet::buildPartOfMySelfSlice(start,end,step,keepCoords));
else
{
- int newNbOfCells=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::buildPartOfMySelf2 for -1 dimension mesh ");
+ int newNbOfCells=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::buildPartOfMySelfSlice for -1 dimension mesh ");
if(newNbOfCells!=1)
throw INTERP_KERNEL::Exception("-1D mesh has only one cell !");
if(start!=0)
DataArrayInt *arrOut=0,*arrIOut=0;
MEDCouplingUMesh::SetPartOfIndexedArrays(cellIdsBg,cellIdsEnd,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index,
arrOut,arrIOut);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrOutAuto(arrOut),arrIOutAuto(arrIOut);
+ MCAuto<DataArrayInt> arrOutAuto(arrOut),arrIOutAuto(arrIOut);
setConnectivity(arrOut,arrIOut,true);
}
}
-void MEDCouplingUMesh::setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
+void MEDCouplingUMesh::setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis)
{
checkConnectivityFullyDefined();
otherOnSameCoordsThanThis.checkConnectivityFullyDefined();
if(getCoords()!=otherOnSameCoordsThanThis.getCoords())
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelf2 : coordinates pointer are not the same ! Invoke setCoords or call tryToShareSameCoords method !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::setPartOfMySelfSlice : coordinates pointer are not the same ! Invoke setCoords or call tryToShareSameCoords method !");
if(getMeshDimension()!=otherOnSameCoordsThanThis.getMeshDimension())
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf2 : Mismatch of meshdimensions ! this is equal to " << getMeshDimension();
+ std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : Mismatch of meshdimensions ! this is equal to " << getMeshDimension();
oss << ", whereas other mesh dimension is set equal to " << otherOnSameCoordsThanThis.getMeshDimension() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- int nbOfCellsToModify=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::setPartOfMySelf2 : ");
+ int nbOfCellsToModify=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::setPartOfMySelfSlice : ");
if(nbOfCellsToModify!=otherOnSameCoordsThanThis.getNumberOfCells())
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf2 : cells ids length (" << nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : cells ids length (" << nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
int nbOfCells=getNumberOfCells();
}
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf2 : On pos #" << i << " id is equal to " << it << " which is not in [0," << nbOfCells << ") !";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : On pos #" << i << " id is equal to " << it << " which is not in [0," << nbOfCells << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
if(easyAssign)
{
- MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index);
+ MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index);
computeTypes();
}
else
{
DataArrayInt *arrOut=0,*arrIOut=0;
- MEDCouplingUMesh::SetPartOfIndexedArrays2(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index,
+ MEDCouplingUMesh::SetPartOfIndexedArraysSlice(start,end,step,_nodal_connec,_nodal_connec_index,otherOnSameCoordsThanThis._nodal_connec,otherOnSameCoordsThanThis._nodal_connec_index,
arrOut,arrIOut);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrOutAuto(arrOut),arrIOutAuto(arrIOut);
+ MCAuto<DataArrayInt> arrOutAuto(arrOut),arrIOutAuto(arrIOut);
setConnectivity(arrOut,arrIOut,true);
}
}
*/
void MEDCouplingUMesh::fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsKept=DataArrayInt::New(); cellIdsKept->alloc(0,1);
+ MCAuto<DataArrayInt> cellIdsKept=DataArrayInt::New(); cellIdsKept->alloc(0,1);
checkConnectivityFullyDefined();
int tmp=-1;
int sz=getNodalConnectivity()->getMaxValue(tmp); sz=std::max(sz,0)+1;
*/
MEDCouplingUMesh *MEDCouplingUMesh::buildFacePartOfMySelfNode(const int *begin, const int *end, bool fullyIn) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc,descIndx,revDesc,revDescIndx;
+ MCAuto<DataArrayInt> desc,descIndx,revDesc,revDescIndx;
desc=DataArrayInt::New(); descIndx=DataArrayInt::New(); revDesc=DataArrayInt::New(); revDescIndx=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> subMesh=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
+ MCAuto<MEDCouplingUMesh> subMesh=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
desc=0; descIndx=0; revDesc=0; revDescIndx=0;
return static_cast<MEDCouplingUMesh*>(subMesh->buildPartOfMySelfNode(begin,end,fullyIn));
}
DataArrayInt *revDesc=DataArrayInt::New();
DataArrayInt *revDescIndx=DataArrayInt::New();
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
+ MCAuto<MEDCouplingUMesh> meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
revDesc->decrRef();
desc->decrRef();
descIndx->decrRef();
DataArrayInt *MEDCouplingUMesh::findCellIdsOnBoundary() const
{
checkFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx=DataArrayInt::New();
+ MCAuto<DataArrayInt> desc=DataArrayInt::New();
+ MCAuto<DataArrayInt> descIndx=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDesc=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDescIndx=DataArrayInt::New();
//
buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx)->decrRef();
desc=(DataArrayInt*)0; descIndx=(DataArrayInt*)0;
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=revDescIndx->deltaShiftIndex();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> faceIds=tmp->getIdsEqual(1); tmp=(DataArrayInt*)0;
+ MCAuto<DataArrayInt> tmp=revDescIndx->deltaShiftIndex();
+ MCAuto<DataArrayInt> faceIds=tmp->findIdsEqual(1); tmp=(DataArrayInt*)0;
const int *revDescPtr=revDesc->getConstPointer();
const int *revDescIndxPtr=revDescIndx->getConstPointer();
int nbOfCells=getNumberOfCells();
otherDimM1OnSameCoords.checkConnectivityFullyDefined();
if(getMeshDimension()-1!=otherDimM1OnSameCoords.getMeshDimension())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findCellIdsLyingOn : invalid mesh dimension of input mesh regarding meshdimesion of this !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fetchedNodeIds1=otherDimM1OnSameCoords.computeFetchedNodeIds();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> s0arr=getCellIdsLyingOnNodes(fetchedNodeIds1->begin(),fetchedNodeIds1->end(),false);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> thisPart=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(s0arr->begin(),s0arr->end(),true));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descThisPart=DataArrayInt::New(),descIThisPart=DataArrayInt::New(),revDescThisPart=DataArrayInt::New(),revDescIThisPart=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> thisPartConsti=thisPart->buildDescendingConnectivity(descThisPart,descIThisPart,revDescThisPart,revDescIThisPart);
+ MCAuto<DataArrayInt> fetchedNodeIds1=otherDimM1OnSameCoords.computeFetchedNodeIds();
+ MCAuto<DataArrayInt> s0arr=getCellIdsLyingOnNodes(fetchedNodeIds1->begin(),fetchedNodeIds1->end(),false);
+ MCAuto<MEDCouplingUMesh> thisPart=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(s0arr->begin(),s0arr->end(),true));
+ MCAuto<DataArrayInt> descThisPart=DataArrayInt::New(),descIThisPart=DataArrayInt::New(),revDescThisPart=DataArrayInt::New(),revDescIThisPart=DataArrayInt::New();
+ MCAuto<MEDCouplingUMesh> thisPartConsti=thisPart->buildDescendingConnectivity(descThisPart,descIThisPart,revDescThisPart,revDescIThisPart);
const int *revDescThisPartPtr=revDescThisPart->getConstPointer(),*revDescIThisPartPtr=revDescIThisPart->getConstPointer();
DataArrayInt *idsOtherInConsti=0;
bool b=thisPartConsti->areCellsIncludedIn(&otherDimM1OnSameCoords,2,idsOtherInConsti);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsOtherInConstiAuto(idsOtherInConsti);
+ MCAuto<DataArrayInt> idsOtherInConstiAuto(idsOtherInConsti);
if(!b)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::findCellIdsLyingOn : the given mdim-1 mesh in other is not a constituent of this !");
std::set<int> s1;
for(const int *idOther=idsOtherInConsti->begin();idOther!=idsOtherInConsti->end();idOther++)
s1.insert(revDescThisPartPtr+revDescIThisPartPtr[*idOther],revDescThisPartPtr+revDescIThisPartPtr[*idOther+1]);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> s1arr_renum1=DataArrayInt::New(); s1arr_renum1->alloc((int)s1.size(),1); std::copy(s1.begin(),s1.end(),s1arr_renum1->getPointer());
+ MCAuto<DataArrayInt> s1arr_renum1=DataArrayInt::New(); s1arr_renum1->alloc((int)s1.size(),1); std::copy(s1.begin(),s1.end(),s1arr_renum1->getPointer());
s1arr_renum1->sort();
cellIdsRk0=s0arr.retn();
//cellIdsRk1=s_renum1.retn();
*/
MEDCouplingUMesh *MEDCouplingUMesh::computeSkin() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx=DataArrayInt::New();
+ MCAuto<DataArrayInt> desc=DataArrayInt::New();
+ MCAuto<DataArrayInt> descIndx=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDesc=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDescIndx=DataArrayInt::New();
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
+ MCAuto<MEDCouplingUMesh> meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
revDesc=0; desc=0; descIndx=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx2=revDescIndx->deltaShiftIndex();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> part=revDescIndx2->getIdsEqual(1);
+ MCAuto<DataArrayInt> revDescIndx2=revDescIndx->deltaShiftIndex();
+ MCAuto<DataArrayInt> part=revDescIndx2->findIdsEqual(1);
return static_cast<MEDCouplingUMesh *>(meshDM1->buildPartOfMySelf(part->begin(),part->end(),true));
}
*/
DataArrayInt *MEDCouplingUMesh::findBoundaryNodes() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> skin=computeSkin();
+ MCAuto<MEDCouplingUMesh> skin=computeSkin();
return skin->computeFetchedNodeIds();
}
void MEDCouplingUMesh::findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords, DataArrayInt *& nodeIdsToDuplicate,
DataArrayInt *& cellIdsNeededToBeRenum, DataArrayInt *& cellIdsNotModified) const
{
- typedef MEDCouplingAutoRefCountObjectPtr<DataArrayInt> DAInt;
+ typedef MCAuto<DataArrayInt> DAInt;
checkFullyDefined();
otherDimM1OnSameCoords.checkFullyDefined();
DAInt cellIdsRk0Auto(cellIdsRk0),cellIdsRk1Auto(cellIdsRk1);
DAInt s0=cellIdsRk1->buildComplement(cellIdsRk0->getNumberOfTuples());
s0->transformWithIndArr(cellIdsRk0Auto->begin(),cellIdsRk0Auto->end());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0Part=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(s0->begin(),s0->end(),true));
+ MCAuto<MEDCouplingUMesh> m0Part=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(s0->begin(),s0->end(),true));
DAInt s1=m0Part->computeFetchedNodeIds();
DAInt s2=otherDimM1OnSameCoords.computeFetchedNodeIds();
DAInt s3=s2->buildSubstraction(s1);
cellIdsRk1->transformWithIndArr(cellIdsRk0Auto->begin(),cellIdsRk0Auto->end());
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0Part2=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(cellIdsRk1->begin(),cellIdsRk1->end(),true));
+ MCAuto<MEDCouplingUMesh> m0Part2=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(cellIdsRk1->begin(),cellIdsRk1->end(),true));
int nCells2 = m0Part2->getNumberOfCells();
DAInt desc00=DataArrayInt::New(),descI00=DataArrayInt::New(),revDesc00=DataArrayInt::New(),revDescI00=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m01=m0Part2->buildDescendingConnectivity(desc00,descI00,revDesc00,revDescI00);
+ MCAuto<MEDCouplingUMesh> m01=m0Part2->buildDescendingConnectivity(desc00,descI00,revDesc00,revDescI00);
// Neighbor information of the mesh without considering the crack (serves to count how many connex pieces it is made of)
DataArrayInt *tmp00=0,*tmp11=0;
MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc00,descI00,revDesc00,revDescI00, tmp00, tmp11);
cellsToModifyConn0_torenum->alloc(0,1);
while (nIter < nIterMax)
{
- DAInt t = hitCells->getIdsEqual(-1);
+ DAInt t = hitCells->findIdsEqual(-1);
if (!t->getNumberOfTuples())
break;
// Connex zone without the crack (to compute the next seed really)
cellsToModifyConn0_torenum = DataArrayInt::Aggregate(cellsToModifyConn0_torenum, spreadZone, 0);
// Compute next seed, i.e. a cell in another connex part, which was not covered by the previous iterations
DAInt comple = cellsToModifyConn0_torenum->buildComplement(nCells2);
- DAInt nonHitCells = hitCells->getIdsEqual(-1);
+ DAInt nonHitCells = hitCells->findIdsEqual(-1);
DAInt intersec = nonHitCells->buildIntersection(comple);
if (intersec->getNumberOfTuples())
{ seed = intersec->getIJ(0,0); }
/*!
* This method renumbers nodes \b in \b connectivity \b only \b without \b any \b reference \b to \b coords.
* This method performs no check on the fact that new coordinate ids are valid. \b Use \b it \b with \b care !
- * This method is an specialization of \ref ParaMEDMEM::MEDCouplingUMesh::renumberNodesInConn "renumberNodesInConn method".
+ * This method is an specialization of \ref MEDCoupling::MEDCouplingUMesh::renumberNodesInConn "renumberNodesInConn method".
*
* \param [in] delta specifies the shift size applied to nodeId in nodal connectivity in \b this.
*/
//
const int *conn=_nodal_connec->getConstPointer();
const int *connI=_nodal_connec_index->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=DataArrayInt::New(); o2n->useArray(array,false,C_DEALLOC,nbCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o=o2n->invertArrayO2N2N2O(nbCells);
+ MCAuto<DataArrayInt> o2n=DataArrayInt::New(); o2n->useArray(array,false,C_DEALLOC,nbCells,1);
+ MCAuto<DataArrayInt> n2o=o2n->invertArrayO2N2N2O(nbCells);
const int *n2oPtr=n2o->begin();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
newConn->alloc(_nodal_connec->getNumberOfTuples(),_nodal_connec->getNumberOfComponents());
newConn->copyStringInfoFrom(*_nodal_connec);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
newConnI->alloc(_nodal_connec_index->getNumberOfTuples(),_nodal_connec_index->getNumberOfComponents());
newConnI->copyStringInfoFrom(*_nodal_connec_index);
//
*/
DataArrayInt *MEDCouplingUMesh::getCellsInBoundingBox(const double *bbox, double eps) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
+ MCAuto<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
if(getMeshDimension()==-1)
{
elems->pushBackSilent(0);
*/
DataArrayInt *MEDCouplingUMesh::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
+ MCAuto<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
if(getMeshDimension()==-1)
{
elems->pushBackSilent(0);
DataArrayInt *MEDCouplingUMesh::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(0,1);
checkConnectivityFullyDefined();
int nbCells=getNumberOfCells();
int mdim=getMeshDimension();
if(mdim<0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSetInstanceFromThis : invalid mesh dimension ! Should be >= 0 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1,tmp2;
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
+ MCAuto<DataArrayInt> tmp1,tmp2;
bool needToCpyCT=true;
if(!_nodal_connec)
{
ret->_types=_types;
if(!_coords)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords=DataArrayDouble::New(); coords->alloc(0,spaceDim);
+ MCAuto<DataArrayDouble> coords=DataArrayDouble::New(); coords->alloc(0,spaceDim);
ret->setCoords(coords);
}
else
}
/*!
- * Copy constructor. If 'deepCpy' is false \a this is a shallow copy of other.
+ * Copy constructor. If 'deepCopy' is false \a this is a shallow copy of other.
* If 'deeCpy' is true all arrays (coordinates and connectivities) are deeply copied.
*/
MEDCouplingUMesh::MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCopy):MEDCouplingPointSet(other,deepCopy),_mesh_dim(other._mesh_dim),
_types(other._types)
{
if(other._nodal_connec)
- _nodal_connec=other._nodal_connec->performCpy(deepCopy);
+ _nodal_connec=other._nodal_connec->performCopyOrIncrRef(deepCopy);
if(other._nodal_connec_index)
- _nodal_connec_index=other._nodal_connec_index->performCpy(deepCopy);
+ _nodal_connec_index=other._nodal_connec_index->performCopyOrIncrRef(deepCopy);
}
MEDCouplingUMesh::~MEDCouplingUMesh()
* user. For more info see \ref MEDCouplingUMeshNodalConnectivity.
* \return int - the length of the nodal connectivity array.
*/
-int MEDCouplingUMesh::getMeshLength() const
+int MEDCouplingUMesh::getNodalConnectivityArrayLen() const
{
return _nodal_connec->getNbOfElems();
}
tinyInfo.push_back(getMeshDimension());
tinyInfo.push_back(getNumberOfCells());
if(_nodal_connec)
- tinyInfo.push_back(getMeshLength());
+ tinyInfo.push_back(getNodalConnectivityArrayLen());
else
tinyInfo.push_back(-1);
}
if(getMeshDimension()>-1)
{
a1=DataArrayInt::New();
- a1->alloc(getMeshLength()+getNumberOfCells()+1,1);
+ a1->alloc(getNodalConnectivityArrayLen()+getNumberOfCells()+1,1);
int *ptA1=a1->getPointer();
const int *conn=getNodalConnectivity()->getConstPointer();
const int *index=getNodalConnectivityIndex()->getConstPointer();
ptA1=std::copy(index,index+getNumberOfCells()+1,ptA1);
- std::copy(conn,conn+getMeshLength(),ptA1);
+ std::copy(conn,conn+getNodalConnectivityArrayLen(),ptA1);
}
else
a1=0;
{
// Connectivity
const int *recvBuffer=a1->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> myConnecIndex=DataArrayInt::New();
+ MCAuto<DataArrayInt> myConnecIndex=DataArrayInt::New();
myConnecIndex->alloc(tinyInfo[6]+1,1);
std::copy(recvBuffer,recvBuffer+tinyInfo[6]+1,myConnecIndex->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> myConnec=DataArrayInt::New();
+ MCAuto<DataArrayInt> myConnec=DataArrayInt::New();
myConnec->alloc(tinyInfo[7],1);
std::copy(recvBuffer+tinyInfo[6]+1,recvBuffer+tinyInfo[6]+1+tinyInfo[7],myConnec->getPointer());
setConnectivity(myConnec, myConnecIndex);
}
/*!
- * This is the low algorithm of MEDCouplingUMesh::buildPartOfMySelf2.
+ * This is the low algorithm of MEDCouplingUMesh::buildPartOfMySelfSlice.
* CellIds are given using range specified by a start an end and step.
*/
-MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const
+MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const
{
checkFullyDefined();
int ncell=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
ret->_mesh_dim=_mesh_dim;
ret->setCoords(_coords);
- int newNbOfCells=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::buildPartOfMySelfKeepCoords2 : ");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(newNbOfCells+1,1);
+ int newNbOfCells=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::buildPartOfMySelfKeepCoordsSlice : ");
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(newNbOfCells+1,1);
int *newConnIPtr=newConnI->getPointer(); *newConnIPtr=0;
int work=start;
const int *conn=_nodal_connec->getConstPointer();
}
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::buildPartOfMySelfKeepCoords2 : On pos #" << i << " input cell id =" << work << " should be in [0," << ncell << ") !";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::buildPartOfMySelfKeepCoordsSlice : On pos #" << i << " input cell id =" << work << " should be in [0," << ncell << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(newConnIPtr[0],1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(newConnIPtr[0],1);
int *newConnPtr=newConn->getPointer();
std::set<INTERP_KERNEL::NormalizedCellType> types;
work=start;
{
checkConnectivityFullyDefined();
int ncell=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
ret->_mesh_dim=_mesh_dim;
ret->setCoords(_coords);
std::size_t nbOfElemsRet=std::distance(begin,end);
types.insert((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*work]]);
connRetWork=std::copy(conn+connIndex[*work],conn+connIndex[*work+1],connRetWork);
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connRetArr=DataArrayInt::New();
+ MCAuto<DataArrayInt> connRetArr=DataArrayInt::New();
connRetArr->useArray(connRet,true,C_DEALLOC,connIndexRet[nbOfElemsRet],1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connIndexRetArr=DataArrayInt::New();
+ MCAuto<DataArrayInt> connIndexRetArr=DataArrayInt::New();
connIndexRetArr->useArray(connIndexRet,true,C_DEALLOC,(int)nbOfElemsRet+1,1);
ret->setConnectivity(connRetArr,connIndexRetArr,false);
ret->_types=types;
std::string name="MeasureOfMesh_";
name+=getName();
int nbelem=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> field=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
field->setName(name);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> array=DataArrayDouble::New();
array->alloc(nbelem,1);
double *area_vol=array->getPointer();
field->setArray(array) ; array=0;
std::string name="PartMeasureOfMesh_";
name+=getName();
int nbelem=(int)std::distance(begin,end);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> array=DataArrayDouble::New();
array->setName(name);
array->alloc(nbelem,1);
double *area_vol=array->getPointer();
*/
MEDCouplingFieldDouble *MEDCouplingUMesh::getMeasureFieldOnNode(bool isAbs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> tmp=getMeasureField(isAbs);
+ MCAuto<MEDCouplingFieldDouble> tmp=getMeasureField(isAbs);
std::string name="MeasureOnNodeOfMesh_";
name+=getName();
int nbNodes=getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_NODES);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_NODES);
double cst=1./((double)getMeshDimension()+1.);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> array=DataArrayDouble::New();
array->alloc(nbNodes,1);
double *valsToFill=array->getPointer();
std::fill(valsToFill,valsToFill+nbNodes,0.);
const double *values=tmp->getArray()->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> daInd=DataArrayInt::New();
+ MCAuto<DataArrayInt> da=DataArrayInt::New();
+ MCAuto<DataArrayInt> daInd=DataArrayInt::New();
getReverseNodalConnectivity(da,daInd);
const int *daPtr=da->getConstPointer();
const int *daIPtr=daInd->getConstPointer();
{
if((getMeshDimension()!=2) && (getMeshDimension()!=1 || getSpaceDimension()!=2))
throw INTERP_KERNEL::Exception("Expected a umesh with ( meshDim == 2 spaceDim == 2 or 3 ) or ( meshDim == 1 spaceDim == 2 ) !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<DataArrayDouble> array=DataArrayDouble::New();
int nbOfCells=getNumberOfCells();
int nbComp=getMeshDimension()+1;
array->alloc(nbOfCells,nbComp);
{
if(getSpaceDimension()==3)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> loc=getBarycenterAndOwner();
+ MCAuto<DataArrayDouble> loc=computeCellCenterOfMass();
const double *locPtr=loc->getConstPointer();
for(int i=0;i<nbOfCells;i++,vals+=3)
{
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> isAbs=getMeasureField(false);
+ MCAuto<MEDCouplingFieldDouble> isAbs=getMeasureField(false);
const double *isAbsPtr=isAbs->getArray()->begin();
for(int i=0;i<nbOfCells;i++,isAbsPtr++)
{ vals[3*i]=0.; vals[3*i+1]=0.; vals[3*i+2]=*isAbsPtr>0.?1.:-1.; }
{
if((getMeshDimension()!=2) && (getMeshDimension()!=1 || getSpaceDimension()!=2))
throw INTERP_KERNEL::Exception("Expected a umesh with ( meshDim == 2 spaceDim == 2 or 3 ) or ( meshDim == 1 spaceDim == 2 ) !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<DataArrayDouble> array=DataArrayDouble::New();
std::size_t nbelems=std::distance(begin,end);
int nbComp=getMeshDimension()+1;
array->alloc((int)nbelems,nbComp);
{
if(getSpaceDimension()==3)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> loc=getPartBarycenterAndOwner(begin,end);
+ MCAuto<DataArrayDouble> loc=getPartBarycenterAndOwner(begin,end);
const double *locPtr=loc->getConstPointer();
for(const int *i=begin;i!=end;i++,vals+=3,locPtr+=3)
{
throw INTERP_KERNEL::Exception("Expected a umesh with meshDim == 1 for buildDirectionVectorField !");
if(_types.size()!=1 || *(_types.begin())!=INTERP_KERNEL::NORM_SEG2)
throw INTERP_KERNEL::Exception("Expected a umesh with only NORM_SEG2 type of elements for buildDirectionVectorField !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array=DataArrayDouble::New();
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<DataArrayDouble> array=DataArrayDouble::New();
int nbOfCells=getNumberOfCells();
int spaceDim=getSpaceDimension();
array->alloc(nbOfCells,spaceDim);
checkFullyDefined();
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
+ MCAuto<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
if(candidates->empty())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D : No 3D cells in this intercepts the specified plane considering bounding boxes !");
std::vector<int> nodes;
DataArrayInt *cellIds1D=0;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
+ MCAuto<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
subMesh->findNodesOnPlane(origin,vec,eps,nodes);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc1=DataArrayInt::New(),desc2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx1=DataArrayInt::New(),descIndx2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc1=DataArrayInt::New(),revDesc2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx1=DataArrayInt::New(),revDescIndx2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc2=subMesh->buildDescendingConnectivity(desc2,descIndx2,revDesc2,revDescIndx2);//meshDim==2 spaceDim==3
+ MCAuto<DataArrayInt> desc1=DataArrayInt::New(),desc2=DataArrayInt::New();
+ MCAuto<DataArrayInt> descIndx1=DataArrayInt::New(),descIndx2=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDesc1=DataArrayInt::New(),revDesc2=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDescIndx1=DataArrayInt::New(),revDescIndx2=DataArrayInt::New();
+ MCAuto<MEDCouplingUMesh> mDesc2=subMesh->buildDescendingConnectivity(desc2,descIndx2,revDesc2,revDescIndx2);//meshDim==2 spaceDim==3
revDesc2=0; revDescIndx2=0;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc1=mDesc2->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
+ MCAuto<MEDCouplingUMesh> mDesc1=mDesc2->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
revDesc1=0; revDescIndx1=0;
mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds1DTmp(cellIds1D);
+ MCAuto<DataArrayInt> cellIds1DTmp(cellIds1D);
//
std::vector<int> cut3DCurve(mDesc1->getNumberOfCells(),-2);
for(const int *it=cellIds1D->begin();it!=cellIds1D->end();it++)
AssemblyForSplitFrom3DCurve(cut3DCurve,nodes,mDesc2->getNodalConnectivity()->getConstPointer(),mDesc2->getNodalConnectivityIndex()->getConstPointer(),
mDesc1->getNodalConnectivity()->getConstPointer(),mDesc1->getNodalConnectivityIndex()->getConstPointer(),
desc1->getConstPointer(),descIndx1->getConstPointer(),cut3DSurf);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New()),cellIds2(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New()),cellIds2(DataArrayInt::New());
connI->pushBackSilent(0); conn->alloc(0,1); cellIds2->alloc(0,1);
subMesh->assemblyForSplitFrom3DSurf(cut3DSurf,desc2->getConstPointer(),descIndx2->getConstPointer(),conn,connI,cellIds2);
if(cellIds2->empty())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D : No 3D cells in this intercepts the specified plane !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("Slice3D",2);
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("Slice3D",2);
ret->setCoords(mDesc1->getCoords());
ret->setConnectivity(conn,connI,true);
cellIds=candidates->selectByTupleId(cellIds2->begin(),cellIds2->end());
checkFullyDefined();
if(getMeshDimension()!=2 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf works on umeshes with meshdim equal to 2 and spaceDim equal to 3 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
+ MCAuto<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
if(candidates->empty())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf : No 3D surf cells in this intercepts the specified plane considering bounding boxes !");
std::vector<int> nodes;
DataArrayInt *cellIds1D=0;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
+ MCAuto<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
subMesh->findNodesOnPlane(origin,vec,eps,nodes);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc1=subMesh->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
+ MCAuto<DataArrayInt> desc1=DataArrayInt::New();
+ MCAuto<DataArrayInt> descIndx1=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDesc1=DataArrayInt::New();
+ MCAuto<DataArrayInt> revDescIndx1=DataArrayInt::New();
+ MCAuto<MEDCouplingUMesh> mDesc1=subMesh->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds1DTmp(cellIds1D);
+ MCAuto<DataArrayInt> cellIds1DTmp(cellIds1D);
//
std::vector<int> cut3DCurve(mDesc1->getNumberOfCells(),-2);
for(const int *it=cellIds1D->begin();it!=cellIds1D->end();it++)
AssemblyForSplitFrom3DCurve(cut3DCurve,nodes,subMesh->getNodalConnectivity()->getConstPointer(),subMesh->getNodalConnectivityIndex()->getConstPointer(),
mDesc1->getNodalConnectivity()->getConstPointer(),mDesc1->getNodalConnectivityIndex()->getConstPointer(),
desc1->getConstPointer(),descIndx1->getConstPointer(),cut3DSurf);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New()),cellIds2(DataArrayInt::New()); connI->pushBackSilent(0);
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New()),cellIds2(DataArrayInt::New()); connI->pushBackSilent(0);
conn->alloc(0,1);
const int *nodal=subMesh->getNodalConnectivity()->getConstPointer();
const int *nodalI=subMesh->getNodalConnectivityIndex()->getConstPointer();
}
if(cellIds2->empty())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf : No 3DSurf cells in this intercepts the specified plane !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("Slice3DSurf",1);
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("Slice3DSurf",1);
ret->setCoords(mDesc1->getCoords());
ret->setConnectivity(conn,connI,true);
cellIds=candidates->selectByTupleId(cellIds2->begin(),cellIds2->end());
double vec2[3];
vec2[0]=vec[1]; vec2[1]=-vec[0]; vec2[2]=0.;//vec2 is the result of cross product of vec with (0,0,1)
double angle=acos(vec[2]/normm);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds;
+ MCAuto<DataArrayInt> cellIds;
double bbox[6];
if(angle>eps)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo=_coords->deepCpy();
+ MCAuto<DataArrayDouble> coo=_coords->deepCopy();
double normm2(sqrt(vec2[0]*vec2[0]+vec2[1]*vec2[1]+vec2[2]*vec2[2]));
if(normm2/normm>1e-6)
MEDCouplingPointSet::Rotate3DAlg(origin,vec2,angle,coo->getNumberOfTuples(),coo->getPointer());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mw=clone(false);//false -> shallow copy
+ MCAuto<MEDCouplingUMesh> mw=clone(false);//false -> shallow copy
mw->setCoords(coo);
mw->getBoundingBox(bbox);
bbox[4]=origin[2]-eps; bbox[5]=origin[2]+eps;
* If not an exception will thrown. If this is an empty mesh with no cell an exception will be thrown too.
* No consideration of coordinate is done by this method.
* A 1D mesh is said contiguous if : a cell i with nodal connectivity (k,p) the cell i+1 the nodal connectivity should be (p,m)
- * If not false is returned. In case that false is returned a call to ParaMEDMEM::MEDCouplingUMesh::mergeNodes could be usefull.
+ * If not false is returned. In case that false is returned a call to MEDCoupling::MEDCouplingUMesh::mergeNodes could be usefull.
*/
bool MEDCouplingUMesh::isContiguous1D() const
{
throw INTERP_KERNEL::Exception("Expected a umesh with only NORM_SEG2 type of elements for project1D !");
if(getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("Expected a umesh with spaceDim==3 for project1D !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f=buildDirectionVectorField();
+ MCAuto<MEDCouplingFieldDouble> f=buildDirectionVectorField();
const double *fPtr=f->getArray()->getConstPointer();
double tmp[3];
for(int i=0;i<getNumberOfCells();i++)
if((int)std::distance(ptBg,ptEnd)!=spaceDim)
{ std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoint : input point has to have dimension equal to the space dimension of this (" << spaceDim << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); }
DataArrayInt *ret1=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> pts=DataArrayDouble::New(); pts->useArray(ptBg,false,C_DEALLOC,1,spaceDim);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret0=distanceToPoints(pts,ret1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1Safe(ret1);
+ MCAuto<DataArrayDouble> pts=DataArrayDouble::New(); pts->useArray(ptBg,false,C_DEALLOC,1,spaceDim);
+ MCAuto<DataArrayDouble> ret0=distanceToPoints(pts,ret1);
+ MCAuto<DataArrayInt> ret1Safe(ret1);
cellId=*ret1Safe->begin();
return *ret0->begin();
}
if(nbCells==0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::distanceToPoints : no cells in this !");
int nbOfPts=pts->getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret0=DataArrayDouble::New(); ret0->alloc(nbOfPts,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1=DataArrayInt::New(); ret1->alloc(nbOfPts,1);
+ MCAuto<DataArrayDouble> ret0=DataArrayDouble::New(); ret0->alloc(nbOfPts,1);
+ MCAuto<DataArrayInt> ret1=DataArrayInt::New(); ret1->alloc(nbOfPts,1);
const int *nc=_nodal_connec->begin(),*ncI=_nodal_connec_index->begin(); const double *coords=_coords->begin();
double *ret0Ptr=ret0->getPointer(); int *ret1Ptr=ret1->getPointer(); const double *ptsPtr=pts->begin();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bboxArr(getBoundingBoxForBBTree());
+ MCAuto<DataArrayDouble> bboxArr(getBoundingBoxForBBTree());
const double *bbox(bboxArr->begin());
switch(spaceDim)
{
*/
void MEDCouplingUMesh::getCellsContainingPoint(const double *pos, double eps, std::vector<int>& elts) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsUg,eltsIndexUg;
+ MCAuto<DataArrayInt> eltsUg,eltsIndexUg;
getCellsContainingPoints(pos,1,eps,eltsUg,eltsIndexUg);
elts.clear(); elts.insert(elts.end(),eltsUg->begin(),eltsUg->end());
}
/// @cond INTERNAL
-namespace ParaMEDMEM
+namespace MEDCoupling
{
template<const int SPACEDIMM>
class DummyClsMCUG
// end
};
- INTERP_KERNEL::Edge *MEDCouplingUMeshBuildQPFromEdge2(INTERP_KERNEL::NormalizedCellType typ, const int *bg, const double *coords2D, std::map< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int>& m)
+ INTERP_KERNEL::Edge *MEDCouplingUMeshBuildQPFromEdge2(INTERP_KERNEL::NormalizedCellType typ, const int *bg, const double *coords2D, std::map< MCAuto<INTERP_KERNEL::Node>,int>& m)
{
INTERP_KERNEL::Edge *ret(0);
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node> n0(new INTERP_KERNEL::Node(coords2D[2*bg[0]],coords2D[2*bg[0]+1])),n1(new INTERP_KERNEL::Node(coords2D[2*bg[1]],coords2D[2*bg[1]+1]));
+ MCAuto<INTERP_KERNEL::Node> n0(new INTERP_KERNEL::Node(coords2D[2*bg[0]],coords2D[2*bg[0]+1])),n1(new INTERP_KERNEL::Node(coords2D[2*bg[1]],coords2D[2*bg[1]+1]));
m[n0]=bg[0]; m[n1]=bg[1];
switch(typ)
{
template<int SPACEDIM>
void MEDCouplingUMesh::getCellsContainingPointsAlg(const double *coords, const double *pos, int nbOfPoints,
- double eps, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& elts, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& eltsIndex) const
+ double eps, MCAuto<DataArrayInt>& elts, MCAuto<DataArrayInt>& eltsIndex) const
{
elts=DataArrayInt::New(); eltsIndex=DataArrayInt::New(); eltsIndex->alloc(nbOfPoints+1,1); eltsIndex->setIJ(0,0,0); elts->alloc(0,1);
int *eltsIndexPtr(eltsIndex->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bboxArr(getBoundingBoxForBBTree(eps));
+ MCAuto<DataArrayDouble> bboxArr(getBoundingBoxForBBTree(eps));
const double *bbox(bboxArr->begin());
int nbOfCells=getNumberOfCells();
const int *conn=_nodal_connec->getConstPointer();
* \endif
*/
void MEDCouplingUMesh::getCellsContainingPoints(const double *pos, int nbOfPoints, double eps,
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& elts, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& eltsIndex) const
+ MCAuto<DataArrayInt>& elts, MCAuto<DataArrayInt>& eltsIndex) const
{
int spaceDim=getSpaceDimension();
int mDim=getMeshDimension();
checkFullyDefined();
const double *coords=getCoords()->getConstPointer();
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodalConnecIndexOut=DataArrayInt::New();
+ MCAuto<DataArrayInt> nodalConnecIndexOut=DataArrayInt::New();
nodalConnecIndexOut->alloc(nbOfCells+1,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodalConnecOut(DataArrayInt::New());
+ MCAuto<DataArrayInt> nodalConnecOut(DataArrayInt::New());
int *workIndexOut=nodalConnecIndexOut->getPointer();
*workIndexOut=0;
const int *nodalConnecIn=_nodal_connec->getConstPointer();
const int *nodalConnecIndexIn=_nodal_connec_index->getConstPointer();
std::set<INTERP_KERNEL::NormalizedCellType> types;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> isChanged(DataArrayInt::New());
+ MCAuto<DataArrayInt> isChanged(DataArrayInt::New());
isChanged->alloc(0,1);
for(int i=0;i<nbOfCells;i++,workIndexOut++)
{
throw INTERP_KERNEL::Exception("Invalid 2D mesh and 1D mesh because 2D mesh has quadratic cells and 1D is not fully quadratic !");
}
int oldNbOfNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords;
+ MCAuto<DataArrayDouble> newCoords;
switch(policy)
{
case 0:
throw INTERP_KERNEL::Exception("Not implemented extrusion policy : must be in (0) !");
}
setCoords(newCoords);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(buildExtrudedMeshFromThisLowLev(oldNbOfNodes,isQuad));
+ MCAuto<MEDCouplingUMesh> ret(buildExtrudedMeshFromThisLowLev(oldNbOfNodes,isQuad));
updateTime();
return ret.retn();
}
if(!addCoo.empty())
{
int newNbOfNodes=nnodes+((int)addCoo.size())/3;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo2=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coo2=DataArrayDouble::New();
coo2->alloc(newNbOfNodes,3);
double *tmp=coo2->getPointer();
tmp=std::copy(_coords->begin(),_coords->end(),tmp);
int nbOf1DCells=mesh1D->getNumberOfCells();
if(nbOf1DCells<2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation2D : impossible to detect any angle of rotation ! Change extrusion policy 1->0 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int nbOfLevsInVec=nbOf1DCells+1;
ret->alloc(oldNbOfNodes*nbOfLevsInVec,2);
double *retPtr=ret->getPointer();
retPtr=std::copy(getCoords()->getConstPointer(),getCoords()->getConstPointer()+getCoords()->getNbOfElems(),retPtr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp2=getCoords()->deepCpy();
+ MCAuto<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
+ MCAuto<DataArrayDouble> tmp2=getCoords()->deepCopy();
tmp->setCoords(tmp2);
const double *coo1D=mesh1D->getCoords()->getConstPointer();
const int *conn1D=mesh1D->getNodalConnectivity()->getConstPointer();
int nbOf1DCells=mesh1D->getNumberOfCells();
if(nbOf1DCells<2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation3D : impossible to detect any angle of rotation ! Change extrusion policy 1->0 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int nbOfLevsInVec=nbOf1DCells+1;
ret->alloc(oldNbOfNodes*nbOfLevsInVec,3);
double *retPtr=ret->getPointer();
retPtr=std::copy(getCoords()->getConstPointer(),getCoords()->getConstPointer()+getCoords()->getNbOfElems(),retPtr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp2=getCoords()->deepCpy();
+ MCAuto<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
+ MCAuto<DataArrayDouble> tmp2=getCoords()->deepCopy();
tmp->setCoords(tmp2);
const double *coo1D=mesh1D->getCoords()->getConstPointer();
const int *conn1D=mesh1D->getNodalConnectivity()->getConstPointer();
int nbOf3DCells(nbOf2DCells*nbOf1DCells);
MEDCouplingUMesh *ret(MEDCouplingUMesh::New("Extruded",getMeshDimension()+1));
const int *conn(_nodal_connec->begin()),*connI(_nodal_connec_index->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn(DataArrayInt::New()),newConnI(DataArrayInt::New());
+ MCAuto<DataArrayInt> newConn(DataArrayInt::New()),newConnI(DataArrayInt::New());
newConnI->alloc(nbOf3DCells+1,1);
int *newConnIPtr(newConnI->getPointer());
*newConnIPtr++=0;
}
if(delta==0)
return ;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
const int *icptr=_nodal_connec->getConstPointer();
- newConn->alloc(getMeshLength()-delta,1);
+ newConn->alloc(getNodalConnectivityArrayLen()-delta,1);
newConnI->alloc(nbOfCells+1,1);
int *ocptr=newConn->getPointer();
int *ociptr=newConnI->getPointer();
DataArrayDouble *coords=0;
std::set<INTERP_KERNEL::NormalizedCellType> types;
checkFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret,connSafe,connISafe;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsSafe;
+ MCAuto<DataArrayInt> ret,connSafe,connISafe;
+ MCAuto<DataArrayDouble> coordsSafe;
int meshDim=getMeshDimension();
switch(conversionType)
{
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::splitSomeEdgesOf2DMesh : mesh1Desc must be the explosion of this with spaceDim=2 and meshDim = 1 !");
//DataArrayInt *out0(0),*outi0(0);
//MEDCouplingUMesh::ExtractFromIndexedArrays(idsInDesc2DToBeRefined->begin(),idsInDesc2DToBeRefined->end(),dd3,dd4,out0,outi0);
- //MEDCouplingAutoRefCountObjectPtr<DataArrayInt> out0s(out0),outi0s(outi0);
+ //MCAuto<DataArrayInt> out0s(out0),outi0s(outi0);
//out0s=out0s->buildUnique(); out0s->sort(true);
}
#endif
*/
DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic1D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bary=getBarycenterAndOwner();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
+ MCAuto<DataArrayDouble> bary=computeCellCenterOfMass();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
int nbOfCells=getNumberOfCells();
int nbOfNodes=getNumberOfNodes();
const int *cPtr=_nodal_connec->getConstPointer();
newConn->pushBackValsSilent(cPtr+icPtr[0],cPtr+icPtr[1]);
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp=bary->selectByTupleIdSafe(ret->begin(),ret->end());
+ MCAuto<DataArrayDouble> tmp=bary->selectByTupleIdSafe(ret->begin(),ret->end());
coords=DataArrayDouble::Aggregate(getCoords(),tmp); conn=newConn.retn(); connI=newConnI.retn();
return ret.retn();
}
DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic2DAnd3D0(const MEDCouplingUMesh *m1D, const DataArrayInt *desc, const DataArrayInt *descI, DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
//
const int *descPtr(desc->begin()),*descIPtr(descI->begin());
DataArrayInt *conn1D=0,*conn1DI=0;
std::set<INTERP_KERNEL::NormalizedCellType> types1D;
DataArrayDouble *coordsTmp=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1D=m1D->convertLinearCellsToQuadratic1D0(conn1D,conn1DI,coordsTmp,types1D); ret1D=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsTmpSafe(coordsTmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn1DSafe(conn1D),conn1DISafe(conn1DI);
+ MCAuto<DataArrayInt> ret1D=m1D->convertLinearCellsToQuadratic1D0(conn1D,conn1DI,coordsTmp,types1D); ret1D=0;
+ MCAuto<DataArrayDouble> coordsTmpSafe(coordsTmp);
+ MCAuto<DataArrayInt> conn1DSafe(conn1D),conn1DISafe(conn1DI);
const int *c1DPtr=conn1D->begin();
const int *c1DIPtr=conn1DI->begin();
int nbOfCells=getNumberOfCells();
*/
DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic2D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc(DataArrayInt::New()),descI(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1D=buildDescendingConnectivity(desc,descI,tmp2,tmp3); tmp2=0; tmp3=0;
+ MCAuto<DataArrayInt> desc(DataArrayInt::New()),descI(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> m1D=buildDescendingConnectivity(desc,descI,tmp2,tmp3); tmp2=0; tmp3=0;
return convertLinearCellsToQuadratic2DAnd3D0(m1D,desc,descI,conn,connI,coords,types);
}
DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic2D1(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc(DataArrayInt::New()),descI(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1D=buildDescendingConnectivity(desc,descI,tmp2,tmp3); tmp2=0; tmp3=0;
+ MCAuto<DataArrayInt> desc(DataArrayInt::New()),descI(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> m1D=buildDescendingConnectivity(desc,descI,tmp2,tmp3); tmp2=0; tmp3=0;
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bary=getBarycenterAndOwner();
+ MCAuto<DataArrayDouble> bary=computeCellCenterOfMass();
const int *descPtr(desc->begin()),*descIPtr(descI->begin());
DataArrayInt *conn1D=0,*conn1DI=0;
std::set<INTERP_KERNEL::NormalizedCellType> types1D;
DataArrayDouble *coordsTmp=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1D=m1D->convertLinearCellsToQuadratic1D0(conn1D,conn1DI,coordsTmp,types1D); ret1D=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsTmpSafe(coordsTmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn1DSafe(conn1D),conn1DISafe(conn1DI);
+ MCAuto<DataArrayInt> ret1D=m1D->convertLinearCellsToQuadratic1D0(conn1D,conn1DI,coordsTmp,types1D); ret1D=0;
+ MCAuto<DataArrayDouble> coordsTmpSafe(coordsTmp);
+ MCAuto<DataArrayInt> conn1DSafe(conn1D),conn1DISafe(conn1DI);
const int *c1DPtr=conn1D->begin();
const int *c1DIPtr=conn1DI->begin();
int nbOfCells=getNumberOfCells();
newConn->pushBackValsSilent(cPtr+icPtr[0],cPtr+icPtr[1]);
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp=bary->selectByTupleIdSafe(ret->begin(),ret->end());
+ MCAuto<DataArrayDouble> tmp=bary->selectByTupleIdSafe(ret->begin(),ret->end());
coords=DataArrayDouble::Aggregate(coordsTmpSafe,tmp); conn=newConn.retn(); connI=newConnI.retn();
return ret.retn();
}
*/
DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic3D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc(DataArrayInt::New()),descI(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1D=explode3DMeshTo1D(desc,descI,tmp2,tmp3); tmp2=0; tmp3=0;
+ MCAuto<DataArrayInt> desc(DataArrayInt::New()),descI(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> m1D=explode3DMeshTo1D(desc,descI,tmp2,tmp3); tmp2=0; tmp3=0;
return convertLinearCellsToQuadratic2DAnd3D0(m1D,desc,descI,conn,connI,coords,types);
}
DataArrayInt *MEDCouplingUMesh::convertLinearCellsToQuadratic3D1(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc2(DataArrayInt::New()),desc2I(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m2D=buildDescendingConnectivityGen<MinusOneSonsGeneratorBiQuadratic>(desc2,desc2I,tmp2,tmp3,MEDCouplingFastNbrer); tmp2=0; tmp3=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc1(DataArrayInt::New()),desc1I(DataArrayInt::New()),tmp4(DataArrayInt::New()),tmp5(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1D=explode3DMeshTo1D(desc1,desc1I,tmp4,tmp5); tmp4=0; tmp5=0;
+ MCAuto<DataArrayInt> desc2(DataArrayInt::New()),desc2I(DataArrayInt::New()),tmp2(DataArrayInt::New()),tmp3(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> m2D=buildDescendingConnectivityGen<MinusOneSonsGeneratorBiQuadratic>(desc2,desc2I,tmp2,tmp3,MEDCouplingFastNbrer); tmp2=0; tmp3=0;
+ MCAuto<DataArrayInt> desc1(DataArrayInt::New()),desc1I(DataArrayInt::New()),tmp4(DataArrayInt::New()),tmp5(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> m1D=explode3DMeshTo1D(desc1,desc1I,tmp4,tmp5); tmp4=0; tmp5=0;
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(),ret2=DataArrayInt::New(); ret->alloc(0,1); ret2->alloc(0,1);
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New(); newConn->alloc(0,1);
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New(); newConnI->alloc(1,1); newConnI->setIJ(0,0,0);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(),ret2=DataArrayInt::New(); ret->alloc(0,1); ret2->alloc(0,1);
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bary=getBarycenterAndOwner();
+ MCAuto<DataArrayDouble> bary=computeCellCenterOfMass();
const int *descPtr(desc1->begin()),*descIPtr(desc1I->begin()),*desc2Ptr(desc2->begin()),*desc2IPtr(desc2I->begin());
DataArrayInt *conn1D=0,*conn1DI=0,*conn2D=0,*conn2DI=0;
std::set<INTERP_KERNEL::NormalizedCellType> types1D,types2D;
DataArrayDouble *coordsTmp=0,*coordsTmp2=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1D=m1D->convertLinearCellsToQuadratic1D0(conn1D,conn1DI,coordsTmp,types1D); ret1D=DataArrayInt::New(); ret1D->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn1DSafe(conn1D),conn1DISafe(conn1DI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsTmpSafe(coordsTmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2D=m2D->convertLinearCellsToQuadratic2D1(conn2D,conn2DI,coordsTmp2,types2D); ret2D=DataArrayInt::New(); ret2D->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsTmp2Safe(coordsTmp2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn2DSafe(conn2D),conn2DISafe(conn2DI);
+ MCAuto<DataArrayInt> ret1D=m1D->convertLinearCellsToQuadratic1D0(conn1D,conn1DI,coordsTmp,types1D); ret1D=DataArrayInt::New(); ret1D->alloc(0,1);
+ MCAuto<DataArrayInt> conn1DSafe(conn1D),conn1DISafe(conn1DI);
+ MCAuto<DataArrayDouble> coordsTmpSafe(coordsTmp);
+ MCAuto<DataArrayInt> ret2D=m2D->convertLinearCellsToQuadratic2D1(conn2D,conn2DI,coordsTmp2,types2D); ret2D=DataArrayInt::New(); ret2D->alloc(0,1);
+ MCAuto<DataArrayDouble> coordsTmp2Safe(coordsTmp2);
+ MCAuto<DataArrayInt> conn2DSafe(conn2D),conn2DISafe(conn2DI);
const int *c1DPtr=conn1D->begin(),*c1DIPtr=conn1DI->begin(),*c2DPtr=conn2D->begin(),*c2DIPtr=conn2DI->begin();
int nbOfCells=getNumberOfCells();
const int *cPtr=_nodal_connec->getConstPointer();
newConn->pushBackValsSilent(cPtr+icPtr[0],cPtr+icPtr[1]);
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diffRet2D=ret2D->getDifferentValues();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2nRet2D=diffRet2D->invertArrayN2O2O2N(coordsTmp2Safe->getNumberOfTuples());
+ MCAuto<DataArrayInt> diffRet2D=ret2D->getDifferentValues();
+ MCAuto<DataArrayInt> o2nRet2D=diffRet2D->invertArrayN2O2O2N(coordsTmp2Safe->getNumberOfTuples());
coordsTmp2Safe=coordsTmp2Safe->selectByTupleId(diffRet2D->begin(),diffRet2D->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp=bary->selectByTupleIdSafe(ret->begin(),ret->end());
+ MCAuto<DataArrayDouble> tmp=bary->selectByTupleIdSafe(ret->begin(),ret->end());
std::vector<const DataArrayDouble *> v(3); v[0]=coordsTmpSafe; v[1]=coordsTmp2Safe; v[2]=tmp;
int *c=newConn->getPointer();
const int *cI(newConnI->begin());
}
/*!
- * This method implements policy 0 of virtual method ParaMEDMEM::MEDCouplingUMesh::simplexize.
+ * This method implements policy 0 of virtual method MEDCoupling::MEDCouplingUMesh::simplexize.
*/
DataArrayInt *MEDCouplingUMesh::simplexizePol0()
{
if(getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::simplexizePol0 : this policy is only available for mesh with meshdim == 2 !");
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbOfCutCells=getNumberOfCellsWithType(INTERP_KERNEL::NORM_QUAD4);
ret->alloc(nbOfCells+nbOfCutCells,1);
if(nbOfCutCells==0) { ret->iota(0); return ret.retn(); }
int *retPt=ret->getPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
newConnI->alloc(nbOfCells+nbOfCutCells+1,1);
- newConn->alloc(getMeshLength()+3*nbOfCutCells,1);
+ newConn->alloc(getNodalConnectivityArrayLen()+3*nbOfCutCells,1);
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
}
/*!
- * This method implements policy 1 of virtual method ParaMEDMEM::MEDCouplingUMesh::simplexize.
+ * This method implements policy 1 of virtual method MEDCoupling::MEDCouplingUMesh::simplexize.
*/
DataArrayInt *MEDCouplingUMesh::simplexizePol1()
{
if(getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::simplexizePol0 : this policy is only available for mesh with meshdim == 2 !");
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbOfCutCells=getNumberOfCellsWithType(INTERP_KERNEL::NORM_QUAD4);
ret->alloc(nbOfCells+nbOfCutCells,1);
if(nbOfCutCells==0) { ret->iota(0); return ret.retn(); }
int *retPt=ret->getPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
newConnI->alloc(nbOfCells+nbOfCutCells+1,1);
- newConn->alloc(getMeshLength()+3*nbOfCutCells,1);
+ newConn->alloc(getNodalConnectivityArrayLen()+3*nbOfCutCells,1);
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
}
/*!
- * This method implements policy INTERP_KERNEL::PLANAR_FACE_5 of virtual method ParaMEDMEM::MEDCouplingUMesh::simplexize.
+ * This method implements policy INTERP_KERNEL::PLANAR_FACE_5 of virtual method MEDCoupling::MEDCouplingUMesh::simplexize.
*/
DataArrayInt *MEDCouplingUMesh::simplexizePlanarFace5()
{
if(getMeshDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::simplexizePlanarFace5 : this policy is only available for mesh with meshdim == 3 !");
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbOfCutCells=getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8);
ret->alloc(nbOfCells+4*nbOfCutCells,1);
if(nbOfCutCells==0) { ret->iota(0); return ret.retn(); }
int *retPt=ret->getPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
newConnI->alloc(nbOfCells+4*nbOfCutCells+1,1);
- newConn->alloc(getMeshLength()+16*nbOfCutCells,1);//21
+ newConn->alloc(getNodalConnectivityArrayLen()+16*nbOfCutCells,1);//21
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
}
/*!
- * This method implements policy INTERP_KERNEL::PLANAR_FACE_6 of virtual method ParaMEDMEM::MEDCouplingUMesh::simplexize.
+ * This method implements policy INTERP_KERNEL::PLANAR_FACE_6 of virtual method MEDCoupling::MEDCouplingUMesh::simplexize.
*/
DataArrayInt *MEDCouplingUMesh::simplexizePlanarFace6()
{
if(getMeshDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::simplexizePlanarFace6 : this policy is only available for mesh with meshdim == 3 !");
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int nbOfCutCells=getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8);
ret->alloc(nbOfCells+5*nbOfCutCells,1);
if(nbOfCutCells==0) { ret->iota(0); return ret.retn(); }
int *retPt=ret->getPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnI=DataArrayInt::New();
newConnI->alloc(nbOfCells+5*nbOfCutCells+1,1);
- newConn->alloc(getMeshLength()+21*nbOfCutCells,1);
+ newConn->alloc(getNodalConnectivityArrayLen()+21*nbOfCutCells,1);
int *pt=newConn->getPointer();
int *ptI=newConnI->getPointer();
ptI[0]=0;
double epsa=fabs(eps);
if(epsa<std::numeric_limits<double>::min())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::tessellate2DInternal : epsilon is null ! Please specify a higher epsilon. If too tiny it can lead to a huge amount of nodes and memory !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc(buildDescendingConnectivity2(desc1,descIndx1,revDesc1,revDescIndx1));
+ MCAuto<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> mDesc(buildDescendingConnectivity2(desc1,descIndx1,revDesc1,revDescIndx1));
revDesc1=0; revDescIndx1=0;
mDesc->tessellate2D(eps);
subDivide2DMesh(mDesc->_nodal_connec->getConstPointer(),mDesc->_nodal_connec_index->getConstPointer(),desc1->getConstPointer(),descIndx1->getConstPointer());
const double *coords=_coords->getConstPointer();
std::vector<double> addCoo;
std::vector<int> newConn;//no direct DataArrayInt because interface with Geometric2D
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI(DataArrayInt::New());
+ MCAuto<DataArrayInt> newConnI(DataArrayInt::New());
newConnI->alloc(nbCells+1,1);
int *newConnIPtr=newConnI->getPointer();
*newConnIPtr=0;
return ;
_types=types;
DataArrayInt::SetArrayIn(newConnI,_nodal_connec_index);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnArr=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConnArr=DataArrayInt::New();
newConnArr->alloc((int)newConn.size(),1);
std::copy(newConn.begin(),newConn.end(),newConnArr->getPointer());
DataArrayInt::SetArrayIn(newConnArr,_nodal_connec);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> newCoords=DataArrayDouble::New();
newCoords->alloc(nbNodes+((int)addCoo.size())/2,2);
double *work=std::copy(_coords->begin(),_coords->end(),newCoords->getPointer());
std::copy(addCoo.begin(),addCoo.end(),work);
connI[1]=newConnLgth;
}
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
+ MCAuto<DataArrayInt> newConn=DataArrayInt::New();
newConn->alloc(newConnLgth,1);
int *work=newConn->getPointer();
for(int i=0;i<nbOfCells;i++)
int nbOfCells=getNumberOfCells();
if(nbOfCells<1)
return ;
- int initMeshLgth=getMeshLength();
+ int initMeshLgth=getNodalConnectivityArrayLen();
int *conn=_nodal_connec->getPointer();
int *index=_nodal_connec_index->getPointer();
int posOfCurCell=0;
int *conn=_nodal_connec->getPointer();
const int *connI=_nodal_connec_index->getConstPointer();
const double *coo=getCoords()->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cells(DataArrayInt::New()); cells->alloc(0,1);
+ MCAuto<DataArrayInt> cells(DataArrayInt::New()); cells->alloc(0,1);
for(int i=0;i<nbOfCells;i++)
{
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connI[i]]);
/*!
* This method is a faster method to correct orientation of all 3D cells in \a this.
* This method works only if \a this is a 3D mesh, that is to say a mesh with mesh dimension 3 and a space dimension 3.
- * This method makes the hypothesis that \a this a coherent that is to say MEDCouplingUMesh::checkCoherency1 should throw no exception.
+ * This method makes the hypothesis that \a this a coherent that is to say MEDCouplingUMesh::checkConsistency should throw no exception.
*
* \return a newly allocated int array with one components containing cell ids renumbered to fit the convention of MED (MED file and MEDCoupling)
* \sa MEDCouplingUMesh::orientCorrectlyPolyhedrons,
int *conn=_nodal_connec->getPointer();
const int *connI=_nodal_connec_index->getConstPointer();
const double *coordsPtr=_coords->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(0,1);
for(int i=0;i<nbOfCells;i++)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
*/
MEDCouplingFieldDouble *MEDCouplingUMesh::getEdgeRatioField() const
{
- checkCoherency();
+ checkConsistencyLight();
int spaceDim=getSpaceDimension();
int meshDim=getMeshDimension();
if(spaceDim!=2 && spaceDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getEdgeRatioField : SpaceDimension must be equal to 2 or 3 !");
if(meshDim!=2 && meshDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getEdgeRatioField : MeshDimension must be equal to 2 or 3 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
ret->setMesh(this);
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
*/
MEDCouplingFieldDouble *MEDCouplingUMesh::getAspectRatioField() const
{
- checkCoherency();
+ checkConsistencyLight();
int spaceDim=getSpaceDimension();
int meshDim=getMeshDimension();
if(spaceDim!=2 && spaceDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getAspectRatioField : SpaceDimension must be equal to 2 or 3 !");
if(meshDim!=2 && meshDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getAspectRatioField : MeshDimension must be equal to 2 or 3 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
ret->setMesh(this);
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
*/
MEDCouplingFieldDouble *MEDCouplingUMesh::getWarpField() const
{
- checkCoherency();
+ checkConsistencyLight();
int spaceDim=getSpaceDimension();
int meshDim=getMeshDimension();
if(spaceDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getWarpField : SpaceDimension must be equal to 3 !");
if(meshDim!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getWarpField : MeshDimension must be equal to 2 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
ret->setMesh(this);
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
*/
MEDCouplingFieldDouble *MEDCouplingUMesh::getSkewField() const
{
- checkCoherency();
+ checkConsistencyLight();
int spaceDim=getSpaceDimension();
int meshDim=getMeshDimension();
if(spaceDim!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getSkewField : SpaceDimension must be equal to 3 !");
if(meshDim!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getSkewField : MeshDimension must be equal to 2 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
ret->setMesh(this);
int nbOfCells=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
arr->alloc(nbOfCells,1);
double *pt=arr->getPointer();
ret->setArray(arr);//In case of throw to avoid mem leaks arr will be used after decrRef.
*/
MEDCouplingFieldDouble *MEDCouplingUMesh::computeDiameterField() const
{
- checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME));
+ checkConsistencyLight();
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME));
ret->setMesh(this);
std::set<INTERP_KERNEL::NormalizedCellType> types;
ComputeAllTypesInternal(types,_nodal_connec,_nodal_connec_index);
int spaceDim(getSpaceDimension()),nbCells(getNumberOfCells());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> arr(DataArrayDouble::New());
arr->alloc(nbCells,1);
for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=types.begin();it!=types.end();it++)
{
INTERP_KERNEL::AutoCppPtr<INTERP_KERNEL::DiameterCalculator> dc(INTERP_KERNEL::CellModel::GetCellModel(*it).buildInstanceOfDiameterCalulator(spaceDim));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds(giveCellsWithType(*it));
+ MCAuto<DataArrayInt> cellIds(giveCellsWithType(*it));
dc->computeForListOfCellIdsUMeshFrmt(cellIds->begin(),cellIds->end(),_nodal_connec_index->begin(),_nodal_connec->begin(),getCoords()->begin(),arr->getPointer());
}
ret->setArray(arr);
{
checkFullyDefined();
int spaceDim(getSpaceDimension()),nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
double *bbox(ret->getPointer());
for(int i=0;i<nbOfCells*spaceDim;i++)
{
int spaceDim(getSpaceDimension()),mDim(getMeshDimension()),nbOfCells(getNumberOfCells());
if(spaceDim!=2 || mDim!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic : This method should be applied on mesh with mesh dimension equal to 2 and space dimension also equal to 2!");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
double *bbox(ret->getPointer());
const double *coords(_coords->getConstPointer());
const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
int spaceDim(getSpaceDimension()),mDim(getMeshDimension()),nbOfCells(getNumberOfCells());
if(spaceDim!=2 || mDim!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic : This method should be applied on mesh with mesh dimension equal to 1 and space dimension also equal to 2!");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
double *bbox(ret->getPointer());
const double *coords(_coords->getConstPointer());
const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
/// @cond INTERNAL
-namespace ParaMEDMEMImpl
+namespace MEDCouplingImpl
{
class ConnReader
{
}
types.insert(typ);
ret[3*i]=typ;
- const int *work2=std::find_if(work+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,typ));
+ const int *work2=std::find_if(work+1,connI+nbOfCells,MEDCouplingImpl::ConnReader(conn,typ));
ret[3*i+1]=(int)std::distance(work,work2);
work=work2;
}
if(types.size()==_types.size())
return 0;
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nb,1);
int *retPtr=ret->getPointer();
const int *connI=_nodal_connec_index->getConstPointer();
int kk=0;
for(std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator it=types.begin();it!=types.end();it++,kk++)
{
- i=std::find_if(i,connI+nbOfCells,ParaMEDMEMImpl::ConnReader2(conn,(int)(*it)));
+ i=std::find_if(i,connI+nbOfCells,MEDCouplingImpl::ConnReader2(conn,(int)(*it)));
int offset=(int)std::distance(connI,i);
- const int *j=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)(*it)));
+ const int *j=std::find_if(i+1,connI+nbOfCells,MEDCouplingImpl::ConnReader(conn,(int)(*it)));
int nbOfCellsOfCurType=(int)std::distance(i,j);
if(code[3*kk+2]==-1)
for(int k=0;k<nbOfCellsOfCurType;k++)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::splitProfilePerType : current mesh is not sorted by type !");
}
types.push_back(curType);
- i=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)curType));
+ i=std::find_if(i+1,connI+nbOfCells,MEDCouplingImpl::ConnReader(conn,(int)curType));
typeRangeVals.push_back((int)std::distance(connI,i));
}
//
DataArrayInt *castArr=0,*rankInsideCast=0,*castsPresent=0;
profile->splitByValueRange(&typeRangeVals[0],&typeRangeVals[0]+typeRangeVals.size(),castArr,rankInsideCast,castsPresent);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp0=castArr;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1=rankInsideCast;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp2=castsPresent;
+ MCAuto<DataArrayInt> tmp0=castArr;
+ MCAuto<DataArrayInt> tmp1=rankInsideCast;
+ MCAuto<DataArrayInt> tmp2=castsPresent;
//
int nbOfCastsFinal=castsPresent->getNumberOfTuples();
code.resize(3*nbOfCastsFinal);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > idsInPflPerType2;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > idsPerType2;
+ std::vector< MCAuto<DataArrayInt> > idsInPflPerType2;
+ std::vector< MCAuto<DataArrayInt> > idsPerType2;
for(int i=0;i<nbOfCastsFinal;i++)
{
int castId=castsPresent->getIJ(i,0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp3=castArr->getIdsEqual(castId);
+ MCAuto<DataArrayInt> tmp3=castArr->findIdsEqual(castId);
idsInPflPerType2.push_back(tmp3);
code[3*i]=(int)types[castId];
code[3*i+1]=tmp3->getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp4=rankInsideCast->selectByTupleId(tmp3->getConstPointer(),tmp3->getConstPointer()+tmp3->getNumberOfTuples());
- if(!tmp4->isIdentity2(typeRangeVals[castId+1]-typeRangeVals[castId]))
+ MCAuto<DataArrayInt> tmp4=rankInsideCast->selectByTupleId(tmp3->getConstPointer(),tmp3->getConstPointer()+tmp3->getNumberOfTuples());
+ if(!tmp4->isIota(typeRangeVals[castId+1]-typeRangeVals[castId]))
{
tmp4->copyStringInfoFrom(*profile);
idsPerType2.push_back(tmp4);
* This method is here too emulate the MEDMEM behaviour on BDC (buildDescendingConnectivity). Hoping this method becomes deprecated very soon.
* This method make the assumption that \a this and 'nM1LevMesh' mesh lyies on same coords (same pointer) as MED and MEDMEM does.
* The following equality should be verified 'nM1LevMesh->getMeshDimension()==this->getMeshDimension()-1'
- * This method returns 5+2 elements. 'desc', 'descIndx', 'revDesc', 'revDescIndx' and 'meshnM1' behaves exactly as ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity except the content as described after. The returned array specifies the n-1 mesh reordered by type as MEDMEM does. 'nM1LevMeshIds' contains the ids in returned 'meshnM1'. Finally 'meshnM1Old2New' contains numbering old2new that is to say the cell #k in coarse 'nM1LevMesh' will have the number ret[k] in returned mesh 'nM1LevMesh' MEDMEM reordered.
+ * This method returns 5+2 elements. 'desc', 'descIndx', 'revDesc', 'revDescIndx' and 'meshnM1' behaves exactly as MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity except the content as described after. The returned array specifies the n-1 mesh reordered by type as MEDMEM does. 'nM1LevMeshIds' contains the ids in returned 'meshnM1'. Finally 'meshnM1Old2New' contains numbering old2new that is to say the cell #k in coarse 'nM1LevMesh' will have the number ret[k] in returned mesh 'nM1LevMesh' MEDMEM reordered.
*/
MEDCouplingUMesh *MEDCouplingUMesh::emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh, DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *&revDesc, DataArrayInt *&revDescIndx, DataArrayInt *& nM1LevMeshIds, DataArrayInt *&meshnM1Old2New) const
{
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::emulateMEDMEMBDC : The mesh passed as first argument should have a meshDim equal to this->getMeshDimension()-1 !" );
if(_coords!=nM1LevMesh->getCoords())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::emulateMEDMEMBDC : 'this' and mesh in first argument should share the same coords : Use tryToShareSameCoords method !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret1=buildDescendingConnectivity(desc,descIndx,tmp0,tmp1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret0=ret1->sortCellsInMEDFileFrmt();
+ MCAuto<DataArrayInt> tmp0=DataArrayInt::New();
+ MCAuto<DataArrayInt> tmp1=DataArrayInt::New();
+ MCAuto<MEDCouplingUMesh> ret1=buildDescendingConnectivity(desc,descIndx,tmp0,tmp1);
+ MCAuto<DataArrayInt> ret0=ret1->sortCellsInMEDFileFrmt();
desc->transformWithIndArr(ret0->getConstPointer(),ret0->getConstPointer()+ret0->getNbOfElems());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
tmp->setConnectivity(tmp0,tmp1);
tmp->renumberCells(ret0->getConstPointer(),false);
revDesc=tmp->getNodalConnectivity();
DataArrayInt *MEDCouplingUMesh::sortCellsInMEDFileFrmt()
{
checkConnectivityFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=getRenumArrForMEDFileFrmt();
+ MCAuto<DataArrayInt> ret=getRenumArrForMEDFileFrmt();
renumberCells(ret->getConstPointer(),false);
return ret.retn();
}
if(types.find(curType)!=types.end())
return false;
types.insert(curType);
- i=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)curType));
+ i=std::find_if(i+1,connI+nbOfCells,MEDCouplingImpl::ConnReader(conn,(int)curType));
}
return true;
}
if(pos<=lastPos)
return false;
lastPos=pos;
- i=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)curType));
+ i=std::find_if(i+1,connI+nbOfCells,MEDCouplingImpl::ConnReader(conn,(int)curType));
}
else
{
if(sg.find(curType)==sg.end())
{
- i=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)curType));
+ i=std::find_if(i+1,connI+nbOfCells,MEDCouplingImpl::ConnReader(conn,(int)curType));
sg.insert(curType);
}
else
int nbOfCells=getNumberOfCells();
const int *conn=_nodal_connec->getConstPointer();
const int *connI=_nodal_connec_index->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmpa=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmpb=DataArrayInt::New();
+ MCAuto<DataArrayInt> tmpa=DataArrayInt::New();
+ MCAuto<DataArrayInt> tmpb=DataArrayInt::New();
tmpa->alloc(nbOfCells,1);
tmpb->alloc((int)std::distance(orderBg,orderEnd),1);
tmpb->fillWithZero();
DataArrayInt *MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
{
DataArrayInt *nbPerType=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmpa=getLevArrPerCellTypes(orderBg,orderEnd,nbPerType);
+ MCAuto<DataArrayInt> tmpa=getLevArrPerCellTypes(orderBg,orderEnd,nbPerType);
nbPerType->decrRef();
return tmpa->buildPermArrPerLevel();
}
{
INTERP_KERNEL::NormalizedCellType curType=(INTERP_KERNEL::NormalizedCellType)conn[*i];
int beginCellId=(int)std::distance(connI,i);
- i=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)curType));
+ i=std::find_if(i+1,connI+nbOfCells,MEDCouplingImpl::ConnReader(conn,(int)curType));
int endCellId=(int)std::distance(connI,i);
int sz=endCellId-beginCellId;
int *cells=new int[sz];
if(_types.size()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : current mesh does not contain exactly one geometric type !");
INTERP_KERNEL::NormalizedCellType typ=*_types.begin();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> ret=MEDCoupling1GTUMesh::New(getName(),typ);
+ MCAuto<MEDCoupling1GTUMesh> ret=MEDCoupling1GTUMesh::New(getName(),typ);
ret->setCoords(getCoords());
MEDCoupling1SGTUMesh *retC=dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh*)ret);
if(retC)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=convertNodalConnectivityToStaticGeoTypeMesh();
+ MCAuto<DataArrayInt> c=convertNodalConnectivityToStaticGeoTypeMesh();
retC->setNodalConnectivity(c);
}
else
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : Internal error !");
DataArrayInt *c=0,*ci=0;
convertNodalConnectivityToDynamicGeoTypeMesh(c,ci);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cs(c),cis(ci);
+ MCAuto<DataArrayInt> cs(c),cis(ci);
retD->setNodalConnectivity(cs,cis);
}
return ret.retn();
int nbCells=getNumberOfCells();
int typi=(int)typ;
int nbNodesPerCell=(int)cm.getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connOut=DataArrayInt::New(); connOut->alloc(nbCells*nbNodesPerCell,1);
+ MCAuto<DataArrayInt> connOut=DataArrayInt::New(); connOut->alloc(nbCells*nbNodesPerCell,1);
int *outPtr=connOut->getPointer();
const int *conn=_nodal_connec->begin();
const int *connI=_nodal_connec_index->begin();
*/
void MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayInt *&nodalConn, DataArrayInt *&nodalConnIndex) const
{
- static const char msg0[]="MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh : nodal connectivity in this are invalid ! Call checkCoherency1 !";
+ static const char msg0[]="MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh : nodal connectivity in this are invalid ! Call checkConsistency !";
checkConnectivityFullyDefined();
if(_types.size()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh : current mesh does not contain exactly one geometric type !");
int nbCells=getNumberOfCells(),lgth=_nodal_connec->getNumberOfTuples();
if(lgth<nbCells)
throw INTERP_KERNEL::Exception(msg0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(DataArrayInt::New()),ci(DataArrayInt::New());
+ MCAuto<DataArrayInt> c(DataArrayInt::New()),ci(DataArrayInt::New());
c->alloc(lgth-nbCells,1); ci->alloc(nbCells+1,1);
int *cp(c->getPointer()),*cip(ci->getPointer());
const int *incp(_nodal_connec->begin()),*incip(_nodal_connec_index->begin());
const DataArrayDouble *refCoo=ms2[0]->getCoords();
int meshDim=ms2[0]->getMeshDimension();
std::vector<const MEDCouplingUMesh *> m1ssm;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > m1ssmAuto;
+ std::vector< MCAuto<MEDCouplingUMesh> > m1ssmAuto;
//
std::vector<const MEDCouplingUMesh *> m1ssmSingle;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > m1ssmSingleAuto;
+ std::vector< MCAuto<MEDCouplingUMesh> > m1ssmSingleAuto;
int fake=0,rk=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret1(DataArrayInt::New()),ret2(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret1(DataArrayInt::New()),ret2(DataArrayInt::New());
ret1->alloc(0,1); ret2->alloc(0,1);
for(std::vector<const MEDCouplingUMesh *>::const_iterator it=ms2.begin();it!=ms2.end();it++,rk++)
{
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords : meshes are not shared by a single coordinates coords !");
std::vector<MEDCouplingUMesh *> sp=(*it)->splitByType();
std::copy(sp.begin(),sp.end(),std::back_insert_iterator< std::vector<const MEDCouplingUMesh *> >(m1ssm));
- std::copy(sp.begin(),sp.end(),std::back_insert_iterator< std::vector<MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > >(m1ssmAuto));
+ std::copy(sp.begin(),sp.end(),std::back_insert_iterator< std::vector<MCAuto<MEDCouplingUMesh> > >(m1ssmAuto));
for(std::vector<MEDCouplingUMesh *>::const_iterator it2=sp.begin();it2!=sp.end();it2++)
{
MEDCouplingUMesh *singleCell=static_cast<MEDCouplingUMesh *>((*it2)->buildPartOfMySelf(&fake,&fake+1,true));
ret1->pushBackSilent((*it2)->getNumberOfCells()); ret2->pushBackSilent(rk);
}
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1ssmSingle2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(m1ssmSingle);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renum=m1ssmSingle2->sortCellsInMEDFileFrmt();
+ MCAuto<MEDCouplingUMesh> m1ssmSingle2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(m1ssmSingle);
+ MCAuto<DataArrayInt> renum=m1ssmSingle2->sortCellsInMEDFileFrmt();
std::vector<const MEDCouplingUMesh *> m1ssmfinal(m1ssm.size());
for(std::size_t i=0;i<m1ssm.size();i++)
m1ssmfinal[renum->getIJ(i,0)]=m1ssm[i];
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret0=MEDCouplingUMesh::MergeUMeshesOnSameCoords(m1ssmfinal);
+ MCAuto<MEDCouplingUMesh> ret0=MEDCouplingUMesh::MergeUMeshesOnSameCoords(m1ssmfinal);
szOfCellGrpOfSameType=ret1->renumber(renum->getConstPointer());
idInMsOfCellGrpOfSameType=ret2->renumber(renum->getConstPointer());
return ret0.retn();
checkFullyDefined();
const int *conn=_nodal_connec->getConstPointer();
const int *connIndex=_nodal_connec_index->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
for(const int *w=begin;w!=end;w++)
if((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*w]]==type)
ret->pushBackSilent(*w);
oss << ". It should be in [0," << szOfType << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsTokeep=DataArrayInt::New(); idsTokeep->alloc(sz+(int)std::distance(idsPerGeoTypeBg,idsPerGeoTypeEnd),1);
+ MCAuto<DataArrayInt> idsTokeep=DataArrayInt::New(); idsTokeep->alloc(sz+(int)std::distance(idsPerGeoTypeBg,idsPerGeoTypeEnd),1);
int *idsPtr=idsTokeep->getPointer();
int offset=0;
for(std::size_t i=0;i<nOfTypesInThis;i++)
idsPtr=std::transform(idsPerGeoTypeBg,idsPerGeoTypeEnd,idsPtr,std::bind2nd(std::plus<int>(),offset));
offset+=code[3*i+1];
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(idsTokeep->begin(),idsTokeep->end(),true));
+ MCAuto<MEDCouplingUMesh> ret=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(idsTokeep->begin(),idsTokeep->end(),true));
ret->copyTinyInfoFrom(this);
return ret.retn();
}
* \throw If the nodal connectivity of cells is not defined.
* \sa MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell
*/
-DataArrayDouble *MEDCouplingUMesh::getBarycenterAndOwner() const
+DataArrayDouble *MEDCouplingUMesh::computeCellCenterOfMass() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int spaceDim=getSpaceDimension();
int nbOfCells=getNumberOfCells();
ret->alloc(nbOfCells,spaceDim);
/*!
* This method computes for each cell in \a this, the location of the iso barycenter of nodes constituting
- * the cell. Contrary to badly named MEDCouplingUMesh::getBarycenterAndOwner method that returns the center of inertia of the
+ * the cell. Contrary to badly named MEDCouplingUMesh::computeCellCenterOfMass method that returns the center of inertia of the
*
* \return a newly allocated DataArrayDouble instance that the caller has to deal with. The returned
* DataArrayDouble instance will have \c this->getNumberOfCells() tuples and \c this->getSpaceDimension() components.
*
- * \sa MEDCouplingUMesh::getBarycenterAndOwner
+ * \sa MEDCouplingUMesh::computeCellCenterOfMass
* \throw If \a this is not fully defined (coordinates and connectivity)
* \throw If there is presence in nodal connectivity in \a this of node ids not in [0, \c this->getNumberOfNodes() )
*/
DataArrayDouble *MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell() const
{
checkFullyDefined();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int spaceDim=getSpaceDimension();
int nbOfCells=getNumberOfCells();
int nbOfNodes=getNumberOfNodes();
*/
DataArrayDouble *MEDCouplingUMesh::computePlaneEquationOf3DFaces() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
int nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes());
if(getSpaceDimension()!=3 || getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::computePlaneEquationOf3DFaces : This method must be applied on a mesh having meshDimension equal 2 and a spaceDimension equal to 3 !");
if(!da)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::Build0DMeshFromCoords : instance of DataArrayDouble must be not null !");
da->checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(da->getName(),0);
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(da->getName(),0);
ret->setCoords(da);
int nbOfTuples=da->getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cI=DataArrayInt::New();
+ MCAuto<DataArrayInt> c=DataArrayInt::New();
+ MCAuto<DataArrayInt> cI=DataArrayInt::New();
c->alloc(2*nbOfTuples,1);
cI->alloc(nbOfTuples+1,1);
int *cp=c->getPointer();
std::ostringstream oss; oss << "MEDCouplingUMesh::MergeUMeshes : item #" << ii << " in input array of size "<< sz << " is empty !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > bb(sz);
+ std::vector< MCAuto<MEDCouplingUMesh> > bb(sz);
std::vector< const MEDCouplingUMesh * > aa(sz);
int spaceDim=-3;
for(std::size_t i=0;i<sz && spaceDim==-3;i++)
std::vector<const MEDCouplingUMesh *>::const_iterator it=a.begin();
int meshDim=(*it)->getMeshDimension();
int nbOfCells=(*it)->getNumberOfCells();
- int meshLgth=(*it++)->getMeshLength();
+ int meshLgth=(*it++)->getNodalConnectivityArrayLen();
for(;it!=a.end();it++)
{
if(meshDim!=(*it)->getMeshDimension())
throw INTERP_KERNEL::Exception("Mesh dimensions mismatches, MergeUMeshes impossible !");
nbOfCells+=(*it)->getNumberOfCells();
- meshLgth+=(*it)->getMeshLength();
+ meshLgth+=(*it)->getNodalConnectivityArrayLen();
}
std::vector<const MEDCouplingPointSet *> aps(a.size());
std::copy(a.begin(),a.end(),aps.begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> pts=MergeNodesArray(aps);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("merge",meshDim);
+ MCAuto<DataArrayDouble> pts=MergeNodesArray(aps);
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("merge",meshDim);
ret->setCoords(pts);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New();
+ MCAuto<DataArrayInt> c=DataArrayInt::New();
c->alloc(meshLgth,1);
int *cPtr=c->getPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cI=DataArrayInt::New();
+ MCAuto<DataArrayInt> cI=DataArrayInt::New();
cI->alloc(nbOfCells+1,1);
int *cIPtr=cI->getPointer();
*cIPtr++=0;
throw INTERP_KERNEL::Exception("meshes does not share the same coords ! Try using tryToShareSameCoords method !");
if(meshDim!=(*iter)->getMeshDimension())
throw INTERP_KERNEL::Exception("Mesh dimensions mismatches, FuseUMeshesOnSameCoords impossible !");
- meshLgth+=(*iter)->getMeshLength();
+ meshLgth+=(*iter)->getNodalConnectivityArrayLen();
meshIndexLgth+=(*iter)->getNumberOfCells();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodal=DataArrayInt::New();
+ MCAuto<DataArrayInt> nodal=DataArrayInt::New();
nodal->alloc(meshLgth,1);
int *nodalPtr=nodal->getPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodalIndex=DataArrayInt::New();
+ MCAuto<DataArrayInt> nodalIndex=DataArrayInt::New();
nodalIndex->alloc(meshIndexLgth+1,1);
int *nodalIndexPtr=nodalIndex->getPointer();
int offset=0;
const int *nod=(*iter)->getNodalConnectivity()->getConstPointer();
const int *index=(*iter)->getNodalConnectivityIndex()->getConstPointer();
int nbOfCells=(*iter)->getNumberOfCells();
- int meshLgth2=(*iter)->getMeshLength();
+ int meshLgth2=(*iter)->getNodalConnectivityArrayLen();
nodalPtr=std::copy(nod,nod+meshLgth2,nodalPtr);
if(iter!=meshes.begin())
nodalIndexPtr=std::transform(index+1,index+nbOfCells+1,nodalIndexPtr,std::bind2nd(std::plus<int>(),offset));
MEDCouplingUMesh *MEDCouplingUMesh::FuseUMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& meshes, int compType, std::vector<DataArrayInt *>& corr)
{
//All checks are delegated to MergeUMeshesOnSameCoords
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MergeUMeshesOnSameCoords(meshes);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=ret->zipConnectivityTraducer(compType);
+ MCAuto<MEDCouplingUMesh> ret=MergeUMeshesOnSameCoords(meshes);
+ MCAuto<DataArrayInt> o2n=ret->zipConnectivityTraducer(compType);
corr.resize(meshes.size());
std::size_t nbOfMeshes=meshes.size();
int offset=0;
* array is created by concatenating the connectivity arrays of all given meshes. All
* the given meshes must be of the same space dimension but dimension of cells **can
* differ**. This method is particulary useful in MEDLoader context to build a \ref
- * ParaMEDMEM::MEDFileUMesh "MEDFileUMesh" instance that expects that underlying
+ * MEDCoupling::MEDFileUMesh "MEDFileUMesh" instance that expects that underlying
* MEDCouplingUMesh'es of different dimension share the same nodal connectivity array.
* \param [in,out] meshes - a vector of meshes to update.
* \throw If any of \a meshes is NULL.
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> res=DataArrayDouble::Aggregate(coords);
+ MCAuto<DataArrayDouble> res=DataArrayDouble::Aggregate(coords);
std::vector<MEDCouplingUMesh *>::const_iterator it=meshes.begin();
int offset=(*it)->getNumberOfNodes();
(*it++)->setCoords(res);
* Merges nodes coincident with a given precision within all given meshes that share
* the nodal connectivity array. The given meshes **can be of different** mesh
* dimension. This method is particulary useful in MEDLoader context to build a \ref
- * ParaMEDMEM::MEDFileUMesh "MEDFileUMesh" instance that expects that underlying
+ * MEDCoupling::MEDFileUMesh "MEDFileUMesh" instance that expects that underlying
* MEDCouplingUMesh'es of different dimension share the same nodal connectivity array.
* \param [in,out] meshes - a vector of meshes to update.
* \param [in] eps - the precision used to detect coincident nodes (infinite norm).
//
DataArrayInt *comm,*commI;
coo->findCommonTuples(eps,-1,comm,commI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1(comm),tmp2(commI);
+ MCAuto<DataArrayInt> tmp1(comm),tmp2(commI);
int oldNbOfNodes=coo->getNumberOfTuples();
int newNbOfNodes;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(oldNbOfNodes,comm->begin(),commI->begin(),commI->end(),newNbOfNodes);
+ MCAuto<DataArrayInt> o2n=DataArrayInt::ConvertIndexArrayToO2N(oldNbOfNodes,comm->begin(),commI->begin(),commI->end(),newNbOfNodes);
if(oldNbOfNodes==newNbOfNodes)
return ;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords=coo->renumberAndReduce(o2n->getConstPointer(),newNbOfNodes);
+ MCAuto<DataArrayDouble> newCoords=coo->renumberAndReduce(o2n->getConstPointer(),newNbOfNodes);
for(std::vector<MEDCouplingUMesh *>::const_iterator it=meshes.begin();it!=meshes.end();it++)
{
(*it)->renumberNodesInConn(o2n->getConstPointer());
{
std::size_t sz=std::distance(begin,end);
if(sz!=4)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsTetra4WellOriented : Tetra4 cell with not 4 nodes ! Call checkCoherency1 !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsTetra4WellOriented : Tetra4 cell with not 4 nodes ! Call checkConsistency !");
double vec0[3],vec1[3];
const double *pt0=coords+3*begin[0],*pt1=coords+3*begin[1],*pt2=coords+3*begin[2],*pt3=coords+3*begin[3];
vec0[0]=pt1[0]-pt0[0]; vec0[1]=pt1[1]-pt0[1]; vec0[2]=pt1[2]-pt0[2]; vec1[0]=pt2[0]-pt0[0]; vec1[1]=pt2[1]-pt0[1]; vec1[2]=pt2[2]-pt0[2];
{
std::size_t sz=std::distance(begin,end);
if(sz!=5)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsPyra5WellOriented : Pyra5 cell with not 5 nodes ! Call checkCoherency1 !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::IsPyra5WellOriented : Pyra5 cell with not 5 nodes ! Call checkConsistency !");
double vec0[3];
INTERP_KERNEL::areaVectorOfPolygon<int,INTERP_KERNEL::ALL_C_MODE>(begin,4,coords,vec0);
const double *pt0=coords+3*begin[0],*pt1=coords+3*begin[4];
void MEDCouplingUMesh::SimplifyPolyhedronCell(double eps, const DataArrayDouble *coords, const int *begin, const int *end, DataArrayInt *res)
{
int nbFaces=std::count(begin+1,end,-1)+1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> v=DataArrayDouble::New(); v->alloc(nbFaces,3);
+ MCAuto<DataArrayDouble> v=DataArrayDouble::New(); v->alloc(nbFaces,3);
double *vPtr=v->getPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> p=DataArrayDouble::New(); p->alloc(nbFaces,1);
+ MCAuto<DataArrayDouble> p=DataArrayDouble::New(); p->alloc(nbFaces,1);
double *pPtr=p->getPointer();
const int *stFaceConn=begin+1;
for(int i=0;i<nbFaces;i++,vPtr+=3,pPtr++)
pPtr=p->getPointer(); vPtr=v->getPointer();
DataArrayInt *comm1=0,*commI1=0;
v->findCommonTuples(eps,-1,comm1,commI1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> comm1Auto(comm1),commI1Auto(commI1);
+ MCAuto<DataArrayInt> comm1Auto(comm1),commI1Auto(commI1);
const int *comm1Ptr=comm1->getConstPointer();
const int *commI1Ptr=commI1->getConstPointer();
int nbOfGrps1=commI1Auto->getNumberOfTuples()-1;
res->pushBackSilent((int)INTERP_KERNEL::NORM_POLYHED);
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mm=MEDCouplingUMesh::New("",3);
+ MCAuto<MEDCouplingUMesh> mm=MEDCouplingUMesh::New("",3);
mm->setCoords(const_cast<DataArrayDouble *>(coords)); mm->allocateCells(1); mm->insertNextCell(INTERP_KERNEL::NORM_POLYHED,(int)std::distance(begin+1,end),begin+1);
mm->finishInsertingCells();
//
for(int i=0;i<nbOfGrps1;i++)
{
int vecId=comm1Ptr[commI1Ptr[i]];
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmpgrp2=p->selectByTupleId(comm1Ptr+commI1Ptr[i],comm1Ptr+commI1Ptr[i+1]);
+ MCAuto<DataArrayDouble> tmpgrp2=p->selectByTupleId(comm1Ptr+commI1Ptr[i],comm1Ptr+commI1Ptr[i+1]);
DataArrayInt *comm2=0,*commI2=0;
tmpgrp2->findCommonTuples(eps,-1,comm2,commI2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> comm2Auto(comm2),commI2Auto(commI2);
+ MCAuto<DataArrayInt> comm2Auto(comm2),commI2Auto(commI2);
const int *comm2Ptr=comm2->getConstPointer();
const int *commI2Ptr=commI2->getConstPointer();
int nbOfGrps2=commI2Auto->getNumberOfTuples()-1;
else
{
int pointId=comm1Ptr[commI1Ptr[i]+comm2Ptr[commI2Ptr[j]]];
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids2=comm2->selectByTupleId2(commI2Ptr[j],commI2Ptr[j+1],1);
+ MCAuto<DataArrayInt> ids2=comm2->selectByTupleIdSafeSlice(commI2Ptr[j],commI2Ptr[j+1],1);
ids2->transformWithIndArr(comm1Ptr+commI1Ptr[i],comm1Ptr+commI1Ptr[i+1]);
DataArrayInt *tmp0=DataArrayInt::New(),*tmp1=DataArrayInt::New(),*tmp2=DataArrayInt::New(),*tmp3=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mm2=mm->buildDescendingConnectivity(tmp0,tmp1,tmp2,tmp3); tmp0->decrRef(); tmp1->decrRef(); tmp2->decrRef(); tmp3->decrRef();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mm3=static_cast<MEDCouplingUMesh *>(mm2->buildPartOfMySelf(ids2->begin(),ids2->end(),true));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsNodeTmp=mm3->zipCoordsTraducer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsNode=idsNodeTmp->invertArrayO2N2N2O(mm3->getNumberOfNodes());
+ MCAuto<MEDCouplingUMesh> mm2=mm->buildDescendingConnectivity(tmp0,tmp1,tmp2,tmp3); tmp0->decrRef(); tmp1->decrRef(); tmp2->decrRef(); tmp3->decrRef();
+ MCAuto<MEDCouplingUMesh> mm3=static_cast<MEDCouplingUMesh *>(mm2->buildPartOfMySelf(ids2->begin(),ids2->end(),true));
+ MCAuto<DataArrayInt> idsNodeTmp=mm3->zipCoordsTraducer();
+ MCAuto<DataArrayInt> idsNode=idsNodeTmp->invertArrayO2N2N2O(mm3->getNumberOfNodes());
const int *idsNodePtr=idsNode->getConstPointer();
double center[3]; center[0]=pPtr[pointId]*vPtr[3*vecId]; center[1]=pPtr[pointId]*vPtr[3*vecId+1]; center[2]=pPtr[pointId]*vPtr[3*vecId+2];
double vec[3]; vec[0]=vPtr[3*vecId+1]; vec[1]=-vPtr[3*vecId]; vec[2]=0.;
mm3->rotate(center,vec,angle);
}
mm3->changeSpaceDimension(2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mm4=mm3->buildSpreadZonesWithPoly();
+ MCAuto<MEDCouplingUMesh> mm4=mm3->buildSpreadZonesWithPoly();
const int *conn4=mm4->getNodalConnectivity()->getConstPointer();
const int *connI4=mm4->getNodalConnectivityIndex()->getConstPointer();
int nbOfCells=mm4->getNumberOfCells();
{
int nbOfNodesExpected(skin->getNumberOfNodes());
const int *n2oPtr(n2o->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
+ MCAuto<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
skin->getReverseNodalConnectivity(revNodal,revNodalI);
const int *revNodalPtr(revNodal->getConstPointer()),*revNodalIPtr(revNodalI->getConstPointer());
const int *nodalPtr(skin->getNodalConnectivity()->getConstPointer());
const int *nodalIPtr(skin->getNodalConnectivityIndex()->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
int *work(ret->getPointer()); *work++=INTERP_KERNEL::NORM_POLYGON;
if(nbOfNodesExpected<1)
return ret.retn();
int nbOfNodesExpected(skin->getNumberOfNodes());
int nbOfTurn(nbOfNodesExpected/2);
const int *n2oPtr(n2o->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
+ MCAuto<DataArrayInt> revNodal(DataArrayInt::New()),revNodalI(DataArrayInt::New());
skin->getReverseNodalConnectivity(revNodal,revNodalI);
const int *revNodalPtr(revNodal->getConstPointer()),*revNodalIPtr(revNodalI->getConstPointer());
const int *nodalPtr(skin->getNodalConnectivity()->getConstPointer());
const int *nodalIPtr(skin->getNodalConnectivityIndex()->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodesExpected+1,1);
int *work(ret->getPointer()); *work++=INTERP_KERNEL::NORM_QPOLYG;
if(nbOfNodesExpected<1)
return ret.retn();
{
if(getMeshDimension()!=2 || getSpaceDimension()!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildUnionOf2DMesh : meshdimension, spacedimension must be equal to 2 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> skin(computeSkin());
+ MCAuto<MEDCouplingUMesh> skin(computeSkin());
int oldNbOfNodes(skin->getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n(skin->zipCoordsTraducer());
+ MCAuto<DataArrayInt> o2n(skin->zipCoordsTraducer());
int nbOfNodesExpected(skin->getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o(o2n->invertArrayO2N2N2O(oldNbOfNodes));
+ MCAuto<DataArrayInt> n2o(o2n->invertArrayO2N2N2O(oldNbOfNodes));
int nbCells(skin->getNumberOfCells());
if(nbCells==nbOfNodesExpected)
return buildUnionOf2DMeshLinear(skin,n2o);
{
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildUnionOf3DMesh : meshdimension, spacedimension must be equal to 2 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=computeSkin();
+ MCAuto<MEDCouplingUMesh> m=computeSkin();
const int *conn=m->getNodalConnectivity()->getConstPointer();
const int *connI=m->getNodalConnectivityIndex()->getConstPointer();
int nbOfCells=m->getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(m->getNodalConnectivity()->getNumberOfTuples(),1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(m->getNodalConnectivity()->getNumberOfTuples(),1);
int *work=ret->getPointer(); *work++=INTERP_KERNEL::NORM_POLYHED;
if(nbOfCells<1)
return ret.retn();
checkConnectivityFullyDefined();
int meshDim = this->getMeshDimension();
- ParaMEDMEM::DataArrayInt* indexr=ParaMEDMEM::DataArrayInt::New();
- ParaMEDMEM::DataArrayInt* revConn=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* indexr=MEDCoupling::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* revConn=MEDCoupling::DataArrayInt::New();
this->getReverseNodalConnectivity(revConn,indexr);
const int* indexr_ptr=indexr->getConstPointer();
const int* revConn_ptr=revConn->getConstPointer();
- const ParaMEDMEM::DataArrayInt* index;
- const ParaMEDMEM::DataArrayInt* conn;
+ const MEDCoupling::DataArrayInt* index;
+ const MEDCoupling::DataArrayInt* conn;
conn=this->getNodalConnectivity(); // it includes a type as the 1st element!!!
index=this->getNodalConnectivityIndex();
int nbCells=this->getNumberOfCells();
_coords->writeVTK(ofs,8,"Points",byteData);
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo=_coords->changeNbOfComponents(3,0.);
+ MCAuto<DataArrayDouble> coo=_coords->changeNbOfComponents(3,0.);
coo->writeVTK(ofs,8,"Points",byteData);
}
ofs << " </Points>\n";
ofs << " <Cells>\n";
const int *cPtr=_nodal_connec->getConstPointer();
const int *cIPtr=_nodal_connec_index->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> faceoffsets=DataArrayInt::New(); faceoffsets->alloc(nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> types=DataArrayInt::New(); types->alloc(nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> offsets=DataArrayInt::New(); offsets->alloc(nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connectivity=DataArrayInt::New(); connectivity->alloc(_nodal_connec->getNumberOfTuples()-nbOfCells,1);
+ MCAuto<DataArrayInt> faceoffsets=DataArrayInt::New(); faceoffsets->alloc(nbOfCells,1);
+ MCAuto<DataArrayInt> types=DataArrayInt::New(); types->alloc(nbOfCells,1);
+ MCAuto<DataArrayInt> offsets=DataArrayInt::New(); offsets->alloc(nbOfCells,1);
+ MCAuto<DataArrayInt> connectivity=DataArrayInt::New(); connectivity->alloc(_nodal_connec->getNumberOfTuples()-nbOfCells,1);
int *w1=faceoffsets->getPointer(),*w2=types->getPointer(),*w3=offsets->getPointer(),*w4=connectivity->getPointer();
int szFaceOffsets=0,szConn=0;
for(int i=0;i<nbOfCells;i++,w1++,w2++,w3++)
{//presence of Polyhedra
connectivity->reAlloc(szConn);
faceoffsets->writeVTK(ofs,8,"Int32","faceoffsets",byteData);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> faces=DataArrayInt::New(); faces->alloc(szFaceOffsets,1);
+ MCAuto<DataArrayInt> faces=DataArrayInt::New(); faces->alloc(szFaceOffsets,1);
w1=faces->getPointer();
for(int i=0;i<nbOfCells;i++)
if((INTERP_KERNEL::NormalizedCellType)cPtr[cIPtr[i]]==INTERP_KERNEL::NORM_POLYHED)
m1Desc,desc1,descIndx1,revDesc1,revDescIndx1,
addCoo, m2Desc,desc2,descIndx2,revDesc2,revDescIndx2);
revDesc1->decrRef(); revDescIndx1->decrRef(); revDesc2->decrRef(); revDescIndx2->decrRef();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> dd1(desc1),dd2(descIndx1),dd3(desc2),dd4(descIndx2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> dd5(m1Desc),dd6(m2Desc);
+ MCAuto<DataArrayInt> dd1(desc1),dd2(descIndx1),dd3(desc2),dd4(descIndx2);
+ MCAuto<MEDCouplingUMesh> dd5(m1Desc),dd6(m2Desc);
// Step 2: re-order newly created nodes according to the ordering found in m2
std::vector< std::vector<int> > intersectEdge2;
/* outputs -> */addCoordsQuadratic,cr,crI,cNb1,cNb2);
// Step 4: Prepare final result:
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> addCooDa(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> addCooDa(DataArrayDouble::New());
addCooDa->alloc((int)(addCoo.size())/2,2);
std::copy(addCoo.begin(),addCoo.end(),addCooDa->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> addCoordsQuadraticDa(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> addCoordsQuadraticDa(DataArrayDouble::New());
addCoordsQuadraticDa->alloc((int)(addCoordsQuadratic.size())/2,2);
std::copy(addCoordsQuadratic.begin(),addCoordsQuadratic.end(),addCoordsQuadraticDa->getPointer());
std::vector<const DataArrayDouble *> coordss(4);
coordss[0]=m1->getCoords(); coordss[1]=m2->getCoords(); coordss[2]=addCooDa; coordss[3]=addCoordsQuadraticDa;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::Aggregate(coordss));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("Intersect2D",2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()); conn->alloc((int)cr.size(),1); std::copy(cr.begin(),cr.end(),conn->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> connI(DataArrayInt::New()); connI->alloc((int)crI.size(),1); std::copy(crI.begin(),crI.end(),connI->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c1(DataArrayInt::New()); c1->alloc((int)cNb1.size(),1); std::copy(cNb1.begin(),cNb1.end(),c1->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c2(DataArrayInt::New()); c2->alloc((int)cNb2.size(),1); std::copy(cNb2.begin(),cNb2.end(),c2->getPointer());
+ MCAuto<DataArrayDouble> coo(DataArrayDouble::Aggregate(coordss));
+ MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("Intersect2D",2));
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()); conn->alloc((int)cr.size(),1); std::copy(cr.begin(),cr.end(),conn->getPointer());
+ MCAuto<DataArrayInt> connI(DataArrayInt::New()); connI->alloc((int)crI.size(),1); std::copy(crI.begin(),crI.end(),connI->getPointer());
+ MCAuto<DataArrayInt> c1(DataArrayInt::New()); c1->alloc((int)cNb1.size(),1); std::copy(cNb1.begin(),cNb1.end(),c1->getPointer());
+ MCAuto<DataArrayInt> c2(DataArrayInt::New()); c2->alloc((int)cNb2.size(),1); std::copy(cNb2.begin(),cNb2.end(),c2->getPointer());
ret->setConnectivity(conn,connI,true);
ret->setCoords(coo);
cellNb1=c1.retn(); cellNb2=c2.retn();
}
MEDCouplingUMesh *BuildMesh1DCutFrom(const MEDCouplingUMesh *mesh1D, const std::vector< std::vector<int> >& intersectEdge2, const DataArrayDouble *coords1, const std::vector<double>& addCoo, const std::map<int,int>& mergedNodes, const std::vector< std::vector<int> >& colinear2, const std::vector< std::vector<int> >& intersectEdge1,
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& idsInRetColinear, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& idsInMesh1DForIdsInRetColinear)
+ MCAuto<DataArrayInt>& idsInRetColinear, MCAuto<DataArrayInt>& idsInMesh1DForIdsInRetColinear)
{
idsInRetColinear=DataArrayInt::New(); idsInRetColinear->alloc(0,1);
idsInMesh1DForIdsInRetColinear=DataArrayInt::New(); idsInMesh1DForIdsInRetColinear->alloc(0,1);
int offset2(offset1+coo2->getNumberOfTuples());
int offset3(offset2+addCoo.size()/2);
std::vector<double> addCooQuad;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cOut(DataArrayInt::New()),ciOut(DataArrayInt::New()); cOut->alloc(0,1); ciOut->alloc(1,1); ciOut->setIJ(0,0,0);
+ MCAuto<DataArrayInt> cOut(DataArrayInt::New()),ciOut(DataArrayInt::New()); cOut->alloc(0,1); ciOut->alloc(1,1); ciOut->setIJ(0,0,0);
int tmp[4],cicnt(0),kk(0);
for(int i=0;i<nCells;i++)
{
- std::map<MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int> m;
+ std::map<MCAuto<INTERP_KERNEL::Node>,int> m;
INTERP_KERNEL::Edge *e(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)c[ci[i]],c+ci[i]+1,coo2Ptr,m));
const std::vector<int>& subEdges(intersectEdge2[i]);
int nbSubEdge(subEdges.size()/2);
for(int j=0;j<nbSubEdge;j++,kk++)
{
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node> n1(MEDCouplingUMeshBuildQPNode(subEdges[2*j],coords1->begin(),offset1,coo2Ptr,offset2,addCoo)),n2(MEDCouplingUMeshBuildQPNode(subEdges[2*j+1],coords1->begin(),offset1,coo2Ptr,offset2,addCoo));
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> e2(e->buildEdgeLyingOnMe(n1,n2));
+ MCAuto<INTERP_KERNEL::Node> n1(MEDCouplingUMeshBuildQPNode(subEdges[2*j],coords1->begin(),offset1,coo2Ptr,offset2,addCoo)),n2(MEDCouplingUMeshBuildQPNode(subEdges[2*j+1],coords1->begin(),offset1,coo2Ptr,offset2,addCoo));
+ MCAuto<INTERP_KERNEL::Edge> e2(e->buildEdgeLyingOnMe(n1,n2));
INTERP_KERNEL::Edge *e2Ptr(e2);
std::map<int,int>::const_iterator itm;
if(dynamic_cast<INTERP_KERNEL::EdgeArcCircle *>(e2Ptr))
}
e->decrRef();
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(mesh1D->getName(),1));
+ MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(mesh1D->getName(),1));
ret->setConnectivity(cOut,ciOut,true);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr3(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> arr3(DataArrayDouble::New());
arr3->useArray(&addCoo[0],false,C_DEALLOC,(int)addCoo.size()/2,2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr4(DataArrayDouble::New()); arr4->useArray(&addCooQuad[0],false,C_DEALLOC,(int)addCooQuad.size()/2,2);
+ MCAuto<DataArrayDouble> arr4(DataArrayDouble::New()); arr4->useArray(&addCooQuad[0],false,C_DEALLOC,(int)addCooQuad.size()/2,2);
std::vector<const DataArrayDouble *> coordss(4);
coordss[0]=coords1; coordss[1]=mesh1D->getCoords(); coordss[2]=arr3; coordss[3]=arr4;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(DataArrayDouble::Aggregate(coordss));
+ MCAuto<DataArrayDouble> arr(DataArrayDouble::Aggregate(coordss));
ret->setCoords(arr);
return ret.retn();
}
if(nb%2!=0)
throw INTERP_KERNEL::Exception("BuildRefined2DCellLinear : internal error 1 !");
std::size_t nbOfEdgesOf2DCellSplit(nb/2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("",2));
+ MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("",2));
ret->setCoords(coords);
ret->allocateCells(1);
std::vector<int> connOut(nbOfEdgesOf2DCellSplit);
INTERP_KERNEL::AutoPtr<int> tmpPtr(new int[ci[cellIdInMesh2D+1]-ci[cellIdInMesh2D]]);
std::vector<int> allEdges,centers;
const double *coordsPtr(coords->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> addCoo(DataArrayDouble::New()); addCoo->alloc(0,1);
+ MCAuto<DataArrayDouble> addCoo(DataArrayDouble::New()); addCoo->alloc(0,1);
int offset(coords->getNumberOfTuples());
for(const int *it2(descBg);it2!=descEnd;it2++,ii++)
{
else
{//the current edge has been subsplit -> create corresponding centers.
std::size_t nbOfCentersToAppend(edge1.size()/2);
- std::map< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int> m;
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> ee(MEDCouplingUMeshBuildQPFromEdge2(typeOfSon,tmpPtr,coordsPtr,m));
+ std::map< MCAuto<INTERP_KERNEL::Node>,int> m;
+ MCAuto<INTERP_KERNEL::Edge> ee(MEDCouplingUMeshBuildQPFromEdge2(typeOfSon,tmpPtr,coordsPtr,m));
std::vector<int>::const_iterator it3(allEdges.end()-edge1.size());
for(std::size_t k=0;k<nbOfCentersToAppend;k++)
{
if(nb%2!=0)
throw INTERP_KERNEL::Exception("BuildRefined2DCellQuadratic : internal error 2 !");
std::size_t nbOfEdgesOf2DCellSplit(nb/2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("",2));
+ MCAuto<MEDCouplingUMesh> ret(MEDCouplingUMesh::New("",2));
if(addCoo->empty())
ret->setCoords(coords);
else
return BuildRefined2DCellQuadratic(coords,mesh2D,cellIdInMesh2D,descBg,descEnd,intersectEdge1);
}
-void AddCellInMesh2D(MEDCouplingUMesh *mesh2D, const std::vector<int>& conn, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& edges)
+void AddCellInMesh2D(MEDCouplingUMesh *mesh2D, const std::vector<int>& conn, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edges)
{
bool isQuad(false);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >::const_iterator it=edges.begin();it!=edges.end();it++)
+ for(std::vector< MCAuto<INTERP_KERNEL::Edge> >::const_iterator it=edges.begin();it!=edges.end();it++)
{
const INTERP_KERNEL::Edge *ee(*it);
if(dynamic_cast<const INTERP_KERNEL::EdgeArcCircle *>(ee))
* This method cuts in 2 parts the input 2D cell given using boundaries description (\a edge1Bis and \a edge1BisPtr) using
* a set of edges defined in \a splitMesh1D.
*/
-void BuildMesh2DCutInternal2(const MEDCouplingUMesh *splitMesh1D, const std::vector<int>& edge1Bis, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& edge1BisPtr,
- std::vector< std::vector<int> >& out0, std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > >& out1)
+void BuildMesh2DCutInternal2(const MEDCouplingUMesh *splitMesh1D, const std::vector<int>& edge1Bis, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edge1BisPtr,
+ std::vector< std::vector<int> >& out0, std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > >& out1)
{
std::size_t nb(edge1Bis.size()/2);
std::size_t nbOfEdgesOf2DCellSplit(nb/2);
out0.resize(1); out1.resize(1);
std::vector<int>& connOut(out0[0]);
connOut.resize(nbOfEdgesOf2DCellSplit);
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& edgesPtr(out1[0]);
+ std::vector< MCAuto<INTERP_KERNEL::Edge> >& edgesPtr(out1[0]);
edgesPtr.resize(nbOfEdgesOf2DCellSplit);
for(std::size_t kk=0;kk<nbOfEdgesOf2DCellSplit;kk++)
{
out0.resize(2); out1.resize(2);
std::vector<int>& connOutLeft(out0[0]);
std::vector<int>& connOutRight(out0[1]);//connOutLeft should end with edge1Bis[2*ii] and connOutRight should end with edge1Bis[2*jj+1]
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& eleft(out1[0]);
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& eright(out1[1]);
+ std::vector< MCAuto<INTERP_KERNEL::Edge> >& eleft(out1[0]);
+ std::vector< MCAuto<INTERP_KERNEL::Edge> >& eright(out1[1]);
for(std::size_t k=ii;k<jj+1;k++)
{ connOutLeft.push_back(edge1Bis[2*k+1]); eleft.push_back(edge1BisPtr[2*k+1]); }
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > ees(iEnd);
+ std::vector< MCAuto<INTERP_KERNEL::Edge> > ees(iEnd);
for(int ik=0;ik<iEnd;ik++)
{
- std::map< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int> m;
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> ee(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)cSplitPtr[ciSplitPtr[ik]],cSplitPtr+ciSplitPtr[ik]+1,splitMesh1D->getCoords()->begin(),m));
+ std::map< MCAuto<INTERP_KERNEL::Node>,int> m;
+ MCAuto<INTERP_KERNEL::Edge> ee(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)cSplitPtr[ciSplitPtr[ik]],cSplitPtr+ciSplitPtr[ik]+1,splitMesh1D->getCoords()->begin(),m));
ees[ik]=ee;
}
for(int ik=iEnd-1;ik>=0;ik--)
{
public:
CellInfo() { }
- CellInfo(const std::vector<int>& edges, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& edgesPtr);
+ CellInfo(const std::vector<int>& edges, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edgesPtr);
public:
std::vector<int> _edges;
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > _edges_ptr;
+ std::vector< MCAuto<INTERP_KERNEL::Edge> > _edges_ptr;
};
-CellInfo::CellInfo(const std::vector<int>& edges, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& edgesPtr)
+CellInfo::CellInfo(const std::vector<int>& edges, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edgesPtr)
{
std::size_t nbe(edges.size());
- std::vector<int> edges2(2*nbe); std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > edgesPtr2(2*nbe);
+ std::vector<int> edges2(2*nbe); std::vector< MCAuto<INTERP_KERNEL::Edge> > edgesPtr2(2*nbe);
for(std::size_t i=0;i<nbe;i++)
{
edges2[2*i]=edges[i]; edges2[2*i+1]=edges[(i+1)%nbe];
class EdgeInfo
{
public:
- EdgeInfo(int istart, int iend, const MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh>& mesh):_istart(istart),_iend(iend),_mesh(mesh),_left(-7),_right(-7) { }
- EdgeInfo(int istart, int iend, int pos, const MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge>& edge):_istart(istart),_iend(iend),_edge(edge),_left(pos),_right(pos+1) { }
+ EdgeInfo(int istart, int iend, const MCAuto<MEDCouplingUMesh>& mesh):_istart(istart),_iend(iend),_mesh(mesh),_left(-7),_right(-7) { }
+ EdgeInfo(int istart, int iend, int pos, const MCAuto<INTERP_KERNEL::Edge>& edge):_istart(istart),_iend(iend),_edge(edge),_left(pos),_right(pos+1) { }
bool isInMyRange(int pos) const { return pos>=_istart && pos<_iend; }
- void somethingHappendAt(int pos, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newRight);
+ void somethingHappendAt(int pos, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newRight);
void feedEdgeInfoAt(double eps, const MEDCouplingUMesh *mesh2D, int offset, int neighbors[2]) const;
private:
int _istart;
int _iend;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> _mesh;
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> _edge;
+ MCAuto<MEDCouplingUMesh> _mesh;
+ MCAuto<INTERP_KERNEL::Edge> _edge;
int _left;
int _right;
};
-void EdgeInfo::somethingHappendAt(int pos, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newRight)
+void EdgeInfo::somethingHappendAt(int pos, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newRight)
{
const MEDCouplingUMesh *mesh(_mesh);
if(mesh)
}
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> barys(mesh->getBarycenterAndOwner());
+ MCAuto<DataArrayDouble> barys(mesh->computeCellCenterOfMass());
int cellId(mesh2D->getCellContainingPoint(barys->begin(),eps));
if(cellId==-1)
throw INTERP_KERNEL::Exception("EdgeInfo::feedEdgeInfoAt : internal error !");
class VectorOfCellInfo
{
public:
- VectorOfCellInfo(const std::vector<int>& edges, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& edgesPtr);
+ VectorOfCellInfo(const std::vector<int>& edges, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edgesPtr);
std::size_t size() const { return _pool.size(); }
int getPositionOf(double eps, const MEDCouplingUMesh *mesh) const;
- void setMeshAt(int pos, const MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh>& mesh, int istart, int iend, const MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > >& edgePtrs);
+ void setMeshAt(int pos, const MCAuto<MEDCouplingUMesh>& mesh, int istart, int iend, const MCAuto<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > >& edgePtrs);
const std::vector<int>& getConnOf(int pos) const { return get(pos)._edges; }
- const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& getEdgePtrOf(int pos) const { return get(pos)._edges_ptr; }
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> getZeMesh() const { return _ze_mesh; }
+ const std::vector< MCAuto<INTERP_KERNEL::Edge> >& getEdgePtrOf(int pos) const { return get(pos)._edges_ptr; }
+ MCAuto<MEDCouplingUMesh> getZeMesh() const { return _ze_mesh; }
void feedEdgeInfoAt(double eps, int pos, int offset, int neighbors[2]) const;
private:
int getZePosOfEdgeGivenItsGlobalId(int pos) const;
- void updateEdgeInfo(int pos, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newRight);
+ void updateEdgeInfo(int pos, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newRight);
const CellInfo& get(int pos) const;
CellInfo& get(int pos);
private:
std::vector<CellInfo> _pool;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> _ze_mesh;
+ MCAuto<MEDCouplingUMesh> _ze_mesh;
std::vector<EdgeInfo> _edge_info;
};
-VectorOfCellInfo::VectorOfCellInfo(const std::vector<int>& edges, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& edgesPtr):_pool(1)
+VectorOfCellInfo::VectorOfCellInfo(const std::vector<int>& edges, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edgesPtr):_pool(1)
{
_pool[0]._edges=edges;
_pool[0]._edges_ptr=edgesPtr;
const MEDCouplingUMesh *zeMesh(_ze_mesh);
if(!zeMesh)
throw INTERP_KERNEL::Exception("VectorOfCellSplitter::getPositionOf : null aggregated mesh !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> barys(mesh->getBarycenterAndOwner());
+ MCAuto<DataArrayDouble> barys(mesh->computeCellCenterOfMass());
return zeMesh->getCellContainingPoint(barys->begin(),eps);
}
-void VectorOfCellInfo::setMeshAt(int pos, const MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh>& mesh, int istart, int iend, const MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > >& edgePtrs)
+void VectorOfCellInfo::setMeshAt(int pos, const MCAuto<MEDCouplingUMesh>& mesh, int istart, int iend, const MCAuto<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > >& edgePtrs)
{
get(pos);//to check pos
bool isFast(pos==0 && _pool.size()==1);
return ;
}
//
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > ms;
+ std::vector< MCAuto<MEDCouplingUMesh> > ms;
if(pos>0)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> elt(static_cast<MEDCouplingUMesh *>(_ze_mesh->buildPartOfMySelf2(0,pos,true)));
+ MCAuto<MEDCouplingUMesh> elt(static_cast<MEDCouplingUMesh *>(_ze_mesh->buildPartOfMySelfSlice(0,pos,true)));
ms.push_back(elt);
}
ms.push_back(mesh);
if(pos<_ze_mesh->getNumberOfCells()-1)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> elt(static_cast<MEDCouplingUMesh *>(_ze_mesh->buildPartOfMySelf2(pos+1,_ze_mesh->getNumberOfCells(),true)));
+ MCAuto<MEDCouplingUMesh> elt(static_cast<MEDCouplingUMesh *>(_ze_mesh->buildPartOfMySelfSlice(pos+1,_ze_mesh->getNumberOfCells(),true)));
ms.push_back(elt);
}
std::vector< const MEDCouplingUMesh *> ms2(ms.size());
throw INTERP_KERNEL::Exception("VectorOfCellInfo::getZePosOfEdgeGivenItsGlobalId : invalid id !");
}
-void VectorOfCellInfo::updateEdgeInfo(int pos, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& newRight)
+void VectorOfCellInfo::updateEdgeInfo(int pos, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newLeft, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& newRight)
{
get(pos);//to check;
if(_edge_info.empty())
*
* \param [in] allEdges a list of pairs (beginNode, endNode). Linked with \a allEdgesPtr to get the equation of edge.
*/
-MEDCouplingUMesh *BuildMesh2DCutInternal(double eps, const MEDCouplingUMesh *splitMesh1D, const std::vector<int>& allEdges, const std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> >& allEdgesPtr, int offset,
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& idsLeftRight)
+MEDCouplingUMesh *BuildMesh2DCutInternal(double eps, const MEDCouplingUMesh *splitMesh1D, const std::vector<int>& allEdges, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& allEdgesPtr, int offset,
+ MCAuto<DataArrayInt>& idsLeftRight)
{
int nbCellsInSplitMesh1D(splitMesh1D->getNumberOfCells());
if(nbCellsInSplitMesh1D==0)
if(nb%2!=0)
throw INTERP_KERNEL::Exception("BuildMesh2DCutFrom : internal error 2 !");
std::vector<int> edge1Bis(nb*2);
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > edge1BisPtr(nb*2);
+ std::vector< MCAuto<INTERP_KERNEL::Edge> > edge1BisPtr(nb*2);
std::copy(allEdges.begin(),allEdges.end(),edge1Bis.begin());
std::copy(allEdges.begin(),allEdges.end(),edge1Bis.begin()+nb);
std::copy(allEdgesPtr.begin(),allEdgesPtr.end(),edge1BisPtr.begin());
if(iEnd<nbCellsInSplitMesh1D)
iEnd++;
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> partOfSplitMesh1D(static_cast<MEDCouplingUMesh *>(splitMesh1D->buildPartOfMySelf2(iStart,iEnd,1,true)));
+ MCAuto<MEDCouplingUMesh> partOfSplitMesh1D(static_cast<MEDCouplingUMesh *>(splitMesh1D->buildPartOfMySelfSlice(iStart,iEnd,1,true)));
int pos(pool.getPositionOf(eps,partOfSplitMesh1D));
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh>retTmp(MEDCouplingUMesh::New("",2));
+ MCAuto<MEDCouplingUMesh>retTmp(MEDCouplingUMesh::New("",2));
retTmp->setCoords(splitMesh1D->getCoords());
retTmp->allocateCells();
std::vector< std::vector<int> > out0;
- std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > > out1;
+ std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > > out1;
BuildMesh2DCutInternal2(partOfSplitMesh1D,pool.getConnOf(pos),pool.getEdgePtrOf(pos),out0,out1);
for(std::size_t cnt=0;cnt<out0.size();cnt++)
MEDCouplingUMesh *BuildMesh2DCutFrom(double eps, int cellIdInMesh2D, const MEDCouplingUMesh *mesh2DDesc, const MEDCouplingUMesh *splitMesh1D,
const int *descBg, const int *descEnd, const std::vector< std::vector<int> >& intersectEdge1, int offset,
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& idsLeftRight)
+ MCAuto<DataArrayInt>& idsLeftRight)
{
const int *cdescPtr(mesh2DDesc->getNodalConnectivity()->begin()),*cidescPtr(mesh2DDesc->getNodalConnectivityIndex()->begin());
//
std::vector<int> allEdges;
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> > allEdgesPtr; // for each sub edge in splitMesh2D the uncut Edge object of the original mesh2D
+ std::vector< MCAuto<INTERP_KERNEL::Edge> > allEdgesPtr; // for each sub edge in splitMesh2D the uncut Edge object of the original mesh2D
for(const int *it(descBg);it!=descEnd;it++) // for all edges in the descending connectivity of the 2D mesh in relative Fortran mode
{
int edgeId(std::abs(*it)-1);
- std::map< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int> m;
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> ee(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)cdescPtr[cidescPtr[edgeId]],cdescPtr+cidescPtr[edgeId]+1,mesh2DDesc->getCoords()->begin(),m));
+ std::map< MCAuto<INTERP_KERNEL::Node>,int> m;
+ MCAuto<INTERP_KERNEL::Edge> ee(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)cdescPtr[cidescPtr[edgeId]],cdescPtr+cidescPtr[edgeId]+1,mesh2DDesc->getCoords()->begin(),m));
const std::vector<int>& edge1(intersectEdge1[edgeId]);
if(*it>0)
allEdges.insert(allEdges.end(),edge1.begin(),edge1.end());
if(std::distance(candidatesIn2DBg,candidatesIn2DEnd)==1)
return *candidatesIn2DBg;
int edgeId(std::abs(cellIdInMesh1DSplitRelative)-1);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> cur1D(static_cast<MEDCouplingUMesh *>(mesh1DSplit->buildPartOfMySelf(&edgeId,&edgeId+1,true)));
+ MCAuto<MEDCouplingUMesh> cur1D(static_cast<MEDCouplingUMesh *>(mesh1DSplit->buildPartOfMySelf(&edgeId,&edgeId+1,true)));
if(cellIdInMesh1DSplitRelative<0)
cur1D->changeOrientationOfCells();
const int *c1D(cur1D->getNodalConnectivity()->begin());
const INTERP_KERNEL::CellModel& ref1DType(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)c1D[0]));
for(const int *it=candidatesIn2DBg;it!=candidatesIn2DEnd;it++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> cur2D(static_cast<MEDCouplingUMesh *>(mesh2DSplit->buildPartOfMySelf(it,it+1,true)));
+ MCAuto<MEDCouplingUMesh> cur2D(static_cast<MEDCouplingUMesh *>(mesh2DSplit->buildPartOfMySelf(it,it+1,true)));
const int *c(cur2D->getNodalConnectivity()->begin()),*ci(cur2D->getNodalConnectivityIndex()->begin());
const INTERP_KERNEL::CellModel &cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)c[ci[0]]));
unsigned sz(cm.getNumberOfSons2(c+ci[0]+1,ci[1]-ci[0]-1));
//
// Build desc connectivity
DataArrayInt *desc1(DataArrayInt::New()),*descIndx1(DataArrayInt::New()),*revDesc1(DataArrayInt::New()),*revDescIndx1(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> dd1(desc1),dd2(descIndx1),dd3(revDesc1),dd4(revDescIndx1);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1Desc(mesh2D->buildDescendingConnectivity2(desc1,descIndx1,revDesc1,revDescIndx1));
+ MCAuto<DataArrayInt> dd1(desc1),dd2(descIndx1),dd3(revDesc1),dd4(revDescIndx1);
+ MCAuto<MEDCouplingUMesh> m1Desc(mesh2D->buildDescendingConnectivity2(desc1,descIndx1,revDesc1,revDescIndx1));
std::map<int,int> mergedNodes;
Intersect1DMeshes(m1Desc,mesh1D,eps,intersectEdge1,colinear2,subDiv2,addCoo,mergedNodes);
// use mergeNodes to fix intersectEdge1
(*it0)[2*n-1]=(*it1).second;
}
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> addCooDa(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> addCooDa(DataArrayDouble::New());
addCooDa->useArray(&addCoo[0],false,C_DEALLOC,(int)addCoo.size()/2,2);
// Step 2: re-order newly created nodes according to the ordering found in m2
std::vector< std::vector<int> > intersectEdge2;
BuildIntersectEdges(m1Desc,mesh1D,addCoo,subDiv2,intersectEdge2);
subDiv2.clear();
// Step 3: compute splitMesh1D
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsInRet1Colinear,idsInDescMesh2DForIdsInRetColinear;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2(DataArrayInt::New()); ret2->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret1(BuildMesh1DCutFrom(mesh1D,intersectEdge2,mesh2D->getCoords(),addCoo,mergedNodes,colinear2,intersectEdge1,
+ MCAuto<DataArrayInt> idsInRet1Colinear,idsInDescMesh2DForIdsInRetColinear;
+ MCAuto<DataArrayInt> ret2(DataArrayInt::New()); ret2->alloc(0,1);
+ MCAuto<MEDCouplingUMesh> ret1(BuildMesh1DCutFrom(mesh1D,intersectEdge2,mesh2D->getCoords(),addCoo,mergedNodes,colinear2,intersectEdge1,
idsInRet1Colinear,idsInDescMesh2DForIdsInRetColinear));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret3(DataArrayInt::New()); ret3->alloc(ret1->getNumberOfCells()*2,1); ret3->fillWithValue(std::numeric_limits<int>::max()); ret3->rearrange(2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsInRet1NotColinear(idsInRet1Colinear->buildComplement(ret1->getNumberOfCells()));
+ MCAuto<DataArrayInt> ret3(DataArrayInt::New()); ret3->alloc(ret1->getNumberOfCells()*2,1); ret3->fillWithValue(std::numeric_limits<int>::max()); ret3->rearrange(2);
+ MCAuto<DataArrayInt> idsInRet1NotColinear(idsInRet1Colinear->buildComplement(ret1->getNumberOfCells()));
// deal with cells in mesh2D that are not cut but only some of their edges are
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsInDesc2DToBeRefined(idsInDescMesh2DForIdsInRetColinear->deepCpy());
+ MCAuto<DataArrayInt> idsInDesc2DToBeRefined(idsInDescMesh2DForIdsInRetColinear->deepCopy());
idsInDesc2DToBeRefined->abs(); idsInDesc2DToBeRefined->applyLin(1,-1);
idsInDesc2DToBeRefined=idsInDesc2DToBeRefined->buildUnique();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> out0s;//ids in mesh2D that are impacted by the fact that some edges of \a mesh1D are part of the edges of those cells
+ MCAuto<DataArrayInt> out0s;//ids in mesh2D that are impacted by the fact that some edges of \a mesh1D are part of the edges of those cells
if(!idsInDesc2DToBeRefined->empty())
{
DataArrayInt *out0(0),*outi0(0);
MEDCouplingUMesh::ExtractFromIndexedArrays(idsInDesc2DToBeRefined->begin(),idsInDesc2DToBeRefined->end(),dd3,dd4,out0,outi0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> outi0s(outi0);
+ MCAuto<DataArrayInt> outi0s(outi0);
out0s=out0;
out0s=out0s->buildUnique();
out0s->sort(true);
}
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret1NonCol(static_cast<MEDCouplingUMesh *>(ret1->buildPartOfMySelf(idsInRet1NotColinear->begin(),idsInRet1NotColinear->end())));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> baryRet1(ret1NonCol->getBarycenterAndOwner());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
+ MCAuto<MEDCouplingUMesh> ret1NonCol(static_cast<MEDCouplingUMesh *>(ret1->buildPartOfMySelf(idsInRet1NotColinear->begin(),idsInRet1NotColinear->end())));
+ MCAuto<DataArrayDouble> baryRet1(ret1NonCol->computeCellCenterOfMass());
+ MCAuto<DataArrayInt> elts,eltsIndex;
mesh2D->getCellsContainingPoints(baryRet1->begin(),baryRet1->getNumberOfTuples(),eps,elts,eltsIndex);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsIndex2(eltsIndex->deltaShiftIndex());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsIndex3(eltsIndex2->getIdsEqual(1));
+ MCAuto<DataArrayInt> eltsIndex2(eltsIndex->deltaShiftIndex());
+ MCAuto<DataArrayInt> eltsIndex3(eltsIndex2->findIdsEqual(1));
if(eltsIndex2->count(0)+eltsIndex3->getNumberOfTuples()!=ret1NonCol->getNumberOfCells())
throw INTERP_KERNEL::Exception("Intersect2DMeshWith1DLine : internal error 1 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellsToBeModified(elts->buildUnique());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> untouchedCells(cellsToBeModified->buildComplement(mesh2D->getNumberOfCells()));
+ MCAuto<DataArrayInt> cellsToBeModified(elts->buildUnique());
+ MCAuto<DataArrayInt> untouchedCells(cellsToBeModified->buildComplement(mesh2D->getNumberOfCells()));
if((DataArrayInt *)out0s)
untouchedCells=untouchedCells->buildSubstraction(out0s);//if some edges in ret1 are colinear to descending mesh of mesh2D remove cells from untouched one
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > outMesh2DSplit;
+ std::vector< MCAuto<MEDCouplingUMesh> > outMesh2DSplit;
// OK all is ready to insert in ret2 mesh
if(!untouchedCells->empty())
{// the most easy part, cells in mesh2D not impacted at all
}
if((DataArrayInt *)out0s)
{// here dealing with cells in out0s but not in cellsToBeModified
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fewModifiedCells(out0s->buildSubstraction(cellsToBeModified));
+ MCAuto<DataArrayInt> fewModifiedCells(out0s->buildSubstraction(cellsToBeModified));
const int *rdptr(dd3->begin()),*rdiptr(dd4->begin()),*dptr(dd1->begin()),*diptr(dd2->begin());
for(const int *it=fewModifiedCells->begin();it!=fewModifiedCells->end();it++)
{
}
int offset(ret2->getNumberOfTuples());
ret2->pushBackValsSilent(fewModifiedCells->begin(),fewModifiedCells->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> partOfRet3(DataArrayInt::New()); partOfRet3->alloc(2*idsInRet1Colinear->getNumberOfTuples(),1);
+ MCAuto<DataArrayInt> partOfRet3(DataArrayInt::New()); partOfRet3->alloc(2*idsInRet1Colinear->getNumberOfTuples(),1);
partOfRet3->fillWithValue(std::numeric_limits<int>::max()); partOfRet3->rearrange(2);
int kk(0),*ret3ptr(partOfRet3->getPointer());
for(const int *it=idsInDescMesh2DForIdsInRetColinear->begin();it!=idsInDescMesh2DForIdsInRetColinear->end();it++,kk++)
int faceId(std::abs(*it)-1);
for(const int *it2=rdptr+rdiptr[faceId];it2!=rdptr+rdiptr[faceId+1];it2++)
{
- int tmp(fewModifiedCells->locateValue(*it2));
+ int tmp(fewModifiedCells->findIdFirstEqual(*it2));
if(tmp!=-1)
{
if(std::find(dptr+diptr[*it2],dptr+diptr[*it2+1],-(*it))!=dptr+diptr[*it2+1])
if(!outMesh2DSplit.empty())
{
DataArrayDouble *da(outMesh2DSplit.back()->getCoords());
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> >::iterator itt=outMesh2DSplit.begin();itt!=outMesh2DSplit.end();itt++)
+ for(std::vector< MCAuto<MEDCouplingUMesh> >::iterator itt=outMesh2DSplit.begin();itt!=outMesh2DSplit.end();itt++)
(*itt)->setCoords(da);
}
}
cellsToBeModified=cellsToBeModified->buildUniqueNotSorted();
for(const int *it=cellsToBeModified->begin();it!=cellsToBeModified->end();it++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsNonColPerCell(elts->getIdsEqual(*it));
+ MCAuto<DataArrayInt> idsNonColPerCell(elts->findIdsEqual(*it));
idsNonColPerCell->transformWithIndArr(eltsIndex3->begin(),eltsIndex3->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsNonColPerCell2(idsInRet1NotColinear->selectByTupleId(idsNonColPerCell->begin(),idsNonColPerCell->end()));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> partOfMesh1CuttingCur2DCell(static_cast<MEDCouplingUMesh *>(ret1NonCol->buildPartOfMySelf(idsNonColPerCell->begin(),idsNonColPerCell->end())));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> partOfRet3;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> splitOfOneCell(BuildMesh2DCutFrom(eps,*it,m1Desc,partOfMesh1CuttingCur2DCell,dd1->begin()+dd2->getIJ(*it,0),dd1->begin()+dd2->getIJ((*it)+1,0),intersectEdge1,ret2->getNumberOfTuples(),partOfRet3));
+ MCAuto<DataArrayInt> idsNonColPerCell2(idsInRet1NotColinear->selectByTupleId(idsNonColPerCell->begin(),idsNonColPerCell->end()));
+ MCAuto<MEDCouplingUMesh> partOfMesh1CuttingCur2DCell(static_cast<MEDCouplingUMesh *>(ret1NonCol->buildPartOfMySelf(idsNonColPerCell->begin(),idsNonColPerCell->end())));
+ MCAuto<DataArrayInt> partOfRet3;
+ MCAuto<MEDCouplingUMesh> splitOfOneCell(BuildMesh2DCutFrom(eps,*it,m1Desc,partOfMesh1CuttingCur2DCell,dd1->begin()+dd2->getIJ(*it,0),dd1->begin()+dd2->getIJ((*it)+1,0),intersectEdge1,ret2->getNumberOfTuples(),partOfRet3));
ret3->setPartOfValues3(partOfRet3,idsNonColPerCell2->begin(),idsNonColPerCell2->end(),0,2,1,true);
outMesh2DSplit.push_back(splitOfOneCell);
for(int i=0;i<splitOfOneCell->getNumberOfCells();i++)
tmp[i]=outMesh2DSplit[i];
//
ret1->getCoords()->setInfoOnComponents(compNames);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret2D(MEDCouplingUMesh::MergeUMeshesOnSameCoords(tmp));
+ MCAuto<MEDCouplingUMesh> ret2D(MEDCouplingUMesh::MergeUMeshesOnSameCoords(tmp));
// To finish - filter ret3 - std::numeric_limits<int>::max() -> -1 - negate values must be resolved.
ret3->rearrange(1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> edgesToDealWith(ret3->getIdsStrictlyNegative());
+ MCAuto<DataArrayInt> edgesToDealWith(ret3->findIdsStricltyNegative());
for(const int *it=edgesToDealWith->begin();it!=edgesToDealWith->end();it++)
{
int old2DCellId(-ret3->getIJ(*it,0)-1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> candidates(ret2->getIdsEqual(old2DCellId));
+ MCAuto<DataArrayInt> candidates(ret2->findIdsEqual(old2DCellId));
ret3->setIJ(*it,0,FindRightCandidateAmong(ret2D,candidates->begin(),candidates->end(),ret1,*it%2==0?-((*it)/2+1):(*it)/2+1,eps));// div by 2 because 2 components natively in ret3
}
ret3->changeValue(std::numeric_limits<int>::max(),-1);
const int *conn2(m2->getNodalConnectivity()->getConstPointer()),*connI2(m2->getNodalConnectivityIndex()->getConstPointer());
int offset2(offset1+m2->getNumberOfNodes());
int offset3(offset2+((int)addCoords.size())/2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bbox1Arr(m1->getBoundingBoxForBBTree()),bbox2Arr(m2->getBoundingBoxForBBTree());
+ MCAuto<DataArrayDouble> bbox1Arr(m1->getBoundingBoxForBBTree()),bbox2Arr(m2->getBoundingBoxForBBTree());
const double *bbox1(bbox1Arr->begin()),*bbox2(bbox2Arr->begin());
// Here a BBTree on 2D-cells, not on segments:
BBTree<SPACEDIM,int> myTree(bbox2,0,0,m2->getNumberOfCells(),eps);
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::orderConsecutiveCells1D works on unstructured mesh with meshdim = 1 !");
// Check that this is a line (and not a more complex 1D mesh) - each point is used at most by 2 segments:
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _d(DataArrayInt::New()),_dI(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rD(DataArrayInt::New()),_rDI(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m_points(buildDescendingConnectivity(_d, _dI, _rD, _rDI));
+ MCAuto<DataArrayInt> _d(DataArrayInt::New()),_dI(DataArrayInt::New());
+ MCAuto<DataArrayInt> _rD(DataArrayInt::New()),_rDI(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> m_points(buildDescendingConnectivity(_d, _dI, _rD, _rDI));
const int *d(_d->getConstPointer()), *dI(_dI->getConstPointer());
const int *rD(_rD->getConstPointer()), *rDI(_rDI->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _dsi(_rDI->deltaShiftIndex());
+ MCAuto<DataArrayInt> _dsi(_rDI->deltaShiftIndex());
const int * dsi(_dsi->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> dsii = _dsi->getIdsNotInRange(0,3);
+ MCAuto<DataArrayInt> dsii = _dsi->findIdsNotInRange(0,3);
m_points=0;
if (dsii->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::orderConsecutiveCells1D only work with a mesh being a (piecewise) connected line!");
int nc(getNumberOfCells());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> result(DataArrayInt::New());
+ MCAuto<DataArrayInt> result(DataArrayInt::New());
result->alloc(nc,1);
// set of edges not used so far
/// @cond INTERNAL
-void IKGeo2DInternalMapper2(INTERP_KERNEL::Node *n, const std::map<MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int>& m, int forbVal0, int forbVal1, std::vector<int>& isect)
+void IKGeo2DInternalMapper2(INTERP_KERNEL::Node *n, const std::map<MCAuto<INTERP_KERNEL::Node>,int>& m, int forbVal0, int forbVal1, std::vector<int>& isect)
{
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node> nTmp(n); nTmp->incrRef();
- std::map<MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int>::const_iterator it(m.find(nTmp));
+ MCAuto<INTERP_KERNEL::Node> nTmp(n); nTmp->incrRef();
+ std::map<MCAuto<INTERP_KERNEL::Node>,int>::const_iterator it(m.find(nTmp));
if(it==m.end())
throw INTERP_KERNEL::Exception("Internal error in remapping !");
int v((*it).second);
isect.push_back(v);
}
-bool IKGeo2DInternalMapper(const INTERP_KERNEL::ComposedEdge& c, const std::map<MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int>& m, int forbVal0, int forbVal1, std::vector<int>& isect)
+bool IKGeo2DInternalMapper(const INTERP_KERNEL::ComposedEdge& c, const std::map<MCAuto<INTERP_KERNEL::Node>,int>& m, int forbVal0, int forbVal1, std::vector<int>& isect)
{
int sz(c.size());
if(sz<=1)
DataArrayInt *MEDCouplingUMesh::conformize2D(double eps)
{
static const int SPACEDIM=2;
- checkCoherency();
+ checkConsistencyLight();
if(getSpaceDimension()!=2 || getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::conformize2D : This method only works for meshes with spaceDim=2 and meshDim=2 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc(buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));
+ MCAuto<DataArrayInt> desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New());
+ MCAuto<MEDCouplingUMesh> mDesc(buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1));
const int *c(mDesc->getNodalConnectivity()->getConstPointer()),*ci(mDesc->getNodalConnectivityIndex()->getConstPointer()),*rd(revDesc1->getConstPointer()),*rdi(revDescIndx1->getConstPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bboxArr(mDesc->getBoundingBoxForBBTree());
+ MCAuto<DataArrayDouble> bboxArr(mDesc->getBoundingBoxForBBTree());
const double *bbox(bboxArr->begin()),*coords(getCoords()->begin());
int nCell(getNumberOfCells()),nDescCell(mDesc->getNumberOfCells());
std::vector< std::vector<int> > intersectEdge(nDescCell),overlapEdge(nDescCell);
for(std::vector<int>::const_iterator it=candidates.begin();it!=candidates.end();it++)
if(*it>i)
{
- std::map<MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int> m;
+ std::map<MCAuto<INTERP_KERNEL::Node>,int> m;
INTERP_KERNEL::Edge *e1(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)c[ci[i]],c+ci[i]+1,coords,m)),
*e2(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)c[ci[*it]],c+ci[*it]+1,coords,m));
INTERP_KERNEL::MergePoints merge;
int sz((int)isect.size());
if(sz>1)
{
- std::map<MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int> m;
+ std::map<MCAuto<INTERP_KERNEL::Node>,int> m;
INTERP_KERNEL::Edge *e(MEDCouplingUMeshBuildQPFromEdge2((INTERP_KERNEL::NormalizedCellType)c[ci[i]],c+ci[i]+1,coords,m));
e->sortSubNodesAbs(coords,isect);
e->decrRef();
}
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()),notRet(DataArrayInt::New()); ret->alloc(nbOf2DCellsToBeSplit,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()),notRet(DataArrayInt::New()); ret->alloc(nbOf2DCellsToBeSplit,1);
if(nbOf2DCellsToBeSplit==0)
return ret.retn();
//
if(cells2DToTreat[i])
*retPtr++=i;
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> mSafe,nSafe,oSafe,pSafe,qSafe,rSafe;
+ MCAuto<DataArrayInt> mSafe,nSafe,oSafe,pSafe,qSafe,rSafe;
DataArrayInt *m(0),*n(0),*o(0),*p(0),*q(0),*r(0);
MEDCouplingUMesh::ExtractFromIndexedArrays(ret->begin(),ret->end(),desc1,descIndx1,m,n); mSafe=m; nSafe=n;
DataArrayInt::PutIntoToSkylineFrmt(intersectEdge,o,p); oSafe=o; pSafe=p;
if(middleNeedsToBeUsed)
{ DataArrayInt::PutIntoToSkylineFrmt(middle,q,r); qSafe=q; rSafe=r; }
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> modif(static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(ret->begin(),ret->end(),true)));
+ MCAuto<MEDCouplingUMesh> modif(static_cast<MEDCouplingUMesh *>(buildPartOfMySelf(ret->begin(),ret->end(),true)));
int nbOfNodesCreated(modif->split2DCells(mSafe,nSafe,oSafe,pSafe,qSafe,rSafe));
setCoords(modif->getCoords());//if nbOfNodesCreated==0 modif and this have the same coordinates pointer so this line has no effect. But for quadratic cases this line is important.
setPartOfMySelf(ret->begin(),ret->end(),*modif);
{
bool areNodesMerged; int newNbOfNodes;
if(nbOfNodesCreated!=0)
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(mergeNodes(eps,areNodesMerged,newNbOfNodes));
+ MCAuto<DataArrayInt> tmp(mergeNodes(eps,areNodesMerged,newNbOfNodes));
}
return ret.retn();
}
*/
DataArrayInt *MEDCouplingUMesh::colinearize2D(double eps)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
- checkCoherency();
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+ checkConsistencyLight();
if(getSpaceDimension()!=2 || getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::colinearize2D : This method only works for meshes with spaceDim=2 and meshDim=2 !");
INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=eps;
INTERP_KERNEL::QUADRATIC_PLANAR::_precision=eps;
int nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes());
const int *cptr(_nodal_connec->begin()),*ciptr(_nodal_connec_index->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newc(DataArrayInt::New()),newci(DataArrayInt::New()); newci->alloc(nbOfCells+1,1); newc->alloc(0,1); newci->setIJ(0,0,0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> appendedCoords(DataArrayDouble::New()); appendedCoords->alloc(0,1);//1 not 2 it is not a bug.
+ MCAuto<DataArrayInt> newc(DataArrayInt::New()),newci(DataArrayInt::New()); newci->alloc(nbOfCells+1,1); newc->alloc(0,1); newci->setIJ(0,0,0);
+ MCAuto<DataArrayDouble> appendedCoords(DataArrayDouble::New()); appendedCoords->alloc(0,1);//1 not 2 it is not a bug.
const double *coords(_coords->begin());
int *newciptr(newci->getPointer());
for(int i=0;i<nbOfCells;i++,newciptr++,ciptr++)
if(!appendedCoords->empty())
{
appendedCoords->rearrange(2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords(DataArrayDouble::Aggregate(getCoords(),appendedCoords));//treat info on components
+ MCAuto<DataArrayDouble> newCoords(DataArrayDouble::Aggregate(getCoords(),appendedCoords));//treat info on components
//non const part
setCoords(newCoords);
}
INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=eps;
const int *c1(m1Desc->getNodalConnectivity()->getConstPointer()),*ci1(m1Desc->getNodalConnectivityIndex()->getConstPointer());
// Build BB tree of all edges in the tool mesh (second mesh)
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bbox1Arr(m1Desc->getBoundingBoxForBBTree()),bbox2Arr(m2Desc->getBoundingBoxForBBTree());
+ MCAuto<DataArrayDouble> bbox1Arr(m1Desc->getBoundingBoxForBBTree()),bbox2Arr(m2Desc->getBoundingBoxForBBTree());
const double *bbox1(bbox1Arr->begin()),*bbox2(bbox2Arr->begin());
int nDescCell1(m1Desc->getNumberOfCells()),nDescCell2(m2Desc->getNumberOfCells());
intersectEdge1.resize(nDescCell1);
std::set<INTERP_KERNEL::Node *> nodes;
pol1->getAllNodes(nodes); pol2->getAllNodes(nodes);
std::size_t szz(nodes.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node> > nodesSafe(szz);
+ std::vector< MCAuto<INTERP_KERNEL::Node> > nodesSafe(szz);
std::set<INTERP_KERNEL::Node *>::const_iterator itt(nodes.begin());
for(std::size_t iii=0;iii<szz;iii++,itt++)
{ (*itt)->incrRef(); nodesSafe[iii]=*itt; }
descIndx2=DataArrayInt::New();
revDesc2=DataArrayInt::New();
revDescIndx2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> dd1(desc1),dd2(descIndx1),dd3(revDesc1),dd4(revDescIndx1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> dd5(desc2),dd6(descIndx2),dd7(revDesc2),dd8(revDescIndx2);
+ MCAuto<DataArrayInt> dd1(desc1),dd2(descIndx1),dd3(revDesc1),dd4(revDescIndx1);
+ MCAuto<DataArrayInt> dd5(desc2),dd6(descIndx2),dd7(revDesc2),dd8(revDescIndx2);
m1Desc=m1->buildDescendingConnectivity2(desc1,descIndx1,revDesc1,revDescIndx1);
m2Desc=m2->buildDescendingConnectivity2(desc2,descIndx2,revDesc2,revDescIndx2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> dd9(m1Desc),dd10(m2Desc);
+ MCAuto<MEDCouplingUMesh> dd9(m1Desc),dd10(m2Desc);
std::map<int,int> notUsedMap;
Intersect1DMeshes(m1Desc,m2Desc,eps,intersectEdge1,colinear2,subDiv2,addCoo,notUsedMap);
m1Desc->incrRef(); desc1->incrRef(); descIndx1->incrRef(); revDesc1->incrRef(); revDescIndx1->incrRef();
* \param [in] arrIndxIn is the input index array allowing to walk into \b arrIn
* \param [out] arrOut the resulting array
* \param [out] arrIndexOut the index array of the resulting array \b arrOut
- * \sa MEDCouplingUMesh::ExtractFromIndexedArrays2
+ * \sa MEDCouplingUMesh::ExtractFromIndexedArraysSlice
*/
void MEDCouplingUMesh::ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
if(nbOfGrps<0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
int maxSizeOfArr=arrIn->getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arro=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrIo=DataArrayInt::New();
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
arrIo->alloc((int)(sz+1),1);
const int *idsIt=idsOfSelectBg;
int *work=arrIo->getPointer();
* \param [out] arrIndexOut the index array of the resulting array \b arrOut
* \sa MEDCouplingUMesh::ExtractFromIndexedArrays
*/
-void MEDCouplingUMesh::ExtractFromIndexedArrays2(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+void MEDCouplingUMesh::ExtractFromIndexedArraysSlice(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
{
if(!arrIn || !arrIndxIn)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays2 : input pointer is NULL !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : input pointer is NULL !");
arrIn->checkAllocated(); arrIndxIn->checkAllocated();
if(arrIn->getNumberOfComponents()!=1 || arrIndxIn->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays2 : input arrays must have exactly one component !");
- int sz=DataArrayInt::GetNumberOfItemGivenBESRelative(idsOfSelectStart,idsOfSelectStop,idsOfSelectStep,"MEDCouplingUMesh::ExtractFromIndexedArrays2 : Input slice ");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : input arrays must have exactly one component !");
+ int sz=DataArrayInt::GetNumberOfItemGivenBESRelative(idsOfSelectStart,idsOfSelectStop,idsOfSelectStep,"MEDCouplingUMesh::ExtractFromIndexedArraysSlice : Input slice ");
const int *arrInPtr=arrIn->getConstPointer();
const int *arrIndxPtr=arrIndxIn->getConstPointer();
int nbOfGrps=arrIndxIn->getNumberOfTuples()-1;
if(nbOfGrps<0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays2 : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArraysSlice : The format of \"arrIndxIn\" is invalid ! Its nb of tuples should be >=1 !");
int maxSizeOfArr=arrIn->getNumberOfTuples();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arro=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrIo=DataArrayInt::New();
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
arrIo->alloc((int)(sz+1),1);
int idsIt=idsOfSelectStart;
int *work=arrIo->getPointer();
lgth+=arrIndxPtr[idsIt+1]-arrIndxPtr[idsIt];
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays2 : id located on pos #" << i << " value is " << idsIt << " ! Must be in [0," << nbOfGrps << ") !";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " ! Must be in [0," << nbOfGrps << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
if(lgth>=work[-1])
*work=lgth;
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays2 : id located on pos #" << i << " value is " << idsIt << " and at this pos arrIndxIn[" << idsIt;
+ std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " and at this pos arrIndxIn[" << idsIt;
oss << "+1]-arrIndxIn[" << idsIt << "] < 0 ! The input index array is bugged !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
work=std::copy(arrInPtr+arrIndxPtr[idsIt],arrInPtr+arrIndxPtr[idsIt+1],work);
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArrays2 : id located on pos #" << i << " value is " << idsIt << " arrIndx[" << idsIt << "] must be >= 0 and arrIndx[";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::ExtractFromIndexedArraysSlice : id located on pos #" << i << " value is " << idsIt << " arrIndx[" << idsIt << "] must be >= 0 and arrIndx[";
oss << idsIt << "+1] <= " << maxSizeOfArr << " (the size of arrIn)!";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
{
if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : presence of null pointer in input parameter !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arro=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrIo=DataArrayInt::New();
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
std::vector<bool> v(nbOfTuples,true);
int offset=0;
}
int lgth=(int)std::count(fetched2.begin(),fetched2.end(),true);
i=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(lgth,1);
+ MCAuto<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(lgth,1);
int *retPtr=ret->getPointer();
for(std::vector<bool>::const_iterator it=fetched2.begin();it!=fetched2.end();it++,i++)
if(*it)
*
* \sa MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx MEDCouplingUMesh::SetPartOfIndexedArrays
*/
-void MEDCouplingUMesh::SetPartOfIndexedArrays2(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+void MEDCouplingUMesh::SetPartOfIndexedArraysSlice(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut)
{
if(arrIn==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays2 : presence of null pointer in input parameter !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arro=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrIo=DataArrayInt::New();
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSlice : presence of null pointer in input parameter !");
+ MCAuto<DataArrayInt> arro=DataArrayInt::New();
+ MCAuto<DataArrayInt> arrIo=DataArrayInt::New();
int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
int offset=0;
const int *arrIndxInPtr=arrIndxIn->getConstPointer();
const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
- int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArrays2 : ");
+ int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSlice : ");
int it=start;
for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
{
offset+=(srcArrIndexPtr[1]-srcArrIndexPtr[0])-(arrIndxInPtr[it+1]-arrIndxInPtr[it]);
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArrays2 : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
* \param [in] srcArr input array that will be used as source of copy for ids in [\b idsOfSelectBg, \b idsOfSelectEnd)
* \param [in] srcArrIndex index array of \b srcArr
*
- * \sa MEDCouplingUMesh::SetPartOfIndexedArrays2 MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx
+ * \sa MEDCouplingUMesh::SetPartOfIndexedArraysSlice MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx
*/
-void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
+void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex)
{
if(arrInOut==0 || arrIndxIn==0 || srcArr==0 || srcArrIndex==0)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2 : presence of null pointer in input parameter !");
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : presence of null pointer in input parameter !");
int nbOfTuples=arrIndxIn->getNumberOfTuples()-1;
const int *arrIndxInPtr=arrIndxIn->getConstPointer();
const int *srcArrIndexPtr=srcArrIndex->getConstPointer();
int *arrInOutPtr=arrInOut->getPointer();
const int *srcArrPtr=srcArr->getConstPointer();
- int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2 : ");
+ int nbOfElemsToSet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : ");
int it=start;
for(int i=0;i<nbOfElemsToSet;i++,srcArrIndexPtr++,it+=step)
{
std::copy(srcArrPtr+srcArrIndexPtr[0],srcArrPtr+srcArrIndexPtr[1],arrInOutPtr+arrIndxInPtr[it]);
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2 : On pos #" << i << " id (idsOfSelectBg[" << i << "]) is " << it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " id (idsOfSelectBg[" << i << "]) is " << it << " arrIndxIn[id+1]-arrIndxIn[id]!=srcArrIndex[pos+1]-srcArrIndex[pos] !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
else
{
- std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx2 : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
+ std::ostringstream oss; oss << "MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice : On pos #" << i << " value is " << it << " not in [0," << nbOfTuples << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
if(mdim!=spaceDim)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSpreadZonesWithPoly : meshdimension and spacedimension do not match !");
std::vector<DataArrayInt *> partition=partitionBySpreadZone();
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > partitionAuto; partitionAuto.reserve(partition.size());
- std::copy(partition.begin(),partition.end(),std::back_insert_iterator<std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > >(partitionAuto));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
+ std::vector< MCAuto<DataArrayInt> > partitionAuto; partitionAuto.reserve(partition.size());
+ std::copy(partition.begin(),partition.end(),std::back_insert_iterator<std::vector< MCAuto<DataArrayInt> > >(partitionAuto));
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
ret->setCoords(getCoords());
ret->allocateCells((int)partition.size());
//
for(std::vector<DataArrayInt *>::const_iterator it=partition.begin();it!=partition.end();it++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf((*it)->begin(),(*it)->end(),true));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cell;
+ MCAuto<MEDCouplingUMesh> tmp=static_cast<MEDCouplingUMesh *>(buildPartOfMySelf((*it)->begin(),(*it)->end(),true));
+ MCAuto<DataArrayInt> cell;
switch(mdim)
{
case 2:
return ret;
DataArrayInt *neigh=0,*neighI=0;
computeNeighborsOfCells(neigh,neighI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> neighAuto(neigh),neighIAuto(neighI);
+ MCAuto<DataArrayInt> neighAuto(neigh),neighIAuto(neighI);
std::vector<bool> fetchedCells(nbOfCellsCur,false);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > ret2;
+ std::vector< MCAuto<DataArrayInt> > ret2;
int seed=0;
while(seed<nbOfCellsCur)
{
ret2.push_back(ComputeSpreadZoneGraduallyFromSeedAlg(fetchedCells,&seed,&seed+1,neigh,neighI,-1,nbOfPeelPerformed));
seed=(int)std::distance(fetchedCells.begin(),std::find(fetchedCells.begin()+seed,fetchedCells.end(),false));
}
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::iterator it=ret2.begin();it!=ret2.end();it++)
+ for(std::vector< MCAuto<DataArrayInt> >::iterator it=ret2.begin();it!=ret2.end();it++)
ret.push_back((*it).retn());
return ret;
}
*/
DataArrayInt *MEDCouplingUMesh::ComputeRangesFromTypeDistribution(const std::vector<int>& code)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
std::size_t nb=code.size()/3;
if(code.size()%3!=0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ComputeRangesFromTypeDistribution : invalid input code !");
if(getMeshDimension()!=3 || getSpaceDimension()!=3)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::tetrahedrize : only available for mesh with meshdim == 3 and spacedim == 3 !");
int nbOfCells(getNumberOfCells()),nbNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret0(MEDCoupling1SGTUMesh::New(getName(),INTERP_KERNEL::NORM_TETRA4));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfCells,1);
+ MCAuto<MEDCoupling1SGTUMesh> ret0(MEDCoupling1SGTUMesh::New(getName(),INTERP_KERNEL::NORM_TETRA4));
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfCells,1);
int *retPt(ret->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn(DataArrayInt::New()); newConn->alloc(0,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> addPts(DataArrayDouble::New()); addPts->alloc(0,1);
+ MCAuto<DataArrayInt> newConn(DataArrayInt::New()); newConn->alloc(0,1);
+ MCAuto<DataArrayDouble> addPts(DataArrayDouble::New()); addPts->alloc(0,1);
const int *oldc(_nodal_connec->begin());
const int *oldci(_nodal_connec_index->begin());
const double *coords(_coords->begin());
}
ret0->setNodalConnectivity(newConn);
//
- ret->computeOffsets2();
+ ret->computeOffsetsFull();
n2oCells=ret->buildExplicitArrOfSliceOnScaledArr(0,nbOfCells,1);
return ret0.retn();
}
void MEDCouplingUMesh::split2DCellsLinear(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI)
{
checkConnectivityFullyDefined();
- int ncells(getNumberOfCells()),lgthToReach(getMeshLength()+subNodesInSeg->getNumberOfTuples());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(DataArrayInt::New()); c->alloc((std::size_t)lgthToReach);
+ int ncells(getNumberOfCells()),lgthToReach(getNodalConnectivityArrayLen()+subNodesInSeg->getNumberOfTuples());
+ MCAuto<DataArrayInt> c(DataArrayInt::New()); c->alloc((std::size_t)lgthToReach);
const int *subPtr(subNodesInSeg->begin()),*subIPtr(subNodesInSegI->begin()),*descPtr(desc->begin()),*descIPtr(descI->begin()),*oldConn(getNodalConnectivity()->begin());
int *cPtr(c->getPointer()),*ciPtr(getNodalConnectivityIndex()->getPointer());
int prevPosOfCi(ciPtr[0]);
for(;(nbOfTurn+nbOfHit)<nbs;nbOfTurn++)
{
cm.fillSonCellNodalConnectivity2(posBaseElt,connBg+1,sz,tmpConn,typeOfSon);
- std::map<MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Node>,int> m;
+ std::map<MCAuto<INTERP_KERNEL::Node>,int> m;
INTERP_KERNEL::Edge *e(MEDCouplingUMeshBuildQPFromEdge2(typeOfSon,tmpConn,coords,m));
posEndElt = posBaseElt+1;
*/
int MEDCouplingUMesh::split2DCellsQuadratic(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *mid, const DataArrayInt *midI)
{
- checkCoherency();
- int ncells(getNumberOfCells()),lgthToReach(getMeshLength()+2*subNodesInSeg->getNumberOfTuples()),nodesCnt(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(DataArrayInt::New()); c->alloc((std::size_t)lgthToReach);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> addCoo(DataArrayDouble::New()); addCoo->alloc(0,1);
+ checkConsistencyLight();
+ int ncells(getNumberOfCells()),lgthToReach(getNodalConnectivityArrayLen()+2*subNodesInSeg->getNumberOfTuples()),nodesCnt(getNumberOfNodes());
+ MCAuto<DataArrayInt> c(DataArrayInt::New()); c->alloc((std::size_t)lgthToReach);
+ MCAuto<DataArrayDouble> addCoo(DataArrayDouble::New()); addCoo->alloc(0,1);
const int *subPtr(subNodesInSeg->begin()),*subIPtr(subNodesInSegI->begin()),*descPtr(desc->begin()),*descIPtr(descI->begin()),*oldConn(getNodalConnectivity()->begin());
const int *midPtr(mid->begin()),*midIPtr(midI->begin());
const double *oldCoordsPtr(getCoords()->begin());
ns[0]=new INTERP_KERNEL::Node(oldCoordsPtr[2*oldConn[prevPosOfCi+1+j]],oldCoordsPtr[2*oldConn[prevPosOfCi+1+j]+1]);
ns[1]=new INTERP_KERNEL::Node(oldCoordsPtr[2*oldConn[prevPosOfCi+1+(1+j)%sz]],oldCoordsPtr[2*oldConn[prevPosOfCi+1+(1+j)%sz]+1]);
ns[2]=new INTERP_KERNEL::Node(oldCoordsPtr[2*oldConn[prevPosOfCi+1+sz+j]],oldCoordsPtr[2*oldConn[prevPosOfCi+1+sz+j]+1]);
- MEDCouplingAutoRefCountObjectPtr<INTERP_KERNEL::Edge> e(INTERP_KERNEL::QuadraticPolygon::BuildArcCircleEdge(ns));
+ MCAuto<INTERP_KERNEL::Edge> e(INTERP_KERNEL::QuadraticPolygon::BuildArcCircleEdge(ns));
for(int k=0;k<sz2;k++)//loop over subsplit of current subedge
{
cPtr[1]=subPtr[offset2+k];
_nodal_connec->decrRef();
_nodal_connec=c.retn(); _types.clear(); _types.insert(INTERP_KERNEL::NORM_QPOLYG);
addCoo->rearrange(2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::Aggregate(getCoords(),addCoo));//info are copied from getCoords() by using Aggregate
+ MCAuto<DataArrayDouble> coo(DataArrayDouble::Aggregate(getCoords(),addCoo));//info are copied from getCoords() by using Aggregate
setCoords(coo);
return addCoo->getNumberOfTuples();
}
if(_cell_id<_nb_cell)
{
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)c[ci[_cell_id]];
- int nbOfElems=(int)std::distance(ci+_cell_id,std::find_if(ci+_cell_id,ci+_nb_cell,ParaMEDMEMImpl::ConnReader(c,type)));
+ int nbOfElems=(int)std::distance(ci+_cell_id,std::find_if(ci+_cell_id,ci+_nb_cell,MEDCouplingImpl::ConnReader(c,type)));
int startId=_cell_id;
_cell_id+=nbOfElems;
return new MEDCouplingUMeshCellEntry(_mesh,type,_cell,startId,_cell_id);
#include <set>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMeshCellByTypeEntry;
class MEDCouplingUMeshCellIterator;
MEDCOUPLING_EXPORT static MEDCouplingUMesh *New();
MEDCOUPLING_EXPORT static MEDCouplingUMesh *New(const std::string& meshName, int meshDim);
// Copy methods
- MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCpy() const;;
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCopy() const;;
MEDCOUPLING_EXPORT MEDCouplingUMesh *clone(bool recDeepCpy) const;
- MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCpyConnectivityOnly() const;
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCopyConnectivityOnly() const;
MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
MEDCOUPLING_EXPORT void updateTime() const;
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
- MEDCOUPLING_EXPORT void checkCoherency() const;
- MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
+ MEDCOUPLING_EXPORT void checkConsistencyLight() const;
+ MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
MEDCOUPLING_EXPORT void setMeshDimension(int meshDim);
MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0);
MEDCOUPLING_EXPORT void insertNextCell(INTERP_KERNEL::NormalizedCellType type, int size, const int *nodalConnOfCell);
MEDCOUPLING_EXPORT int getNumberOfNodesInCell(int cellId) const;
MEDCOUPLING_EXPORT int getNumberOfCells() const;
MEDCOUPLING_EXPORT int getMeshDimension() const;
- MEDCOUPLING_EXPORT int getMeshLength() const;
+ MEDCOUPLING_EXPORT int getNodalConnectivityArrayLen() const;
MEDCOUPLING_EXPORT void computeTypes();
//! size of returned tinyInfo must be always the same.
MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
//tools
MEDCOUPLING_EXPORT static int AreCellsEqual(const int *conn, const int *connI, int cell1, int cell2, int compType);
- MEDCOUPLING_EXPORT static int AreCellsEqual0(const int *conn, const int *connI, int cell1, int cell2);
- MEDCOUPLING_EXPORT static int AreCellsEqual1(const int *conn, const int *connI, int cell1, int cell2);
- MEDCOUPLING_EXPORT static int AreCellsEqual2(const int *conn, const int *connI, int cell1, int cell2);
- MEDCOUPLING_EXPORT static int AreCellsEqual3(const int *conn, const int *connI, int cell1, int cell2);
- MEDCOUPLING_EXPORT static int AreCellsEqual7(const int *conn, const int *connI, int cell1, int cell2);
+ MEDCOUPLING_EXPORT static int AreCellsEqualPolicy0(const int *conn, const int *connI, int cell1, int cell2);
+ MEDCOUPLING_EXPORT static int AreCellsEqualPolicy1(const int *conn, const int *connI, int cell1, int cell2);
+ MEDCOUPLING_EXPORT static int AreCellsEqualPolicy2(const int *conn, const int *connI, int cell1, int cell2);
+ MEDCOUPLING_EXPORT static int AreCellsEqualPolicy2NoType(const int *conn, const int *connI, int cell1, int cell2);
+ MEDCOUPLING_EXPORT static int AreCellsEqualPolicy7(const int *conn, const int *connI, int cell1, int cell2);
MEDCOUPLING_EXPORT void convertToPolyTypes(const int *cellIdsToConvertBg, const int *cellIdsToConvertEnd);
MEDCOUPLING_EXPORT void convertAllToPoly();
MEDCOUPLING_EXPORT void convertExtrudedPolyhedra();
MEDCOUPLING_EXPORT DataArrayInt *zipCoordsTraducer();
MEDCOUPLING_EXPORT void findCommonCells(int compType, int startCellId, DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) const;
MEDCOUPLING_EXPORT bool areCellsIncludedIn(const MEDCouplingUMesh *other, int compType, DataArrayInt *& arr) const;
- MEDCOUPLING_EXPORT bool areCellsIncludedIn2(const MEDCouplingUMesh *other, DataArrayInt *& arr) const;
+ MEDCOUPLING_EXPORT bool areCellsIncludedInPolicy7(const MEDCouplingUMesh *other, DataArrayInt *& arr) const;
MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const;
MEDCOUPLING_EXPORT MEDCouplingUMesh *explode3DMeshTo1D(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
MEDCOUPLING_EXPORT MEDCouplingUMesh *buildDescendingConnectivity(DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const;
MEDCOUPLING_EXPORT void computeNeighborsOfNodes(DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const;
MEDCOUPLING_EXPORT MEDCouplingUMesh *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
MEDCOUPLING_EXPORT MEDCouplingUMesh *buildPartOfMySelf(const int *begin, const int *end, bool keepCoords=true) const;
- MEDCOUPLING_EXPORT MEDCouplingUMesh *buildPartOfMySelf2(int start, int end, int step, bool keepCoords=true) const;
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *buildPartOfMySelfSlice(int start, int end, int step, bool keepCoords=true) const;
MEDCOUPLING_EXPORT void setPartOfMySelf(const int *cellIdsBg, const int *cellIdsEnd, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
- MEDCOUPLING_EXPORT void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
+ MEDCOUPLING_EXPORT void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
MEDCOUPLING_EXPORT MEDCouplingUMesh *buildFacePartOfMySelfNode(const int *begin, const int *end, bool fullyIn) const;
MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const;
MEDCOUPLING_EXPORT DataArrayInt *findBoundaryNodes() const;
MEDCOUPLING_EXPORT DataArrayDouble *distanceToPoints(const DataArrayDouble *pts, DataArrayInt *& cellIds) const;
MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const;
MEDCOUPLING_EXPORT void getCellsContainingPoint(const double *pos, double eps, std::vector<int>& elts) const;
- MEDCOUPLING_EXPORT void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& elts, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& eltsIndex) const;
+ MEDCOUPLING_EXPORT void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MCAuto<DataArrayInt>& elts, MCAuto<DataArrayInt>& eltsIndex) const;
MEDCOUPLING_EXPORT void checkButterflyCells(std::vector<int>& cells, double eps=1e-12) const;
MEDCOUPLING_EXPORT DataArrayInt *convexEnvelop2D();
MEDCOUPLING_EXPORT DataArrayInt *findAndCorrectBadOriented3DExtrudedCells();
MEDCOUPLING_EXPORT std::vector<bool> getQuadraticStatus() const;
//
MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
- MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayDouble *getPartBarycenterAndOwner(const int *begin, const int *end) const;
MEDCOUPLING_EXPORT DataArrayDouble *computePlaneEquationOf3DFaces() const;
MEDCOUPLING_EXPORT static bool RemoveIdsFromIndexedArrays(const int *idsToRemoveBg, const int *idsToRemoveEnd, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0);
MEDCOUPLING_EXPORT static void ExtractFromIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
- MEDCOUPLING_EXPORT static void ExtractFromIndexedArrays2(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ MEDCOUPLING_EXPORT static void ExtractFromIndexedArraysSlice(int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
MEDCOUPLING_EXPORT static void SetPartOfIndexedArrays(const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdx(const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex);
- MEDCOUPLING_EXPORT static void SetPartOfIndexedArrays2(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
+ MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSlice(int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn,
const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex,
DataArrayInt* &arrOut, DataArrayInt* &arrIndexOut);
- MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdx2(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
+ MEDCOUPLING_EXPORT static void SetPartOfIndexedArraysSameIdxSlice(int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn,
const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex);
MEDCOUPLING_EXPORT static DataArrayInt *ComputeSpreadZoneGradually(const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn);
MEDCOUPLING_EXPORT static DataArrayInt *ComputeSpreadZoneGraduallyFromSeed(const int *seedBg, const int *seedEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling, int& nbOfDepthPeelingPerformed);
DataArrayDouble *fillExtCoordsUsingTranslAndAutoRotation3D(const MEDCouplingUMesh *mesh1D, bool isQuad) const;
static bool AreCellsEqualInPool(const std::vector<int>& candidates, int compType, const int *conn, const int *connI, DataArrayInt *result) ;
MEDCouplingUMesh *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const;
- MEDCouplingUMesh *buildPartOfMySelfKeepCoords2(int start, int end, int step) const;
+ MEDCouplingUMesh *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const;
DataArrayInt *convertLinearCellsToQuadratic1D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
DataArrayInt *convertLinearCellsToQuadratic2DAnd3D0(const MEDCouplingUMesh *m1D, const DataArrayInt *desc, const DataArrayInt *descI, DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
DataArrayInt *convertLinearCellsToQuadratic2D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
DataArrayInt *buildUnionOf2DMeshQuadratic(const MEDCouplingUMesh *skin, const DataArrayInt *n2o) const;
template<int SPACEDIM>
void getCellsContainingPointsAlg(const double *coords, const double *pos, int nbOfPoints,
- double eps, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& elts, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& eltsIndex) const;
+ double eps, MCAuto<DataArrayInt>& elts, MCAuto<DataArrayInt>& eltsIndex) const;
/// @cond INTERNAL
static MEDCouplingUMesh *MergeUMeshesLL(std::vector<const MEDCouplingUMesh *>& a);
typedef int (*DimM1DescNbrer)(int id, unsigned nb, const INTERP_KERNEL::CellModel& cm, bool compute, const int *conn1, const int *conn2);
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTest.hxx"
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingMultiFields.hxx"
#include "MEDCouplingNormalizedUnstructuredMesh.txx"
#include "MEDCouplingNormalizedCartesianMesh.txx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
typedef std::vector<std::map<int,double> > IntersectionMatrix;
std::copy(coords,coords+22,myCoords->getPointer());
ret->setCoords(myCoords);
myCoords->decrRef();
- ret->checkCoherency();
+ ret->checkConsistencyLight();
return ret;
}
MEDCouplingMultiFields *MEDCouplingBasicsTest::buildMultiFields_1()
{
- ParaMEDMEM::MEDCouplingUMesh *m1=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m1=build2DTargetMesh_1();
m1->setName("m1");
- ParaMEDMEM::MEDCouplingUMesh *m2=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m2=build2DTargetMesh_1();
m2->setName("m2");
const double vals0[]={-0.7,-1.,-2.,-3.,-4.};
const double vals1[]={0.,1.,2.,3.,4.,0.1,0.2,0.3,0.4};
const double vals2[]={5.,6.,7.,8.,9.};
const double vals4[]={15.,16.,17.,18.,19.};
//
- ParaMEDMEM::DataArrayDouble *d0=ParaMEDMEM::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
- ParaMEDMEM::DataArrayDouble *d1=ParaMEDMEM::DataArrayDouble::New(); d1->alloc(9,1); std::copy(vals1,vals1+9,d1->getPointer());
- ParaMEDMEM::DataArrayDouble *d1_1=ParaMEDMEM::DataArrayDouble::New(); d1_1->alloc(9,1); std::copy(vals1_1,vals1_1+9,d1_1->getPointer());
- ParaMEDMEM::DataArrayDouble *d2=ParaMEDMEM::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
- ParaMEDMEM::DataArrayDouble *d4=ParaMEDMEM::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
+ MEDCoupling::DataArrayDouble *d0=MEDCoupling::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
+ MEDCoupling::DataArrayDouble *d1=MEDCoupling::DataArrayDouble::New(); d1->alloc(9,1); std::copy(vals1,vals1+9,d1->getPointer());
+ MEDCoupling::DataArrayDouble *d1_1=MEDCoupling::DataArrayDouble::New(); d1_1->alloc(9,1); std::copy(vals1_1,vals1_1+9,d1_1->getPointer());
+ MEDCoupling::DataArrayDouble *d2=MEDCoupling::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
+ MEDCoupling::DataArrayDouble *d4=MEDCoupling::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
//
d0->setName("d0"); d1->setName("d1"); d1_1->setName("d1_1"); d2->setName("d2"); d4->setName("d4");
d0->setInfoOnComponent(0,"c1");
d2->setInfoOnComponent(0,"c5");
d4->setInfoOnComponent(0,"c7");
//
- ParaMEDMEM::MEDCouplingFieldDouble *f0=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f0=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f0->setMesh(m1);
f0->setArray(d0);
f0->setTime(0.2,5,6);
f0->setName("f0");
- ParaMEDMEM::MEDCouplingFieldDouble *f1=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES,ParaMEDMEM::LINEAR_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::LINEAR_TIME);
f1->setMesh(m1);
- std::vector<ParaMEDMEM::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
+ std::vector<MEDCoupling::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
f1->setArrays(d1s);
f1->setStartTime(0.7,7,8);
f1->setEndTime(1.2,9,10);
f1->setName("f1");
- ParaMEDMEM::MEDCouplingFieldDouble *f2=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::CONST_ON_TIME_INTERVAL);
+ MEDCoupling::MEDCouplingFieldDouble *f2=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::CONST_ON_TIME_INTERVAL);
f2->setMesh(m2);
f2->setArray(d2);
f2->setTime(1.2,11,12);
f2->setEndTime(1.5,13,14);
f2->setName("f2");
- ParaMEDMEM::MEDCouplingFieldDouble *f3=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f3=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f3->setMesh(m1);
f3->setArray(d2);
f3->setTime(1.7,15,16);
f3->setName("f3");
- ParaMEDMEM::MEDCouplingFieldDouble *f4=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f4=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
f4->setMesh(m2);
f4->setArray(d4);
f4->setName("f4");
//
- std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> fs(5);
+ std::vector<MEDCoupling::MEDCouplingFieldDouble *> fs(5);
fs[0]=f0; fs[1]=f1; fs[2]=f2; fs[3]=f3; fs[4]=f4;
- ParaMEDMEM::MEDCouplingMultiFields *ret=ParaMEDMEM::MEDCouplingMultiFields::New(fs);
+ MEDCoupling::MEDCouplingMultiFields *ret=MEDCoupling::MEDCouplingMultiFields::New(fs);
//
m1->decrRef();
m2->decrRef();
std::vector<MEDCouplingFieldDouble *> MEDCouplingBasicsTest::buildMultiFields_2()
{
- ParaMEDMEM::MEDCouplingUMesh *m1=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m1=build2DTargetMesh_1();
m1->setName("m1");
- ParaMEDMEM::MEDCouplingUMesh *m2=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m2=build2DTargetMesh_1();
m2->setName("m2");
const double vals0[]={-0.7,-1.,-2.,-3.,-4.};
const double vals1[]={0.,1.,2.,3.,4.};
const double vals2[]={5.,6.,7.,8.,9.};
const double vals4[]={15.,16.,17.,18.,19.};
//
- ParaMEDMEM::DataArrayDouble *d0=ParaMEDMEM::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
- ParaMEDMEM::DataArrayDouble *d1=ParaMEDMEM::DataArrayDouble::New(); d1->alloc(5,1); std::copy(vals1,vals1+5,d1->getPointer());
- ParaMEDMEM::DataArrayDouble *d1_1=ParaMEDMEM::DataArrayDouble::New(); d1_1->alloc(5,1); std::copy(vals1_1,vals1_1+5,d1_1->getPointer());
- ParaMEDMEM::DataArrayDouble *d2=ParaMEDMEM::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
- ParaMEDMEM::DataArrayDouble *d4=ParaMEDMEM::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
+ MEDCoupling::DataArrayDouble *d0=MEDCoupling::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
+ MEDCoupling::DataArrayDouble *d1=MEDCoupling::DataArrayDouble::New(); d1->alloc(5,1); std::copy(vals1,vals1+5,d1->getPointer());
+ MEDCoupling::DataArrayDouble *d1_1=MEDCoupling::DataArrayDouble::New(); d1_1->alloc(5,1); std::copy(vals1_1,vals1_1+5,d1_1->getPointer());
+ MEDCoupling::DataArrayDouble *d2=MEDCoupling::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
+ MEDCoupling::DataArrayDouble *d4=MEDCoupling::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
//
d0->setName("d0"); d1->setName("d1"); d1_1->setName("d1_1"); d2->setName("d2"); d4->setName("d4");
d0->setInfoOnComponent(0,"c1");
d2->setInfoOnComponent(0,"c5");
d4->setInfoOnComponent(0,"c7");
//
- ParaMEDMEM::MEDCouplingFieldDouble *f0=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f0=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f0->setMesh(m1);
f0->setArray(d0);
f0->setTime(0.2,5,6);
f0->setName("f0");
- ParaMEDMEM::MEDCouplingFieldDouble *f1=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::LINEAR_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::LINEAR_TIME);
f1->setMesh(m1);
- std::vector<ParaMEDMEM::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
+ std::vector<MEDCoupling::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
f1->setArrays(d1s);
f1->setStartTime(0.7,7,8);
f1->setEndTime(1.2,9,10);
f1->setName("f1");
- ParaMEDMEM::MEDCouplingFieldDouble *f2=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::CONST_ON_TIME_INTERVAL);
+ MEDCoupling::MEDCouplingFieldDouble *f2=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::CONST_ON_TIME_INTERVAL);
f2->setMesh(m2);
f2->setArray(d2);
f2->setTime(1.2,11,12);
f2->setEndTime(1.5,13,14);
f2->setName("f2");
- ParaMEDMEM::MEDCouplingFieldDouble *f3=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f3=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f3->setMesh(m1);
f3->setArray(d2);
f3->setTime(1.7,15,16);
f3->setName("f3");
- ParaMEDMEM::MEDCouplingFieldDouble *f4=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f4=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
f4->setMesh(m2);
f4->setArray(d4);
f4->setName("f4");
//
- std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> fs(5);
+ std::vector<MEDCoupling::MEDCouplingFieldDouble *> fs(5);
fs[0]=f0; fs[1]=f1; fs[2]=f2; fs[3]=f3; fs[4]=f4;
m1->decrRef();
m2->decrRef();
#include "MEDCouplingBasicsTest1.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include <algorithm>
#include <functional>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MEDCouplingBasicsTest1::testArray()
{
CPPUNIT_ASSERT_EQUAL(7,arr1->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,arr1->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr1Ref,arr1Ref+14,arr1->getConstPointer()));
- DataArrayInt *arr2=arr1->substr(3);
+ DataArrayInt *arr2=arr1->subArray(3);
CPPUNIT_ASSERT_EQUAL(4,arr2->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,arr2->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr1Ref+6,arr1Ref+14,arr2->getConstPointer()));
arr2->decrRef();
- DataArrayInt *arr3=arr1->substr(2,5);
+ DataArrayInt *arr3=arr1->subArray(2,5);
CPPUNIT_ASSERT_EQUAL(3,arr3->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,arr3->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr1Ref+4,arr1Ref+10,arr3->getConstPointer()));
CPPUNIT_ASSERT_EQUAL(7,arr4->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,arr4->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr4Ref,arr4Ref+14,arr4->getConstPointer()));
- DataArrayDouble *arr5=arr4->substr(3);
+ DataArrayDouble *arr5=arr4->subArray(3);
CPPUNIT_ASSERT_EQUAL(4,arr5->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,arr5->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr4Ref+6,arr4Ref+14,arr5->getConstPointer()));
arr5->decrRef();
- DataArrayDouble *arr6=arr4->substr(2,5);
+ DataArrayDouble *arr6=arr4->subArray(2,5);
CPPUNIT_ASSERT_EQUAL(3,arr6->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,arr6->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr4Ref+4,arr4Ref+10,arr6->getConstPointer()));
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//test 1 - no copy ownership C++
myCoords=DataArrayDouble::New();
double *tmp=new double[3*nbOfNodes];
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//test 2 - no copy ownership C
myCoords=DataArrayDouble::New();
tmp=(double *)malloc(3*nbOfNodes*sizeof(double));
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh->getNumberOfNodes());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//test 3 - copy.
myCoords=DataArrayDouble::New();
myCoords->alloc(nbOfNodes,3);
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh->getNumberOfNodes());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
// test clone not recursively
MEDCouplingUMesh *mesh2=mesh->clone(false);
CPPUNIT_ASSERT(mesh2!=mesh);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh2->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(3,mesh2->getSpaceDimension());
// test clone not recursively
MEDCouplingUMesh *mesh3=mesh->clone(true);
CPPUNIT_ASSERT(mesh3!=mesh);
- mesh3->checkCoherency();
+ mesh3->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh3->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh3->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(3,mesh3->getSpaceDimension());
std::fill(tmp,tmp+9*nbOfCells,7.);
//content of field changed -> declare it.
fieldOnCells->declareAsNew();
- fieldOnCells->checkCoherency();
+ fieldOnCells->checkConsistencyLight();
// testing clone of fields - no recursive
MEDCouplingFieldDouble *fieldOnCells2=fieldOnCells->clone(false);
CPPUNIT_ASSERT(fieldOnCells2!=fieldOnCells);
- fieldOnCells2->checkCoherency();
+ fieldOnCells2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells2->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(9,fieldOnCells2->getNumberOfComponents());
CPPUNIT_ASSERT(fieldOnCells2->getArray()==fieldOnCells->getArray());
// testing clone of fields - recursive
MEDCouplingFieldDouble *fieldOnCells3=fieldOnCells->clone(true);
CPPUNIT_ASSERT(fieldOnCells3!=fieldOnCells);
- fieldOnCells3->checkCoherency();
+ fieldOnCells3->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells3->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(9,fieldOnCells3->getNumberOfComponents());
CPPUNIT_ASSERT(fieldOnCells3->getArray()!=fieldOnCells->getArray());
targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+6);
targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+7);
targetMesh->finishInsertingCells();
- CPPUNIT_ASSERT_THROW(targetMesh->checkCoherency(),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(targetMesh->checkConsistencyLight(),INTERP_KERNEL::Exception);
DataArrayDouble *myCoords=DataArrayDouble::New();
myCoords->alloc(9,3);
std::copy(targetCoords,targetCoords+27,myCoords->getPointer());
targetMesh->setCoords(myCoords);
myCoords->decrRef();
//
- targetMesh->checkCoherency();
+ targetMesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,targetMesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(8,targetMesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(9,targetMesh->getNumberOfNodes());
CPPUNIT_ASSERT_THROW(meshM1D->getNumberOfCells(),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(meshM1D->setMeshDimension(-2),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(meshM1D->setMeshDimension(-10),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(meshM1D->checkCoherency(),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(meshM1D->checkConsistencyLight(),INTERP_KERNEL::Exception);
meshM1D->setMeshDimension(-1);
- meshM1D->checkCoherency();
+ meshM1D->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(-1,meshM1D->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(1,meshM1D->getNumberOfCells());
CPPUNIT_ASSERT_THROW(meshM1D->getNumberOfNodes(),INTERP_KERNEL::Exception);
double *tmp=array->getPointer();
array->decrRef();
std::fill(tmp,tmp+6,7.);
- fieldOnCells->checkCoherency();
+ fieldOnCells->checkConsistencyLight();
//
fieldOnCells->decrRef();
meshM1D->decrRef();
std::fill(array->getPointer(),array->getPointer()+5*3,7.);
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,array->getIJ(3,2),1e-14);
double *tmp1=array->getPointer();
- DataArrayDouble *array2=array->deepCpy();
+ DataArrayDouble *array2=array->deepCopy();
double *tmp2=array2->getPointer();
CPPUNIT_ASSERT(tmp1!=tmp2);
array->decrRef();
std::fill(array3->getPointer(),array3->getPointer()+5*3,17);
CPPUNIT_ASSERT_EQUAL(17,array3->getIJ(3,2));
int *tmp3=array3->getPointer();
- DataArrayInt *array4=array3->deepCpy();
+ DataArrayInt *array4=array3->deepCopy();
int *tmp4=array4->getPointer();
CPPUNIT_ASSERT(tmp3!=tmp4);
array3->decrRef();
const int elts[2]={1,3};
std::vector<int> eltsV(elts,elts+2);
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(23,mesh->getNodalConnectivity()->getNumberOfTuples());
const int *pt=mesh->getNodalConnectivity()->getConstPointer();
////// 3D
mesh=build3DTargetMesh_1();
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(8,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(114,mesh->getNodalConnectivity()->getNumberOfTuples());
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(8,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(114,mesh->getNodalConnectivity()->getNumberOfTuples());
//
DataArrayInt *revDescIndx=DataArrayInt::New();
//
MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(13,mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,revDescIndx->getNumberOfTuples());
const int elts[2]={1,3};
std::vector<int> eltsV(elts,elts+2);
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//
desc=DataArrayInt::New();
descIndx=DataArrayInt::New();
revDescIndx=DataArrayInt::New();
//
mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(13,mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,revDescIndx->getNumberOfTuples());
DataArrayInt *revDescIndx=DataArrayInt::New();
//
MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(36,mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,revDescIndx->getNumberOfTuples());
const int elts[2]={1,3};
std::vector<int> eltsV(elts,elts+2);
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
desc=DataArrayInt::New();
descIndx=DataArrayInt::New();
revDesc=DataArrayInt::New();
revDescIndx=DataArrayInt::New();
mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(36,mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,revDescIndx->getNumberOfTuples());
CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15));
CPPUNIT_ASSERT(fieldOnCells2->isEqual(fieldOnCells1,1e-12,1e-15));
//
- DataArrayDouble *arr2=arr->deepCpy();
+ DataArrayDouble *arr2=arr->deepCopy();
fieldOnCells2->setArray(arr2);
arr2->decrRef();
CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15));
void MEDCouplingBasicsTest1::testNatureChecking()
{
MEDCouplingFieldDouble *field=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
- field->setNature(Integral);
- field->setNature(ConservativeVolumic);
- field->setNature(IntegralGlobConstraint);
+ field->setNature(ExtensiveMaximum);
+ field->setNature(IntensiveMaximum);
+ field->setNature(ExtensiveConservation);
field->decrRef();
field=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME);
- field->setNature(ConservativeVolumic);
- CPPUNIT_ASSERT_THROW(field->setNature(Integral),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(field->setNature(IntegralGlobConstraint),INTERP_KERNEL::Exception);
+ field->setNature(IntensiveMaximum);
+ CPPUNIT_ASSERT_THROW(field->setNature(ExtensiveMaximum),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(field->setNature(ExtensiveConservation),INTERP_KERNEL::Exception);
field->decrRef();
}
{
MEDCouplingUMesh *mesh2D=0;
MEDCouplingUMesh *mesh3D=build3DExtrudedUMesh_1(mesh2D);
- MEDCouplingExtrudedMesh *ext=MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,1);
+ MEDCouplingMappedExtrudedMesh *ext=MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,1);
CPPUNIT_ASSERT_EQUAL(18,ext->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(60,ext->getNumberOfNodes());
DataArrayInt *ids3D=ext->getMesh3DIds();
mTT->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(43,(int)n.size());
MEDCouplingUMesh *mTT3dSurf=(MEDCouplingUMesh *)mTT->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *meTT=MEDCouplingExtrudedMesh::New(mTT,mTT3dSurf,0);
+ MEDCouplingMappedExtrudedMesh *meTT=MEDCouplingMappedExtrudedMesh::New(mTT,mTT3dSurf,0);
CPPUNIT_ASSERT_EQUAL(200,meTT->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(10,meTT->getMesh2D()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(20,meTT->getMesh1D()->getNumberOfCells());
mN->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(30,(int)n.size());
MEDCouplingUMesh *mN3dSurf=(MEDCouplingUMesh *)mN->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *meN=MEDCouplingExtrudedMesh::New(mN,mN3dSurf,0);
+ MEDCouplingMappedExtrudedMesh *meN=MEDCouplingMappedExtrudedMesh::New(mN,mN3dSurf,0);
CPPUNIT_ASSERT_EQUAL(40,meN->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(20,meN->getMesh2D()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(2,meN->getMesh1D()->getNumberOfCells());
mTF->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(27,(int)n.size());
MEDCouplingUMesh *mTF3dSurf=(MEDCouplingUMesh *)mTF->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *meTF=MEDCouplingExtrudedMesh::New(mTF,mTF3dSurf,0);
+ MEDCouplingMappedExtrudedMesh *meTF=MEDCouplingMappedExtrudedMesh::New(mTF,mTF3dSurf,0);
CPPUNIT_ASSERT_EQUAL(340,meTF->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(17,meTF->getMesh2D()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(20,meTF->getMesh1D()->getNumberOfCells());
m2->rotate(center,vector,-M_PI/2.);
MEDCouplingUMesh *m3=m1->buildExtrudedMesh(m2,0);
//
- MEDCouplingExtrudedMesh *m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
+ MEDCouplingMappedExtrudedMesh *m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(5,m4->getMesh2D()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,m4->getMesh1D()->getNumberOfCells());
//some random in cells to check that extrusion alg find it correctly
const int expected1[15]={1,3,2,0,6,5,7,10,11,8,12,9,14,13,4};
m3->renumberCells(expected1,false);
- m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
+ m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(5,m4->getMesh2D()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,m4->getMesh1D()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_POLYHED,(int)m3->getTypeOfCell(3));
CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_HEXA8,(int)m3->getTypeOfCell(4));
m3->renumberCells(expected1,false);
- m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
+ m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(5,m4->getMesh2D()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,m4->getMesh1D()->getNumberOfCells());
}
/*!
- * This test check MEDCouplingUMesh::buildExtrudedMesh method, but also, MEDCouplingExtrudedMesh following methods :
+ * This test check MEDCouplingUMesh::buildExtrudedMesh method, but also, MEDCouplingMappedExtrudedMesh following methods :
* getCellContainingPoint getMeasureField getNodeIdsOfCell getCoordinateOfNode getTypeOfCell build3DUnstructuredMesh.
*/
void MEDCouplingBasicsTest1::testExtrudedMesh4()
const int expected1[15]= {1,3,2,0,6,5,7,10,11,8,12,9,14,13,4};
const int rexpected1[15]={3, 0, 2, 1, 14, 5, 4, 6, 9, 11, 7, 8, 10, 13, 12};
m3->renumberCells(expected1,false);
- MEDCouplingExtrudedMesh *m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
+ MEDCouplingMappedExtrudedMesh *m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,m4->getTypeOfCell(0));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,m4->getTypeOfCell(1));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POLYHED,m4->getTypeOfCell(2));
MEDCouplingMesh *m3=m1->mergeMyselfWith(m2);
MEDCouplingUMesh *m3C=dynamic_cast<MEDCouplingUMesh *>(m3);
CPPUNIT_ASSERT(m3C);
- m3->checkCoherency();
+ m3->checkConsistencyLight();
MEDCouplingUMesh *m4=build2DTargetMeshMerged_1();
CPPUNIT_ASSERT(m3->isEqual(m4,1.e-12));
m4->decrRef();
std::vector<const MEDCouplingUMesh *> meshes;
meshes.push_back(m1); meshes.push_back(m2); meshes.push_back(m3);
MEDCouplingUMesh *m4=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
- m4->checkCoherency();
+ m4->checkConsistencyLight();
CPPUNIT_ASSERT(m4->getCoords()==m1->getCoords());
CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
const int cells1[5]={0,1,2,3,4};
MEDCouplingFieldDouble *f1=m1->getMeasureField(true);
MEDCouplingFieldDouble *f2=m2->getMeasureField(true);
MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::MergeFields(f1,f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
MEDCouplingUMesh *m4=build2DTargetMeshMerged_1();
CPPUNIT_ASSERT(f3->getMesh()->isEqual(m4,1.e-12));
std::string name=f3->getName();
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.4,f1->getTime(a,b),1.e-14);
CPPUNIT_ASSERT_EQUAL(5,a); CPPUNIT_ASSERT_EQUAL(6,b);
CPPUNIT_ASSERT_EQUAL(std::string(f1->getTimeUnit()),std::string("us"));
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_CELLS);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,1,func1);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,2,func2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(2,f1->getNumberOfComponents());
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_CELLS,1,"y+x");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_CELLS);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,1,"y+2*x");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
f1=m->fillFromAnalytic(ON_NODES,1,"2.*x+y");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,2,"(x+y)*IVec+2*(x+y)*JVec");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(2,f1->getNumberOfComponents());
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,2,func2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(2,f1->getNumberOfComponents());
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,2,func2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT_EQUAL(2,f1->getNumberOfComponents());
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,1,func1);
MEDCouplingFieldDouble *f2=m->fillFromAnalytic(ON_NODES,1,func1);
- f1->checkCoherency();
- f2->checkCoherency();
+ f1->checkConsistencyLight();
+ f2->checkConsistencyLight();
MEDCouplingFieldDouble *f3=(*f1)+(*f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f3->getTimeDiscretization()==ONE_TIME);
double values1[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
f3->decrRef();
//
f3=(*f1)*(*f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f3->getTimeDiscretization()==ONE_TIME);
double values2[9]={0.36,0.01,0.16,0.01,0.16,0.81,0.16,0.81,1.96};
//
f3=(*f1)+(*f2);
MEDCouplingFieldDouble *f4=(*f1)-(*f3);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==ONE_TIME);
double values3[9]={0.6,0.1,-0.4,0.1,-0.4,-0.9,-0.4,-0.9,-1.4};
//
f3=(*f1)+(*f2);
f4=(*f3)/(*f2);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==ONE_TIME);
tmp=f4->getArray()->getConstPointer();
f4->decrRef();
//
f4=f2->buildNewTimeReprFromThis(NO_TIME,false);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getArray()==f2->getArray());
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==NO_TIME);
f3->decrRef();
//
f4=f2->buildNewTimeReprFromThis(NO_TIME,true);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getArray()!=f2->getArray());
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==NO_TIME);
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,1,"x+y+z");
MEDCouplingFieldDouble *f2=m->fillFromAnalytic(ON_NODES,1,"a*a+b+c*c");
MEDCouplingFieldDouble *f3=(*f1)/(*f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f3->getTimeDiscretization()==ONE_TIME);
const double expected1[9]={-2.4999999999999991, 1.2162162162162162, 0.77868852459016391,
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,1,"x+y+z");
MEDCouplingFieldDouble *f2=m->fillFromAnalytic(ON_NODES,1,"a*a+b+c*c");
(*f1)/=(*f2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
const double expected1[9]={-2.4999999999999991, 1.2162162162162162, 0.77868852459016391,
std::copy(arr1,arr1+15,tmp);
f1->setStartTime(2.,0,0);
f1->setEndTime(3.,0,0);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
double res[3];
const double pos[2]={0.3,-0.2};
f1->getValueOn(pos,res);
f2->setArray(f1->getArray());
f2->setStartTime(2.,3,0);
f2->setEndTime(4.,13,0);
- CPPUNIT_ASSERT_THROW(f2->checkCoherency(),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(f2->checkConsistencyLight(),INTERP_KERNEL::Exception);
DataArrayDouble *array2=DataArrayDouble::New();
array2->alloc(nbOfCells,3);
tmp=array2->getPointer();
std::copy(arr2,arr2+15,tmp);
f2->setEndArray(array2);
array2->decrRef();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
//
std::fill(res,res+3,0.);
f2->getValueOn(pos,3.21,res);
{
MEDCouplingUMesh *targetMesh=build2DTargetMesh_1();
double pos[12]={0.,0.,0.4,0.4,0.,0.4,0.1,0.1,0.25,0.,0.65,0.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> t1,t2;
+ MCAuto<DataArrayInt> t1,t2;
//2D basic
targetMesh->getCellsContainingPoints(pos,6,1e-12,t1,t2);
CPPUNIT_ASSERT_EQUAL(6,(int)t1->getNbOfElems());
CPPUNIT_ASSERT_DOUBLES_EQUAL(6.,res[0],1e-12);
fieldOnCells->decrRef();
//
- MEDCouplingMesh* meshDeepCopy=mesh->deepCpy();
+ MEDCouplingMesh* meshDeepCopy=mesh->deepCopy();
MEDCouplingCMesh* meshClone=mesh->clone(false);
CPPUNIT_ASSERT_THROW(meshEmpty->copyTinyStringsFrom(0),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT(mesh1->isEqual(mesh2,1e-5));
CPPUNIT_ASSERT(!mesh1->isEqual(mesh2,1e-7));
- CPPUNIT_ASSERT_THROW(mesh3->checkCoherency1(1e-12),INTERP_KERNEL::Exception);
- mesh1->checkCoherency1(1e-12);
+ CPPUNIT_ASSERT_THROW(mesh3->checkConsistency(1e-12),INTERP_KERNEL::Exception);
+ mesh1->checkConsistency(1e-12);
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,mesh1->getTypeOfCell(1));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,*((mesh1->getAllGeoTypes()).begin()));
mesh->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(9,(int)n.size());
MEDCouplingUMesh *m3dSurf=(MEDCouplingUMesh *)mesh->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *me=MEDCouplingExtrudedMesh::New(mesh,m3dSurf,0);
+ MEDCouplingMappedExtrudedMesh *me=MEDCouplingMappedExtrudedMesh::New(mesh,m3dSurf,0);
const DataArrayInt *da=me->getMesh3DIds();
CPPUNIT_ASSERT_EQUAL(8,me->getNumberOfCells());
const int expected[8]={0,1,2,3,4,5,6,7};
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTest2.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingGaussLocalization.hxx"
#include <functional>
#include <iterator>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MEDCouplingBasicsTest2::testGaussPointField1()
{
f->setArray(array);
f->setName("MyFirstFieldOnGaussPoint");
array->decrRef();
- f->checkCoherency();
+ f->checkConsistencyLight();
CPPUNIT_ASSERT_DOUBLES_EQUAL(27.,f->getIJK(2,5,0),1e-14);
CPPUNIT_ASSERT_DOUBLES_EQUAL(16.,f->getIJK(1,5,1),1e-14);
//
f->clearGaussLocalizations();
CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization());
- CPPUNIT_ASSERT_THROW(f->checkCoherency(),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);
int ids1[4]={0,1,3,4};
CPPUNIT_ASSERT_THROW(f->setGaussLocalizationOnCells(ids1,ids1+4,_refCoo2,_gsCoo1,_wg1),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization());
CPPUNIT_ASSERT_EQUAL(0,f->getGaussLocalizationIdOfOneCell(0));
CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(1));
CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(2));
- CPPUNIT_ASSERT_THROW(f->checkCoherency(),INTERP_KERNEL::Exception);//<- cell 3 has no localization
+ CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);//<- cell 3 has no localization
int ids4[1]={3};
std::vector<double> _gsCoo2(_gsCoo1);
std::vector<double> _wg2(_wg1);
f->getCellIdsHavingGaussLocalization(0,tmpIds);
CPPUNIT_ASSERT_EQUAL(2,(int)tmpIds.size());
CPPUNIT_ASSERT(std::equal(ids2,ids2+2,tmpIds.begin()));
- CPPUNIT_ASSERT_THROW(f->checkCoherency(),INTERP_KERNEL::Exception);//<- it's always not ok because undelying array not with the good size.
- DataArrayDouble *array2=f->getArray()->substr(0,10);
+ CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);//<- it's always not ok because undelying array not with the good size.
+ DataArrayDouble *array2=f->getArray()->subArray(0,10);
f->setArray(array2);
array2->decrRef();
- f->checkCoherency();//<- here it is OK
+ f->checkConsistencyLight();//<- here it is OK
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
MEDCouplingGaussLocalization& gl1=f2->getGaussLocalization(0);
gl1.setGaussCoord(1,1,tmp);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
f->decrRef();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
//
f2->decrRef();
m->decrRef();
f->setArray(array);
array->decrRef();
//
- f->checkCoherency();
+ f->checkConsistencyLight();
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
CPPUNIT_ASSERT_DOUBLES_EQUAL(21.,f->getIJK(2,0,0),1e-14);
res1.clear();
m2->arePolyhedronsNotCorrectlyOriented(res1);
CPPUNIT_ASSERT(res1.empty());
- m2->checkCoherency();
+ m2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(18,m2->getNumberOfCells());
int cellIds[3]={0,6,12};
std::vector<int> cellIds2(cellIds,cellIds+3);
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(std::abs(expected1[i]),f3Ptr[i],1e-12);
f3->decrRef();
- DataArrayDouble *f4=m5->getBarycenterAndOwner();
+ DataArrayDouble *f4=m5->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(15,f4->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,f4->getNumberOfComponents());
const double *f4Ptr=f4->getConstPointer();
std::copy(coords,coords+27,myCoords->getPointer());
meshN->setCoords(myCoords);
myCoords->decrRef();
- meshN->checkCoherency();
+ meshN->checkConsistencyLight();
//
std::vector<int> res1;
meshN->arePolyhedronsNotCorrectlyOriented(res1);
meshN->orientCorrectlyPolyhedrons();
CPPUNIT_ASSERT(res1.empty());
const double *ref,*daPtr;
- DataArrayDouble *da=meshN->getBarycenterAndOwner();
+ DataArrayDouble *da=meshN->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(1,da->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,da->getNumberOfComponents());
daPtr=da->getConstPointer();
//
const double center[]={0.,0.,0.};
const double vec[]={0.,2.78,0.};
- da=meshN->getBarycenterAndOwner();
+ da=meshN->computeCellCenterOfMass();
daPtr=da->getConstPointer();
ref=meshN->getCoords()->getConstPointer()+24;
for(int i=0;i<3;i++)
//
meshN->rotate(center,vec,M_PI/7.);
meshN->translate(vec);
- da=meshN->getBarycenterAndOwner();
+ da=meshN->computeCellCenterOfMass();
daPtr=da->getConstPointer();
ref=meshN->getCoords()->getConstPointer()+24;
for(int i=0;i<3;i++)
const double vec2[]={4.5,9.3,2.8};
meshN->rotate(center2,vec2,M_E);
meshN->translate(vec2);
- da=meshN->getBarycenterAndOwner();
+ da=meshN->computeCellCenterOfMass();
daPtr=da->getConstPointer();
ref=meshN->getCoords()->getConstPointer()+24;
for(int i=0;i<3;i++)
array->decrRef();
//
const double *ptr;
- DataArrayDouble *f3=m1->getBarycenterAndOwner();
+ DataArrayDouble *f3=m1->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(4,f3->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,f3->getNumberOfComponents());
double expected9[4]={0.75,5.105,0.8,5.155};
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i]*sqrt(2.),ptr[i],1e-12);
f2->decrRef();
//bary
- f3=m1->getBarycenterAndOwner();
+ f3=m1->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(4,f3->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,f3->getNumberOfComponents());
double expected10[8]={0.75,0.75,5.105,5.105,0.8,0.8,5.155,5.155};
for(int i=0;i<10;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(std::abs(expected1[i]),ptr[i],1e-12);
f1->decrRef();
- DataArrayDouble *f2=m1->getBarycenterAndOwner();
+ DataArrayDouble *f2=m1->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(10,f2->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,f2->getNumberOfComponents());
double expected2[20]={
for(int i=0;i<10;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(std::abs(expected1[i]),ptr[i],1e-12);
f1->decrRef();
- f2=m1->getBarycenterAndOwner();
+ f2=m1->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(10,f2->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,f2->getNumberOfComponents());
ptr=f2->getConstPointer();
std::copy(coords,coords+207,myCoords->getPointer());
meshN->setCoords(myCoords);
myCoords->decrRef();
- meshN->checkCoherency();
+ meshN->checkConsistencyLight();
std::vector<int> res1;
meshN->arePolyhedronsNotCorrectlyOriented(res1);
meshN->orientCorrectlyPolyhedrons();
meshN->arePolyhedronsNotCorrectlyOriented(res1);
CPPUNIT_ASSERT(res1.empty());
//
- DataArrayDouble *da=meshN->getBarycenterAndOwner();
+ DataArrayDouble *da=meshN->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(4,da->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,da->getNumberOfComponents());
const double *daPtr=da->getConstPointer();
std::copy(values2,values2+36,arr->getPointer());
f->setArray(arr);
arr->decrRef();
- f->checkCoherency();
+ f->checkConsistencyLight();
MEDCouplingFieldDouble *fCpy=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12));
f->renumberCells(renumber1,false);
std::copy(values3,values3+36,arr->getPointer());
f->setArray(arr);
arr->decrRef();
- f->checkCoherency();
+ f->checkConsistencyLight();
fCpy=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12));
f->renumberCells(renumber1,false);
arr->decrRef();
const double values1[27]={7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.,12.,112.,10012.,13.,113.,10013.,14.,114.,10014.,15.,115.,10015.};
std::copy(values1,values1+27,arr->getPointer());
- f->checkCoherency();
+ f->checkConsistencyLight();
const int renumber1[9]={0,4,1,3,5,2,6,7,8};
double res[3];
const double loc[]={0.5432,-0.2432, 0.5478,0.1528};
void MEDCouplingBasicsTest2::testConvertQuadraticCellsToLinear()
{
MEDCouplingUMesh *mesh=build2DTargetMesh_3();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
std::set<INTERP_KERNEL::NormalizedCellType> types=mesh->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(5,(int)types.size());
INTERP_KERNEL::NormalizedCellType expected1[5]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_QUAD8};
std::set<INTERP_KERNEL::NormalizedCellType> expected1Bis(expected1,expected1+5);
CPPUNIT_ASSERT(expected1Bis==types);
CPPUNIT_ASSERT(mesh->isPresenceOfQuadratic());
- CPPUNIT_ASSERT_EQUAL(62,mesh->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(62,mesh->getNodalConnectivityArrayLen());
MEDCouplingFieldDouble *f1=mesh->getMeasureField(false);
//
mesh->convertQuadraticCellsToLinear();
CPPUNIT_ASSERT(!mesh->isPresenceOfQuadratic());
//
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
MEDCouplingFieldDouble *f2=mesh->getMeasureField(false);
CPPUNIT_ASSERT(f1->getArray()->isEqual(*f2->getArray(),1e-12));
- CPPUNIT_ASSERT_EQUAL(48,mesh->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(48,mesh->getNodalConnectivityArrayLen());
std::set<INTERP_KERNEL::NormalizedCellType> types2=mesh->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(3,(int)types2.size());
INTERP_KERNEL::NormalizedCellType expected2[3]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4};
a1->fillWithZero();
a1->setInfoOnComponent(0,"c");
a1->setInfoOnComponent(1,"d");
- DataArrayDouble *a2=a1->deepCpy();
+ DataArrayDouble *a2=a1->deepCopy();
a2->setInfoOnComponent(0,"e");
a2->setInfoOnComponent(1,"f");
f->setArray(a1);
m->getCoords()->setInfoOnComponent(1,"i");
m->getCoords()->setInfoOnComponent(2,"j");
//
- f->checkCoherency();
+ f->checkConsistencyLight();
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f2->isEqual(f,1e-12,1e-12));
f2->setName("smth");
std::copy(targetCoords,targetCoords+8,myCoords->getPointer());
m2->setCoords(myCoords);
myCoords->decrRef();
- m2->checkCoherency();
- m1->checkCoherency();
+ m2->checkConsistencyLight();
+ m1->checkConsistencyLight();
//
const double expected1[5]={0.25,0.125,0.125,0.25,0.25};
MEDCouplingFieldDouble *f1=m1->getMeasureField(false);
f->setArray(a1);
f->setEndArray(a2);
f->setEndTime(3.,3,4);
- f->checkCoherency();
+ f->checkConsistencyLight();
//
CPPUNIT_ASSERT_DOUBLES_EQUAL(8.,f->getMaxValue(),1e-14);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,f->getMinValue(),1e-14);
f1->setArray(array);
array->decrRef();
//
- f1->checkCoherency();
- DataArrayInt *da=f1->getIdsInRange(2.9,7.1);
+ f1->checkConsistencyLight();
+ DataArrayInt *da=f1->findIdsInRange(2.9,7.1);
CPPUNIT_ASSERT_EQUAL((std::size_t)5,da->getNbOfElems());
const int expected1[5]={2,3,5,7,9};
CPPUNIT_ASSERT(std::equal(expected1,expected1+5,da->getConstPointer()));
da->decrRef();
- da=f1->getIdsInRange(8.,12.);
+ da=f1->findIdsInRange(8.,12.);
CPPUNIT_ASSERT_EQUAL((std::size_t)4,da->getNbOfElems());
const int expected2[4]={1,4,6,8};
CPPUNIT_ASSERT(std::equal(expected2,expected2+4,da->getConstPointer()));
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
MEDCouplingUMesh *m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
- CPPUNIT_ASSERT_EQUAL(13,m2C->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(13,m2C->getNodalConnectivityArrayLen());
const double expected2[12]={0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7};
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
- CPPUNIT_ASSERT_EQUAL(8,m2C->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(8,m2C->getNodalConnectivityArrayLen());
for(int i=0;i<8;i++)//8 is not an error
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
- CPPUNIT_ASSERT_EQUAL(8,m2C->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(8,m2C->getNodalConnectivityArrayLen());
for(int i=0;i<8;i++)//8 is not an error
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
- CPPUNIT_ASSERT_EQUAL(13,m2C->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(13,m2C->getNodalConnectivityArrayLen());
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
std::copy(arr1,arr1+30,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->doublyContractedProduct();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
for(int i=0;i<5;i++)
f1->setArray(array);
array->decrRef();
//4 components
- f1->checkCoherency();
+ f1->checkConsistencyLight();
MEDCouplingFieldDouble *f2=f1->determinant();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(CONST_ON_TIME_INTERVAL,f2->getTimeDiscretization());
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfValues());
std::copy(arr2,arr2+54,array->getPointer());
f1->setArray(array);
array->decrRef();
- CPPUNIT_ASSERT_THROW(f1->checkCoherency(),INTERP_KERNEL::Exception);//no end array specified !
+ CPPUNIT_ASSERT_THROW(f1->checkConsistencyLight(),INTERP_KERNEL::Exception);//no end array specified !
//
f2=f1->determinant();
CPPUNIT_ASSERT_EQUAL(LINEAR_TIME,f2->getTimeDiscretization());
std::copy(arr3,arr3+54,array->getPointer());
f1->setEndArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
f2=f1->determinant();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(LINEAR_TIME,f2->getTimeDiscretization());
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(9,f2->getNumberOfTuples());
f1->setArray(array);
array->decrRef();
//
- f1->checkCoherency();
+ f1->checkConsistencyLight();
f2=f1->determinant();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(ONE_TIME,f2->getTimeDiscretization());
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
std::copy(arr1,arr1+30,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->eigenValues();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
const double expected1[3]={13.638813677891717,-4.502313844635971,-2.2364998332557486};
std::copy(arr1,arr1+30,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->eigenVectors();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(9,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
const double expected1[9]={
std::copy(arr1,arr1+45,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->inverse();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(9,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
const double expected1[9]={-2.6538108356290113, 2.855831037649208, -1.1111111111111067, 3.461891643709813, -4.775022956841121, 2.2222222222222143, -1.1111111111111054, 2.222222222222214, -1.1111111111111072};
std::copy(arr3,arr3+30,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
f2=f1->inverse();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(6,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
const double expected3[6]={-0.3617705098531818, -0.8678630828458127, -0.026843764174972983, 0.5539957431465833, 0.13133439560823013, -0.05301294502145887};
std::copy(arr2,arr2+20,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
f2=f1->inverse();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(4,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
const double expected2[4]={-1.8595041322314059, 0.9504132231404963, 1.404958677685951, -0.49586776859504156};
std::copy(arr1,arr1+45,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->trace();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
for(int i=0;i<5;i++)
std::copy(arr3,arr3+30,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
f2=f1->trace();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
for(int i=0;i<5;i++)
std::copy(arr2,arr2+20,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
f2=f1->trace();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
for(int i=0;i<5;i++)
std::copy(arr1,arr1+30,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->deviator();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(6,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
const double expected1[6]={-1.1,0.,1.1,4.5,5.6,6.7};
std::copy(arr1,arr1+25,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->magnitude();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
for(int i=0;i<5;i++)
std::copy(arr1,arr1+25,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=f1->maxPerTuple();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
for(int i=0;i<5;i++)
std::copy(arr1,arr1+25,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
f1->changeNbOfComponents(3,7.77);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
const double expected1[15]={1.2,2.3,3.4, 1.2,3.4,4.5, 3.4,4.5,5.6, 5.6,1.2,2.3, 4.5,5.6,1.2};
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(0,i),1e-13);
f1->changeNbOfComponents(4,7.77);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(4,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
const double expected2[20]={1.2,2.3,3.4,7.77, 1.2,3.4,4.5,7.77, 3.4,4.5,5.6,7.77, 5.6,1.2,2.3,7.77, 4.5,5.6,1.2,7.77};
std::copy(arr1,arr1+25,array->getPointer());
f1->setArray(array);
array->decrRef();
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
f1->sortPerTuple(true);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
for(int i=0;i<5;i++)
}
//
f1->sortPerTuple(false);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
for(int i=0;i<5;i++)
f1->setMesh(m);
f1->setName("myField");
f1->fillFromAnalytic(1,"y+x");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(std::string(f1->getName())=="myField");
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_CELLS);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
f1->setMesh(m);
f1->setEndTime(1.2,3,4);
f1->fillFromAnalytic(1,"y+2*x");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==CONST_ON_TIME_INTERVAL);
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
f1->setMesh(m);
f1->setEndTime(1.2,3,4);
f1->fillFromAnalytic(1,"2.*x+y");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==LINEAR_TIME);
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
f1=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME);
f1->setMesh(m);
f1->fillFromAnalytic(2,"(x+y)*IVec+2*(x+y)*JVec");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==NO_TIME);
CPPUNIT_ASSERT_EQUAL(2,f1->getNumberOfComponents());
CPPUNIT_ASSERT_THROW((*f1)=0.07,INTERP_KERNEL::Exception);
f1->setMesh(m);
(*f1)=0.07;
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.07,f1->getIJ(i,0),1e-16);
(*f1)=0.09;
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
for(int i=0;i<5;i++)
f1->setEndTime(4.5,2,3);
f1->setMesh(m);
(*f1)=0.08;
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(9,f1->getNumberOfTuples());
for(int i=0;i<9;i++)
std::transform(tmpConn,tmpConn+8,tmpConn,std::bind2nd(std::plus<int>(),6));
mesh->insertNextCell(INTERP_KERNEL::NORM_PYRA5,5,tmpConn);
mesh->finishInsertingCells();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
bool isMerged;
int newNebOfNodes;
DataArrayInt *da=mesh->mergeNodes(1e-7,isMerged,newNebOfNodes);
CPPUNIT_ASSERT_DOUBLES_EQUAL(volPenta6,vols->getIJ(1,0),1e-7);
CPPUNIT_ASSERT_DOUBLES_EQUAL(volPyra5,vols->getIJ(2,0),1e-7);
vols->decrRef();
- DataArrayDouble *bary=mesh->getBarycenterAndOwner();
+ DataArrayDouble *bary=mesh->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(3,bary->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,bary->getNumberOfComponents());
CPPUNIT_ASSERT_DOUBLES_EQUAL(baryHexa8[0],bary->getIJ(0,0),1e-11);
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTest3.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingGaussLocalization.hxx"
#include <functional>
#include <iterator>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MEDCouplingBasicsTest3::testGetMeasureFieldCMesh1()
{
std::copy(discX,discX+4,da->getPointer());
m->setCoordsAt(0,da);
da->decrRef();
- m->checkCoherency();
+ m->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(4,m->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(3,m->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(1,m->getSpaceDimension());
for(int i=0;i<4;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(discX[i],coords->getIJ(i,0),1e-12);
coords->decrRef();
- coords=m->getBarycenterAndOwner();
+ coords=m->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(3,coords->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,coords->getNumberOfComponents());
const double expected1_3[3]={2.85,4.6,8.};
std::copy(discY,discY+3,da->getPointer());
m->setCoordsAt(1,da);
da->decrRef();
- m->checkCoherency();
+ m->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(12,m->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(6,m->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(2,m->getSpaceDimension());
for(int i=0;i<24;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2_2[i],coords->getIJ(0,i),1e-12);
coords->decrRef();
- coords=m->getBarycenterAndOwner();
+ coords=m->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(6,coords->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,coords->getNumberOfComponents());
const double expected2_3[12]={2.85,17.85,4.6,17.85,8.,17.85, 2.85,34.6,4.6,34.6,8.,34.6};
std::copy(discZ,discZ+5,da->getPointer());
m->setCoordsAt(2,da);
da->decrRef();
- m->checkCoherency();
+ m->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(60,m->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(24,m->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,m->getSpaceDimension());
for(int i=0;i<180;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected3_2[i],coords->getIJ(0,i),1e-12);
coords->decrRef();
- coords=m->getBarycenterAndOwner();
+ coords=m->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(24,coords->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,coords->getNumberOfComponents());
const double expected3_3[72]={
MEDCouplingFieldDouble *f=m->fillFromAnalytic(ON_NODES,2,"x*2.");
f->getArray()->setInfoOnComponent(0,"titi");
f->getArray()->setInfoOnComponent(1,"tutu");
- f->checkCoherency();
+ f->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(18,f->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(2,f->getNumberOfComponents());
const double expected1[36]={-0.6, -0.6, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, 0.4, 0.4};
for(int i=0;i<36;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f->getIJ(0,i),1e-12);
CPPUNIT_ASSERT(f->zipCoords());
- f->checkCoherency();
+ f->checkConsistencyLight();
const double expected2[30]={-0.6, -0.6, 1.4, 1.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, 0.4, 0.4};
for(int i=0;i<30;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f->getIJ(0,i),1e-12);
CPPUNIT_ASSERT(!f->zipCoords());
- f->checkCoherency();
+ f->checkConsistencyLight();
for(int i=0;i<30;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f->getIJ(0,i),1e-12);
CPPUNIT_ASSERT(std::string(f->getArray()->getInfoOnComponent(0))=="titi");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f->getIJ(0,i),1e-12);
f->getArray()->setInfoOnComponent(0,"titi");
f->getArray()->setInfoOnComponent(1,"tutu");
- f->checkCoherency();
+ f->checkConsistencyLight();
CPPUNIT_ASSERT(f->zipConnectivity(0));
const double expected2[14]={-0.05, -0.05, 0.3666666666666667, 0.3666666666666667, 0.53333333333333321, 0.53333333333333321,
-0.05, -0.05, 0.45, 0.45, 0.36666666666666659, 0.36666666666666659, 0.033333333333333326, 0.033333333333333326};
a->decrRef();
f->setMesh(m2);
//
- f->checkCoherency();
+ f->checkConsistencyLight();
double m=f->getMaxValue();
CPPUNIT_ASSERT_DOUBLES_EQUAL(8.71,m,1e-12);
DataArrayInt *ws;
//
const double arr2[18]={-8.71,-4.53,12.41,-8.71,8.71,-8.7099,-4.55,-8.71,-5.55,-6.77,1e-200,-4.55,-8.7099,0.,-1.23,0.,-2.22,-8.71};
std::copy(arr2,arr2+18,a->getPointer());
- f->checkCoherency();
+ f->checkConsistencyLight();
m=f->getMinValue();
CPPUNIT_ASSERT_DOUBLES_EQUAL(-8.71,m,1e-12);
m=f->getMinValue2(ws);
std::copy(discX,discX+4,da->getPointer());
m->setCoordsAt(0,da);
da->decrRef();
- m->checkCoherency();
+ m->checkConsistencyLight();
double pos=2.4;
CPPUNIT_ASSERT_EQUAL(0,m->getCellContainingPoint(&pos,1e-12));
pos=3.7;
CPPUNIT_ASSERT_EQUAL(-1,m->getCellContainingPoint(&pos,1e-12));
//
MEDCouplingUMesh *m2=m->buildUnstructured();
- m2->checkCoherency();
+ m2->checkConsistencyLight();
MEDCouplingFieldDouble *f1=m->getMeasureField(false);
MEDCouplingFieldDouble *f2=m2->getMeasureField(false);
CPPUNIT_ASSERT_EQUAL(f1->getNumberOfTuples(),3);
f2->decrRef();
//
m2=m->buildUnstructured();
- m2->checkCoherency();
+ m2->checkConsistencyLight();
f1=m->getMeasureField(false);
f2=m2->getMeasureField(false);
CPPUNIT_ASSERT_EQUAL(f1->getNumberOfTuples(),6);
m->setCoordsAt(2,da);
da->decrRef();
m2=m->buildUnstructured();
- m2->checkCoherency();
+ m2->checkConsistencyLight();
f1=m->getMeasureField(false);
f2=m2->getMeasureField(false);
CPPUNIT_ASSERT_EQUAL(f1->getNumberOfTuples(),24);
f1->setMesh(m1);
f1->setName("f1");
f1->setArray(a1);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
const int arr2[6]={1,2,1,2,0,0};
std::vector<int> arr2V(arr2,arr2+6);
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.3,f2->getTime(dt,it),1e-13);
CPPUNIT_ASSERT_EQUAL(4,dt);
CPPUNIT_ASSERT_EQUAL(5,it);
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(6,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
CPPUNIT_ASSERT(std::string(f2->getArray()->getInfoOnComponent(0))=="bbbb");
f5->setTime(6.7,8,9);
f5->getArray()->setInfoOnComponent(0,"eeee");
f5->getArray()->setInfoOnComponent(1,"ffff");
- f5->checkCoherency();
+ f5->checkConsistencyLight();
const int arr4[2]={1,2};
std::vector<int> arr4V(arr4,arr4+2);
f2->setSelectedComponents(f5,arr4V);
CPPUNIT_ASSERT_EQUAL(6,f2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.3,f2->getTime(dt,it),1e-13);
CPPUNIT_ASSERT_EQUAL(4,dt);
CPPUNIT_ASSERT_EQUAL(5,it);
CPPUNIT_ASSERT(!((ret.str().find("Float32"))==std::string::npos));
CPPUNIT_ASSERT(!((ret.str().find("16 15 14 13 12 11 10"))==std::string::npos));
- CPPUNIT_ASSERT_THROW(dbl->selectByTupleId2(0,1,-1),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(dbl->substr(-1,1),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(dbl->substr(8,1),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(dbl->substr(0,8),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dbl->selectByTupleIdSafeSlice(0,1,-1),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dbl->subArray(-1,1),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dbl->subArray(8,1),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dbl->subArray(0,8),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(dbl->meldWith(dd),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(dbl->setPartOfValuesAdv(dbl2,da),INTERP_KERNEL::Exception); //dbl dbl2 not have the same number of components
dbl3->setIJ(6,0,0.);
CPPUNIT_ASSERT_THROW(dbl3->checkNoNullValues(),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(dbl3->applyInv(1.),INTERP_KERNEL::Exception); //div by zero
- CPPUNIT_ASSERT_THROW(dbl2->getIdsInRange(1.,2.),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dbl2->findIdsInRange(1.,2.),INTERP_KERNEL::Exception);
std::vector<const DataArrayDouble *> a(0); //input list must be NON EMPTY
CPPUNIT_ASSERT_THROW(DataArrayDouble::Aggregate(a),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(DataArrayDouble::Meld(a),INTERP_KERNEL::Exception);
DataArrayInt *da=DataArrayInt::New();
da->alloc(7,1);
std::copy(tab1,tab1+7,da->getPointer());
- DataArrayInt *da2=da->getIdsEqual(-2);
+ DataArrayInt *da2=da->findIdsEqual(-2);
CPPUNIT_ASSERT_EQUAL(3,da2->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,da2->getNumberOfComponents());
const int expected1[3]={1,3,6};
std::copy(tab1,tab1+7,da->getPointer());
const int tab2[3]={3,-2,0};
std::vector<int> tab2V(tab2,tab2+3);
- DataArrayInt *da2=da->getIdsEqualList(&tab2V[0],&tab2V[0]+tab2V.size());
+ DataArrayInt *da2=da->findIdsEqualList(&tab2V[0],&tab2V[0]+tab2V.size());
CPPUNIT_ASSERT_EQUAL(4,da2->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,da2->getNumberOfComponents());
const int expected1[4]={1,3,4,6};
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
mesh->unPolyze();
MEDCouplingUMesh *mesh2=build3DTargetMesh_1();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT(mesh->isEqual(mesh2,1e-12));
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
CPPUNIT_ASSERT(!mesh->isEqual(mesh2,1e-12));
mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+16);
mesh->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+24);
mesh->finishInsertingCells();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(4,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,mesh->getTypeOfCell(0));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,mesh->getTypeOfCell(1));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,mesh->getTypeOfCell(3));
MEDCouplingFieldDouble *f1=mesh->getMeasureField(true);
mesh->convertDegeneratedCells();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
MEDCouplingFieldDouble *f2=mesh->getMeasureField(true);
CPPUNIT_ASSERT_EQUAL(4,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_PENTA6,mesh->getTypeOfCell(0));
CPPUNIT_ASSERT_EQUAL(37,tmp3);
tmp->decrRef();
i->convertDegeneratedCells();
- i->checkCoherency();
+ i->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(36,i->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(37,i->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(12,i->getNumberOfCellsWithType(INTERP_KERNEL::NORM_TRI3));
for(int k=0;k<3;k++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[k],j->getIJ(0,ii*3+k),1e-10);
const double expected2[72]={0.62200846792814113, 0.16666666666681595, 1.4513530918323276, 0.38888888888923495, 2.6293994326053212, 0.7045454545460802, 0.45534180126145435, 0.45534180126150181, 1.0624642029433926, 1.0624642029435025, 1.9248539780597826, 1.9248539780599816, 0.16666666666661334, 0.62200846792815856, 0.38888888888876294, 1.4513530918323678, 0.70454545454522521, 2.629399432605394, -0.16666666666674007, 0.62200846792812436, -0.38888888888906142, 1.4513530918322881, -0.70454545454576778, 2.6293994326052488, -0.45534180126154766, 0.45534180126140844, -1.0624642029436118, 1.0624642029432834, -1.9248539780601803, 1.9248539780595841, -0.62200846792817499, 0.1666666666665495, -1.451353091832408, 0.388888888888613, -2.6293994326054668, 0.70454545454495332, -0.62200846792810593, -0.16666666666680507, -1.451353091832247, -0.38888888888921297, -2.6293994326051746, -0.70454545454604123, -0.45534180126135926, -0.45534180126159562, -1.0624642029431723, -1.0624642029437235, -1.9248539780593836, -1.9248539780603811, -0.1666666666664828, -0.62200846792819242, -0.38888888888846079, -1.4513530918324489, -0.70454545454467987, -2.6293994326055397, 0.16666666666687083, -0.62200846792808862, 0.38888888888936374, -1.4513530918322073, 0.70454545454631357, -2.6293994326051022, 0.45534180126164348, -0.45534180126131207, 1.0624642029438327, -1.0624642029430627, 1.9248539780605791, -1.9248539780591853, 0.62200846792821063, -0.16666666666641802, 1.4513530918324888, -0.38888888888831086, 2.6293994326056125, -0.70454545454440853};
- DataArrayDouble *m=i->getBarycenterAndOwner();
+ DataArrayDouble *m=i->computeCellCenterOfMass();
for(int ii=0;ii<72;ii++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[ii],m->getIJ(0,ii),1e-10);
//
const double center[2]={0.,0.};
f->rotate(center,0,M_PI/3);
MEDCouplingUMesh *g=c->buildExtrudedMesh(f,0);
- g->checkCoherency();
+ g->checkConsistencyLight();
const double expected1[]={ 0.4330127018922193, 0.4330127018922193, 0.649519052838329, 1.2990381056766578, 1.299038105676658, 1.948557158514987, 2.1650635094610955, 2.1650635094610964, 3.2475952641916446, 3.031088913245533, 3.0310889132455352, 4.546633369868303 };
MEDCouplingFieldDouble *f1=g->getMeasureField(true);
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(0,i),1e-12);
const double expected2[]={0.625, 0.21650635094610962, 1.625, 0.21650635094610959, 2.8750000000000004, 0.21650635094610965, 1.1250000000000002, 1.0825317547305482, 2.125, 1.0825317547305482, 3.3750000000000004, 1.0825317547305484, 2.125, 2.8145825622994254, 3.125, 2.8145825622994254, 4.375, 2.8145825622994254, 3.6250000000000009, 5.4126587736527414, 4.625, 5.4126587736527414, 5.875, 5.4126587736527414};
- DataArrayDouble *f2=g->getBarycenterAndOwner();
+ DataArrayDouble *f2=g->computeCellCenterOfMass();
for(int i=0;i<24;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f2->getIJ(0,i),1e-12);
//
const int expected2[7]={0,0,1,2,3,4,4};
for(int i=0;i<7;i++)
CPPUNIT_ASSERT_EQUAL(expected2[i],da->getIJ(i,0));
- m->checkCoherency();
+ m->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(7,m->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,m->getTypeOfCell(0));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,m->getTypeOfCell(1));
CPPUNIT_ASSERT_EQUAL(1,da->getNumberOfComponents());
for(int i=0;i<7;i++)
CPPUNIT_ASSERT_EQUAL(expected2[i],da->getIJ(i,0));
- m->checkCoherency();
+ m->checkConsistencyLight();
types=m->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(2,(int)types.size());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*(types.begin()));
f1->setArray(arr);
arr->decrRef();
//
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->simplexize(0));
- f1->checkCoherency();
+ f1->checkConsistencyLight();
const double expected1[14]={10.,110.,10.,110.,20.,120.,30.,130.,40.,140.,50.,150.,50.,150.};
for(int i=0;i<14;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(0,i),1e-10);
da3->setInfoOnComponent(1,"c1da3");
da3->setInfoOnComponent(2,"c2da3");
//
- DataArrayDouble *da1C=da1->deepCpy();
+ DataArrayDouble *da1C=da1->deepCopy();
da1->meldWith(da3);
CPPUNIT_ASSERT_EQUAL(5,da1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(7,da1->getNumberOfTuples());
da1->setInfoOnComponent(0,"aaa");
f1->setArray(da1);
f1->setTime(3.4,2,1);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
- MEDCouplingFieldDouble *f2=f1->deepCpy();
+ MEDCouplingFieldDouble *f2=f1->deepCopy();
f2->setMesh(f1->getMesh());
- f2->checkCoherency();
+ f2->checkConsistencyLight();
f2->changeNbOfComponents(2,5.);
(*f2)=5.;
f2->getArray()->setInfoOnComponent(0,"bbb");
f2->getArray()->setInfoOnComponent(1,"ccc");
- f2->checkCoherency();
+ f2->checkConsistencyLight();
//
MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::MeldFields(f2,f1);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(5,f3->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,f3->getNumberOfComponents());
CPPUNIT_ASSERT(f3->getArray()->getInfoOnComponent(0)=="bbb");
MEDCouplingFieldDouble *f4=f2->buildNewTimeReprFromThis(NO_TIME,false);
MEDCouplingFieldDouble *f5=f1->buildNewTimeReprFromThis(NO_TIME,false);
MEDCouplingFieldDouble *f6=MEDCouplingFieldDouble::MeldFields(f4,f5);
- f6->checkCoherency();
+ f6->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(5,f6->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,f6->getNumberOfComponents());
CPPUNIT_ASSERT(f6->getArray()->getInfoOnComponent(0)=="bbb");
MEDCouplingUMesh *m3=MEDCouplingUMesh::MergeUMeshes(tmp);
bool b;
int newNbOfNodes;
- DataArrayInt *da=m3->mergeNodes2(0.01,b,newNbOfNodes);
+ DataArrayInt *da=m3->mergeNodesCenter(0.01,b,newNbOfNodes);
CPPUNIT_ASSERT_EQUAL(9,m3->getNumberOfNodes());
const double expected1[18]={-0.299,-0.3, 0.201,-0.3, 0.701,-0.3, -0.299,0.2, 0.201,0.2, 0.701,0.2, -0.299,0.7, 0.201,0.7, 0.701,0.7};
for(int i=0;i<18;i++)
std::copy(targetCoords,targetCoords+18,myCoords->getPointer());
targetMesh->setCoords(myCoords);
myCoords->decrRef();
- targetMesh->checkCoherency();
+ targetMesh->checkConsistencyLight();
targetMesh->decrRef();
}
MEDCouplingFieldDouble *f2=MEDCouplingFieldDouble::New(ON_CELLS);
f2->setArray(arr);
f2->setMesh(m1);
- f2->checkCoherency();
+ f2->checkConsistencyLight();
//
MEDCouplingFieldDouble *f3=(*f1)/(*f2);
CPPUNIT_ASSERT_THROW((*f2)/(*f1),INTERP_KERNEL::Exception);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
(*f1)/=(*f2);
CPPUNIT_ASSERT(f1->isEqual(f3,1e-10,1e-10));
CPPUNIT_ASSERT_THROW((*f2)/=(*f1),INTERP_KERNEL::Exception);
ms2[0]=m1; ms2[1]=m2_2; ms2[2]=m3_2;
//
MEDCouplingUMesh *m4=MEDCouplingUMesh::MergeUMeshes(ms);
- m4->checkCoherency();
+ m4->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(10,m4->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(20,m4->getNumberOfNodes());
- CPPUNIT_ASSERT_EQUAL(45,m4->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(45,m4->getNodalConnectivityArrayLen());
//
MEDCouplingMesh *m4bis=MEDCouplingMesh::MergeMeshes(ms2);
CPPUNIT_ASSERT(m4->isEqual(m4bis,1e-12));
coo->setName("My0D");
std::copy(sourceCoords,sourceCoords+12,coo->getPointer());
MEDCouplingUMesh *m=MEDCouplingUMesh::Build0DMeshFromCoords(coo);
- m->checkCoherency();
+ m->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(4,m->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(4,m->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,m->getSpaceDimension());
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTest4.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingGaussLocalization.hxx"
#include <functional>
#include <iterator>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MEDCouplingBasicsTest4::testDescriptionInMeshTimeUnit1()
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
m->setDescription(text1);
CPPUNIT_ASSERT(std::string(m->getDescription())==text1);
- MEDCouplingUMesh *m2=(MEDCouplingUMesh *)m->deepCpy();
+ MEDCouplingUMesh *m2=(MEDCouplingUMesh *)m->deepCopy();
CPPUNIT_ASSERT(m->isEqual(m2,1e-12));
CPPUNIT_ASSERT(std::string(m2->getDescription())==text1);
m2->setDescription("ggg");
MEDCouplingFieldDouble *f=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
f->setTimeUnit(text1);
CPPUNIT_ASSERT(std::string(f->getTimeUnit())==text1);
- MEDCouplingFieldDouble *f2=f->deepCpy();
+ MEDCouplingFieldDouble *f2=f->deepCopy();
CPPUNIT_ASSERT(std::string(f2->getTimeUnit())==text1);
f2->decrRef();
//
CPPUNIT_ASSERT_EQUAL(6,(int)das.size());
CPPUNIT_ASSERT_EQUAL(5,(int)das2.size());
//
- MEDCouplingMultiFields *mfs2=mfs->deepCpy();
+ MEDCouplingMultiFields *mfs2=mfs->deepCopy();
CPPUNIT_ASSERT(mfs->isEqual(mfs2,1e-12,1e-12));
mfs2->decrRef();
//
da->iota(0);
da2=da->checkAndPreparePermutation();
CPPUNIT_ASSERT_EQUAL(1,da2->getNumberOfComponents());
- CPPUNIT_ASSERT(da2->isIdentity2(8));
+ CPPUNIT_ASSERT(da2->isIota(8));
da2->decrRef();
da->decrRef();
//
{
MEDCouplingUMesh *m=build3DSurfTargetMesh_1();
DataArrayInt *da5=m->findCellIdsOnBoundary();
- CPPUNIT_ASSERT(da5->isIdentity2(5));
+ CPPUNIT_ASSERT(da5->isIota(5));
//
da5->decrRef();
m->decrRef();
CPPUNIT_ASSERT(!m1->isEqual(m2,1e-12));
//
m1->setTime(10.34,55,12);
- MEDCouplingUMesh *m3=(MEDCouplingUMesh *)m1->deepCpy();
+ MEDCouplingUMesh *m3=(MEDCouplingUMesh *)m1->deepCopy();
CPPUNIT_ASSERT(m1->isEqual(m3,1e-12));
tmp3=m3->getTime(tmp1,tmp2);
CPPUNIT_ASSERT_EQUAL(55,tmp1);
CPPUNIT_ASSERT_EQUAL(8,tmp1);
CPPUNIT_ASSERT_EQUAL(100,tmp2);
CPPUNIT_ASSERT_DOUBLES_EQUAL(5.67,tmp3,1e-12);
- MEDCouplingCMesh *c=(MEDCouplingCMesh *)b->deepCpy();
+ MEDCouplingCMesh *c=(MEDCouplingCMesh *)b->deepCopy();
CPPUNIT_ASSERT(c->isEqual(b,1e-12));
tmp3=c->getTime(tmp1,tmp2);
CPPUNIT_ASSERT_EQUAL(8,tmp1);
std::copy(vals,vals+15,da->getPointer());
f1->setArray(da);
//
- CPPUNIT_ASSERT_THROW(da->applyFunc2(1,"y+z"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncCompo(1,"y+z"),INTERP_KERNEL::Exception);
da->setInfoOnComponent(0,"x [m]");
da->setInfoOnComponent(1,"y [mm]");
da->setInfoOnComponent(2,"z [km]");
- CPPUNIT_ASSERT_THROW(da->applyFunc2(1,"x+y+zz+zzz"),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(da->applyFunc2(1,"toto(x+y)"),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(da->applyFunc2(1,"x/0"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncCompo(1,"x+y+zz+zzz"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncCompo(1,"toto(x+y)"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncCompo(1,"x/0"),INTERP_KERNEL::Exception);
- DataArrayDouble *da2=da->applyFunc2(1,"y+z");
+ DataArrayDouble *da2=da->applyFuncCompo(1,"y+z");
CPPUNIT_ASSERT_EQUAL(1,da2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,da2->getNumberOfTuples());
const double expected1[5]={32.,34.,36.,38.,40.};
//
CPPUNIT_ASSERT_EQUAL(3,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
- f1->applyFunc2(1,"y+z");
+ f1->applyFuncCompo(1,"y+z");
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
for(int i=0;i<5;i++)
//
std::vector<std::string> vs(3);
vs[0]="x"; vs[1]="Y"; vs[2]="z";
- CPPUNIT_ASSERT_THROW(da->applyFunc3(1,vs,"y+z"),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(da->applyFunc3(1,vs,"x+Y+z+zz+zzz"),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(da->applyFunc3(1,vs,"x/0."),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncNamedCompo(1,vs,"y+z"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncNamedCompo(1,vs,"x+Y+z+zz+zzz"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncNamedCompo(1,vs,"x/0."),INTERP_KERNEL::Exception);
vs[1]="y";
- DataArrayDouble *da2=da->applyFunc3(1,vs,"y+z");
+ DataArrayDouble *da2=da->applyFuncNamedCompo(1,vs,"y+z");
const double expected1[5]={32.,34.,36.,38.,40.};
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],da2->getIJ(0,i),1e-12);
da2->decrRef();
std::vector<std::string> vs2(4); vs2[0]="x"; vs2[1]="y"; vs2[2]="z"; vs2[3]="a";
- CPPUNIT_ASSERT_THROW(da->applyFunc3(1,vs2,"x+a"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(da->applyFuncNamedCompo(1,vs2,"x+a"),INTERP_KERNEL::Exception);
f1->setArray(da);
CPPUNIT_ASSERT_EQUAL(3,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
- f1->applyFunc3(1,vs,"y+z");
+ f1->applyFuncNamedCompo(1,vs,"y+z");
CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
for(int i=0;i<5;i++)
MEDCouplingUMesh *m1=build3DSurfTargetMesh_1();
m1->setTime(3.4,5,6); m1->setTimeUnit("us");
int a,b;
- CPPUNIT_ASSERT_THROW(m1->fillFromAnalytic2(ON_NODES,1,"y+z"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(m1->fillFromAnalyticCompo(ON_NODES,1,"y+z"),INTERP_KERNEL::Exception);
m1->getCoords()->setInfoOnComponent(0,"x [m]");
m1->getCoords()->setInfoOnComponent(1,"y");
m1->getCoords()->setInfoOnComponent(2,"z");
- MEDCouplingFieldDouble *f1=m1->fillFromAnalytic2(ON_NODES,1,"y+z");
+ MEDCouplingFieldDouble *f1=m1->fillFromAnalyticCompo(ON_NODES,1,"y+z");
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.4,f1->getTime(a,b),1.e-14);
CPPUNIT_ASSERT_EQUAL(5,a); CPPUNIT_ASSERT_EQUAL(6,b);
CPPUNIT_ASSERT_EQUAL(std::string(f1->getTimeUnit()),std::string("us"));
int a,b;
std::vector<std::string> vs(3);
vs[0]="x"; vs[1]="Y"; vs[2]="z";
- CPPUNIT_ASSERT_THROW(m1->fillFromAnalytic3(ON_NODES,1,vs,"y+z"),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(m1->fillFromAnalyticNamedCompo(ON_NODES,1,vs,"y+z"),INTERP_KERNEL::Exception);
vs[1]="y";
- MEDCouplingFieldDouble *f1=m1->fillFromAnalytic3(ON_NODES,1,vs,"y+z");
+ MEDCouplingFieldDouble *f1=m1->fillFromAnalyticNamedCompo(ON_NODES,1,vs,"y+z");
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.4,f1->getTime(a,b),1.e-14);
CPPUNIT_ASSERT_EQUAL(5,a); CPPUNIT_ASSERT_EQUAL(6,b);
CPPUNIT_ASSERT_EQUAL(std::string(f1->getTimeUnit()),std::string("us"));
const double values1[15]={7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.};
std::copy(values1,values1+15,arr->getPointer());
const double loc[10]={-0.05,-0.05, 0.55,-0.25, 0.55,0.15, -0.05,0.45, 0.45,0.45};
- f->checkCoherency();
+ f->checkConsistencyLight();
DataArrayDouble *locs=f->getValueOnMulti(loc,5);
CPPUNIT_ASSERT_EQUAL(5,locs->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,locs->getNumberOfComponents());
std::copy(values2,values2+27,arr->getPointer());
const double loc2[8]={0.5432,-0.2432, 0.5478,0.1528, 0.5432,-0.2432, 0.5432,-0.2432};
const double expected2[12]={9.0272, 109.0272, 10009.0272, 11.4124,111.4124,10011.4124, 9.0272, 109.0272, 10009.0272, 9.0272, 109.0272, 10009.0272};
- f->checkCoherency();
+ f->checkConsistencyLight();
locs=f->getValueOnMulti(loc2,4);
CPPUNIT_ASSERT_EQUAL(4,locs->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,locs->getNumberOfComponents());
const int vals1[10]={2,3,5,6,8,5,5,6,1,-5};
d->alloc(10,1);
std::copy(vals1,vals1+10,d->getPointer());
- DataArrayInt *d2=d->getIdsNotEqual(5);
+ DataArrayInt *d2=d->findIdsNotEqual(5);
CPPUNIT_ASSERT_EQUAL(7,d2->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,d2->getNumberOfComponents());
const int expected1[7]={0,1,3,4,7,8,9};
for(int i=0;i<7;i++)
CPPUNIT_ASSERT_EQUAL(expected1[i],d2->getIJ(0,i));
d->rearrange(2);
- CPPUNIT_ASSERT_THROW(d->getIdsNotEqual(5),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(d->findIdsNotEqual(5),INTERP_KERNEL::Exception);
const int vals2[3]={-4,5,6};
std::vector<int> vals3(vals2,vals2+3);
d->rearrange(1);
- DataArrayInt *d3=d->getIdsNotEqualList(&vals3[0],&vals3[0]+vals3.size());
+ DataArrayInt *d3=d->findIdsNotEqualList(&vals3[0],&vals3[0]+vals3.size());
CPPUNIT_ASSERT_EQUAL(5,d3->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,d3->getNumberOfComponents());
const int expected2[5]={0,1,4,8,9};
mesh->finishInsertingCells();
coo->decrRef();
//
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
MEDCouplingFieldDouble *vols=mesh->getMeasureField(false);
CPPUNIT_ASSERT_EQUAL(1,vols->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,vols->getNumberOfComponents());
CPPUNIT_ASSERT_DOUBLES_EQUAL(-5.196152422706632,vols->getIJ(0,0),1e-12);
- DataArrayDouble *bary=mesh->getBarycenterAndOwner();
+ DataArrayDouble *bary=mesh->computeCellCenterOfMass();
CPPUNIT_ASSERT_EQUAL(1,bary->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(3,bary->getNumberOfComponents());
const double expected1[3]={0.,0.,1.};
CPPUNIT_ASSERT(INTERP_KERNEL::NORM_POLYHED==mesh->getTypeOfCell(0));
mesh->unPolyze();
CPPUNIT_ASSERT(INTERP_KERNEL::NORM_HEXGP12==mesh->getTypeOfCell(0));
- CPPUNIT_ASSERT_EQUAL(13,mesh->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(13,mesh->getNodalConnectivityArrayLen());
//
vols->decrRef();
bary->decrRef();
void MEDCouplingBasicsTest4::testCheckCoherencyDeeper1()
{
MEDCouplingUMesh *m=build3DSourceMesh_1();
- m->checkCoherency();
- m->checkCoherency1();
+ m->checkConsistencyLight();
+ m->checkConsistency();
m->getNodalConnectivity()->setIJ(8,0,-1);
- m->checkCoherency();
- CPPUNIT_ASSERT_THROW(m->checkCoherency1(),INTERP_KERNEL::Exception);
+ m->checkConsistencyLight();
+ CPPUNIT_ASSERT_THROW(m->checkConsistency(),INTERP_KERNEL::Exception);
m->getNodalConnectivity()->setIJ(8,0,-6);
- m->checkCoherency();
- CPPUNIT_ASSERT_THROW(m->checkCoherency1(),INTERP_KERNEL::Exception);
+ m->checkConsistencyLight();
+ CPPUNIT_ASSERT_THROW(m->checkConsistency(),INTERP_KERNEL::Exception);
m->getNodalConnectivity()->setIJ(8,0,9);//9>=NbOfNodes
- m->checkCoherency();
- CPPUNIT_ASSERT_THROW(m->checkCoherency1(),INTERP_KERNEL::Exception);
+ m->checkConsistencyLight();
+ CPPUNIT_ASSERT_THROW(m->checkConsistency(),INTERP_KERNEL::Exception);
m->getNodalConnectivity()->setIJ(8,0,8);//OK
- m->checkCoherency();
- m->checkCoherency1();
+ m->checkConsistencyLight();
+ m->checkConsistency();
const int elts[2]={1,5};
std::vector<int> eltsV(elts,elts+2);
m->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- m->checkCoherency();
- m->checkCoherency1();
+ m->checkConsistencyLight();
+ m->checkConsistency();
m->getNodalConnectivity()->setIJ(2,0,9);//9>=NbOfNodes
- m->checkCoherency();
- CPPUNIT_ASSERT_THROW(m->checkCoherency1(),INTERP_KERNEL::Exception);
+ m->checkConsistencyLight();
+ CPPUNIT_ASSERT_THROW(m->checkConsistency(),INTERP_KERNEL::Exception);
m->getNodalConnectivity()->setIJ(2,0,-3);
- m->checkCoherency();
- CPPUNIT_ASSERT_THROW(m->checkCoherency1(),INTERP_KERNEL::Exception);
+ m->checkConsistencyLight();
+ CPPUNIT_ASSERT_THROW(m->checkConsistency(),INTERP_KERNEL::Exception);
m->getNodalConnectivity()->setIJ(2,0,-1);
- m->checkCoherency();
- CPPUNIT_ASSERT_THROW(m->checkCoherency1(),INTERP_KERNEL::Exception);//Throw because cell#0 is not a polyhedron
+ m->checkConsistencyLight();
+ CPPUNIT_ASSERT_THROW(m->checkConsistency(),INTERP_KERNEL::Exception);//Throw because cell#0 is not a polyhedron
m->getNodalConnectivity()->setIJ(2,0,4);
- m->checkCoherency();
- m->checkCoherency1();
+ m->checkConsistencyLight();
+ m->checkConsistency();
m->getNodalConnectivity()->setIJ(7,0,-1);
- m->checkCoherency();
- m->checkCoherency1();//OK because we are in polyhedron connec
+ m->checkConsistencyLight();
+ m->checkConsistency();//OK because we are in polyhedron connec
m->getNodalConnectivity()->setIJ(36,0,14);
- m->checkCoherency();
- CPPUNIT_ASSERT_THROW(m->checkCoherency1(),INTERP_KERNEL::Exception);//Throw beacause now cell 5 is a TETRA4 (14) so mimatch of number index and static type.
+ m->checkConsistencyLight();
+ CPPUNIT_ASSERT_THROW(m->checkConsistency(),INTERP_KERNEL::Exception);//Throw beacause now cell 5 is a TETRA4 (14) so mimatch of number index and static type.
m->decrRef();
}
m2->convertToPolyTypes(&temp[0],&temp[0]+temp.size());
m2->unPolyze();
CPPUNIT_ASSERT(INTERP_KERNEL::NORM_TETRA4==m2->getTypeOfCell(2));
- CPPUNIT_ASSERT_EQUAL(40,m2->getMeshLength());
+ CPPUNIT_ASSERT_EQUAL(40,m2->getNodalConnectivityArrayLen());
std::vector<int> temp2;
m2->getNodeIdsOfCell(2,temp2);
CPPUNIT_ASSERT(4==(int)temp2.size());
CPPUNIT_ASSERT(std::equal(conn,conn+4,temp2.begin()));
- m2->checkCoherency1();
- MEDCouplingMesh *m3=m2->deepCpy();
+ m2->checkConsistency();
+ MEDCouplingMesh *m3=m2->deepCopy();
m2->unPolyze();
CPPUNIT_ASSERT(m3->isEqual(m2,1e-12));
m3->decrRef();
//
DataArrayDouble *d1=DataArrayDouble::New();
CPPUNIT_ASSERT(!d->isEqual(*d1,1e-12));
- d1->cpyFrom(*d);
+ d1->deepCopyFrom(*d);
CPPUNIT_ASSERT(d->isEqual(*d1,1e-12));
- d1->cpyFrom(*d);
+ d1->deepCopyFrom(*d);
CPPUNIT_ASSERT(d->isEqual(*d1,1e-12));
d1->rearrange(2);
CPPUNIT_ASSERT(!d->isEqual(*d1,1e-12));
- d1->cpyFrom(*d);
+ d1->deepCopyFrom(*d);
CPPUNIT_ASSERT(d->isEqual(*d1,1e-12));
//
DataArrayInt *d2=d->convertToIntArr();
DataArrayInt *d4=DataArrayInt::New();
CPPUNIT_ASSERT(!d2->isEqual(*d4));
- d4->cpyFrom(*d2);
+ d4->deepCopyFrom(*d2);
CPPUNIT_ASSERT(d2->isEqual(*d4));
- d4->cpyFrom(*d2);
+ d4->deepCopyFrom(*d2);
CPPUNIT_ASSERT(d2->isEqual(*d4));
d4->rearrange(2);
CPPUNIT_ASSERT(!d2->isEqual(*d4));
- d4->cpyFrom(*d2);
+ d4->deepCopyFrom(*d2);
CPPUNIT_ASSERT(d2->isEqual(*d4));
//
d->decrRef();
{
MEDCouplingUMesh *m1=0;
MEDCouplingUMesh *m=buildPointe_1(m1);
- MEDCouplingUMesh *m2=(MEDCouplingUMesh *)m->deepCpy();
+ MEDCouplingUMesh *m2=(MEDCouplingUMesh *)m->deepCopy();
m->setCoords(0);
const int vals[16]={0,1,2,14,3,12,4,5,15,6,7,8,9,10,11,13};
DataArrayInt *da=DataArrayInt::New();
const int expected1[7]={0,3,8,9,11,11,19};
d->alloc(6,1);
std::copy(vals1,vals1+6,d->getPointer());
- d->computeOffsets2();
+ d->computeOffsetsFull();
CPPUNIT_ASSERT_EQUAL(7,d->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,d->getNumberOfComponents());
for(int i=0;i<7;i++)
std::copy(tab,tab+10,d->getPointer());
f->setArray(d);
d->decrRef();
- f->checkCoherency();
+ f->checkConsistencyLight();
//
CPPUNIT_ASSERT_DOUBLES_EQUAL(11.209371079592289,f->norm2(),1e-14);
//
std::copy(tab,tab+10,d->getPointer());
f->setArray(d);
d->decrRef();
- f->checkCoherency();
+ f->checkConsistencyLight();
//
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.8,f->normMax(),1e-14);
//
const int expected2[10]={0,5,14,19,42,49,86,95,108,159};
CPPUNIT_ASSERT(std::equal(expected1,expected1+159,da->getConstPointer()));
CPPUNIT_ASSERT(std::equal(expected2,expected2+10,dai->getConstPointer()));
- m->checkCoherency1();
+ m->checkConsistency();
//
m->decrRef();
}
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->getMeasureField(true);
f1->getArray()->setInfoOnComponent(0,"P [N/m^2]");
- DataArrayDouble *bary=m->getBarycenterAndOwner();
+ DataArrayDouble *bary=m->computeCellCenterOfMass();
MEDCouplingFieldDouble *f2=f1->buildNewTimeReprFromThis(NO_TIME,false);
f2->setArray(bary);
CPPUNIT_ASSERT_THROW(f1->copyTinyAttrFrom(f2),INTERP_KERNEL::Exception);
coordsX->decrRef();
coordsY->decrRef();
coordsZ->decrRef();
- MEDCouplingMesh *mesh2=mesh->deepCpy();
+ MEDCouplingMesh *mesh2=mesh->deepCopy();
//
static const int ids1[9]={0,1,2,10,11,12,20,21,22};
for(const int *myId=ids1;myId!=ids1+9;myId++)
b->alloc(3,1);
std::copy(arrI,arrI+3,b->getPointer());
int newNbTuple=-1;
- DataArrayInt *ret=DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(10,a->begin(),b->begin(),b->end(),newNbTuple);
+ DataArrayInt *ret=DataArrayInt::ConvertIndexArrayToO2N(10,a->begin(),b->begin(),b->end(),newNbTuple);
const int expected[10]={0,1,2,0,3,4,5,4,6,4};
CPPUNIT_ASSERT_EQUAL((std::size_t)10,ret->getNbOfElems());
CPPUNIT_ASSERT_EQUAL(7,newNbTuple);
CPPUNIT_ASSERT_EQUAL(1,ret->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(expected,expected+10,ret->getConstPointer()));
- CPPUNIT_ASSERT_THROW(DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(9,a->begin(),b->begin(),b->end(),newNbTuple),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(DataArrayInt::ConvertIndexArrayToO2N(9,a->begin(),b->begin(),b->end(),newNbTuple),INTERP_KERNEL::Exception);
ret->decrRef();
b->decrRef();
a->decrRef();
DataArrayInt *revDescIndx=DataArrayInt::New();
//
MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity2(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(13,mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,revDescIndx->getNumberOfTuples());
MEDCouplingUMesh *m1=m1c->buildUnstructured();
const int subPart1[3]={3,4,5};
MEDCouplingUMesh *m1bis=static_cast<MEDCouplingUMesh *>(m1->buildPartOfMySelf(subPart1,subPart1+3,false));
- MEDCouplingUMesh *m2tmp=static_cast<MEDCouplingUMesh *>(m1->deepCpy());
+ MEDCouplingUMesh *m2tmp=static_cast<MEDCouplingUMesh *>(m1->deepCopy());
const int subPart2[3]={0,1,2};
MEDCouplingUMesh *m2=static_cast<MEDCouplingUMesh *>(m2tmp->buildPartOfMySelf(subPart2,subPart2+3,false));
const double vec[2]={0.5,0.5};
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTest5.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingGaussLocalization.hxx"
#include <functional>
#include <iterator>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MEDCouplingBasicsTest5::testUMeshTessellate2D1()
{
m1->setCoords(myCoords1);
myCoords1->decrRef();
//
- MEDCouplingUMesh *m11=static_cast<MEDCouplingUMesh *>(m1->deepCpy());
+ MEDCouplingUMesh *m11=static_cast<MEDCouplingUMesh *>(m1->deepCopy());
m11->tessellate2D(1.);
CPPUNIT_ASSERT(m11->getCoords()->isEqual(*m11->getCoords(),1e-12));
const int expected1[48]={5,0,3,11,1,5,3,4,12,2,1,11,5,5,15,3,0,5,6,16,4,3,15,5,5,5,0,7,19,5,6,5,19,7,8,20,5,0,1,23,7,5,1,2,24,8,7,23};
CPPUNIT_ASSERT(std::equal(expected2,expected2+9,m11->getNodalConnectivityIndex()->getConstPointer()));
m11->decrRef();
//
- MEDCouplingUMesh *m12=static_cast<MEDCouplingUMesh *>(m1->deepCpy());
+ MEDCouplingUMesh *m12=static_cast<MEDCouplingUMesh *>(m1->deepCopy());
m12->tessellate2D(0.5);
CPPUNIT_ASSERT_EQUAL(41,m12->getNumberOfNodes());
const int expected3[60]={5,0,3,25,26,1,5,3,4,27,28,2,1,26,25,5,5,29,30,3,0,5,6,31,32,4,3,30,29,5,5,5,0,7,33,34,5,6,5,34,33,7,8,35,36,5,0,1,37,38,7,5,1,2,39,40,8,7,38,37};
m1->setCoords(myCoords);
myCoords->decrRef();
- MEDCouplingUMesh *m2 = static_cast<MEDCouplingUMesh *>(m1->deepCpy());
+ MEDCouplingUMesh *m2 = static_cast<MEDCouplingUMesh *>(m1->deepCopy());
m2->tessellate2D(0.1);
- CPPUNIT_ASSERT_NO_THROW(m2->checkCoherency1(0.0)); // eps param not used
+ CPPUNIT_ASSERT_NO_THROW(m2->checkConsistency(0.0)); // eps param not used
m1->decrRef();
m2->decrRef();
}
da2->alloc(5,2);
std::copy(data2,data2+10,da2->getPointer());
//
- DataArrayDouble *dac=da->deepCpy();
- dac->setContigPartOfSelectedValues2(1,da2,2,4,1);
+ DataArrayDouble *dac=da->deepCopy();
+ dac->setContigPartOfSelectedValuesSlice(1,da2,2,4,1);
const double expected3[14]={1.,11.,0.,30.,11.,41.,4.,14.,5.,15.,6.,16.,7.,17.};
for(int i=0;i<14;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected3[i],dac->getIJ(0,i),1e-14);
dac->decrRef();
//
- dac=da->deepCpy();
- CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues2(3,da2,0,5,1),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues2(0,da2,4,6,1),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues2(3,da2,5,0,1),INTERP_KERNEL::Exception);
- dac->setContigPartOfSelectedValues2(3,da2,1,5,1);
+ dac=da->deepCopy();
+ CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(3,da2,0,5,1),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(0,da2,4,6,1),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(3,da2,5,0,1),INTERP_KERNEL::Exception);
+ dac->setContigPartOfSelectedValuesSlice(3,da2,1,5,1);
const double expected4[14]={1.,11.,2.,12.,3.,13.,9.,39.,0.,30.,11.,41.,12.,42.};
for(int i=0;i<14;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected4[i],dac->getIJ(0,i),1e-14);
//
DataArrayInt *ids=DataArrayInt::New();
ids->alloc(3,1);
- dac=da->deepCpy();
+ dac=da->deepCopy();
ids->setIJ(0,0,2); ids->setIJ(1,0,0); ids->setIJ(2,0,4);
dac->setContigPartOfSelectedValues(2,da2,ids);
const double expected5[14]={1.,11.,2.,12.,0.,30.,8.,38.,12.,42.,6.,16.,7.,17.};
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected5[i],dac->getIJ(0,i),1e-14);
dac->decrRef();
//
- dac=da->deepCpy();
+ dac=da->deepCopy();
ids->setIJ(0,0,2); ids->setIJ(1,0,5); ids->setIJ(2,0,4);
CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues(1,da2,ids),INTERP_KERNEL::Exception);
ids->setIJ(0,0,2); ids->setIJ(1,0,2); ids->setIJ(2,0,-1);
dac->decrRef();
//
ids->setIJ(0,0,2); ids->setIJ(1,0,2); ids->setIJ(2,0,1);
- dac=da->deepCpy();
+ dac=da->deepCopy();
dac->setContigPartOfSelectedValues(4,da2,ids);
const double expected6[14]={1.,11.,2.,12.,3.,13.,4.,14.,0.,30.,0.,30.,9.,39.};
for(int i=0;i<14;i++)
da2->alloc(5,2);
std::copy(data2,data2+10,da2->getPointer());
//
- DataArrayInt *dac=da->deepCpy();
- dac->setContigPartOfSelectedValues2(1,da2,2,4,1);
+ DataArrayInt *dac=da->deepCopy();
+ dac->setContigPartOfSelectedValuesSlice(1,da2,2,4,1);
const int expected3[14]={1,11,0,30,11,41,4,14,5,15,6,16,7,17};
for(int i=0;i<14;i++)
CPPUNIT_ASSERT_EQUAL(expected3[i],dac->getIJ(0,i));
dac->decrRef();
//
- dac=da->deepCpy();
- CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues2(3,da2,0,5,1),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues2(0,da2,4,6,1),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues2(3,da2,5,0,1),INTERP_KERNEL::Exception);
- dac->setContigPartOfSelectedValues2(3,da2,1,5,1);
+ dac=da->deepCopy();
+ CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(3,da2,0,5,1),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(0,da2,4,6,1),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValuesSlice(3,da2,5,0,1),INTERP_KERNEL::Exception);
+ dac->setContigPartOfSelectedValuesSlice(3,da2,1,5,1);
const int expected4[14]={1,11,2,12,3,13,9,39,0,30,11,41,12,42};
for(int i=0;i<14;i++)
CPPUNIT_ASSERT_EQUAL(expected4[i],dac->getIJ(0,i));
//
DataArrayInt *ids=DataArrayInt::New();
ids->alloc(3,1);
- dac=da->deepCpy();
+ dac=da->deepCopy();
ids->setIJ(0,0,2); ids->setIJ(1,0,0); ids->setIJ(2,0,4);
dac->setContigPartOfSelectedValues(2,da2,ids);
const int expected5[14]={1,11,2,12,0,30,8,38,12,42,6,16,7,17};
CPPUNIT_ASSERT_EQUAL(expected5[i],dac->getIJ(0,i));
dac->decrRef();
//
- dac=da->deepCpy();
+ dac=da->deepCopy();
ids->setIJ(0,0,2); ids->setIJ(1,0,5); ids->setIJ(2,0,4);
CPPUNIT_ASSERT_THROW(dac->setContigPartOfSelectedValues(1,da2,ids),INTERP_KERNEL::Exception);
ids->setIJ(0,0,2); ids->setIJ(1,0,2); ids->setIJ(2,0,-1);
dac->decrRef();
//
ids->setIJ(0,0,2); ids->setIJ(1,0,2); ids->setIJ(2,0,1);
- dac=da->deepCpy();
+ dac=da->deepCopy();
dac->setContigPartOfSelectedValues(4,da2,ids);
const int expected6[14]={1,11,2,12,3,13,4,14,0,30,0,30,9,39};
for(int i=0;i<14;i++)
DataArrayInt *revDescIndx=DataArrayInt::New();
//
MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity2(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(30,mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)31,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(31,revDescIndx->getNumberOfTuples());
{
vec2[0]=3.*cos(M_PI/9.*i);
vec2[1]=3.*sin(M_PI/9.*i);
- MEDCouplingUMesh *m1Cpy=static_cast<MEDCouplingUMesh *>(m1->deepCpy());
+ MEDCouplingUMesh *m1Cpy=static_cast<MEDCouplingUMesh *>(m1->deepCopy());
m1Cpy->translate(vec2);
std::vector<int> res;
CPPUNIT_ASSERT_THROW(m1Cpy->are2DCellsNotCorrectlyOriented(vec1,false,res),INTERP_KERNEL::Exception);
std::copy(mesh2DCoords,mesh2DCoords+27,myCoords->getPointer());
mesh2D->setCoords(myCoords);
myCoords->decrRef();
- mesh2D->checkCoherency();
+ mesh2D->checkConsistencyLight();
//
double mesh3DCoords[24]={-0.3,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.2,-0.3,0., -0.3,-0.3,1., -0.3,0.2,1., 0.2,0.2,1., 0.2,-0.3,1. };
int mesh3DConn[8]={0,1,2,3,4,5,6,7};
std::copy(mesh3DCoords,mesh3DCoords+24,myCoords3D->getPointer());
mesh3D->setCoords(myCoords3D);
myCoords3D->decrRef();
- mesh3D->checkCoherency();
+ mesh3D->checkConsistencyLight();
//
- MEDCouplingUMesh *mesh3D_2=dynamic_cast<MEDCouplingUMesh *>(mesh3D->deepCpy());
- MEDCouplingUMesh *mesh2D_2=dynamic_cast<MEDCouplingUMesh *>(mesh2D->deepCpy());
- MEDCouplingUMesh *mesh3D_4=dynamic_cast<MEDCouplingUMesh *>(mesh3D->deepCpy());
- MEDCouplingUMesh *mesh2D_4=dynamic_cast<MEDCouplingUMesh *>(mesh2D->deepCpy());
+ MEDCouplingUMesh *mesh3D_2=dynamic_cast<MEDCouplingUMesh *>(mesh3D->deepCopy());
+ MEDCouplingUMesh *mesh2D_2=dynamic_cast<MEDCouplingUMesh *>(mesh2D->deepCopy());
+ MEDCouplingUMesh *mesh3D_4=dynamic_cast<MEDCouplingUMesh *>(mesh3D->deepCopy());
+ MEDCouplingUMesh *mesh2D_4=dynamic_cast<MEDCouplingUMesh *>(mesh2D->deepCopy());
DataArrayInt *renumNodes=DataArrayInt::New();
int oldNbOf3DNodes=mesh3D->getNumberOfNodes();
renumNodes->alloc(mesh2D->getNumberOfNodes(),1);
mesh3D->setCoords(coo);
mesh2D->setCoords(coo);
coo->decrRef();
- MEDCouplingUMesh *mesh2D_3=dynamic_cast<MEDCouplingUMesh *>(mesh2D->deepCpy());
+ MEDCouplingUMesh *mesh2D_3=dynamic_cast<MEDCouplingUMesh *>(mesh2D->deepCopy());
mesh2D_3->shiftNodeNumbersInConn(oldNbOf3DNodes);
mesh2D->renumberNodesInConn(renumNodes->getConstPointer());
renumNodes->decrRef();
da2->decrRef();
//
const double vect[3]={1.,0.,0.};
- MEDCouplingUMesh *mesh2D_5=dynamic_cast<MEDCouplingUMesh *>(mesh2D_4->deepCpy());
+ MEDCouplingUMesh *mesh2D_5=dynamic_cast<MEDCouplingUMesh *>(mesh2D_4->deepCopy());
mesh2D_5->translate(vect);
std::vector<MEDCouplingUMesh *> meshes(3);
meshes[0]=mesh3D_4; meshes[1]=mesh2D_4; meshes[2]=mesh2D_5;
MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
CPPUNIT_ASSERT(mesh3D_4->getCoords()==mesh2D_4->getCoords());
CPPUNIT_ASSERT(mesh2D_4->getCoords()==mesh2D_5->getCoords());
- mesh3D_4->checkCoherency(); mesh2D_4->checkCoherency(); mesh2D_5->checkCoherency();
+ mesh3D_4->checkConsistencyLight(); mesh2D_4->checkConsistencyLight(); mesh2D_5->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(26,mesh3D_4->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(3,mesh3D_4->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(9,mesh3D_4->getNodalConnectivity()->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected5[i],mesh3D_4->getCoords()->getIJ(0,i),1e-12);
//
MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,1e-12);
- mesh3D_4->checkCoherency(); mesh2D_4->checkCoherency(); mesh2D_5->checkCoherency();
+ mesh3D_4->checkConsistencyLight(); mesh2D_4->checkConsistencyLight(); mesh2D_5->checkConsistencyLight();
CPPUNIT_ASSERT(mesh3D_4->getCoords()==mesh2D_4->getCoords());
CPPUNIT_ASSERT(mesh2D_4->getCoords()==mesh2D_5->getCoords());
CPPUNIT_ASSERT_EQUAL(19,mesh3D_4->getNumberOfNodes());
std::copy(mesh2DCoords,mesh2DCoords+10,myCoords->getPointer());
mesh2D->setCoords(myCoords);
myCoords->decrRef();
- mesh2D->checkCoherency();
+ mesh2D->checkConsistencyLight();
//
std::vector<int> v;
mesh2D->checkButterflyCells(v);
std::copy(coords,coords+662,coordsDa->getPointer());
m->setCoords(coordsDa);
coordsDa->decrRef();
- m->checkCoherency();
+ m->checkConsistencyLight();
//
DataArrayInt *da=m->convexEnvelop2D();
- m->checkCoherency();
+ m->checkConsistencyLight();
CPPUNIT_ASSERT(coordsDa==m->getCoords());
DataArrayInt *daC=da->buildComplement(331);
da->decrRef();
vals->substractEqual(ref2);
ref2->decrRef();
vals->abs();
- DataArrayInt *theTest=vals->getIdsInRange(-1.,1e-7);
- CPPUNIT_ASSERT(theTest->isIdentity2(331));
+ DataArrayInt *theTest=vals->findIdsInRange(-1.,1e-7);
+ CPPUNIT_ASSERT(theTest->isIota(331));
theTest->decrRef();
valsF->decrRef();
//
CPPUNIT_ASSERT_THROW(arr->sort(false),INTERP_KERNEL::Exception);//no one component
arr->rearrange(1);
std::copy(values,values+6,arr->getPointer());
- DataArrayInt *arr1=arr->deepCpy();
- DataArrayInt *arr2=arr->deepCpy();
+ DataArrayInt *arr1=arr->deepCopy();
+ DataArrayInt *arr2=arr->deepCopy();
arr1->sort(true);
const int expected1[6]={1,2,4,5,6,7};
CPPUNIT_ASSERT_EQUAL(6,arr1->getNumberOfTuples());
CPPUNIT_ASSERT_THROW(ard->sort(false),INTERP_KERNEL::Exception);//no one component
ard->rearrange(1);
std::copy(valuesD,valuesD+6,ard->getPointer());
- DataArrayDouble *ard1=ard->deepCpy();
- DataArrayDouble *ard2=ard->deepCpy();
+ DataArrayDouble *ard1=ard->deepCopy();
+ DataArrayDouble *ard2=ard->deepCopy();
ard1->sort(true);
const double expected3[6]={1.,2.,4.,5.,6.,7.};
CPPUNIT_ASSERT_EQUAL(6,ard1->getNumberOfTuples());
DataArrayDouble *arr=DataArrayDouble::New(); arr->alloc(mesh3D->getNumberOfCells(),2);
arr->rearrange(1); arr->iota(2.); arr->rearrange(2);
f->setArray(arr);
- f->checkCoherency();
+ f->checkConsistencyLight();
const int exp1[9]={1,3,4,7,9,10,13,15,16};
DataArrayInt *expected1=DataArrayInt::New(); expected1->alloc(9,1); std::copy(exp1,exp1+9,expected1->getPointer());
CPPUNIT_ASSERT(expected1->isEqual(*ids));
//
const int subPart1[3]={1,5,9};
MEDCouplingFieldDouble *f2=f->buildSubPart(subPart1,subPart1+3);
- f2->checkCoherency();
+ f2->checkConsistencyLight();
DataArrayInt *cI=m->computeNbOfNodesPerCell();
- cI->computeOffsets2();
+ cI->computeOffsetsFull();
const int sel1[3]={1,5,9};
DataArrayInt *sel=DataArrayInt::New(); sel->useArray(sel1,false,CPP_DEALLOC,3,1);
DataArrayInt *res=sel->buildExplicitArrByRanges(cI);
MEDCouplingUMesh *part=dynamic_cast<MEDCouplingUMesh *>(umesh->buildFacePartOfMySelfNode(ids->begin(),ids->end(),true));
part->setName(skin->getName().c_str());
CPPUNIT_ASSERT(part->isEqual(skin,1e-12));
- MEDCouplingUMesh *part2=dynamic_cast<MEDCouplingUMesh *>(part->buildPartOfMySelf2(1,18,2,true));
+ MEDCouplingUMesh *part2=dynamic_cast<MEDCouplingUMesh *>(part->buildPartOfMySelfSlice(1,18,2,true));
DataArrayInt *ids2=DataArrayInt::Range(0,18,2);
part->setPartOfMySelf(ids2->begin(),ids2->end(),*part2);
ids2->decrRef();
m->decrRef(); part->decrRef();
// resize with range ids
m=build2DTargetMesh_1();
- part=static_cast<MEDCouplingUMesh *>(m->buildPartOfMySelf2(3,5,1,true));
- m->setPartOfMySelf2(1,3,1,*part);
+ part=static_cast<MEDCouplingUMesh *>(m->buildPartOfMySelfSlice(3,5,1,true));
+ m->setPartOfMySelfSlice(1,3,1,*part);
const int expected5[25]={4,0,3,4,1,4,6,7,4,3,4,7,8,5,4,4,6,7,4,3,4,7,8,5,4};
CPPUNIT_ASSERT(std::equal(expected5,expected5+25,m->getNodalConnectivity()->getConstPointer()));
CPPUNIT_ASSERT_EQUAL((std::size_t)25,m->getNodalConnectivity()->getNbOfElems());
m->decrRef(); part->decrRef();
// no resize with range ids
m=build2DTargetMesh_1();
- part=static_cast<MEDCouplingUMesh *>(m->buildPartOfMySelf2(0,5,3,true));
+ part=static_cast<MEDCouplingUMesh *>(m->buildPartOfMySelfSlice(0,5,3,true));
part->convertAllToPoly();
- m->setPartOfMySelf2(3,5,1,*part);
+ m->setPartOfMySelfSlice(3,5,1,*part);
const int expected7[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3};
CPPUNIT_ASSERT(std::equal(expected7,expected7+23,m->getNodalConnectivity()->getConstPointer()));
CPPUNIT_ASSERT_EQUAL((std::size_t)23,m->getNodalConnectivity()->getNbOfElems());
m->decrRef(); part->decrRef();
// no resize with range ids negative direction
m=build2DTargetMesh_1();
- part=static_cast<MEDCouplingUMesh *>(m->buildPartOfMySelf2(3,-1,-3,true));
+ part=static_cast<MEDCouplingUMesh *>(m->buildPartOfMySelfSlice(3,-1,-3,true));
part->convertAllToPoly();
- m->setPartOfMySelf2(4,2,-1,*part);
+ m->setPartOfMySelfSlice(4,2,-1,*part);
const int expected9[23]={4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3};
CPPUNIT_ASSERT(std::equal(expected9,expected9+23,m->getNodalConnectivity()->getConstPointer()));
CPPUNIT_ASSERT_EQUAL((std::size_t)23,m->getNodalConnectivity()->getNbOfElems());
std::copy(coord,coord+18,coords->getPointer());
m->setCoords(coords);
coords->decrRef();
- m->checkCoherency();
+ m->checkConsistencyLight();
//
MEDCouplingFieldDouble *vol=m->getMeasureField(ON_CELLS);
CPPUNIT_ASSERT_EQUAL(1,vol->getArray()->getNumberOfTuples());
srcVals->alloc(nbOfInputPoints,1);
std::copy(srcFieldValsOnPoints,srcFieldValsOnPoints+nbOfInputPoints,srcVals->getPointer());
f->setArray(srcVals);
- f->checkCoherency();
+ f->checkConsistencyLight();
//
double *res0=new double[1];
f->getValueOn(targetPointCoordsX,res0);
c->useArray(coords,false,CPP_DEALLOC,24,3);
m->setCoords(c);
c->decrRef();
- m->checkCoherency1();
+ m->checkConsistency();
//
- MEDCouplingUMesh *m1=static_cast<MEDCouplingUMesh *>(m->deepCpy());
+ MEDCouplingUMesh *m1=static_cast<MEDCouplingUMesh *>(m->deepCopy());
DataArrayInt *d1=m1->simplexize(INTERP_KERNEL::PLANAR_FACE_5);
- m1->checkCoherency1();
+ m1->checkConsistency();
MEDCouplingFieldDouble *f1=m1->getMeasureField(ON_CELLS);
const double vol1Expected[12]={1./6, 1./6, 1./6,1./6, 1./6, 1./3,1./6, 1./6, 1./6, 1./6, 1./3, 1./6};
CPPUNIT_ASSERT_EQUAL(1,f1->getArray()->getNumberOfComponents());
m1->decrRef();
d1->decrRef();
//
- MEDCouplingUMesh *m2=static_cast<MEDCouplingUMesh *>(m->deepCpy());
+ MEDCouplingUMesh *m2=static_cast<MEDCouplingUMesh *>(m->deepCopy());
DataArrayInt *d2=m2->simplexize(INTERP_KERNEL::PLANAR_FACE_6);
- m2->checkCoherency1();
+ m2->checkConsistency();
MEDCouplingFieldDouble *f2=m2->getMeasureField(ON_CELLS);
const double vol2Expected[14]={1./6, 1./6, 1./6,1./6, 1./6, 1./6,1./6,1./6, 1./6, 1./6, 1./6, 1./6,1./6,1./6};
CPPUNIT_ASSERT_EQUAL(1,f2->getArray()->getNumberOfComponents());
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTestInterp.hxx"
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "Interpolation2D.txx"
#include <cmath>
#include <functional>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
typedef std::vector<std::map<int,double> > IntersectionMatrix;
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTest.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingMultiFields.hxx"
void CppExample_MEDCouplingFieldDouble_WriteVTK()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_WriteVTK_1]
// mesh1
const double coords[3] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh1 = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh1 = MEDCouplingCMesh::New();
mesh1->setCoords(coordsArr,coordsArr); // mesh becomes a 2D one
// 3 fields (lying on the same mesh!)
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field1 =
+ MCAuto<MEDCouplingFieldDouble> field1 =
mesh1->getMeasureField( true );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field2 =
+ MCAuto<MEDCouplingFieldDouble> field2 =
mesh1->buildOrthogonalField();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field3 =
+ MCAuto<MEDCouplingFieldDouble> field3 =
mesh1->fillFromAnalytic( ON_CELLS, 1, "x");
field2->setName( "Normal" ); // name is necessary!
field3->setName( "Barycenter" ); // name is necessary!
void CppExample_MEDCouplingFieldDouble_MaxFields()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_MaxFields_1]
const double vals1[4] = {0.,2., 4.,6.}; // for field 1
const double vals2[4] = {2.,0., 6.,4.}; // for field 2
const double valsMax[4] = {2.,2., 6.,6.}; // expected max field
const double valsMin[4] = {0.,0., 4.,4.}; // expected min field
// field 1
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> valsArr1 = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> valsArr1 = DataArrayDouble::New();
valsArr1->useExternalArrayWithRWAccess( vals1, 2,2 ); // 2 tuples per 2 components
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field1 = MEDCouplingFieldDouble::New( ON_NODES );
+ MCAuto<MEDCouplingFieldDouble> field1 = MEDCouplingFieldDouble::New( ON_NODES );
field1->setArray( valsArr1 );
// field 2
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> valsArr2 = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> valsArr2 = DataArrayDouble::New();
valsArr2->useExternalArrayWithRWAccess( vals2, 2,2 ); // 2 tuples per 2 components
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field2 = MEDCouplingFieldDouble::New( ON_NODES );
+ MCAuto<MEDCouplingFieldDouble> field2 = MEDCouplingFieldDouble::New( ON_NODES );
field2->setArray( valsArr2 );
// max field
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fieldMax = MEDCouplingFieldDouble::MaxFields( field1, field2 );
+ MCAuto<MEDCouplingFieldDouble> fieldMax = MEDCouplingFieldDouble::MaxFields( field1, field2 );
CPPUNIT_ASSERT( std::equal( valsMax, valsMax+4, fieldMax->getArray()->getConstPointer() )); // fieldMax == valsMax
// min field
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fieldMin = MEDCouplingFieldDouble::MinFields( field1, field2 );
+ MCAuto<MEDCouplingFieldDouble> fieldMin = MEDCouplingFieldDouble::MinFields( field1, field2 );
CPPUNIT_ASSERT( std::equal( valsMin, valsMin+4, fieldMin->getArray()->getConstPointer() )); // fieldMin == valsMin
//! [CppSnippet_MEDCouplingFieldDouble_MaxFields_1]
}
void CppExample_MEDCouplingFieldDouble_MergeFields()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_MergeFields_1]
// mesh1
const double coords[3] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh1 = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh1 = MEDCouplingCMesh::New();
mesh1->setCoords(coordsArr); // mesh becomes a 1D
// field1
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field1 =
+ MCAuto<MEDCouplingFieldDouble> field1 =
mesh1->fillFromAnalytic( ON_CELLS, 1, "x");
// mesh2 and field2
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field2 =
+ MCAuto<MEDCouplingFieldDouble> field2 =
field1->cloneWithMesh( true );
double vec[1] = { 5. };
- (const_cast<ParaMEDMEM::MEDCouplingMesh *>(field2->getMesh()))->translate(vec); // translate mesh2
+ (const_cast<MEDCoupling::MEDCouplingMesh *>(field2->getMesh()))->translate(vec); // translate mesh2
field2->applyFunc("x + 5"); // "translate" field2
// concatenate field1 and field2
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field3 =
+ MCAuto<MEDCouplingFieldDouble> field3 =
MEDCouplingFieldDouble::MergeFields( field1, field2 );
std::vector<const MEDCouplingFieldDouble *> fields( 2 );
fields[0] = field1;
fields[1] = field2;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field4 =
+ MCAuto<MEDCouplingFieldDouble> field4 =
MEDCouplingFieldDouble::MergeFields( fields );
//! [CppSnippet_MEDCouplingFieldDouble_MergeFields_1]
}
void CppExample_MEDCouplingFieldDouble_substractInPlaceDM()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_1]
const double coords1[4] = {0.,1.,2.,3.};
const double coords2[4] = {2.,1.,0.,3.}; // #0 <==> #2
// mesh 1
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh1 = MEDCouplingUMesh::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<MEDCouplingUMesh> mesh1 = MEDCouplingUMesh::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords1, 4, 1 );
mesh1->setCoords(coordsArr);
mesh1->setMeshDimension(0);
mesh1->allocateCells(0);
mesh1->finishInsertingCells();
// mesh 2
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh2 =
- (MEDCouplingUMesh*) mesh1->deepCpy();
+ MCAuto<MEDCouplingUMesh> mesh2 =
+ (MEDCouplingUMesh*) mesh1->deepCopy();
mesh2->getCoords()->useExternalArrayWithRWAccess( coords2, 4, 1 );
//! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_1]
//! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field1 =
- mesh1->fillFromAnalytic( ParaMEDMEM::ON_NODES,1,"x"); // field1 values == coords1
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field2 =
- mesh2->fillFromAnalytic( ParaMEDMEM::ON_NODES,1,"x"); // field2 values == coords2
+ MCAuto<MEDCouplingFieldDouble> field1 =
+ mesh1->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field1 values == coords1
+ MCAuto<MEDCouplingFieldDouble> field2 =
+ mesh2->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field2 values == coords2
const double levOfCheck = 10; // nodes can be permuted
field1->substractInPlaceDM( field2, levOfCheck, 1e-13, 0 ); // values #0 and #2 must swap
//! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_2]
void CppExample_MEDCouplingFieldDouble_changeUnderlyingMesh()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_1]
const double coords1[4] = {0.,1.,2.,3.};
const double coords2[4] = {2.,1.,0.,3.}; // #0 <==> #2
// mesh 1
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh1 = MEDCouplingUMesh::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<MEDCouplingUMesh> mesh1 = MEDCouplingUMesh::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords1, 4, 1 );
mesh1->setCoords(coordsArr);
mesh1->setMeshDimension(0);
mesh1->allocateCells(0);
mesh1->finishInsertingCells();
// mesh 2
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh2 =
- (MEDCouplingUMesh*) mesh1->deepCpy();
+ MCAuto<MEDCouplingUMesh> mesh2 =
+ (MEDCouplingUMesh*) mesh1->deepCopy();
mesh2->getCoords()->useExternalArrayWithRWAccess( coords2, 4, 1 );
//! [CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_1]
//! [CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh1->fillFromAnalytic( ParaMEDMEM::ON_NODES,1,"x"); // field values == coords1
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh1->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field values == coords1
const double levOfCheck = 10; // nodes can be permuted
field->changeUnderlyingMesh( mesh2, levOfCheck, 1e-13, 0 ); // values #0 and #2 must swap
CPPUNIT_ASSERT( std::equal( coords2, coords2+4, field->getArray()->getConstPointer() ));
void CppExample_MEDCouplingFieldDouble_applyFunc_same_nb_comp()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc_same_nb_comp_1]
const double v[4] = {1.,2., 3.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> array = DataArrayDouble::New();
array->useExternalArrayWithRWAccess( v, 2, 2 ); // 2 tuples per 2 components
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setArray( array );
const char func[] = "IVec * v + JVec * w*w + 10";
field->applyFunc( 2, func );
void CppExample_MEDCouplingFieldDouble_applyFunc3()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc3_1]
// create a 2D vector field
const double values[4] = {1.,1., 2.,1.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> array = DataArrayDouble::New();
array->useExternalArrayWithRWAccess( values, 2, 2 ); // 2 tuples per 2 components
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setArray( array );
// transform the field to a 3D vector field
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
const char* varNames[2] = { "a", "b" }; // names used to refer to X and Y components
std::vector<std::string> varNamesVec( varNames, varNames+2 );
- field->applyFunc3( 3, varNamesVec, func ); // require 3 components
+ field->applyFuncNamedCompo( 3, varNamesVec, func ); // require 3 components
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components as required
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc3_1]
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc3_2]
void CppExample_MEDCouplingFieldDouble_applyFunc2()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc2_1]
// create a 2D vector field
const double values[4] = {1.,1., 2.,1.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> array = DataArrayDouble::New();
array->useExternalArrayWithRWAccess( values, 2, 2 ); // 2 tuples per 2 components
array->setInfoOnComponent(0,"a"); // name used to refer to X component within a function
array->setInfoOnComponent(1,"b"); // name used to refer to Y component within a function
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setArray( array );
// transform the field to a 3D vector field
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
- field->applyFunc2( 3, func ); // require 3 components
+ field->applyFuncCompo( 3, func ); // require 3 components
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components as required
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc2_1]
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc2_2]
void CppExample_MEDCouplingFieldDouble_applyFunc()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_applyFunc_1]
// create a 2D vector field
const double values[4] = {1.,1., 2.,1.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> array = DataArrayDouble::New();
array->useExternalArrayWithRWAccess( values, 2, 2 ); // 2 tuples per 2 components
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setArray( array );
// transform the field to a 3D vector field
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
void CppExample_MEDCouplingFieldDouble_applyFunc_val()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [Snippet_MEDCouplingFieldDouble_applyFunc_val_1]
// mesh
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr); // mesh becomes a 2D structured mesh
// field
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setMesh( mesh );
field->fillFromAnalytic(2,"IVec * x + JVec * y"); // 2 components
//! [Snippet_MEDCouplingFieldDouble_applyFunc_val_1]
void CppExample_MEDCouplingFieldDouble_fillFromAnalytic3()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_1]
const double coords[4] = {0.,2.,4.,6.}; // 6. is not used
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> x = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> x = DataArrayDouble::New();
x->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> y = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> y = DataArrayDouble::New();
y->useExternalArrayWithRWAccess( coords, 2, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
mesh->setCoords(x,y);
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_1]
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setMesh( mesh );
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
const char* varNames[2] = { "a", "b" }; // names used to refer to X and Y coord components
std::vector<std::string> varNamesVec( varNames, varNames+2 );
- field->fillFromAnalytic3( 3, varNamesVec, func );
+ field->fillFromAnalyticNamedCompo( 3, varNamesVec, func );
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_2]
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic3_3]
double val1[3]; // a value (vector) of the cell #1
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components in the field
field->getArray()->getTuple( 1, val1 );
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc =
- mesh->getBarycenterAndOwner(); // func is applied to barycenters of cells
+ MCAuto<DataArrayDouble> bc =
+ mesh->computeCellCenterOfMass(); // func is applied to barycenters of cells
double bc1[2]; // coordinates of the second point
bc->getTuple( 1, bc1 );
//
void CppExample_MEDCouplingFieldDouble_fillFromAnalytic2()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> x = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> x = DataArrayDouble::New();
x->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> y = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> y = DataArrayDouble::New();
y->useExternalArrayWithRWAccess( coords, 2, 1 );
x->setInfoOnComponent(0,"a"); // name used to refer to X coordinate within a function
y->setInfoOnComponent(0,"b"); // name used to refer to Y coordinate within a function
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
mesh->setCoords(x,y);
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_1]
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic2_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setMesh( mesh );
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
field->fillFromAnalytic( 3, func );
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components in the field
field->getArray()->getTuple( 1, val1 );
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc =
- mesh->getBarycenterAndOwner(); // func is applied to barycenters of cells
+ MCAuto<DataArrayDouble> bc =
+ mesh->computeCellCenterOfMass(); // func is applied to barycenters of cells
double bc1[2]; // coordinates of the second point
bc->getTuple( 1, bc1 );
//
void CppExample_MEDCouplingFieldDouble_fillFromAnalytic()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_1]
const double coords[3] = {0.,2.,4};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> x = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> x = DataArrayDouble::New();
x->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> y = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> y = DataArrayDouble::New();
y->useExternalArrayWithRWAccess( coords, 2, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
mesh->setCoords(x,y);
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_1]
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_2]
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setMesh( mesh );
field->fillFromAnalytic( 3, func );
//! [CppSnippet_MEDCouplingFieldDouble_fillFromAnalytic_2]
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components in the field
field->getArray()->getTuple( 1, val1 );
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc =
- mesh->getBarycenterAndOwner(); // func is applied to barycenters of cells
+ MCAuto<DataArrayDouble> bc =
+ mesh->computeCellCenterOfMass(); // func is applied to barycenters of cells
double bc1[2]; // coordinates of the second point
bc->getTuple( 1, bc1 );
//
void CppExample_MEDCouplingFieldDouble_fillFromAnalytic_c_func()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [Snippet_MEDCouplingFieldDouble_fillFromAnalytic_c_func_1]
// mesh
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr); // mesh becomes a 2D structured mesh
// field
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setMesh( mesh );
field->fillFromAnalytic( 3, &getNewValue ); // 3 components are required
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 );
void CppExample_MEDCouplingFieldDouble_applyFunc_c_func()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [Snippet_MEDCouplingFieldDouble_applyFunc_c_func_1]
// mesh
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr); // mesh becomes a 2D structured mesh
// field
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS );
field->setMesh( mesh );
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc = mesh->getBarycenterAndOwner();
+ MCAuto<DataArrayDouble> bc = mesh->computeCellCenterOfMass();
field->setArray( bc ); // 2 components here as the mesh is 2D
//! [Snippet_MEDCouplingFieldDouble_applyFunc_c_func_1]
//! [Snippet_MEDCouplingFieldDouble_applyFunc_c_func_2]
void CppExample_MEDCouplingFieldDouble_getValueOn_time()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_getValueOn_time_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr);
//! [CppSnippet_MEDCouplingFieldDouble_getValueOn_time_1]
//! [CppSnippet_MEDCouplingFieldDouble_getValueOn_time_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- MEDCouplingFieldDouble::New( ParaMEDMEM::ON_CELLS, ParaMEDMEM::LINEAR_TIME );
+ MCAuto<MEDCouplingFieldDouble> field =
+ MEDCouplingFieldDouble::New( MEDCoupling::ON_CELLS, MEDCoupling::LINEAR_TIME );
field->setMesh( mesh );
field->fillFromAnalytic( 1,"10"); // all values == 10.
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> array2 =
+ MCAuto<DataArrayDouble> array2 =
DataArrayDouble::Add( field->getArray(), field->getArray() ); // == 2 * field->getArray()
field->setEndArray( array2 ); // all values == 20.
const double time1 = 1.1, time2 = 22.;
void CppExample_MEDCouplingFieldDouble_getValueOnMulti()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic( ParaMEDMEM::ON_CELLS,1,"x+y");
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalytic( MEDCoupling::ON_CELLS,1,"x+y");
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_1]
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_2]
// field values are located at cell barycenters
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc = mesh->getBarycenterAndOwner();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> valArray =
+ MCAuto<DataArrayDouble> bc = mesh->computeCellCenterOfMass();
+ MCAuto<DataArrayDouble> valArray =
field->getValueOnMulti( bc->getConstPointer(), bc->getNumberOfTuples() );
CPPUNIT_ASSERT( valArray->isEqual( * field->getArray(), 1e-13 ));
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnMulti_2]
void CppExample_MEDCouplingFieldDouble_getValueOn()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_getValueOn_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic( ParaMEDMEM::ON_CELLS,1,"x+y");
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalytic( MEDCoupling::ON_CELLS,1,"x+y");
//! [CppSnippet_MEDCouplingFieldDouble_getValueOn_1]
//! [CppSnippet_MEDCouplingFieldDouble_getValueOn_2]
// field values are located at cell barycenters
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc = mesh->getBarycenterAndOwner();
+ MCAuto<DataArrayDouble> bc = mesh->computeCellCenterOfMass();
std::vector<double> vals( field->getNumberOfTuples() ); // array to collect values returned by getValueOn()
double cellBC[2]; // we are in 2D space
for ( int i = 0; i < bc->getNumberOfTuples(); ++i )
void CppExample_MEDCouplingFieldDouble_getValueOnPos()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnPos_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic( ParaMEDMEM::ON_CELLS,1,"x+y");
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalytic( MEDCoupling::ON_CELLS,1,"x+y");
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnPos_1]
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnPos_2]
double val11[1]; // 1 == field->getNumberOfComponents()
field->getValueOnPos( 1,1,-1, val11 );
// field values are located at cell barycenters
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc = mesh->getBarycenterAndOwner();
+ MCAuto<DataArrayDouble> bc = mesh->computeCellCenterOfMass();
CPPUNIT_ASSERT( val11[0] == bc->getIJ(3,0) + bc->getIJ(3,1) );
//! [CppSnippet_MEDCouplingFieldDouble_getValueOnPos_2]
}
void CppExample_MEDCouplingFieldDouble_renumberNodes()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_renumberNodes_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> cmesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> cmesh = MEDCouplingCMesh::New();
cmesh->setCoords(coordsArr,coordsArr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh = cmesh->buildUnstructured();
+ MCAuto<MEDCouplingUMesh> mesh = cmesh->buildUnstructured();
//! [CppSnippet_MEDCouplingFieldDouble_renumberNodes_1]
//! [CppSnippet_MEDCouplingFieldDouble_renumberNodes_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic( ParaMEDMEM::ON_NODES,2,"IVec*x+JVec*y");
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalytic( MEDCoupling::ON_NODES,2,"IVec*x+JVec*y");
const DataArrayDouble* values = field->getArray();
const DataArrayDouble* nodeCoords = mesh->getCoords();
CPPUNIT_ASSERT( values->isEqualWithoutConsideringStr( *nodeCoords, 1e-13 ));
void CppExample_MEDCouplingFieldDouble_renumberCells()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_renumberCells_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> cmesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> cmesh = MEDCouplingCMesh::New();
cmesh->setCoords(coordsArr,coordsArr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh = cmesh->buildUnstructured();
+ MCAuto<MEDCouplingUMesh> mesh = cmesh->buildUnstructured();
//! [CppSnippet_MEDCouplingFieldDouble_renumberCells_1]
//! [CppSnippet_MEDCouplingFieldDouble_renumberCells_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic( ParaMEDMEM::ON_CELLS,2,"IVec*x+JVec*y");
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalytic( MEDCoupling::ON_CELLS,2,"IVec*x+JVec*y");
const DataArrayDouble* values = field->getArray();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc = mesh->getBarycenterAndOwner();
+ MCAuto<DataArrayDouble> bc = mesh->computeCellCenterOfMass();
CPPUNIT_ASSERT( values->isEqualWithoutConsideringStr( *bc, 1e-13 ));
//! [CppSnippet_MEDCouplingFieldDouble_renumberCells_2]
//! [CppSnippet_MEDCouplingFieldDouble_renumberCells_3]
field->renumberCells(renumber,false);
const MEDCouplingMesh* mesh2 = field->getMesh(); // field now refers to another mesh
values = field->getArray();
- bc = mesh2->getBarycenterAndOwner();
+ bc = mesh2->computeCellCenterOfMass();
CPPUNIT_ASSERT( values->isEqualWithoutConsideringStr( *bc, 1e-13 ));
//! [CppSnippet_MEDCouplingFieldDouble_renumberCells_3]
}
void CppExample_MEDCouplingFieldDouble_buildNewTimeReprFromThis()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_1]
const double coords[4] = {0.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr = DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh = MEDCouplingCMesh::New();
mesh->setCoords(coordsArr,coordsArr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field1 =
- mesh->fillFromAnalytic( ParaMEDMEM::ON_NODES,1,"x+y");
- CPPUNIT_ASSERT( field1->getTimeDiscretization() == ParaMEDMEM::ONE_TIME );
+ MCAuto<MEDCouplingFieldDouble> field1 =
+ mesh->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x+y");
+ CPPUNIT_ASSERT( field1->getTimeDiscretization() == MEDCoupling::ONE_TIME );
//! [CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_1]
//! [CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field2 =
- field1->buildNewTimeReprFromThis( ParaMEDMEM::NO_TIME, false );
- CPPUNIT_ASSERT( field2->getTimeDiscretization() == ParaMEDMEM::NO_TIME );
+ MCAuto<MEDCouplingFieldDouble> field2 =
+ field1->buildNewTimeReprFromThis( MEDCoupling::NO_TIME, false );
+ CPPUNIT_ASSERT( field2->getTimeDiscretization() == MEDCoupling::NO_TIME );
//! [CppSnippet_MEDCouplingFieldDouble_buildNewTimeReprFromThis_2]
}
void CppExample_MEDCouplingMesh_fillFromAnalytic3()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic3_1]
const double coords[4] = {0.,2.,4.,6.}; // 6. is not used
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> x = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> x = DataArrayDouble::New();
x->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> y = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> y = DataArrayDouble::New();
y->useExternalArrayWithRWAccess( coords, 2, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
mesh->setCoords(x,y);
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic3_1]
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic3_2]
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
const char* varNames[2] = { "a", "b" }; // names used to refer to X and Y coord components
std::vector<std::string> varNamesVec( varNames, varNames+2 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic3( ParaMEDMEM::ON_CELLS, 3, varNamesVec, func );
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalyticNamedCompo( MEDCoupling::ON_CELLS, 3, varNamesVec, func );
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic3_2]
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic3_3]
double val1[3]; // a value (vector) of the cell #1
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components in the field
field->getArray()->getTuple( 1, val1 );
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc =
- mesh->getBarycenterAndOwner(); // func is applied to barycenters of cells
+ MCAuto<DataArrayDouble> bc =
+ mesh->computeCellCenterOfMass(); // func is applied to barycenters of cells
double bc1[2]; // coordinates of the second point
bc->getTuple( 1, bc1 );
//
void CppExample_MEDCouplingMesh_fillFromAnalytic2()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic2_1]
const double coords[4] = {0.,2.,4.,6.}; // 6. is not used
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> x = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> x = DataArrayDouble::New();
x->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> y = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> y = DataArrayDouble::New();
y->useExternalArrayWithRWAccess( coords, 2, 1 );
x->setInfoOnComponent(0,"a"); // name used to refer to X coordinate within a function
y->setInfoOnComponent(0,"b"); // name used to refer to Y coordinate within a function
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
mesh->setCoords(x,y);
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic2_1]
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic2_2]
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic2( ParaMEDMEM::ON_CELLS, 3, func );
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalyticCompo( MEDCoupling::ON_CELLS, 3, func );
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic2_2]
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic2_3]
double val1[3]; // a value (vector) of the cell #1
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components in the field
field->getArray()->getTuple( 1, val1 );
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc =
- mesh->getBarycenterAndOwner(); // func is applied to barycenters of cells
+ MCAuto<DataArrayDouble> bc =
+ mesh->computeCellCenterOfMass(); // func is applied to barycenters of cells
double bc1[2]; // coordinates of the second point
bc->getTuple( 1, bc1 );
//
void CppExample_MEDCouplingMesh_fillFromAnalytic()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic_1]
const double coords[4] = {0.,2.,4.,6.}; // 6. is not used
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> x = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> x = DataArrayDouble::New();
x->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> y = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> y = DataArrayDouble::New();
y->useExternalArrayWithRWAccess( coords, 2, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
mesh->setCoords(x,y);
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic_1]
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic_2]
const char func[] = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10";
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field =
- mesh->fillFromAnalytic( ParaMEDMEM::ON_CELLS, 3, func );
+ MCAuto<MEDCouplingFieldDouble> field =
+ mesh->fillFromAnalytic( MEDCoupling::ON_CELLS, 3, func );
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic_2]
//! [CppSnippet_MEDCouplingMesh_fillFromAnalytic_3]
double val1[3]; // a value (vector) of the cell #1
CPPUNIT_ASSERT( field->getNumberOfComponents() == 3 ); // 3 components in the field
field->getArray()->getTuple( 1, val1 );
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bc =
- mesh->getBarycenterAndOwner(); // func is applied to barycenters of cells
+ MCAuto<DataArrayDouble> bc =
+ mesh->computeCellCenterOfMass(); // func is applied to barycenters of cells
double bc1[2]; // coordinates of the second point
bc->getTuple( 1, bc1 );
//
void CppExample_MEDCouplingCMesh_getCoordsAt()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingCMesh_getCoordsAt_1]
const double coords[3] = {1.,2.,4.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> x = DataArrayDouble::New();
+ MCAuto<DataArrayDouble> x = DataArrayDouble::New();
x->useExternalArrayWithRWAccess( coords, 3, 1 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
+ MCAuto<MEDCouplingCMesh> mesh=MEDCouplingCMesh::New();
mesh->setCoordsAt(0,x);
const DataArrayDouble* x2=mesh->getCoordsAt(0);
CPPUNIT_ASSERT( x2->isEqual( *x, 1e-13 ));
void CppExample_MEDCouplingUMesh_areCellsIncludedIn()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh1=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh1=MEDCouplingUMesh::New();
mesh1->setMeshDimension(2);
mesh1->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh1->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // #3
mesh1->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // #4
mesh1->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
//! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_1]
//! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_2]
const int cells2[3] = { 4,2,0 }; // even cells selected
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh2 =
+ MCAuto<MEDCouplingUMesh> mesh2 =
(MEDCouplingUMesh*) mesh1->buildPartOfMySelf( cells2, cells2+3, true );
//! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_2]
//! [CppSnippet_MEDCouplingUMesh_areCellsIncludedIn_3]
void CppExample_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_1]
// 2D coordinates of 5 base nodes
const double coords[5*2]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2 };
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 5, 2 );
// coordinates of 5 top nodes
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr2 = coordsArr->deepCpy();
+ MCAuto<DataArrayDouble> coordsArr2 = coordsArr->deepCopy();
// 3D coordinates of base + top nodes
coordsArr = coordsArr-> changeNbOfComponents( 3, 0 );
coordsArr2 = coordsArr2->changeNbOfComponents( 3, 1 );
coordsArr = DataArrayDouble::Aggregate( coordsArr, coordsArr2 );
// mesh
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
mesh->setMeshDimension(3);
mesh->allocateCells(2);
mesh->finishInsertingCells();
//! [CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_1]
//! [CppSnippet_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells_2]
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fixedCells =
+ MCAuto<DataArrayInt> fixedCells =
mesh->findAndCorrectBadOriented3DExtrudedCells();
CPPUNIT_ASSERT( fixedCells->getNumberOfTuples() == 2 ); // 2 cells fixed
fixedCells = mesh->findAndCorrectBadOriented3DExtrudedCells();
void CppExample_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented_1]
// 2D coordinates of 5 base nodes
const double coords[5*2]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2 };
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 5, 2 );
// coordinates of 5 top nodes
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr2 = coordsArr->deepCpy();
+ MCAuto<DataArrayDouble> coordsArr2 = coordsArr->deepCopy();
// 3D coordinates of base + top nodes
coordsArr = coordsArr-> changeNbOfComponents( 3, 0 );
coordsArr2 = coordsArr2->changeNbOfComponents( 3, 1 );
coordsArr = DataArrayDouble::Aggregate( coordsArr, coordsArr2 );
// mesh
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
mesh->setMeshDimension(3);
mesh->allocateCells(2);
void CppExample_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_getCellsContainingPoints()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getCellsContainingPoints_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
0.3, 0.3, // point located somewhere inside the mesh
coords[2], coords[3]}; // point at the node #1
const double eps = 1e-4; // ball radius
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cells, cellsIndex;
+ MCAuto<DataArrayInt> cells, cellsIndex;
mesh->getCellsContainingPoints( pos, 3, eps, cells, cellsIndex );
const int cellsExpected[3]={4, 0, 1};
const int cellsIndexExpected[4]={0, 0, 1, 3};
void CppExample_MEDCouplingUMesh_getCellsContainingPoint()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getCellsContainingPoint_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_buildPartOrthogonalField()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
//! [CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_1]
//! [CppSnippet_MEDCouplingUMesh_buildPartOrthogonalField_2]
const int part[4] = {1,2,3,4}; // cell #0 is omitted
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vecField=
+ MCAuto<MEDCouplingFieldDouble> vecField=
mesh->buildPartOrthogonalField( part, part+4 );
CPPUNIT_ASSERT ( vecField->getArray()->getNumberOfTuples() == 4 );
CPPUNIT_ASSERT ( vecField->getArray()->getNumberOfComponents() == 3 );
void CppExample_MEDCouplingUMesh_getPartMeasureField()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,2,4, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
//! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_2]
const bool isAbs = true;
const int part[4] = {1,2,3,4}; // cell #0 is omitted
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> areaArr=
+ MCAuto<DataArrayDouble> areaArr=
mesh->getPartMeasureField( isAbs, part, part+4 );
CPPUNIT_ASSERT( areaArr->getIJ(0,0) > 0 ); // orientation ignored
areaArr=mesh->getPartMeasureField( !isAbs, part, part+4 );
//! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_2]
//! [CppSnippet_MEDCouplingUMesh_getPartMeasureField_3]
const int cellIds[4] = {1,2,3,4}; // cell #0 is omitted
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> baryCenters=
+ MCAuto<DataArrayDouble> baryCenters=
mesh->getPartBarycenterAndOwner( cellIds, cellIds+4 );
CPPUNIT_ASSERT( baryCenters->getNumberOfTuples() == 4 );
CPPUNIT_ASSERT( baryCenters->getNumberOfComponents() == mesh->getSpaceDimension() );
void CppExample_MEDCouplingUMesh_getCellsInBoundingBox()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(1);
const double coords[3*2]={0.,0., 0.,1., 1.,1};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 3,2);
mesh->setCoords(coordsArr);
mesh->allocateCells(1);
//! [CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_1]
//! [CppSnippet_MEDCouplingUMesh_getCellsInBoundingBox_2]
const double bbox[] = {1., 1., 1.001,1.001}; // xMin, xMax, yMin, yMax
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsArr =
+ MCAuto<DataArrayInt> cellIdsArr =
mesh->getCellsInBoundingBox( bbox, 0.0 );
CPPUNIT_ASSERT( cellIdsArr->getNumberOfTuples() == 0 );
cellIdsArr = mesh->getCellsInBoundingBox( bbox, 0.1 );
void CppExample_MEDCouplingUMesh_renumberNodesInConn()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_renumberNodesInConn_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(1);
const int conn[4]={4,3,2,1};
void CppExample_MEDCouplingUMesh_renumberNodes()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_renumberNodes_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
const double coords[4*2]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.3};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 4,2);
mesh->setCoords(coordsArr);
mesh->allocateCells(0);
mesh->renumberNodes(newIds, 3);
coordsArr = mesh->getCoordinatesAndOwner(); // get a shorten array
const double coordsExpected[3*2]={0.7,-0.3, 0.2,-0.3, -0.3,-0.3};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsExpectedArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsExpectedArr=DataArrayDouble::New();
coordsExpectedArr->useExternalArrayWithRWAccess(coordsExpected, 3,2);
CPPUNIT_ASSERT( coordsExpectedArr->isEqual( *coordsArr, 1e-13 ));
//! [CppSnippet_MEDCouplingUMesh_renumberNodes_2]
//! [CppSnippet_MEDCouplingUMesh_renumberNodes_3]
coordsArr->useExternalArrayWithRWAccess(coords, 4,2); // restore old nodes
const int newIds2[] = { 2,1,0,2 };
- mesh->renumberNodes2(newIds2, 3);
+ mesh->renumberNodesCenter(newIds2, 3);
coordsArr = mesh->getCoordinatesAndOwner(); // get a shorten array
const double coordsExpected2[3*2]={0.7,-0.3, 0.2,-0.3, -0.3, 0.0};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsExpectedArr2=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsExpectedArr2=DataArrayDouble::New();
coordsExpectedArr2->useExternalArrayWithRWAccess(coordsExpected2, 3,2);
CPPUNIT_ASSERT( coordsExpectedArr2->isEqual( *coordsArr, 1e-13 ));
//! [CppSnippet_MEDCouplingUMesh_renumberNodes_3]
void CppExample_MEDCouplingUMesh_findBoundaryNodes()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_findBoundaryNodes_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingUMesh_findBoundaryNodes_1]
//! [CppSnippet_MEDCouplingUMesh_findBoundaryNodes_2]
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodeIdsArr=mesh->findBoundaryNodes();
+ MCAuto<DataArrayInt> nodeIdsArr=mesh->findBoundaryNodes();
CPPUNIT_ASSERT( nodeIdsArr->getNumberOfTuples() == mesh->getNumberOfNodes() - 1 );
//! [CppSnippet_MEDCouplingUMesh_findBoundaryNodes_2]
}
void CppExample_MEDCouplingUMesh_buildBoundaryMesh()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_1]
//! [CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_2]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> mesh1=mesh->buildBoundaryMesh(true);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> mesh2=mesh->buildBoundaryMesh(false);
+ MCAuto<MEDCouplingPointSet> mesh1=mesh->buildBoundaryMesh(true);
+ MCAuto<MEDCouplingPointSet> mesh2=mesh->buildBoundaryMesh(false);
CPPUNIT_ASSERT( coordsArr->isEqual( *mesh1->getCoords(), 1e-13 )); // same nodes
CPPUNIT_ASSERT( !coordsArr->isEqual( *mesh2->getCoords(), 1e-13 )); // different nodes
//! [CppSnippet_MEDCouplingUMesh_buildBoundaryMesh_2]
void CppExample_MEDCouplingUMesh_buildFacePartOfMySelfNode()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
std::vector<int> nodes;
mesh->getNodeIdsOfCell( 0, nodes );
const bool allNodes = true;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh1 =
+ MCAuto<MEDCouplingUMesh> mesh1 =
(MEDCouplingUMesh*)mesh->buildFacePartOfMySelfNode( &nodes[0],&nodes[0]+nodes.size(),allNodes);
CPPUNIT_ASSERT( mesh1->getNumberOfCells() == 4 ); // 4 segments bounding QUAD4 #0 only
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh2 =
+ MCAuto<MEDCouplingUMesh> mesh2 =
(MEDCouplingUMesh*)mesh->buildFacePartOfMySelfNode( &nodes[0],&nodes[0]+nodes.size(),!allNodes);
CPPUNIT_ASSERT( mesh2->getNumberOfCells() == 9 ); // more segments added
//! [CppSnippet_MEDCouplingUMesh_buildFacePartOfMySelfNode_2]
void CppExample_MEDCouplingUMesh_buildPartOfMySelfNode()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_buildPartOfMySelfNode_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
std::vector<int> nodes;
mesh->getNodeIdsOfCell( 0, nodes );
const bool allNodes = true;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh1 =
+ MCAuto<MEDCouplingUMesh> mesh1 =
(MEDCouplingUMesh*)mesh->buildPartOfMySelfNode( &nodes[0], &nodes[0]+nodes.size(), allNodes);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh2 =
+ MCAuto<MEDCouplingUMesh> mesh2 =
(MEDCouplingUMesh*)mesh->buildPartOfMySelfNode( &nodes[0], &nodes[0]+nodes.size(),!allNodes);
CPPUNIT_ASSERT_EQUAL( mesh1->getNumberOfCells(), 1 );
CPPUNIT_ASSERT_EQUAL( mesh2->getNumberOfCells(), mesh->getNumberOfCells() );
void CppExample_MEDCouplingUMesh_getCellIdsLyingOnNodes()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getCellIdsLyingOnNodes_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getCellIdsFullyIncludedInNodeIds_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_buildPartOfMySelf()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_buildPartOfMySelf_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_mergeNodes()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_mergeNodes_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2};
1.1,0.0, // #3
1.1,0.0, // #4 == #3
0.3,-0.303}; // #5 ~~ #0
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(6,2);
std::copy(coords,coords+6*2,coordsArr->getPointer());
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingUMesh_mergeNodes_1]
//! [CppSnippet_MEDCouplingUMesh_mergeNodes_2]
bool areNodesMerged; int newNbOfNodes;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=
+ MCAuto<DataArrayInt> arr=
mesh->mergeNodes(0.004,areNodesMerged,newNbOfNodes);
const int idsExpected[6] = {0, 1, 0, 2, 2, 0};
CPPUNIT_ASSERT(std::equal(idsExpected,idsExpected+6,arr->getPointer()));
coordsArr->alloc(6,2);
std::copy(coords,coords+6*2,coordsArr->getPointer());
mesh->setCoords(coordsArr);
- // call mergeNodes2()
- arr = mesh->mergeNodes2(0.004,areNodesMerged,newNbOfNodes);
+ // call mergeNodesCenter()
+ arr = mesh->mergeNodesCenter(0.004,areNodesMerged,newNbOfNodes);
coordsArr=mesh->getCoordinatesAndOwner(); // retrieve a new shorten coord array
CPPUNIT_ASSERT_DOUBLES_EQUAL( baryCoords2[1], coordsArr->getIJ(0,1), 13 ); // Y of node #0 equals to that of baryCoords2
//! [CppSnippet_MEDCouplingUMesh_mergeNodes_3]
void CppExample_MEDCouplingUMesh_zipConnectivityTraducer()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_zipConnectivityTraducer_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[11]={0,3,4,1, 1,4,2, 4,1,0,3};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+0); // 3 == 0
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+7); // 4 ~~ 0
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_zipCoordsTraducer()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_zipCoordsTraducer_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_getNodeIdsInUse()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getNodeIdsInUse_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14);
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_convertToPolyTypes()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_convertToPolyTypes_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_buildDescendingConnectivity2()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity2_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_buildDescendingConnectivity()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_buildDescendingConnectivity_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_getReverseNodalConnectivity()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_getReverseNodalConnectivity_1]
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(2);
mesh->allocateCells(5);
const int conn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+10); // 3
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+14); // 4
mesh->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->alloc(9,2);
const double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 };
std::copy(coords,coords+18,coordsArr->getPointer());
void CppExample_MEDCouplingUMesh_checkDeepEquivalWith()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_1]
// mesh 1
MEDCouplingUMesh *mesh1=MEDCouplingUMesh::New();
0.0,1.0}; // #3
{
mesh1->setMeshDimension(2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords, 4, 2 );
mesh1->setCoords(coordsArr);
mesh1->allocateCells(2);
1.0,1.001}; // #3 ~ #2
{
mesh2->setMeshDimension(2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess( coords2, 4, 2 );
mesh2->setCoords(coordsArr);
mesh2->allocateCells(2);
void CppExample_MEDCouplingPointSet_scale()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_scale_1]
double coords[4*2]={0.0,0.0, 1.0,0.0, 1.0,1.0, 0.0,1.0}; // 2D coordinates of 4 nodes
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 4,2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
- DataArrayDouble *initCoords = coordsArr->deepCpy();
+ DataArrayDouble *initCoords = coordsArr->deepCopy();
//! [CppSnippet_MEDCouplingPointSet_scale_1]
//! [CppSnippet_MEDCouplingPointSet_scale_2]
const double center[2] = {0.,0.};
void CppExample_MEDCouplingPointSet_translate()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_translate_1]
double coords[4*2]={0.0,0.0, 1.0,0.0, 1.0,1.0, 0.0,1.0}; // 2D coordinates of 4 nodes
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 4,2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
- DataArrayDouble *initCoords = coordsArr->deepCpy();
+ DataArrayDouble *initCoords = coordsArr->deepCopy();
//! [CppSnippet_MEDCouplingPointSet_translate_1]
//! [CppSnippet_MEDCouplingPointSet_translate_2]
double vector[2] = {1.,1.};
void CppExample_MEDCouplingPointSet_rotate()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_rotate_1]
double coords[4*2]={0.0,0.0, 0.1,0.0, 0.1,0.1, 0.0,0.1}; // 2D coordinates of 4 nodes
double coordsOrig[4*2];
std::copy(coords,coords+sizeof(coords)/sizeof(double),coordsOrig);//keep tracks of initial values
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 4,2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingPointSet_rotate_1]
//! [CppSnippet_MEDCouplingPointSet_rotate_2]
void CppExample_MEDCouplingPointSet_getBoundingBox()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_getBoundingBox_1]
double cc[2*3]={0.0, 0.1, 0.2, // 3D coordinates of 2 nodes
2.0, 2.1, 2.2};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(cc, 2,3);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingPointSet_getBoundingBox_1]
//! [CppSnippet_MEDCouplingPointSet_getBoundingBox_2]
void CppExample_MEDCouplingPointSet_getNodeIdsNearPoint()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_1]
// 2D coordinates of 5 nodes
double coords[5*2]={0.3,-0.30001, // #0
0.3,-0.30002, // #2
1.1,0.0, // #3
0.3,-0.30003};// #4
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 5,2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_1]
//! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoint_2]
// check found ids
const int expectedIDs[3] = {0,2,4};
- DataArrayInt * okIDs = ids->getIdsEqualList ( expectedIDs, expectedIDs+3 );
+ DataArrayInt * okIDs = ids->findIdsEqualList ( expectedIDs, expectedIDs+3 );
CPPUNIT_ASSERT_EQUAL(3, okIDs->getNumberOfTuples());
// release data
}
void CppExample_MEDCouplingPointSet_getNodeIdsNearPoints()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_1]
// 2D coordinates of 7 nodes
double coords[7*2]={0.3,-0.301, // #0
1.1,0.0, // #4
1.1,0.002, // #5
0.3,-0.303};// #6
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 7,2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_1]
//! [CppSnippet_MEDCouplingPointSet_getNodeIdsNearPoints_2]
// check found ids (i.e. contents of 'ids' array)
const int expectedIDs[4] = {1, 3, 4, 5};
- DataArrayInt * okIDs = ids->getIdsEqualList ( expectedIDs, expectedIDs+4 );
+ DataArrayInt * okIDs = ids->findIdsEqualList ( expectedIDs, expectedIDs+4 );
CPPUNIT_ASSERT_EQUAL(4, okIDs->getNumberOfTuples());
// release data
void CppExample_MEDCouplingPointSet_findCommonNodes()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_findCommonNodes_1]
double coords[6*2]={0.3,-0.301, // 0
0.2,-0.3, // 1
1.1,0.0, // 3
1.1,0.0, // 4
0.3,-0.303};// 5
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 6,2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingPointSet_findCommonNodes_1]
//! [CppSnippet_MEDCouplingPointSet_findCommonNodes_2]
void CppExample_MEDCouplingPointSet_getCoordinatesOfNode()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_1]
double coords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3};
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsArr=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> coordsArr=DataArrayDouble::New();
coordsArr->useExternalArrayWithRWAccess(coords, 3,2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> mesh=MEDCouplingUMesh::New();
mesh->setCoords(coordsArr);
//! [CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_1]
//! [CppSnippet_MEDCouplingPointSet_getCoordinatesOfNode_2]
void CppExample_DataArrayInt_buildPermutationArr()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_DataArrayInt_buildPermutationArr_1]
DataArrayInt *a=DataArrayInt::New();
const int vala[5]={4,5,6,7,8};
void CppExample_DataArrayInt_invertArrayO2N2N2O()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_DataArrayInt_invertArrayO2N2N2O_1]
const int arr1[6]={2,0,4,1,5,3};
DataArrayInt *da=DataArrayInt::New();
void CppExample_DataArrayInt_invertArrayN2O2O2N()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_DataArrayInt_invertArrayN2O2O2N_1]
const int arr1[6]={2,0,4,1,5,3};
DataArrayInt *da=DataArrayInt::New();
void CppExample_DataArrayDouble_getIdsInRange()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_DataArrayDouble_getIdsInRange_1]
DataArrayDouble *da=DataArrayDouble::New();
da->alloc(10,1);
da->iota();
- DataArrayInt* da2 = da->getIdsInRange( 2.5, 6 );
+ DataArrayInt* da2 = da->findIdsInRange( 2.5, 6 );
//! [CppSnippet_DataArrayDouble_getIdsInRange_1]
da->decrRef();
da2->decrRef();
void CppExample_DataArrayDouble_findCommonTuples()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_DataArrayDouble_findCommonTuples1]
DataArrayDouble *da=DataArrayDouble::New();
da->alloc(6,2);
void CppExample_DataArrayDouble_Meld1()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_DataArrayDouble_Meld1_1]
const int sameNbTuples = 7;
void CppExample_DataArrayInt_Meld1()
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//! [CppSnippet_DataArrayInt_Meld1_1]
const int sameNbTuples = 7;
void CppExampleFieldDoubleBuildSubPart1()
{
//! [CppSnippetFieldDoubleBuildSubPart1_1]
- ParaMEDMEM::MEDCouplingUMesh *mesh1=ParaMEDMEM::MEDCouplingBasicsTest::build2DTargetMesh_1();
- ParaMEDMEM::MEDCouplingFieldDouble *f1=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingUMesh *mesh1=MEDCoupling::MEDCouplingBasicsTest::build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingFieldDouble *f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f1->setTime(2.3,5,6);
f1->setMesh(mesh1);
- ParaMEDMEM::DataArrayDouble *array=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
array->alloc(mesh1->getNumberOfCells(),2);
const double arr1[10]={3.,103.,4.,104.,5.,105.,6.,106.,7.,107.};
std::copy(arr1,arr1+10,array->getPointer());
//! [CppSnippetFieldDoubleBuildSubPart1_1]
//! [CppSnippetFieldDoubleBuildSubPart1_2]
const int part1[3]={2,1,4};
- ParaMEDMEM::MEDCouplingFieldDouble *f2=f1->buildSubPart(part1,part1+3);
+ MEDCoupling::MEDCouplingFieldDouble *f2=f1->buildSubPart(part1,part1+3);
//! [CppSnippetFieldDoubleBuildSubPart1_2]
f2->zipCoords();
CPPUNIT_ASSERT_EQUAL(3,f2->getMesh()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(6,f2->getMesh()->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
- ParaMEDMEM::MEDCouplingUMesh *m2C=dynamic_cast<ParaMEDMEM::MEDCouplingUMesh *>(const_cast<ParaMEDMEM::MEDCouplingMesh *>(f2->getMesh()));
- CPPUNIT_ASSERT_EQUAL(13,m2C->getMeshLength());
+ MEDCoupling::MEDCouplingUMesh *m2C=dynamic_cast<MEDCoupling::MEDCouplingUMesh *>(const_cast<MEDCoupling::MEDCouplingMesh *>(f2->getMesh()));
+ CPPUNIT_ASSERT_EQUAL(13,m2C->getNodalConnectivityArrayLen());
const double expected2[12]={0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7};
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
f2->decrRef();
f1->decrRef();
//! [CppSnippetFieldDoubleBuildSubPart1_3]
- f1=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES,ParaMEDMEM::ONE_TIME);
+ f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::ONE_TIME);
f1->setTime(2.3,5,6);
f1->setMesh(mesh1);
- array=ParaMEDMEM::DataArrayDouble::New();
+ array=MEDCoupling::DataArrayDouble::New();
array->alloc(mesh1->getNumberOfNodes(),2);
const double arr2[18]={3.,103.,4.,104.,5.,105.,6.,106.,7.,107.,8.,108.,9.,109.,10.,110.,11.,111.};
std::copy(arr2,arr2+18,array->getPointer());
f2->decrRef();
//idem previous because nodes of cell#4 are not fully present in part3
const int part3[2]={1,2};
- ParaMEDMEM::DataArrayInt *arrr=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt *arrr=MEDCoupling::DataArrayInt::New();
arrr->alloc(2,1);
std::copy(part3,part3+2,arrr->getPointer());
f2=f1->buildSubPart(arrr);
int nodalConnPerCell[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4};
//! [CppSnippetUMeshStdBuild1_1]
//! [CppSnippetUMeshStdBuild1_2]
- ParaMEDMEM::MEDCouplingUMesh *mesh=ParaMEDMEM::MEDCouplingUMesh::New("My2DMesh",2);
+ MEDCoupling::MEDCouplingUMesh *mesh=MEDCoupling::MEDCouplingUMesh::New("My2DMesh",2);
//! [CppSnippetUMeshStdBuild1_2]
//! [CppSnippetUMeshStdBuild1_3]
mesh->allocateCells(5);//You can put more than 5 if you want but not less.
mesh->finishInsertingCells();
//! [CppSnippetUMeshStdBuild1_3]
//! [CppSnippetUMeshStdBuild1_4]
- ParaMEDMEM::DataArrayDouble *coordsArr=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *coordsArr=MEDCoupling::DataArrayDouble::New();
coordsArr->alloc(9,3);//here coordsArr are declared to have 3 components, mesh will deduce that its spaceDim==3.
std::copy(coords,coords+27,coordsArr->getPointer());
mesh->setCoords(coordsArr);//coordsArr contains 9 tuples, that is to say mesh contains 9 nodes.
coordsArr->decrRef();
//! [CppSnippetUMeshStdBuild1_4]
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//! [CppSnippetUMeshStdBuild1_5]
mesh->decrRef();
//! [CppSnippetUMeshStdBuild1_5]
//! [CppSnippetCMeshStdBuild1_1]
double XCoords[9]={-0.3,0.,0.1,0.3,0.45,0.47,0.49,1.,1.22};
double YCoords[7]={0.,0.1,0.37,0.45,0.47,0.49,1.007};
- ParaMEDMEM::DataArrayDouble *arrX=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *arrX=MEDCoupling::DataArrayDouble::New();
arrX->alloc(9,1);
std::copy(XCoords,XCoords+9,arrX->getPointer());
arrX->setInfoOnComponent(0,"X [m]");
- ParaMEDMEM::DataArrayDouble *arrY=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *arrY=MEDCoupling::DataArrayDouble::New();
arrY->alloc(7,1);
std::copy(YCoords,YCoords+7,arrY->getPointer());
arrY->setInfoOnComponent(0,"Y [m]");
//! [CppSnippetCMeshStdBuild1_1]
//! [CppSnippetCMeshStdBuild1_2]
- ParaMEDMEM::MEDCouplingCMesh *mesh=ParaMEDMEM::MEDCouplingCMesh::New("My2D_CMesh");
+ MEDCoupling::MEDCouplingCMesh *mesh=MEDCoupling::MEDCouplingCMesh::New("My2D_CMesh");
mesh->setCoords(arrX,arrY);
arrX->decrRef();
arrY->decrRef();
CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension());
//! [CppSnippetCMeshStdBuild1_3]
mesh->decrRef();
- mesh=ParaMEDMEM::MEDCouplingCMesh::New("My2D_CMesh");
- arrX=ParaMEDMEM::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
- arrY=ParaMEDMEM::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
+ mesh=MEDCoupling::MEDCouplingCMesh::New("My2D_CMesh");
+ arrX=MEDCoupling::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
+ arrY=MEDCoupling::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
//! [CppSnippetCMeshStdBuild1_2bis]
mesh->setCoordsAt(0,arrX);
arrX->decrRef();
int nodalConnPerCellIndex[6]={0,5,9,13,18,23};
//! [CppSnippetUMeshAdvBuild1_1]
//! [CppSnippetUMeshAdvBuild1_2]
- ParaMEDMEM::MEDCouplingUMesh *mesh=ParaMEDMEM::MEDCouplingUMesh::New("My2DMesh",2);
+ MEDCoupling::MEDCouplingUMesh *mesh=MEDCoupling::MEDCouplingUMesh::New("My2DMesh",2);
//! [CppSnippetUMeshAdvBuild1_2]
//! [CppSnippetUMeshAdvBuild1_3]
- ParaMEDMEM::DataArrayInt *nodalConn=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt *nodalConn=MEDCoupling::DataArrayInt::New();
nodalConn->alloc(23,1);
std::copy(nodalConnPerCell,nodalConnPerCell+23,nodalConn->getPointer());
- ParaMEDMEM::DataArrayInt *nodalConnI=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt *nodalConnI=MEDCoupling::DataArrayInt::New();
nodalConnI->alloc(6,1);
std::copy(nodalConnPerCellIndex,nodalConnPerCellIndex+6,nodalConnI->getPointer());
mesh->setConnectivity(nodalConn,nodalConnI,true);
nodalConnI->decrRef();// nodalConnI DataArrayInt instance is owned by mesh after call to setConnectivity method. No more need here -> decrRef()
//! [CppSnippetUMeshAdvBuild1_3]
//! [CppSnippetUMeshAdvBuild1_4]
- ParaMEDMEM::DataArrayDouble *coordsArr=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *coordsArr=MEDCoupling::DataArrayDouble::New();
coordsArr->alloc(9,3);//here coordsArr are declared to have 3 components, mesh will deduce that its spaceDim==3.
std::copy(coords,coords+27,coordsArr->getPointer());
mesh->setCoords(coordsArr);//coordsArr contains 9 tuples, that is to say mesh contains 9 nodes.
coordsArr->decrRef();
//! [CppSnippetUMeshAdvBuild1_4]
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//! [CppSnippetUMeshAdvBuild1_5]
mesh->decrRef();
//! [CppSnippetUMeshAdvBuild1_5]
const int nbOfNodes=12;
double coords[3*nbOfNodes]={2.,3.,4.,3.,4.,5.,4.,5.,6.,5.,6.,7.,6.,7.,8.,7.,8.,9.,8.,9.,10.,9.,10.,11.,10.,11.,12.,11.,12.,13.,12.,13.,14.,13.,14.,15.};
//
- ParaMEDMEM::DataArrayDouble *coordsArr=0;
+ MEDCoupling::DataArrayDouble *coordsArr=0;
double *tmp=0;
//! [CppSnippetDataArrayBuild1_0]
//
//! [CppSnippetDataArrayBuild1_1]
- coordsArr=ParaMEDMEM::DataArrayDouble::New();
- coordsArr->useArray(coords,false,ParaMEDMEM::CPP_DEALLOC,nbOfNodes,3);
+ coordsArr=MEDCoupling::DataArrayDouble::New();
+ coordsArr->useArray(coords,false,MEDCoupling::CPP_DEALLOC,nbOfNodes,3);
//now use coordsArr as you need
//...
//coordsArr is no more useful here : release it
coordsArr->decrRef();
//! [CppSnippetDataArrayBuild1_1]
//! [CppSnippetDataArrayBuild1_2]
- coordsArr=ParaMEDMEM::DataArrayDouble::New();
+ coordsArr=MEDCoupling::DataArrayDouble::New();
tmp=new double[3*nbOfNodes];
std::copy(coords,coords+3*nbOfNodes,tmp);
- coordsArr->useArray(tmp,true,ParaMEDMEM::CPP_DEALLOC,nbOfNodes,3);
+ coordsArr->useArray(tmp,true,MEDCoupling::CPP_DEALLOC,nbOfNodes,3);
//now use coordsArr as you need
//...
//coordsArr is no more useful, release it
coordsArr->decrRef();
//! [CppSnippetDataArrayBuild1_2]
//! [CppSnippetDataArrayBuild1_3]
- coordsArr=ParaMEDMEM::DataArrayDouble::New();
+ coordsArr=MEDCoupling::DataArrayDouble::New();
tmp=(double *)malloc(3*nbOfNodes*sizeof(double));
std::copy(coords,coords+3*nbOfNodes,tmp);
- coordsArr->useArray(tmp,true,ParaMEDMEM::C_DEALLOC,nbOfNodes,3);
+ coordsArr->useArray(tmp,true,MEDCoupling::C_DEALLOC,nbOfNodes,3);
//now use coordsArr as you need
//...
//coordsArr is no more useful here : release it
coordsArr->decrRef();
//! [CppSnippetDataArrayBuild1_3]
//! [CppSnippetDataArrayBuild1_4]
- coordsArr=ParaMEDMEM::DataArrayDouble::New();
+ coordsArr=MEDCoupling::DataArrayDouble::New();
coordsArr->alloc(nbOfNodes,3);
tmp=coordsArr->getPointer();
std::copy(coords,coords+3*nbOfNodes,tmp);
//coordsArr is no more useful here : release it
coordsArr->decrRef();
//! [CppSnippetDataArrayBuild1_4]
- coordsArr=ParaMEDMEM::DataArrayDouble::New();
+ coordsArr=MEDCoupling::DataArrayDouble::New();
coordsArr->alloc(nbOfNodes,3);
tmp=coordsArr->getPointer();
std::copy(coords,coords+3*nbOfNodes,tmp);
- ParaMEDMEM::DataArrayDouble *coordsArrCpy=0;
+ MEDCoupling::DataArrayDouble *coordsArrCpy=0;
//! [CppSnippetDataArrayBuild1_5]
- coordsArrCpy=coordsArr->deepCpy();
+ coordsArrCpy=coordsArr->deepCopy();
//! [CppSnippetDataArrayBuild1_5]
//! [CppSnippetDataArrayBuild1_6]
CPPUNIT_ASSERT(coordsArrCpy->isEqual(*coordsArr,1e-12));
coordsArrCpy->decrRef();
//! [CppSnippetDataArrayBuild1_7]
//! [CppSnippetDataArrayBuild1_5bis]
- coordsArrCpy=coordsArr->performCpy(true);
+ coordsArrCpy=coordsArr->performCopyOrIncrRef(true);
//! [CppSnippetDataArrayBuild1_5bis]
CPPUNIT_ASSERT(coordsArrCpy->isEqual(*coordsArr,1e-12));
coordsArrCpy->setIJ(0,0,1000.);
CPPUNIT_ASSERT(!coordsArrCpy->isEqual(*coordsArr,1e-12));//coordsArrCpy only has been modified
coordsArrCpy->decrRef();
//! [CppSnippetDataArrayBuild1_8]
- coordsArrCpy=coordsArr->performCpy(false);
+ coordsArrCpy=coordsArr->performCopyOrIncrRef(false);
//! [CppSnippetDataArrayBuild1_8]
//! [CppSnippetDataArrayBuild1_9]
CPPUNIT_ASSERT(coordsArrCpy->isEqual(*coordsArr,1e-12));
coordsArrCpy->decrRef();
//! [CppSnippetDataArrayBuild1_10]
//! [CppSnippetDataArrayBuild1_11]
- coordsArrCpy=ParaMEDMEM::DataArrayDouble::New();
+ coordsArrCpy=MEDCoupling::DataArrayDouble::New();
//! [CppSnippetDataArrayBuild1_11]
//! [CppSnippetDataArrayBuild1_12]
- coordsArrCpy->cpyFrom(*coordsArr);
+ coordsArrCpy->deepCopyFrom(*coordsArr);
//! [CppSnippetDataArrayBuild1_12]
//! [CppSnippetDataArrayBuild1_13]
CPPUNIT_ASSERT(coordsArrCpy->isEqual(*coordsArr,1e-12));
{
double XCoords[9]={-0.3,0.07,0.1,0.3,0.45,0.47,0.49,1.,1.22};
double YCoords[7]={0.07,0.1,0.37,0.45,0.47,0.49,1.007};
- ParaMEDMEM::DataArrayDouble *arrX=ParaMEDMEM::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
- ParaMEDMEM::DataArrayDouble *arrY=ParaMEDMEM::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
- ParaMEDMEM::MEDCouplingCMesh *mesh=ParaMEDMEM::MEDCouplingCMesh::New("My2D_CMesh");
+ MEDCoupling::DataArrayDouble *arrX=MEDCoupling::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
+ MEDCoupling::DataArrayDouble *arrY=MEDCoupling::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
+ MEDCoupling::MEDCouplingCMesh *mesh=MEDCoupling::MEDCouplingCMesh::New("My2D_CMesh");
mesh->setCoords(arrX,arrY); arrX->decrRef(); arrY->decrRef();
//! [CppSnippetFieldDoubleBuild1_1]
- ParaMEDMEM::MEDCouplingFieldDouble* fieldOnCells=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME);
+ MEDCoupling::MEDCouplingFieldDouble* fieldOnCells=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
fieldOnCells->setName("MyTensorFieldOnCellNoTime");
fieldOnCells->setMesh(mesh);
mesh->decrRef(); // no more need of mesh because mesh has been attached to fieldOnCells
- ParaMEDMEM::DataArrayDouble *array=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
array->alloc(fieldOnCells->getMesh()->getNumberOfCells(),9);//Implicitely fieldOnCells will be a 9 components field.
array->fillWithValue(7.);
fieldOnCells->setArray(array);
// fieldOnCells is no more useful here : release it
fieldOnCells->decrRef();
//! [CppSnippetFieldDoubleBuild1_1]
- arrX=ParaMEDMEM::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
- arrY=ParaMEDMEM::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
- mesh=ParaMEDMEM::MEDCouplingCMesh::New("My2D_CMesh");
+ arrX=MEDCoupling::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
+ arrY=MEDCoupling::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
+ mesh=MEDCoupling::MEDCouplingCMesh::New("My2D_CMesh");
mesh->setCoords(arrX,arrY); arrX->decrRef(); arrY->decrRef();
//! [CppSnippetFieldDoubleBuild1_2]
- ParaMEDMEM::MEDCouplingFieldDouble *f1=mesh->fillFromAnalytic(ParaMEDMEM::ON_CELLS,1,"x*x+y*y*3+2.*x");//f1 is scalar
- ParaMEDMEM::MEDCouplingFieldDouble *f2=mesh->fillFromAnalytic(ParaMEDMEM::ON_CELLS,1,"cos(x+y/x)");//f2 is scalar too
- ParaMEDMEM::MEDCouplingFieldDouble *f2bis=mesh->fillFromAnalytic(ParaMEDMEM::ON_CELLS,2,"x*x*IVec+3*y*JVec");//f2bis is a vectors field
- ParaMEDMEM::MEDCouplingFieldDouble *f3=(*f1)+(*f2);//f3 scalar
- ParaMEDMEM::MEDCouplingFieldDouble *f4=(*f3)/(*f2);//f4 scalar
+ MEDCoupling::MEDCouplingFieldDouble *f1=mesh->fillFromAnalytic(MEDCoupling::ON_CELLS,1,"x*x+y*y*3+2.*x");//f1 is scalar
+ MEDCoupling::MEDCouplingFieldDouble *f2=mesh->fillFromAnalytic(MEDCoupling::ON_CELLS,1,"cos(x+y/x)");//f2 is scalar too
+ MEDCoupling::MEDCouplingFieldDouble *f2bis=mesh->fillFromAnalytic(MEDCoupling::ON_CELLS,2,"x*x*IVec+3*y*JVec");//f2bis is a vectors field
+ MEDCoupling::MEDCouplingFieldDouble *f3=(*f1)+(*f2);//f3 scalar
+ MEDCoupling::MEDCouplingFieldDouble *f4=(*f3)/(*f2);//f4 scalar
f2bis->applyFunc(1,"sqrt(x*x+y*y)");//f2bis becomes scalar
- ParaMEDMEM::MEDCouplingFieldDouble *f5=(*f2bis)*(*f4);//f5 scalar
+ MEDCoupling::MEDCouplingFieldDouble *f5=(*f2bis)*(*f4);//f5 scalar
const double pos1[2]={0.48,0.38};
double res;
f4->getValueOn(pos1,&res);//f4 is scalar so the returned value is of size 1.
{
double XCoords[9]={-0.3,0.,0.1,0.3,0.45,0.47,0.49,1.,1.22};
double YCoords[7]={0.,0.1,0.37,0.45,0.47,0.49,1.007};
- ParaMEDMEM::DataArrayDouble *arrX=ParaMEDMEM::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
- ParaMEDMEM::DataArrayDouble *arrY=ParaMEDMEM::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
- ParaMEDMEM::MEDCouplingCMesh *mesh=ParaMEDMEM::MEDCouplingCMesh::New("My2D_CMesh");
+ MEDCoupling::DataArrayDouble *arrX=MEDCoupling::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
+ MEDCoupling::DataArrayDouble *arrY=MEDCoupling::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
+ MEDCoupling::MEDCouplingCMesh *mesh=MEDCoupling::MEDCouplingCMesh::New("My2D_CMesh");
mesh->setCoords(arrX,arrY); arrX->decrRef(); arrY->decrRef();
//! [CppSnippetFieldDoubleBuild2_1]
- ParaMEDMEM::MEDCouplingFieldDouble* fieldOnNodes=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES,ParaMEDMEM::NO_TIME);
+ MEDCoupling::MEDCouplingFieldDouble* fieldOnNodes=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::NO_TIME);
fieldOnNodes->setName("MyScalarFieldOnNodeNoTime");
fieldOnNodes->setMesh(mesh);
mesh->decrRef(); // no more need of mesh because mesh has been attached to fieldOnNodes
- ParaMEDMEM::DataArrayDouble *array=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
array->alloc(fieldOnNodes->getMesh()->getNumberOfNodes(),1);//Implicitely fieldOnNodes will be a 1 component field.
array->fillWithValue(8.);
fieldOnNodes->setArray(array);
{
double XCoords[9]={-0.3,0.,0.1,0.3,0.45,0.47,0.49,1.,1.22};
double YCoords[7]={0.,0.1,0.37,0.45,0.47,0.49,1.007};
- ParaMEDMEM::DataArrayDouble *arrX=ParaMEDMEM::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
- ParaMEDMEM::DataArrayDouble *arrY=ParaMEDMEM::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
- ParaMEDMEM::MEDCouplingCMesh *mesh=ParaMEDMEM::MEDCouplingCMesh::New("My2D_CMesh");
+ MEDCoupling::DataArrayDouble *arrX=MEDCoupling::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
+ MEDCoupling::DataArrayDouble *arrY=MEDCoupling::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
+ MEDCoupling::MEDCouplingCMesh *mesh=MEDCoupling::MEDCouplingCMesh::New("My2D_CMesh");
mesh->setCoords(arrX,arrY); arrX->decrRef(); arrY->decrRef();
//! [CppSnippetFieldDoubleBuild3_1]
- ParaMEDMEM::MEDCouplingFieldDouble* fieldOnCells=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble* fieldOnCells=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
fieldOnCells->setName("MyTensorFieldOnCellNoTime");
fieldOnCells->setTimeUnit("ms"); // Time unit is ms.
fieldOnCells->setTime(4.22,2,-1); // Time attached is 4.22 ms, iteration id is 2 and order id (or sub iteration id) is -1
fieldOnCells->setMesh(mesh);
mesh->decrRef(); // no more need of mesh because mesh has been attached to fieldOnCells
- ParaMEDMEM::DataArrayDouble *array=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
array->alloc(fieldOnCells->getMesh()->getNumberOfCells(),2);//Implicitely fieldOnCells will be a 2 components field.
array->fillWithValue(7.);
fieldOnCells->setArray(array);
{
double XCoords[9]={-0.3,0.,0.1,0.3,0.45,0.47,0.49,1.,1.22};
double YCoords[7]={0.,0.1,0.37,0.45,0.47,0.49,1.007};
- ParaMEDMEM::DataArrayDouble *arrX=ParaMEDMEM::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
- ParaMEDMEM::DataArrayDouble *arrY=ParaMEDMEM::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
- ParaMEDMEM::MEDCouplingCMesh *mesh=ParaMEDMEM::MEDCouplingCMesh::New("My2D_CMesh");
+ MEDCoupling::DataArrayDouble *arrX=MEDCoupling::DataArrayDouble::New(); arrX->alloc(9,1); std::copy(XCoords,XCoords+9,arrX->getPointer()); arrX->setInfoOnComponent(0,"X [m]");
+ MEDCoupling::DataArrayDouble *arrY=MEDCoupling::DataArrayDouble::New(); arrY->alloc(7,1); std::copy(YCoords,YCoords+7,arrY->getPointer()); arrY->setInfoOnComponent(0,"Y [m]");
+ MEDCoupling::MEDCouplingCMesh *mesh=MEDCoupling::MEDCouplingCMesh::New("My2D_CMesh");
mesh->setCoords(arrX,arrY); arrX->decrRef(); arrY->decrRef();
//! [CppSnippetFieldDoubleBuild4_1]
- ParaMEDMEM::MEDCouplingFieldDouble* fieldOnNodes=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES,ParaMEDMEM::CONST_ON_TIME_INTERVAL);
+ MEDCoupling::MEDCouplingFieldDouble* fieldOnNodes=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::CONST_ON_TIME_INTERVAL);
fieldOnNodes->setName("MyVecFieldOnNodeWithConstTime");
fieldOnNodes->setTimeUnit("ms"); // Time unit is ms.
fieldOnNodes->setStartTime(4.22,2,-1);
fieldOnNodes->setEndTime(6.44,4,-1); // fieldOnNodes is defined in interval [4.22 ms,6.44 ms]
fieldOnNodes->setMesh(mesh);
mesh->decrRef(); // no more need of mesh because mesh has been attached to fieldOnNodes
- ParaMEDMEM::DataArrayDouble *array=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *array=MEDCoupling::DataArrayDouble::New();
array->alloc(fieldOnNodes->getMesh()->getNumberOfNodes(),3);//Implicitely fieldOnNodes will be a 3 components field.
array->fillWithValue(8.);
fieldOnNodes->setArray(array);
#include "MEDCouplingRemapperTest.hxx"
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingMemArray.hxx"
#include <cmath>
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MEDCouplingRemapperTest::test2DInterpP0P0_1()
{
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(IntegralGlobConstraint);
+ srcField->setNature(ExtensiveConservation);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
const double valuesExpected2[5]={3.75 ,1.75 ,1.75,4.,3.75};
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected2[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(5,trgfield->getArray()->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(IntegralGlobConstraint);
+ srcField->setNature(ExtensiveConservation);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(5,trgfield->getArray()->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected2[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(Integral);
+ srcField->setNature(ExtensiveMaximum);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(5,trgfield->getArray()->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected2[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(RevIntegral);
+ srcField->setNature(IntensiveConservation);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(5,trgfield->getArray()->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
MEDCouplingFieldDouble *targetField=MEDCouplingFieldDouble::New(ON_CELLS);
- targetField->setNature(ConservativeVolumic);
+ targetField->setNature(IntensiveMaximum);
targetField->setMesh(targetMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(targetMesh->getNumberOfCells(),1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected[i0],values[i0],1e-12);
srcfield->decrRef();
//
- targetField->setNature(IntegralGlobConstraint);
+ targetField->setNature(ExtensiveConservation);
srcfield=remapper.reverseTransferField(targetField,4.57);
values=srcfield->getArray()->getConstPointer();
const double valuesExpected2[2]={26., 19.};
MEDCouplingRemapper remapper;
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected1[i0],values[i0],1e-12);
trgfield->decrRef();
const double valuesExpected2[2]={24.75,5.75};
- srcField->setNature(Integral);
+ srcField->setNature(ExtensiveMaximum);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(2,trgfield->getArray()->getNumberOfTuples());
trgfield->decrRef();
//
const double valuesExpected3[2]={24.75,9.25};
- srcField->setNature(IntegralGlobConstraint);
+ srcField->setNature(ExtensiveConservation);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(2,trgfield->getArray()->getNumberOfTuples());
trgfield->decrRef();
//
const double valuesExpected4[2]={7.4444444444444446,7.4};
- srcField->setNature(RevIntegral);
+ srcField->setNature(IntensiveConservation);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(2,trgfield->getArray()->getNumberOfTuples());
targetMesh=MEDCouplingBasicsTest::build2DCurveTargetMesh_2();
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
for(int i0=0;i0<2;i0++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected1[i0],values[i0],1e-12);
trgfield->decrRef();
- srcField->setNature(Integral);
+ srcField->setNature(ExtensiveMaximum);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(2,trgfield->getArray()->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected2[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(IntegralGlobConstraint);
+ srcField->setNature(ExtensiveConservation);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(2,trgfield->getArray()->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected3[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(RevIntegral);
+ srcField->setNature(IntensiveConservation);
trgfield=remapper.transferField(srcField,4.57);
values=trgfield->getArray()->getConstPointer();
CPPUNIT_ASSERT_EQUAL(2,trgfield->getArray()->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
//
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P1P0"));
srcField=MEDCouplingFieldDouble::New(ON_NODES);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfNodes(),1);
//
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(targetMesh,sourceMesh,"P0P1"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(targetMesh);
array=DataArrayDouble::New();
array->alloc(targetMesh->getNumberOfCells(),1);
targetMesh=MEDCouplingBasicsTest::build2DTargetMesh_2();
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P1P1"));
srcField=MEDCouplingFieldDouble::New(ON_NODES);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfNodes(),1);
remapper.setIntersectionType(INTERP_KERNEL::Triangulation);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
targetMesh=MEDCouplingBasicsTest::build3DSurfTargetMesh_1();
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
targetMesh=MEDCouplingBasicsTest::build3DTargetMesh_1();
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
remapper.setIntersectionType(INTERP_KERNEL::PointLocator);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
remapper.setIntersectionType(INTERP_KERNEL::PointLocator);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
remapper.setIntersectionType(INTERP_KERNEL::PointLocator);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
remapper.setIntersectionType(INTERP_KERNEL::PointLocator);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
sourceMesh=MEDCouplingBasicsTest::build2DTargetMesh_1();
targetMesh=MEDCouplingUMesh::New("an example of -1 D mesh",-1);
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
for(int i0=0;i0<5;i0++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(9.125,values[i0],1e-14);
srcField->decrRef();
- trgField->setNature(Integral);
+ trgField->setNature(ExtensiveMaximum);
srcField=remapper.reverseTransferField(trgField,4.220173);
CPPUNIT_ASSERT_EQUAL(5,srcField->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(1,srcField->getNumberOfComponents());
// ------------- -1D -> 2D
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(targetMesh,sourceMesh,"P0P0"));
trgField=MEDCouplingFieldDouble::New(ON_CELLS);
- trgField->setNature(ConservativeVolumic);
+ trgField->setNature(IntensiveMaximum);
trgField->setMesh(targetMesh);
array=DataArrayDouble::New();
array->alloc(targetMesh->getNumberOfCells(),1);
for(int i0=0;i0<5;i0++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,values[i0],1e-14);
srcField->decrRef();
- trgField->setNature(IntegralGlobConstraint);
+ trgField->setNature(ExtensiveConservation);
srcField=remapper.transferField(trgField,4.221073);
values=srcField->getArray()->getConstPointer();
const double valuesExpected7[5]={1.75,0.875,0.875,1.75,1.75};
for(int i0=0;i0<5;i0++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected7[i0],values[i0],1e-14);
srcField->decrRef();
- trgField->setNature(Integral);
+ trgField->setNature(ExtensiveMaximum);
srcField=remapper.transferField(trgField,4.221073);
values=srcField->getArray()->getConstPointer();
for(int i0=0;i0<5;i0++)
remapper.setIntersectionType(INTERP_KERNEL::Geometric2D);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(4,1); array->iota(2.);
remapper.setIntersectionType(INTERP_KERNEL::Geometric2D);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(targetMesh,sourceMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(targetMesh);
array=DataArrayDouble::New();
array->alloc(3,1); array->iota(2.);
remapper.setIntersectionType(INTERP_KERNEL::Triangulation);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(7,1); array->iota(2.);
//------------- 3D -> 2D
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(targetMesh,sourceMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(targetMesh);
array=DataArrayDouble::New();
array->alloc(3,1); array->iota(2.);
remapper.setIntersectionType(INTERP_KERNEL::Triangulation);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(IntegralGlobConstraint);
+ srcField->setNature(ExtensiveConservation);
trgfield=remapper.transferField(srcField,4.220173);
values=trgfield->getArray()->getConstPointer();
const double valuesExpected2[4]={2.8374999999999999, 7.3624999999999998, 4.220173, 4.7999999999999998};
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected2[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(Integral);
+ srcField->setNature(ExtensiveMaximum);
trgfield=remapper.transferField(srcField,4.220173);
values=trgfield->getArray()->getConstPointer();
const double valuesExpected3[4]={1.24, 4.5199999999999996, 4.220173, 1.9199999999999999};
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected3[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(RevIntegral);
+ srcField->setNature(IntensiveConservation);
trgfield=remapper.transferField(srcField,4.220173);
values=trgfield->getArray()->getConstPointer();
const double valuesExpected9[4]={2.48, 3.766666666666666, 4.220173, 1.9199999999999999};
srcField->decrRef();
// REVERSE ***********
trgfield=MEDCouplingFieldDouble::New(ON_CELLS);
- trgfield->setNature(ConservativeVolumic);
+ trgfield->setNature(IntensiveMaximum);
trgfield->setMesh(targetMesh);
array=DataArrayDouble::New();
array->alloc(targetMesh->getNumberOfCells(),1);
//
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected5[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(IntegralGlobConstraint);
+ srcField->setNature(ExtensiveConservation);
trgfield=remapper.transferField(srcField,4.220173);
values=trgfield->getArray()->getConstPointer();
const double valuesExpected6[4]={9.25, 15.75};
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected6[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(Integral);
+ srcField->setNature(ExtensiveMaximum);
trgfield=remapper.transferField(srcField,4.220173);
values=trgfield->getArray()->getConstPointer();
const double valuesExpected7[2]={4.56, 4.3466666666666667};
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesExpected7[i0],values[i0],1e-12);
trgfield->decrRef();
//
- srcField->setNature(RevIntegral);
+ srcField->setNature(IntensiveConservation);
trgfield=remapper.transferField(srcField,4.220173);
values=trgfield->getArray()->getConstPointer();
const double valuesExpected10[2]={5.08, 3.56};
srcField->decrRef();
// REVERSE ***********
trgfield=MEDCouplingFieldDouble::New(ON_CELLS);
- trgfield->setNature(ConservativeVolumic);
+ trgfield->setNature(IntensiveMaximum);
trgfield->setMesh(targetMesh);
array=DataArrayDouble::New();
array->alloc(targetMesh->getNumberOfCells(),1);
{
MEDCouplingUMesh *mesh2DS=0;
MEDCouplingUMesh *mesh3DS=build3DExtrudedUMesh_1(mesh2DS);
- MEDCouplingExtrudedMesh *extS=MEDCouplingExtrudedMesh::New(mesh3DS,mesh2DS,1);
+ MEDCouplingMappedExtrudedMesh *extS=MEDCouplingMappedExtrudedMesh::New(mesh3DS,mesh2DS,1);
mesh3DS->decrRef();
mesh2DS->decrRef();
MEDCouplingUMesh *mesh2DT=0;
MEDCouplingUMesh *mesh3DT=build3DExtrudedUMesh_1(mesh2DT);
- MEDCouplingExtrudedMesh *extT=MEDCouplingExtrudedMesh::New(mesh3DT,mesh2DT,1);
+ MEDCouplingMappedExtrudedMesh *extT=MEDCouplingMappedExtrudedMesh::New(mesh3DT,mesh2DT,1);
//
//
mesh3DT->decrRef();
MEDCouplingUMesh *meshTF2D=(MEDCouplingUMesh *)meshTF->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
n.clear();
//
- MEDCouplingExtrudedMesh *meshNE=MEDCouplingExtrudedMesh::New(meshN,meshN2D,0);
- MEDCouplingExtrudedMesh *meshTTE=MEDCouplingExtrudedMesh::New(meshTT,meshTT2D,0);
- MEDCouplingExtrudedMesh *meshTFE=MEDCouplingExtrudedMesh::New(meshTF,meshTF2D,0);
+ MEDCouplingMappedExtrudedMesh *meshNE=MEDCouplingMappedExtrudedMesh::New(meshN,meshN2D,0);
+ MEDCouplingMappedExtrudedMesh *meshTTE=MEDCouplingMappedExtrudedMesh::New(meshTT,meshTT2D,0);
+ MEDCouplingMappedExtrudedMesh *meshTFE=MEDCouplingMappedExtrudedMesh::New(meshTF,meshTF2D,0);
//
MEDCouplingRemapper remapper;
remapper.setPrecision(1e-12);
remapper.setIntersectionType(INTERP_KERNEL::Triangulation);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(meshNE,meshTTE,"P0P0"));
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(IntegralGlobConstraint);
+ srcField->setNature(ExtensiveConservation);
srcField->setMesh(meshNE);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(meshNE->getNumberOfCells(),1);
};
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(meshNE,meshTTE,"P0P0"));
trgField=MEDCouplingFieldDouble::New(ON_CELLS);
- trgField->setNature(ConservativeVolumic);
+ trgField->setNature(IntensiveMaximum);
trgField->setMesh(meshTTE);
array=DataArrayDouble::New();
array->alloc(meshTTE->getNumberOfCells(),1);
};
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(meshNE,meshTFE,"P0P0"));
trgField=MEDCouplingFieldDouble::New(ON_CELLS);
- trgField->setNature(ConservativeVolumic);
+ trgField->setNature(IntensiveMaximum);
trgField->setMesh(meshTFE);
array=DataArrayDouble::New();
array->alloc(meshTFE->getNumberOfCells(),1);
srcFt->decrRef();
trgFt->decrRef();
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
remapper.setIntersectionType(INTERP_KERNEL::PointLocator);
CPPUNIT_ASSERT_EQUAL(1,remapper.prepare(sourceMesh,targetMesh,"P0P0"));
MEDCouplingFieldDouble *srcField=MEDCouplingFieldDouble::New(ON_CELLS);
- srcField->setNature(ConservativeVolumic);
+ srcField->setNature(IntensiveMaximum);
srcField->setMesh(sourceMesh);
DataArrayDouble *array=DataArrayDouble::New();
array->alloc(sourceMesh->getNumberOfCells(),1);
ptr[i]=(double)(i+7);
array->decrRef();
MEDCouplingFieldDouble *trgField=MEDCouplingFieldDouble::New(ON_CELLS);
- trgField->setNature(ConservativeVolumic);
+ trgField->setNature(IntensiveMaximum);
trgField->setMesh(targetMesh);
array=DataArrayDouble::New();
array->alloc(targetMesh->getNumberOfCells(),1);
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
#include "MEDCouplingBasicsTest5.hxx"
#include "MEDCouplingBasicsTestInterp.hxx"
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDCouplingBasicsTest1 );
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDCouplingBasicsTest2 );
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDCouplingBasicsTest3 );
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDCouplingBasicsTest4 );
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDCouplingBasicsTest5 );
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDCouplingBasicsTestInterp );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDCouplingBasicsTest1 );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDCouplingBasicsTest2 );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDCouplingBasicsTest3 );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDCouplingBasicsTest4 );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDCouplingBasicsTest5 );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDCouplingBasicsTestInterp );
#include "BasicMainTest.hxx"
#include "MEDCouplingRemapperTest.hxx"
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDCouplingRemapperTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDCouplingRemapperTest );
#include "BasicMainTest.hxx"
%include "MEDCouplingCommon.i"
%pythoncode %{
-def ParaMEDMEMDataArrayDoublenew(cls,*args):
+def MEDCouplingDataArrayDoublenew(cls,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDouble____new___(cls,args)
-def ParaMEDMEMDataArrayDoubleIadd(self,*args):
+def MEDCouplingDataArrayDoubleIadd(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDouble____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIsub(self,*args):
+def MEDCouplingDataArrayDoubleIsub(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDouble____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleImul(self,*args):
+def MEDCouplingDataArrayDoubleImul(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDouble____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleIdiv(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDouble____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIpow(self,*args):
+def MEDCouplingDataArrayDoubleIpow(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDouble____ipow___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoublenew(cls,*args):
+def MEDCouplingFieldDoublenew(cls,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingFieldDouble____new___(cls,args)
-def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args):
+def MEDCouplingFieldDoubleIadd(self,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingFieldDouble____iadd___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args):
+def MEDCouplingFieldDoubleIsub(self,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingFieldDouble____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args):
+def MEDCouplingFieldDoubleImul(self,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingFieldDouble____imul___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args):
+def MEDCouplingFieldDoubleIdiv(self,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingFieldDouble____idiv___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args):
+def MEDCouplingFieldDoubleIpow(self,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingFieldDouble____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayIntnew(cls,*args):
+def MEDCouplingDataArrayIntnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____new___(cls,args)
-def ParaMEDMEMDataArrayIntIadd(self,*args):
+def MEDCouplingDataArrayIntIadd(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntIsub(self,*args):
+def MEDCouplingDataArrayIntIsub(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntImul(self,*args):
+def MEDCouplingDataArrayIntImul(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntIdiv(self,*args):
+def MEDCouplingDataArrayIntIdiv(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntImod(self,*args):
+def MEDCouplingDataArrayIntImod(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____imod___(self, self, *args)
-def ParaMEDMEMDataArrayIntIpow(self,*args):
+def MEDCouplingDataArrayIntIpow(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
+def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDoubleTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
+def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDoubleTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
+def MEDCouplingDataArrayDoubleTupleImul(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDoubleTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayDoubleTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayIntTupleIadd(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayIntTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
+def MEDCouplingDataArrayIntTupleIsub(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayIntTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImul(self,*args):
+def MEDCouplingDataArrayIntTupleImul(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayIntTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
+def MEDCouplingDataArrayIntTupleIdiv(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayIntTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImod(self,*args):
+def MEDCouplingDataArrayIntTupleImod(self,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayIntTuple____imod___(self, self, *args)
def ParaMEDMEMDenseMatrixIadd(self,*args):
def ParaMEDMEMDenseMatrixIsub(self,*args):
import _MEDCoupling
return _MEDCoupling.DenseMatrix____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingUMeshnew(cls,*args):
+def MEDCouplingUMeshnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingUMesh____new___(cls,args)
-def ParaMEDMEMMEDCoupling1DGTUMeshnew(cls,*args):
+def MEDCoupling1DGTUMeshnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.MEDCoupling1DGTUMesh____new___(cls,args)
-def ParaMEDMEMMEDCoupling1SGTUMeshnew(cls,*args):
+def MEDCoupling1SGTUMeshnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.MEDCoupling1SGTUMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingCurveLinearMeshnew(cls,*args):
+def MEDCouplingCurveLinearMeshnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingCurveLinearMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingCMeshnew(cls,*args):
+def MEDCouplingCMeshnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingCMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingIMeshnew(cls,*args):
+def MEDCouplingIMeshnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.MEDCouplingIMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingExtrudedMeshnew(cls,*args):
+def MEDCouplingExtrudedMeshnew(cls,*args):
import _MEDCoupling
- return _MEDCoupling.MEDCouplingExtrudedMesh____new___(cls,args)
+ return _MEDCoupling.MEDCouplingMappedExtrudedMesh____new___(cls,args)
%}
%include "MEDCouplingFinalize.i"
self.assertEqual(7,arr1.getNumberOfTuples());
self.assertEqual(2,arr1.getNumberOfComponents());
self.assertEqual(arr1Ref,list(arr1.getValues()));
- arr2=arr1.substr(3);
+ arr2=arr1.subArray(3);
self.assertEqual(4,arr2.getNumberOfTuples());
self.assertEqual(2,arr2.getNumberOfComponents());
self.assertEqual(arr1Ref[6:],list(arr2.getValues()));
- arr3=arr1.substr(2,5);
+ arr3=arr1.subArray(2,5);
self.assertEqual(3,arr3.getNumberOfTuples());
self.assertEqual(2,arr3.getNumberOfComponents());
self.assertEqual(arr1Ref[4:10],list(arr3.getValues()));
for i in xrange(14):
self.assertTrue(abs(arr4Ref[i]-tmp[i])<1e-14);
pass
- arr5=arr4.substr(3);
+ arr5=arr4.subArray(3);
self.assertEqual(4,arr5.getNumberOfTuples());
self.assertEqual(2,arr5.getNumberOfComponents());
tmp=arr5.getValues()
for i in xrange(8):
self.assertTrue(abs(arr4Ref[6+i]-tmp[i])<1e-14);
pass
- arr6=arr4.substr(2,5);
+ arr6=arr4.subArray(2,5);
self.assertEqual(3,arr6.getNumberOfTuples());
self.assertEqual(2,arr6.getNumberOfComponents());
tmp=arr6.getValues()
myCoords.setValues(coords,nbOfNodes,3);
self.assertTrue(myCoords.getIJ(3,2)==-0.305)
mesh.setCoords(myCoords);
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
self.assertTrue(mesh.getAllGeoTypes()==[4])
myFalseConn=DataArrayInt.New()
myFalseConn.setValues(tab4,6,4)
#
field=MEDCouplingFieldDouble.New(ON_CELLS)
field.setMesh(mesh)
- field.setNature(Integral)
+ field.setNature(ExtensiveMaximum)
myCoords=DataArrayDouble.New()
sampleTab=[]
for i in range(nbOfCells*9):
myCoords.setValues(sampleTab,nbOfCells,9);
field.setArray(myCoords)
self.assertTrue(3==mesh.getSpaceDimension())
- field.checkCoherency()
+ field.checkConsistencyLight()
mesh2=mesh.clone(False)
mesh3=mesh.clone(True)
mesh3=0
targetMesh.insertNextCell(NORM_POINT1,1,[7]);
targetMesh.insertNextCell(NORM_POINT1,1,[6]);
targetMesh.finishInsertingCells();
- self.assertRaises(InterpKernelException,targetMesh.checkCoherency);
+ self.assertRaises(InterpKernelException,targetMesh.checkConsistencyLight);
myCoords=DataArrayDouble.New();
myCoords.setValues(targetCoords,9,3);
targetMesh.setCoords(myCoords);
self.assertRaises(InterpKernelException,meshM1D.setMeshDimension,-2)
self.assertRaises(InterpKernelException,meshM1D.setMeshDimension,-10)
meshM1D.setMeshDimension(-1);
- meshM1D.checkCoherency();
+ meshM1D.checkConsistencyLight();
self.assertEqual(meshM1D.getMeshDimension(),-1);
self.assertEqual(meshM1D.getNumberOfCells(),1);
self.assertRaises(InterpKernelException,meshM1D.getNumberOfNodes);
array=DataArrayDouble.New();
array.setValues(6*[7.],1,6);
fieldOnCells.setArray(array);
- fieldOnCells.checkCoherency();
+ fieldOnCells.checkConsistencyLight();
pass
def testDeepCopy(self):
array=DataArrayDouble.New();
array.setValues(5*3*[7.],5,3);
self.assertEqual(array.getIJ(3,2),7.);
- array2=array.deepCpy();
+ array2=array.deepCopy();
self.assertEqual(array2.getIJ(3,2),7.)
#
array3=DataArrayInt.New();
array3.setValues(5*3*[17],5,3);
self.assertEqual(array3.getIJ(3,2),17);
- array4=array3.deepCpy();
+ array4=array3.deepCopy();
self.assertEqual(array4.getIJ(3,2),17);
pass
mesh=MEDCouplingDataForTest.build2DTargetMesh_1();
elts=[1,3];
mesh.convertToPolyTypes(elts);
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
self.assertEqual(5,mesh.getNumberOfCells());
self.assertEqual(23,mesh.getNodalConnectivity().getNumberOfTuples());
expected1=[4, 0, 3, 4, 1, 5, 1, 4, 2, 3, 4, 5, 2, 5, 6, 7, 4, 3, 4, 7, 8, 5, 4]
#
mesh=MEDCouplingDataForTest.build3DTargetMesh_1();
mesh.convertToPolyTypes(elts);
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
self.assertEqual(8,mesh.getNumberOfCells());
self.assertEqual(114,mesh.getNodalConnectivity().getNumberOfTuples());
mesh.convertToPolyTypes(elts);
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
self.assertEqual(8,mesh.getNumberOfCells());
self.assertEqual(114,mesh.getNodalConnectivity().getNumberOfTuples());
pass
revDesc=DataArrayInt.New();
revDescIndx=DataArrayInt.New();
mesh2=mesh.buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2.checkCoherency();
+ mesh2.checkConsistencyLight();
self.assertEqual(1,mesh2.getMeshDimension());
self.assertEqual(13,mesh2.getNumberOfCells());
self.assertEqual(14,revDescIndx.getNbOfElems()); self.assertEqual(14,revDescIndx.getNumberOfTuples());
#
eltsV=[1,3];
mesh.convertToPolyTypes(eltsV);
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
#
desc=DataArrayInt.New();
descIndx=DataArrayInt.New();
revDescIndx=DataArrayInt.New();
#
mesh2=mesh.buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2.checkCoherency();
+ mesh2.checkConsistencyLight();
self.assertEqual(1,mesh2.getMeshDimension());
self.assertEqual(13,mesh2.getNumberOfCells());
self.assertEqual(14,revDescIndx.getNbOfElems()); self.assertEqual(14,revDescIndx.getNumberOfTuples());
revDescIndx=DataArrayInt.New();
#
mesh2=mesh.buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2.checkCoherency();
+ mesh2.checkConsistencyLight();
self.assertEqual(2,mesh2.getMeshDimension());
self.assertEqual(36,mesh2.getNumberOfCells());
self.assertEqual(37,revDescIndx.getNbOfElems()); self.assertEqual(37,revDescIndx.getNumberOfTuples());
#
eltsV=[1,3]
mesh.convertToPolyTypes(eltsV);
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
desc=DataArrayInt.New();
descIndx=DataArrayInt.New();
revDesc=DataArrayInt.New();
revDescIndx=DataArrayInt.New();
mesh2=mesh.buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2.checkCoherency();
+ mesh2.checkConsistencyLight();
self.assertEqual(2,mesh2.getMeshDimension());
self.assertEqual(36,mesh2.getNumberOfCells());
self.assertEqual(37,revDescIndx.getNbOfElems()); self.assertEqual(37,revDescIndx.getNumberOfTuples());
self.assertTrue(fieldOnCells1.isEqual(fieldOnCells2,1e-12,1e-15));
self.assertTrue(fieldOnCells2.isEqual(fieldOnCells1,1e-12,1e-15));
#
- arr2=arr.deepCpy();
+ arr2=arr.deepCopy();
fieldOnCells2.setArray(arr2);
self.assertTrue(fieldOnCells1.isEqual(fieldOnCells2,1e-12,1e-15));
self.assertTrue(fieldOnCells2.isEqual(fieldOnCells1,1e-12,1e-15));
def testNatureChecking(self):
field=MEDCouplingFieldDouble.New(ON_CELLS,NO_TIME);
- field.setNature(Integral);
- field.setNature(ConservativeVolumic);
- field.setNature(IntegralGlobConstraint);
+ field.setNature(ExtensiveMaximum);
+ field.setNature(IntensiveMaximum);
+ field.setNature(ExtensiveConservation);
field=MEDCouplingFieldDouble.New(ON_NODES,NO_TIME);
- field.setNature(ConservativeVolumic);
- self.assertRaises(InterpKernelException,field.setNature,Integral);
- self.assertRaises(InterpKernelException,field.setNature,IntegralGlobConstraint);
+ field.setNature(IntensiveMaximum);
+ self.assertRaises(InterpKernelException,field.setNature,ExtensiveMaximum);
+ self.assertRaises(InterpKernelException,field.setNature,ExtensiveConservation);
pass
def testNatureOperations(self):
m.setCoordsAt(1, DataArrayDouble([1.0,2.0,3.0]))
m = m.buildUnstructured()
f1, f2 = MEDCouplingFieldDouble.New(ON_CELLS, NO_TIME), MEDCouplingFieldDouble.New(ON_CELLS, NO_TIME)
- f1.setNature(Integral)
- f2.setNature(ConservativeVolumic)
- self.assertEqual(Integral, f1.getNature())
- self.assertEqual(ConservativeVolumic, f2.getNature())
+ f1.setNature(ExtensiveMaximum)
+ f2.setNature(IntensiveMaximum)
+ self.assertEqual(ExtensiveMaximum, f1.getNature())
+ self.assertEqual(IntensiveMaximum, f2.getNature())
da = DataArrayDouble([1.0,2.0,3.0,4.0])
f1.setMesh(m); f2.setMesh(m)
- f1.setArray(da); f2.setArray(da.deepCpy())
+ f1.setArray(da); f2.setArray(da.deepCopy())
# All this should complain about nature:
self.assertRaises(InterpKernelException, f1.__add__, f2)
self.assertRaises(InterpKernelException, f1.__iadd__, f2)
self.assertEqual(NoNature, f3.getNature())
f3 = f1*f2
self.assertEqual(NoNature, f3.getNature())
- f1Tmp = f1.deepCpy(); f1Tmp.setMesh(m); f1Tmp *= f2
+ f1Tmp = f1.deepCopy(); f1Tmp.setMesh(m); f1Tmp *= f2
self.assertEqual(NoNature, f1Tmp.getNature())
f3 = MEDCouplingFieldDouble.DivideFields(f1,f2)
self.assertEqual(NoNature, f3.getNature())
f3 = f1/f2
self.assertEqual(NoNature, f3.getNature())
- f1Tmp = f1.deepCpy(); f1Tmp.setMesh(m); f1Tmp /= f2
+ f1Tmp = f1.deepCopy(); f1Tmp.setMesh(m); f1Tmp /= f2
self.assertEqual(NoNature, f1Tmp.getNature())
# f3 = MEDCouplingFieldDouble.PowFields(f1,f2)
# self.assertEqual(NoNature, f3.getNature())
f3 = f1**f2
self.assertEqual(NoNature, f3.getNature())
- f1Tmp = f1.deepCpy(); f1Tmp.setMesh(m); f1Tmp **= f2
+ f1Tmp = f1.deepCopy(); f1Tmp.setMesh(m); f1Tmp **= f2
self.assertEqual(NoNature, f1Tmp.getNature())
f3 = MEDCouplingFieldDouble.DotFields(f1,f2)
self.assertEqual(NoNature, f3.getNature())
self.assertEqual(NoNature, f3.getNature())
da = DataArrayDouble.Meld([da, da, da])
- f1.setArray(da); f2.setArray(da.deepCpy())
+ f1.setArray(da); f2.setArray(da.deepCopy())
f3 = MEDCouplingFieldDouble.CrossProductFields(f1,f2)
self.assertEqual(NoNature, f3.getNature())
f3 = f1.crossProduct(f2)
def testExtrudedMesh1(self):
mesh3D,mesh2D=MEDCouplingDataForTest.build3DExtrudedUMesh_1();
- ext=MEDCouplingExtrudedMesh.New(mesh3D,mesh2D,1);
+ ext=MEDCouplingMappedExtrudedMesh.New(mesh3D,mesh2D,1);
self.assertEqual(18,ext.getNumberOfCells());
self.assertEqual(60,ext.getNumberOfNodes());
ids3D=ext.getMesh3DIds();
m2.rotate(center,vector,-pi/2.);
m3=m1.buildExtrudedMesh(m2,0);
#
- m4=MEDCouplingExtrudedMesh.New(m3,m1,0);
+ m4=MEDCouplingMappedExtrudedMesh.New(m3,m1,0);
self.assertEqual(15,m4.getNumberOfCells());
self.assertEqual(5,m4.getMesh2D().getNumberOfCells());
self.assertEqual(3,m4.getMesh1D().getNumberOfCells());
#some random in cells to check that extrusion alg find it correctly
expected1=[1,3,2,0,6,5,7,10,11,8,12,9,14,13,4]
m3.renumberCells(expected1,False);
- m4=MEDCouplingExtrudedMesh.New(m3,m1,0);
+ m4=MEDCouplingMappedExtrudedMesh.New(m3,m1,0);
self.assertEqual(15,m4.getNumberOfCells());
self.assertEqual(5,m4.getMesh2D().getNumberOfCells());
self.assertEqual(3,m4.getMesh1D().getNumberOfCells());
self.assertEqual(NORM_POLYHED,m3.getTypeOfCell(3));
self.assertEqual(NORM_HEXA8,m3.getTypeOfCell(4));
m3.renumberCells(expected1,False);
- m4=MEDCouplingExtrudedMesh.New(m3,m1,0);
+ m4=MEDCouplingMappedExtrudedMesh.New(m3,m1,0);
self.assertEqual(15,m4.getNumberOfCells());
self.assertEqual(5,m4.getMesh2D().getNumberOfCells());
self.assertEqual(3,m4.getMesh1D().getNumberOfCells());
expected1=[1,3,2,0,6,5,7,10,11,8,12,9,14,13,4]
rexpected1=[3, 0, 2, 1, 14, 5, 4, 6, 9, 11, 7, 8, 10, 13, 12]
m3.renumberCells(expected1,False);
- m4=MEDCouplingExtrudedMesh.New(m3,m1,0);
+ m4=MEDCouplingMappedExtrudedMesh.New(m3,m1,0);
self.assertEqual(NORM_HEXA8,m4.getTypeOfCell(0));
self.assertEqual(NORM_HEXA8,m4.getTypeOfCell(1));
self.assertEqual(NORM_POLYHED,m4.getTypeOfCell(2));
self.assertTrue(m5.isEqual(m3,1e-12));
f=m5.getMeasureField(True);
f.setMesh(m4)
- self.assertTrue(isinstance(f.getMesh(),MEDCouplingExtrudedMesh))
+ self.assertTrue(isinstance(f.getMesh(),MEDCouplingMappedExtrudedMesh))
arr=f.getArray();
arrPtr=arr.getValues();
for i in xrange(15):
m2.translate(vec);
m3=m1.mergeMyselfWith(m2);
self.assertTrue(isinstance(m3,MEDCouplingUMesh));
- m3.checkCoherency();
+ m3.checkConsistencyLight();
m4=MEDCouplingDataForTest.build2DTargetMeshMerged_1();
self.assertTrue(m3.isEqual(m4,1.e-12));
da,isMerged,newNbOfNodes=m3.mergeNodes(1.e-12);
m3.tryToShareSameCoords(m2,1e-12);
meshes=[m1,m2,m3]
m4=MEDCouplingUMesh.MergeUMeshesOnSameCoords(meshes);
- m4.checkCoherency();
+ m4.checkConsistencyLight();
self.assertEqual(15,m4.getNumberOfCells());
cells1=[0,1,2,3,4]
m1_1=m4.buildPartOfMySelf(cells1,True);
f1=m1.getMeasureField(True);
f2=m2.getMeasureField(True);
f3=MEDCouplingFieldDouble.MergeFields(f1,f2);
- f3.checkCoherency();
+ f3.checkConsistencyLight();
m4=MEDCouplingDataForTest.build2DTargetMeshMerged_1();
self.assertTrue(f3.getMesh().isEqual(m4,1.e-12));
name=f3.getName();
f1=m.fillFromAnalytic(ON_CELLS,1,"x+y");
self.assertAlmostEqual(3.4,f1.getTime()[0],12) ; self.assertEqual(5,f1.getTime()[1]) ; self.assertEqual(6,f1.getTime()[2])
self.assertEqual("us",f1.getTimeUnit())
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_CELLS);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(1,f1.getNumberOfComponents());
pass
#
f1=m.fillFromAnalytic(ON_NODES,1,"x+y");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(1,f1.getNumberOfComponents());
pass
#
f1=m.fillFromAnalytic(ON_NODES,2,"(x+y)*IVec+(2*(x+y))*JVec");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(2,f1.getNumberOfComponents());
def testFillFromAnalytic2(self):
m=MEDCouplingDataForTest.build2DTargetMesh_1();
f1=m.fillFromAnalytic(ON_CELLS,1,"y+x");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_CELLS);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(1,f1.getNumberOfComponents());
pass
#
f1=m.fillFromAnalytic(ON_NODES,1,"y+2*x");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(1,f1.getNumberOfComponents());
self.assertTrue(abs(values2[i]-tmp[i])<1.e-12);
pass
f1=m.fillFromAnalytic(ON_NODES,1,"2.*x+y");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(1,f1.getNumberOfComponents());
pass
#
f1=m.fillFromAnalytic(ON_NODES,2,"(x+y)*IVec+2*(x+y)*JVec");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(2,f1.getNumberOfComponents());
def testApplyFunc(self):
m=MEDCouplingDataForTest.build2DTargetMesh_1();
f1=m.fillFromAnalytic(ON_NODES,2,"(x+y)*IVec+(2*(x+y))*JVec");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(2,f1.getNumberOfComponents());
def testApplyFunc2(self):
m=MEDCouplingDataForTest.build2DTargetMesh_1();
f1=m.fillFromAnalytic(ON_NODES,2,"(x+y)*IVec+2*(x+y)*JVec");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(2,f1.getNumberOfComponents());
m=MEDCouplingDataForTest.build2DTargetMesh_1();
f1=m.fillFromAnalytic(ON_NODES,1,"x+y");
f2=m.fillFromAnalytic(ON_NODES,1,"x+y");
- f1.checkCoherency();
- f2.checkCoherency();
+ f1.checkConsistencyLight();
+ f2.checkConsistencyLight();
f3=f1+f2;
- f3.checkCoherency();
+ f3.checkConsistencyLight();
self.assertEqual(f3.getTypeOfField(),ON_NODES);
self.assertEqual(f3.getTimeDiscretization(),ONE_TIME);
values1=[-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8]
pass
#
f3=f1*f2;
- f3.checkCoherency();
+ f3.checkConsistencyLight();
self.assertEqual(f3.getTypeOfField(),ON_NODES);
self.assertEqual(f3.getTimeDiscretization(),ONE_TIME);
values2=[0.36,0.01,0.16,0.01,0.16,0.81,0.16,0.81,1.96]
#
f3=f1+f2;
f4=f1-f3;
- f4.checkCoherency();
+ f4.checkConsistencyLight();
self.assertEqual(f4.getTypeOfField(),ON_NODES);
self.assertEqual(f4.getTimeDiscretization(),ONE_TIME);
values3=[0.6,0.1,-0.4,0.1,-0.4,-0.9,-0.4,-0.9,-1.4]
#
f3=f1+f2;
f4=f3/f2;
- f4.checkCoherency();
+ f4.checkConsistencyLight();
self.assertEqual(f4.getTypeOfField(),ON_NODES);
self.assertEqual(f4.getTimeDiscretization(),ONE_TIME);
tmp=f4.getArray().getValues();
pass
#
f4=f2.buildNewTimeReprFromThis(NO_TIME,False);
- f4.checkCoherency();
+ f4.checkConsistencyLight();
self.assertEqual(f4.getTypeOfField(),ON_NODES);
self.assertEqual(f4.getTimeDiscretization(),NO_TIME);
self.assertRaises(InterpKernelException,f1.__add__,f4);
pass
#
f4=f2.buildNewTimeReprFromThis(NO_TIME,True);
- f4.checkCoherency();
+ f4.checkConsistencyLight();
self.assertEqual(f4.getTypeOfField(),ON_NODES);
self.assertEqual(f4.getTimeDiscretization(),NO_TIME);
self.assertRaises(InterpKernelException,f1.__add__,f4);
f1=m.fillFromAnalytic(ON_NODES,1,"x+y+z");
f2=m.fillFromAnalytic(ON_NODES,1,"a*a+b+c*c");
f3=f1/f2;
- f3.checkCoherency();
+ f3.checkConsistencyLight();
self.assertEqual(f3.getTypeOfField(),ON_NODES);
self.assertEqual(f3.getTimeDiscretization(),ONE_TIME);
expected1=[-2.4999999999999991, 1.2162162162162162, 0.77868852459016391,
f1=m.fillFromAnalytic(ON_NODES,1,"x+y+z");
f2=m.fillFromAnalytic(ON_NODES,1,"a*a+b+c*c");
f1/=f2
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
expected1=[-2.4999999999999991, 1.2162162162162162, 0.77868852459016391,
array.setValues(arr1,nbOfCells,3);
f1.setStartTime(2.,0,0);
f1.setEndTime(3.,0,0);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
pos=[0.3,-0.2]
res=f1.getValueOn(pos);
self.assertTrue(abs(arr1[3]-res[0])<1.e-12);
f2.setArray(f1.getArray());
f2.setStartTime(2.,3,0);
f2.setEndTime(4.,13,0);
- self.assertRaises(InterpKernelException,f2.checkCoherency)
+ self.assertRaises(InterpKernelException,f2.checkConsistencyLight)
array2=DataArrayDouble.New();
array2.setValues(arr2,nbOfCells,3);
f2.setEndArray(array2);
- f2.checkCoherency();
+ f2.checkConsistencyLight();
#
res=None
res=f2.getValueOn(pos,3.21);
#res=fieldOnCells.getValueOnPos(1,2,1);
#self.assertAlmostEqual(6.,res,12);
#
- meshDeepCopy=mesh.deepCpy();
+ meshDeepCopy=mesh.deepCopy();
meshClone=mesh.clone(False);
meshEmpty.copyTinyStringsFrom(mesh);
self.assertTrue(mesh1.isEqual(mesh2, 1e-5));
self.assertTrue(not mesh1.isEqual(mesh2, 1e-7));
- self.assertRaises(InterpKernelException, mesh3.checkCoherency1, 1e-12);
- mesh1.checkCoherency1(1e-12);
+ self.assertRaises(InterpKernelException, mesh3.checkConsistency, 1e-12);
+ mesh1.checkConsistency(1e-12);
self.assertEqual(NORM_HEXA8, mesh1.getTypeOfCell(1));
self.assertEqual(NORM_HEXA8, mesh1.getAllGeoTypes()[0]);
self.assertEqual(9,len(n));
m3dSurf=mesh.buildFacePartOfMySelfNode(n,True);
self.assertTrue(isinstance(m3dSurf,MEDCouplingUMesh))
- me=MEDCouplingExtrudedMesh.New(mesh,m3dSurf,0);
+ me=MEDCouplingMappedExtrudedMesh.New(mesh,m3dSurf,0);
da=me.getMesh3DIds();
self.assertEqual(8,me.getNumberOfCells());
expected=[0,1,2,3,4,5,6,7]
#
m3dSurf=mesh.buildFacePartOfMySelfNode(n,True);
self.assertTrue(isinstance(m3dSurf,MEDCouplingUMesh))
- me=MEDCouplingExtrudedMesh.New(mesh,m3dSurf,0);
+ me=MEDCouplingMappedExtrudedMesh.New(mesh,m3dSurf,0);
da=me.getMesh3DIds();
self.assertEqual(8,me.getNumberOfCells());
expected=[0,1,2,3,4,5,6,7]
ptr=array.getPointer();
f.setArray(array);
f.setName("MyFirstFieldOnGaussPoint");
- f.checkCoherency();
+ f.checkConsistencyLight();
self.assertAlmostEqual(27.,f.getIJK(2,5,0),14);
self.assertAlmostEqual(16.,f.getIJK(1,5,1),14);
#
f.clearGaussLocalizations();
self.assertEqual(0,f.getNbOfGaussLocalization());
- self.assertRaises(InterpKernelException,f.checkCoherency);
+ self.assertRaises(InterpKernelException,f.checkConsistencyLight);
ids1=[0,1,3,4]
self.assertRaises(InterpKernelException,f.setGaussLocalizationOnCells,ids1,_refCoo2,_gsCoo1,_wg1);
self.assertEqual(0,f.getNbOfGaussLocalization());
self.assertEqual(0,f.getGaussLocalizationIdOfOneCell(0));
self.assertEqual(1,f.getGaussLocalizationIdOfOneCell(1));
self.assertEqual(1,f.getGaussLocalizationIdOfOneCell(2));
- self.assertRaises(InterpKernelException,f.checkCoherency);#<- cell 3 has no localization
+ self.assertRaises(InterpKernelException,f.checkConsistencyLight);#<- cell 3 has no localization
ids4=[3]
_gsCoo2=_gsCoo1;
_wg2=_wg1;
self.assertEqual(3,f.getNbOfGaussLocalization());
tmpIds=f.getCellIdsHavingGaussLocalization(0);
self.assertEqual(ids2,list(tmpIds.getValues()));
- self.assertRaises(InterpKernelException,f.checkCoherency);#<- it's always not ok because undelying array not with the good size.
- array2=f.getArray().substr(0,10);
+ self.assertRaises(InterpKernelException,f.checkConsistencyLight);#<- it's always not ok because undelying array not with the good size.
+ array2=f.getArray().subArray(0,10);
f.setArray(array2);
- f.checkCoherency();#<- here it is OK
+ f.checkConsistencyLight();#<- here it is OK
f2=f.clone(True);
self.assertTrue(f.isEqual(f2,1e-14,1e-14));
gl1=f2.getGaussLocalization(0);
self.assertTrue(not f.isEqual(f2,1e-14,1e-14));
gl1.setGaussCoord(1,1,tmp);
self.assertTrue(f.isEqual(f2,1e-14,1e-14));
- f2.checkCoherency();
+ f2.checkConsistencyLight();
pass
def testGaussPointNEField1(self):
ptr=array.getPointer();
f.setArray(array);
#
- f.checkCoherency();
+ f.checkConsistencyLight();
f2=f.clone(True);
self.assertTrue(f.isEqual(f2,1e-14,1e-14));
self.assertAlmostEqual(21.,f.getIJK(2,0,0),14);
m2.orientCorrectlyPolyhedrons();
res1=m2.arePolyhedronsNotCorrectlyOriented();
self.assertTrue(len(res1)==0);
- m2.checkCoherency();
+ m2.checkConsistencyLight();
self.assertEqual(18,m2.getNumberOfCells());
cellIds2=[0,6,12]
m2.convertToPolyTypes(cellIds2);
for i in xrange(15):
self.assertTrue(abs(expected1[i]-f3Ptr[i])<1e-12);
pass
- f4=m5.getBarycenterAndOwner();
+ f4=m5.computeCellCenterOfMass();
self.assertEqual(15,f4.getNumberOfTuples());
self.assertEqual(3,f4.getNumberOfComponents());
f4Ptr=f4.getValues();
myCoords=DataArrayDouble.New();
myCoords.setValues(coords,9,3);
meshN.setCoords(myCoords);
- meshN.checkCoherency();
+ meshN.checkConsistencyLight();
#
res1=meshN.arePolyhedronsNotCorrectlyOriented();
meshN.orientCorrectlyPolyhedrons();
self.assertTrue(len(res1)==0);
- da=meshN.getBarycenterAndOwner();
+ da=meshN.computeCellCenterOfMass();
self.assertEqual(1,da.getNumberOfTuples());
self.assertEqual(3,da.getNumberOfComponents());
daPtr=da.getValues();
#
center=[0.,0.,0.]
vec=[0.,2.78,0.]
- da=meshN.getBarycenterAndOwner();
+ da=meshN.computeCellCenterOfMass();
daPtr=da.getValues();
ref=meshN.getCoords().getValues()[24:];
for i in xrange(3):
#
meshN.rotate(center,vec,pi/7.);
meshN.translate(vec);
- da=meshN.getBarycenterAndOwner();
+ da=meshN.computeCellCenterOfMass();
daPtr=da.getValues();
ref=meshN.getCoords().getValues()[24:];
for i in xrange(3):
vec2=[4.5,9.3,2.8]
meshN.rotate(center2,vec2,e);
meshN.translate(vec2);
- da=meshN.getBarycenterAndOwner();
+ da=meshN.computeCellCenterOfMass();
daPtr=da.getValues();
ref=meshN.getCoords().getValues()[24:];
for i in xrange(3):
array.setValues(arr,m1.getNumberOfCells(),3);
f1.setArray(array);
#
- f3=m1.getBarycenterAndOwner();
+ f3=m1.computeCellCenterOfMass();
self.assertEqual(4,f3.getNumberOfTuples());
self.assertEqual(1,f3.getNumberOfComponents());
expected9=[0.75,5.105,0.8,5.155]
self.assertTrue(abs(expected2[i]*sqrt(2.)-ptr[i])<1e-12);
pass
#bary
- f3=m1.getBarycenterAndOwner();
+ f3=m1.computeCellCenterOfMass();
self.assertEqual(4,f3.getNumberOfTuples());
self.assertEqual(2,f3.getNumberOfComponents());
expected10=[0.75,0.75,5.105,5.105,0.8,0.8,5.155,5.155]
for i in xrange(10):
self.assertTrue(abs(abs(expected1[i])-ptr[i])<1e-12);
pass
- f2=m1.getBarycenterAndOwner();
+ f2=m1.computeCellCenterOfMass();
self.assertEqual(10,f2.getNumberOfTuples());
self.assertEqual(2,f2.getNumberOfComponents());
expected2=[0.5,0.3333333333333333,0.5,0.5,0.5,0.77777777777777777,0.5,0.3333333333333333,0.5,0.5,0.5,0.3333333333333333,0.5,0.5,0.5,0.77777777777777777,0.5,0.3333333333333333,0.5,0.5]
for i in xrange(10):
self.assertTrue(abs(abs(expected1[i])-ptr[i])<1e-12);
pass
- f2=m1.getBarycenterAndOwner();
+ f2=m1.computeCellCenterOfMass();
self.assertEqual(10,f2.getNumberOfTuples());
self.assertEqual(3,f2.getNumberOfComponents());
ptr=f2.getValues();
myCoords=DataArrayDouble.New();
myCoords.setValues(coords,69,3);
meshN.setCoords(myCoords);
- meshN.checkCoherency();
+ meshN.checkConsistencyLight();
res1=meshN.arePolyhedronsNotCorrectlyOriented();
meshN.orientCorrectlyPolyhedrons();
res1=meshN.arePolyhedronsNotCorrectlyOriented();
self.assertTrue(len(res1)==0);
#
- da=meshN.getBarycenterAndOwner();
+ da=meshN.computeCellCenterOfMass();
self.assertEqual(4,da.getNumberOfTuples());
self.assertEqual(3,da.getNumberOfComponents());
daPtr=da.getValues();
values2=[1.,1001.,2.,1002., 11.,1011.,12.,1012.,13.,1013.,14.,1014.,15.,1015.,16.,1016., 21.,1021.,22.,1022.,23.,1023.,24.,1024.,25.,1025.,26.,1026., 31.,1031.,32.,1032., 41.,1041.,42.,1042.]
arr.setValues(values2,18,2);
f.setArray(arr);
- f.checkCoherency();
+ f.checkConsistencyLight();
fCpy=f.clone(True);
self.assertTrue(f.isEqual(fCpy,1e-12,1e-12));
f.renumberCells(renumber1,False);
values3=[1.,1001.,2.,1002.,3.,1003.,4.,1004., 11.,1011.,12.,1012.,13.,1013., 21.,1021.,22.,1022.,23.,1023., 31.,1031.,32.,1032.,33.,1033.,34.,1034., 41.,1041.,42.,1042.,43.,1043.,44.,1044.]
arr.setValues(values3,18,2);
f.setArray(arr);
- f.checkCoherency();
+ f.checkConsistencyLight();
fCpy=f.clone(True);
self.assertTrue(f.isEqual(fCpy,1e-12,1e-12));
f.renumberCells(renumber1,False);
values1=[7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.,12.,112.,10012.,13.,113.,10013.,14.,114.,10014.,15.,115.,10015.]
arr.setValues(values1,nbOfNodes,3);
f.setArray(arr);
- f.checkCoherency();
+ f.checkConsistencyLight();
renumber1=[0,4,1,3,5,2,6,7,8]
loc=[0.5432,-0.2432, 0.5478,0.1528]
expected1=[9.0272, 109.0272, 10009.0272, 11.4124,111.4124,10011.4124]
def testConvertQuadraticCellsToLinear(self):
mesh=MEDCouplingDataForTest.build2DTargetMesh_3();
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
types=mesh.getAllGeoTypes();
types.sort()
self.assertEqual(5,len(types));
expected1.sort()
self.assertEqual(expected1,types);
self.assertTrue(mesh.isPresenceOfQuadratic());
- self.assertEqual(62,mesh.getMeshLength());
+ self.assertEqual(62,mesh.getNodalConnectivityArrayLen());
f1=mesh.getMeasureField(False);
#
mesh.convertQuadraticCellsToLinear();
self.assertTrue(not mesh.isPresenceOfQuadratic());
#
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
f2=mesh.getMeasureField(False);
self.assertTrue(f1.getArray().isEqual(f2.getArray(),1e-12));
- self.assertEqual(48,mesh.getMeshLength());
+ self.assertEqual(48,mesh.getNodalConnectivityArrayLen());
types2=mesh.getAllGeoTypes();
types2.sort()
self.assertEqual(3,len(types2));
m = MEDCouplingUMesh("tst", 2)
m.setCoords(DataArrayDouble([], 0,2))
m.setConnectivity(DataArrayInt([]), DataArrayInt([0]))
- m2 = m.deepCpy()
+ m2 = m.deepCopy()
m.checkDeepEquivalWith(m2, 0, eps) # Should not raise!
pass
a1.fillWithZero();
a1.setInfoOnComponent(0,"c");
a1.setInfoOnComponent(1,"d");
- a2=a1.deepCpy();
+ a2=a1.deepCopy();
a2.setInfoOnComponent(0,"e");
a2.setInfoOnComponent(1,"f");
f.setArray(a1);
m.getCoords().setInfoOnComponent(1,"i");
m.getCoords().setInfoOnComponent(2,"j");
#
- f.checkCoherency();
+ f.checkConsistencyLight();
f2=f.clone(True);
self.assertTrue(f2.isEqual(f,1e-12,1e-12));
f2.setName("smth");
myCoords=DataArrayDouble.New();
myCoords.setValues(targetCoords,4,2);
m2.setCoords(myCoords);
- m2.checkCoherency();
- m1.checkCoherency();
+ m2.checkConsistencyLight();
+ m1.checkConsistencyLight();
#
expected1=[0.25,0.125,0.125,0.25,0.25]
f1=m1.getMeasureField(False);
f.setArray(a1);
f.setEndArray(a2);
f.setEndTime(3.,3,4);
- f.checkCoherency();
+ f.checkConsistencyLight();
#
self.assertAlmostEqual(8.,f.getMaxValue(),14);
self.assertAlmostEqual(0.,f.getMinValue(),14);
array.setValues(arr1,mesh1.getNumberOfCells(),1);
f1.setArray(array);
#
- f1.checkCoherency();
- da=f1.getIdsInRange(2.9,7.1);
+ f1.checkConsistencyLight();
+ da=f1.findIdsInRange(2.9,7.1);
self.failUnlessEqual(5,da.getNbOfElems());
expected1=[2,3,5,7,9]
self.failUnlessEqual(expected1,list(da.getValues()));
- da=f1.getIdsInRange(8.,12.);
+ da=f1.findIdsInRange(8.,12.);
self.failUnlessEqual(4,da.getNbOfElems());
expected2=[1,4,6,8]
self.failUnlessEqual(expected2,list(da.getValues()));
self.failUnlessEqual(2,f2.getMesh().getSpaceDimension());
self.failUnlessEqual(2,f2.getMesh().getMeshDimension());
m2C=f2.getMesh();
- self.failUnlessEqual(13,m2C.getMeshLength());
+ self.failUnlessEqual(13,m2C.getNodalConnectivityArrayLen());
expected2=[0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7]
for i in xrange(12):
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12);
self.failUnlessEqual(2,f2.getMesh().getSpaceDimension());
self.failUnlessEqual(2,f2.getMesh().getMeshDimension());
m2C=f2.getMesh();
- self.failUnlessEqual(8,m2C.getMeshLength());
+ self.failUnlessEqual(8,m2C.getNodalConnectivityArrayLen());
for i in xrange(8):#8 is not an error
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12);
pass
self.failUnlessEqual(2,f2.getMesh().getSpaceDimension());
self.failUnlessEqual(2,f2.getMesh().getMeshDimension());
m2C=f2.getMesh();
- self.failUnlessEqual(8,m2C.getMeshLength());
+ self.failUnlessEqual(8,m2C.getNodalConnectivityArrayLen());
for i in xrange(8):#8 is not an error
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12);
pass
self.failUnlessEqual(2,f2.getMesh().getSpaceDimension());
self.failUnlessEqual(2,f2.getMesh().getMeshDimension());
m2C=f2.getMesh();
- self.failUnlessEqual(13,m2C.getMeshLength());
+ self.failUnlessEqual(13,m2C.getNodalConnectivityArrayLen());
for i in xrange(12):
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12);
pass
arr1=[7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5]
array.setValues(arr1,mesh1.getNumberOfCells(),6);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.doublyContractedProduct();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
for i in xrange(5):
array.setValues(arr1,mesh1.getNumberOfCells(),4);
f1.setArray(array);
#4 components
- f1.checkCoherency();
+ f1.checkConsistencyLight();
f2=f1.determinant();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(CONST_ON_TIME_INTERVAL,f2.getTimeDiscretization());
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfValues());
1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7]
array.setValues(arr2,mesh1.getNumberOfNodes(),6);
f1.setArray(array);
- self.assertRaises(InterpKernelException,f1.checkCoherency);#no end array specified !
+ self.assertRaises(InterpKernelException,f1.checkConsistencyLight);#no end array specified !
#
f2=f1.determinant();
self.assertEqual(LINEAR_TIME,f2.getTimeDiscretization());
7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5]
array.setValues(arr3,mesh1.getNumberOfNodes(),6);
f1.setEndArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
f2=f1.determinant();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(LINEAR_TIME,f2.getTimeDiscretization());
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(9,f2.getNumberOfTuples());
array.setValues(arr4,mesh1.getNumberOfCells(),9);
f1.setArray(array);
#
- f1.checkCoherency();
+ f1.checkConsistencyLight();
f2=f1.determinant();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(ONE_TIME,f2.getTimeDiscretization());
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
arr1=[1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7]
array.setValues(arr1,mesh1.getNumberOfCells(),6);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.eigenValues();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(3,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
expected1=[13.638813677891717,-4.502313844635971,-2.2364998332557486]
arr1=[1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7]
array.setValues(arr1,mesh1.getNumberOfCells(),6);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.eigenVectors();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(9,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
expected1=[0.5424262364180696, 0.5351201064614425, 0.6476266283176001,#eigenvect 0
arr1=[1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1]
array.setValues(arr1,mesh1.getNumberOfCells(),9);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.inverse();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(9,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
expected1=[-2.6538108356290113, 2.855831037649208, -1.1111111111111067, 3.461891643709813, -4.775022956841121, 2.2222222222222143, -1.1111111111111054, 2.222222222222214, -1.1111111111111072]
arr3=[7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5]
array.setValues(arr3,mesh1.getNumberOfCells(),6);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.inverse();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(6,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
expected3=[-0.3617705098531818, -0.8678630828458127, -0.026843764174972983, 0.5539957431465833, 0.13133439560823013, -0.05301294502145887]
arr2=[1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5]
array.setValues(arr2,mesh1.getNumberOfCells(),4);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.inverse();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(4,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
expected2=[-1.8595041322314059, 0.9504132231404963, 1.404958677685951, -0.49586776859504156]
arr1=[1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1, 1.2,2.3,3.4,4.5,5.6,6.7,7.8,8.9,9.1]
array.setValues(arr1,mesh1.getNumberOfCells(),9);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.trace();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
for i in xrange(5):
arr3=[7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5, 7.8,8.9,9.1,10.2,23.4,34.5]
array.setValues(arr3,mesh1.getNumberOfCells(),6);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.trace();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
for i in xrange(5):
arr2=[1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5, 1.2,2.3,3.4,4.5]
array.setValues(arr2,mesh1.getNumberOfCells(),4);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.trace();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
for i in xrange(5):
arr1=[1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7, 1.2,2.3,3.4,4.5,5.6,6.7]
array.setValues(arr1,mesh1.getNumberOfCells(),6);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.deviator();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(6,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
expected1=[-1.1,0.,1.1,4.5,5.6,6.7]
arr1=[1.2,2.3,3.4,4.5,5.6, 1.2,2.3,3.4,4.5,5.6, 1.2,2.3,3.4,4.5,5.6, 1.2,2.3,3.4,4.5,5.6, 1.2,2.3,3.4,4.5,5.6]
array.setValues(arr1,mesh1.getNumberOfCells(),5);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.magnitude();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
for i in xrange(5):
arr1=[1.2,2.3,3.4,4.5,5.6, 1.2,3.4,4.5,5.6,2.3, 3.4,4.5,5.6,1.2,2.3, 5.6,1.2,2.3,3.4,4.5, 4.5,5.6,1.2,2.3,3.4]
array.setValues(arr1,mesh1.getNumberOfCells(),5);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=f1.maxPerTuple();
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(1,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
for i in xrange(5):
arr1=[1.2,2.3,3.4,4.5,5.6, 1.2,3.4,4.5,5.6,2.3, 3.4,4.5,5.6,1.2,2.3, 5.6,1.2,2.3,3.4,4.5, 4.5,5.6,1.2,2.3,3.4]
array.setValues(arr1,mesh1.getNumberOfCells(),5);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f1.changeNbOfComponents(3,7.77);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(3,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
expected1=[1.2,2.3,3.4, 1.2,3.4,4.5, 3.4,4.5,5.6, 5.6,1.2,2.3, 4.5,5.6,1.2]
self.assertAlmostEqual(expected1[i],f1.getIJ(0,i),13);
pass
f1.changeNbOfComponents(4,7.77);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(4,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
expected2=[1.2,2.3,3.4,7.77, 1.2,3.4,4.5,7.77, 3.4,4.5,5.6,7.77, 5.6,1.2,2.3,7.77, 4.5,5.6,1.2,7.77]
arr1=[1.2,2.3,3.4,4.5,5.6, 1.2,3.4,4.5,5.6,2.3, 3.4,4.5,5.6,1.2,2.3, 5.6,1.2,2.3,3.4,4.5, 4.5,5.6,1.2,2.3,3.4]
array.setValues(arr1,mesh1.getNumberOfCells(),5);
f1.setArray(array);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f1.sortPerTuple(True);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(5,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
for i in xrange(5):
pass
#
f1.sortPerTuple(False);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(5,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
for i in xrange(5):
f1.setMesh(m)
f1.setName("myField");
f1.fillFromAnalytic(1,"y+x");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getName(),"myField");
self.assertEqual(f1.getTypeOfField(),ON_CELLS);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
f1.setMesh(m)
f1.fillFromAnalytic(1,"y+2*x");
f1.setEndTime(1.2,3,4);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),CONST_ON_TIME_INTERVAL);
self.assertEqual(1,f1.getNumberOfComponents());
f1.setMesh(m)
f1.fillFromAnalytic(1,"2.*x+y");
f1.setEndTime(1.2,3,4);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),LINEAR_TIME);
self.assertEqual(1,f1.getNumberOfComponents());
f1=MEDCouplingFieldDouble.New(ON_NODES,ONE_TIME);
f1.setMesh(m)
f1.fillFromAnalytic(2,"(x+y)*IVec+2*(x+y)*JVec");
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(f1.getTypeOfField(),ON_NODES);
self.assertEqual(f1.getTimeDiscretization(),ONE_TIME);
self.assertEqual(2,f1.getNumberOfComponents());
self.assertRaises(InterpKernelException,f1.assign,0.07);
f1.setMesh(m);
f1.assign(0.07);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(1,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
for i in xrange(5):
self.assertAlmostEqual(0.07,f1.getIJ(i,0),16);
pass
f1.assign(0.09);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(1,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
for i in xrange(5):
f1.setEndTime(4.5,2,3);
f1.setMesh(m);
f1.assign(0.08);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertEqual(1,f1.getNumberOfComponents());
self.assertEqual(9,f1.getNumberOfTuples());
for i in xrange(9):
mesh.insertNextCell(NORM_PENTA6,6,[i+8 for i in tmpConn])
mesh.insertNextCell(NORM_PYRA5,5,[i+14 for i in tmpConn])
mesh.finishInsertingCells();
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
mesh.mergeNodes(1e-7)
self.assertEqual(12,mesh.getNumberOfNodes());
vols=mesh.getMeasureField(True);
self.assertAlmostEqual(volHexa8,vols.getIJ(0,0),6);
self.assertAlmostEqual(volPenta6,vols.getIJ(1,0),7);
self.assertAlmostEqual(volPyra5,vols.getIJ(2,0),7);
- bary=mesh.getBarycenterAndOwner();
+ bary=mesh.computeCellCenterOfMass();
self.assertEqual(3,bary.getNumberOfTuples());
self.assertEqual(3,bary.getNumberOfComponents());
self.assertAlmostEqual(baryHexa8[0],bary.getIJ(0,0),11);
discZ=[-0.7,1.2,1.25,2.13,2.67]
da.setValues(discX,4,1);
m.setCoordsAt(0,da);
- m.checkCoherency();
+ m.checkConsistencyLight();
self.assertEqual(4,m.getNumberOfNodes());
self.assertEqual(3,m.getNumberOfCells());
self.assertEqual(1,m.getSpaceDimension());
for i in xrange(4):
self.assertAlmostEqual(discX[i],coords.getIJ(i,0),12);
pass
- coords=m.getBarycenterAndOwner();
+ coords=m.computeCellCenterOfMass();
self.assertEqual(3,coords.getNumberOfTuples());
self.assertEqual(1,coords.getNumberOfComponents());
expected1_3=[2.85,4.6,8.]
da=DataArrayDouble.New();
da.setValues(discY,3,1);
m.setCoordsAt(1,da);
- m.checkCoherency();
+ m.checkConsistencyLight();
self.assertEqual(12,m.getNumberOfNodes());
self.assertEqual(6,m.getNumberOfCells());
self.assertEqual(2,m.getSpaceDimension());
for i in xrange(24):
self.assertAlmostEqual(expected2_2[i],coords.getIJ(0,i),12);
pass
- coords=m.getBarycenterAndOwner();
+ coords=m.computeCellCenterOfMass();
self.assertEqual(6,coords.getNumberOfTuples());
self.assertEqual(2,coords.getNumberOfComponents());
expected2_3=[2.85,17.85,4.6,17.85,8.,17.85, 2.85,34.6,4.6,34.6,8.,34.6]
da=DataArrayDouble.New();
da.setValues(discZ,5,1);
m.setCoordsAt(2,da);
- m.checkCoherency();
+ m.checkConsistencyLight();
self.assertEqual(60,m.getNumberOfNodes());
self.assertEqual(24,m.getNumberOfCells());
self.assertEqual(3,m.getSpaceDimension());
for i in xrange(180):
self.assertAlmostEqual(expected3_2[i],coords.getIJ(0,i),12);
pass
- coords=m.getBarycenterAndOwner();
+ coords=m.computeCellCenterOfMass();
self.assertEqual(24,coords.getNumberOfTuples());
self.assertEqual(3,coords.getNumberOfComponents());
expected3_3=[
f=m.fillFromAnalytic(ON_NODES,2,"x*2.");
f.getArray().setInfoOnComponent(0,"titi");
f.getArray().setInfoOnComponent(1,"tutu");
- f.checkCoherency();
+ f.checkConsistencyLight();
self.assertEqual(18,f.getNumberOfTuples());
self.assertEqual(2,f.getNumberOfComponents());
expected1=[-0.6, -0.6, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, 0.4, 0.4]
self.assertAlmostEqual(expected1[i],f.getIJ(0,i),12);
pass
self.assertTrue(f.zipCoords());
- f.checkCoherency();
+ f.checkConsistencyLight();
expected2=[-0.6, -0.6, 1.4, 1.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, 1.4, 1.4, -0.6, -0.6, 0.4, 0.4, 1.4, 1.4, 0.4, 0.4]
for i in xrange(30):
self.assertAlmostEqual(expected2[i],f.getIJ(0,i),12);
pass
self.assertTrue(not f.zipCoords());
- f.checkCoherency();
+ f.checkConsistencyLight();
for i in xrange(30):
self.assertAlmostEqual(expected2[i],f.getIJ(0,i),12);
pass
pass
f.getArray().setInfoOnComponent(0,"titi");
f.getArray().setInfoOnComponent(1,"tutu");
- f.checkCoherency();
+ f.checkConsistencyLight();
self.assertTrue(f.zipConnectivity(0));
expected2=[-0.05, -0.05, 0.3666666666666667, 0.3666666666666667, 0.53333333333333321, 0.53333333333333321,
-0.05, -0.05, 0.45, 0.45, 0.36666666666666659, 0.36666666666666659, 0.033333333333333326, 0.033333333333333326];
f.setArray(a);
f.setMesh(m2);
#
- f.checkCoherency();
+ f.checkConsistencyLight();
m=f.getMaxValue();
self.assertAlmostEqual(8.71,m,12);
m,ws=f.getMaxValue2();
#
arr2=[-8.71,-4.53,12.41,-8.71,8.71,-8.7099,-4.55,-8.71,-5.55,-6.77,1e-200,-4.55,-8.7099,0.,-1.23,0.,-2.22,-8.71]
a.setValues(arr2,18,1);
- f.checkCoherency();
+ f.checkConsistencyLight();
m=f.getMinValue();
self.assertAlmostEqual(-8.71,m,12);
m,ws=f.getMinValue2();
discZ=[-0.7,1.2,1.25,2.13,2.67]
da.setValues(discX,4,1);
m.setCoordsAt(0,da);
- m.checkCoherency();
+ m.checkConsistencyLight();
self.assertEqual(0,m.getCellContainingPoint([2.4],1e-12));
self.assertEqual(1,m.getCellContainingPoint([3.7],1e-12));
self.assertEqual(2,m.getCellContainingPoint([5.9],1e-12));
self.assertEqual(-1,m.getCellContainingPoint([1.3],1e-12));
#
m2=m.buildUnstructured();
- m2.checkCoherency();
+ m2.checkConsistencyLight();
f1=m.getMeasureField(False);
f2=m2.getMeasureField(False);
self.assertTrue(isinstance(f1.getMesh(),MEDCouplingCMesh))
m.setCoordsAt(1,da);
#
m2=m.buildUnstructured();
- m2.checkCoherency();
+ m2.checkConsistencyLight();
f1=m.getMeasureField(False);
f2=m2.getMeasureField(False);
self.assertEqual(f1.getNumberOfTuples(),6);
da.setValues(discZ,5,1);
m.setCoordsAt(2,da);
m2=m.buildUnstructured();
- m2.checkCoherency();
+ m2.checkConsistencyLight();
f1=m.getMeasureField(False);
f2=m2.getMeasureField(False);
self.assertEqual(f1.getNumberOfTuples(),24);
f1.setMesh(m1);
f1.setName("f1");
f1.setArray(a1);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
arr2V=[1,2,1,2,0,0]
f2=f1.keepSelectedComponents(arr2V);
self.assertAlmostEqual(2.3,t,13);
self.assertEqual(4,dt);
self.assertEqual(5,it);
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertEqual(6,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
self.assertTrue(f2.getArray().getInfoOnComponent(0)=="bbbb");
f5.setTime(6.7,8,9);
f5.getArray().setInfoOnComponent(0,"eeee");
f5.getArray().setInfoOnComponent(1,"ffff");
- f5.checkCoherency();
+ f5.checkConsistencyLight();
arr4V=[1,2]
f2.setSelectedComponents(f5,arr4V);
self.assertEqual(6,f2.getNumberOfComponents());
self.assertEqual(5,f2.getNumberOfTuples());
- f2.checkCoherency();
+ f2.checkConsistencyLight();
t,dt,it=f2.getTime()
self.assertAlmostEqual(2.3,t,13);
self.assertEqual(4,dt);
self.assertTrue(not ((dd.reprZip().find("Number of components : 1"))==-1));
self.assertTrue(not ((dbl.reprZip().find("Number of components : 1"))==-1));
- self.assertRaises(InterpKernelException, dbl.selectByTupleId2, 0, 1, -1);
- self.assertRaises(InterpKernelException, dbl.substr, -1, 1);
- self.assertRaises(InterpKernelException, dbl.substr, 8, 1);
- self.assertRaises(InterpKernelException, dbl.substr, 0, 8);
+ self.assertRaises(InterpKernelException, dbl.selectByTupleIdSafeSlice, 0, 1, -1);
+ self.assertRaises(InterpKernelException, dbl.subArray, -1, 1);
+ self.assertRaises(InterpKernelException, dbl.subArray, 8, 1);
+ self.assertRaises(InterpKernelException, dbl.subArray, 0, 8);
self.assertRaises(InterpKernelException, dbl.meldWith, dd);
self.assertRaises(InterpKernelException, dbl.setPartOfValuesAdv, dbl2, da); #dbl dbl2 not have the same number of components
dbl3.setIJ(5,0,0.);
self.assertRaises(InterpKernelException, dbl3.checkNoNullValues);
self.assertRaises(InterpKernelException, dbl3.applyInv, 1.); #div by zero
- self.assertRaises(InterpKernelException, dbl2.getIdsInRange, 1., 2.);
+ self.assertRaises(InterpKernelException, dbl2.findIdsInRange, 1., 2.);
a=[]
self.assertRaises(InterpKernelException, DataArrayDouble_Aggregate, a);
self.assertRaises(InterpKernelException, DataArrayDouble_Meld, a);
tab1=[5,-2,-4,-2,3,2,-2];
da=DataArrayInt.New();
da.setValues(tab1,7,1);
- da2=da.getIdsEqual(-2);
+ da2=da.findIdsEqual(-2);
self.assertEqual(3,da2.getNumberOfTuples());
self.assertEqual(1,da2.getNumberOfComponents());
expected1=[1,3,6];
tab1=[5,-2,-4,-2,3,2,-2];
da=DataArrayInt.New();
da.setValues(tab1,7,1);
- da2=da.getIdsEqualList([3,-2,0]);
+ da2=da.findIdsEqualList([3,-2,0]);
self.assertEqual(4,da2.getNumberOfTuples());
self.assertEqual(1,da2.getNumberOfComponents());
expected1=[1,3,4,6];
mesh.convertToPolyTypes(eltsV);
mesh.unPolyze();
mesh2=MEDCouplingDataForTest.build3DTargetMesh_1();
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
self.assertTrue(mesh.isEqual(mesh2,1e-12));
mesh.convertToPolyTypes(eltsV);
self.assertTrue(not mesh.isEqual(mesh2,1e-12));
mesh.insertNextCell(NORM_HEXA8,8,conn[16:24])
mesh.insertNextCell(NORM_HEXA8,8,conn[24:32])
mesh.finishInsertingCells();
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
self.assertEqual(4,mesh.getNumberOfCells());
self.assertEqual(NORM_HEXA8,mesh.getTypeOfCell(0));
self.assertEqual(NORM_HEXA8,mesh.getTypeOfCell(1));
self.assertEqual(NORM_HEXA8,mesh.getTypeOfCell(3));
f1=mesh.getMeasureField(True);
mesh.convertDegeneratedCells();
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
f2=mesh.getMeasureField(True);
self.assertEqual(4,mesh.getNumberOfCells());
self.assertEqual(NORM_PENTA6,mesh.getTypeOfCell(0));
self.assertTrue(tmp2);
self.assertEqual(37,tmp3);
i.convertDegeneratedCells();
- i.checkCoherency();
+ i.checkConsistencyLight();
self.assertEqual(36,i.getNumberOfCells());
self.assertEqual(37,i.getNumberOfNodes());
self.assertEqual(12,i.getNumberOfCellsWithType(NORM_TRI3));
pass
pass
expected2=[0.62200846792814113, 0.16666666666681595, 1.4513530918323276, 0.38888888888923495, 2.6293994326053212, 0.7045454545460802, 0.45534180126145435, 0.45534180126150181, 1.0624642029433926, 1.0624642029435025, 1.9248539780597826, 1.9248539780599816, 0.16666666666661334, 0.62200846792815856, 0.38888888888876294, 1.4513530918323678, 0.70454545454522521, 2.629399432605394, -0.16666666666674007, 0.62200846792812436, -0.38888888888906142, 1.4513530918322881, -0.70454545454576778, 2.6293994326052488, -0.45534180126154766, 0.45534180126140844, -1.0624642029436118, 1.0624642029432834, -1.9248539780601803, 1.9248539780595841, -0.62200846792817499, 0.1666666666665495, -1.451353091832408, 0.388888888888613, -2.6293994326054668, 0.70454545454495332, -0.62200846792810593, -0.16666666666680507, -1.451353091832247, -0.38888888888921297, -2.6293994326051746, -0.70454545454604123, -0.45534180126135926, -0.45534180126159562, -1.0624642029431723, -1.0624642029437235, -1.9248539780593836, -1.9248539780603811, -0.1666666666664828, -0.62200846792819242, -0.38888888888846079, -1.4513530918324489, -0.70454545454467987, -2.6293994326055397, 0.16666666666687083, -0.62200846792808862, 0.38888888888936374, -1.4513530918322073, 0.70454545454631357, -2.6293994326051022, 0.45534180126164348, -0.45534180126131207, 1.0624642029438327, -1.0624642029430627, 1.9248539780605791, -1.9248539780591853, 0.62200846792821063, -0.16666666666641802, 1.4513530918324888, -0.38888888888831086, 2.6293994326056125, -0.70454545454440853]
- m=i.getBarycenterAndOwner();
+ m=i.computeCellCenterOfMass();
for i in xrange(72):
self.assertAlmostEqual(expected2[i],m.getIJ(0,i),10);
pass
center=[0.,0.]
f.rotate(center,None,pi/3);
g=c.buildExtrudedMesh(f,0);
- g.checkCoherency();
+ g.checkConsistencyLight();
expected1=[ 0.4330127018922193, 0.4330127018922193, 0.649519052838329, 1.2990381056766578, 1.299038105676658, 1.948557158514987, 2.1650635094610955, 2.1650635094610964, 3.2475952641916446, 3.031088913245533, 3.0310889132455352, 4.546633369868303 ]
f1=g.getMeasureField(True);
for i in xrange(12):
self.assertAlmostEqual(expected1[i],f1.getIJ(0,i),12);
pass
expected2=[0.625, 0.21650635094610962, 1.625, 0.21650635094610959, 2.8750000000000004, 0.21650635094610965, 1.1250000000000002, 1.0825317547305482, 2.125, 1.0825317547305482, 3.3750000000000004, 1.0825317547305484, 2.125, 2.8145825622994254, 3.125, 2.8145825622994254, 4.375, 2.8145825622994254, 3.6250000000000009, 5.4126587736527414, 4.625, 5.4126587736527414, 5.875, 5.4126587736527414]
- f2=g.getBarycenterAndOwner();
+ f2=g.computeCellCenterOfMass();
for i in xrange(24):
self.assertAlmostEqual(expected2[i],f2.getIJ(0,i),12);
pass
for i in xrange(7):
self.assertEqual(expected2[i],da.getIJ(i,0));
pass
- m.checkCoherency();
+ m.checkConsistencyLight();
self.assertEqual(7,m.getNumberOfCells());
self.assertEqual(NORM_TRI3,m.getTypeOfCell(0));
self.assertEqual(NORM_TRI3,m.getTypeOfCell(1));
for i in xrange(7):
self.assertEqual(expected2[i],da.getIJ(i,0));
pass
- m.checkCoherency();
+ m.checkConsistencyLight();
types=m.getAllGeoTypes();
self.assertEqual([NORM_TRI3,NORM_POLYGON],types);
self.assertEqual(7,m.getNumberOfCells());
arr.setValues(arr1,5,2);
f1.setArray(arr);
#
- f1.checkCoherency();
+ f1.checkConsistencyLight();
self.assertTrue(f1.simplexize(0));
- f1.checkCoherency();
+ f1.checkConsistencyLight();
expected1=[10.,110.,10.,110.,20.,120.,30.,130.,40.,140.,50.,150.,50.,150.]
for i in xrange(14):
self.assertAlmostEqual(expected1[i],f1.getIJ(0,i),10);
da3.setInfoOnComponent(1,"c1da3");
da3.setInfoOnComponent(2,"c2da3");
#
- da1C=da1.deepCpy();
+ da1C=da1.deepCopy();
da1.meldWith(da3);
self.assertEqual(5,da1.getNumberOfComponents());
self.assertEqual(7,da1.getNumberOfTuples());
da1.setInfoOnComponent(0,"aaa");
f1.setArray(da1);
f1.setTime(3.4,2,1);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
- f2=f1.deepCpy();
+ f2=f1.deepCopy();
f2.setMesh(f1.getMesh());
- f2.checkCoherency();
+ f2.checkConsistencyLight();
f2.changeNbOfComponents(2,5.);
f2.assign(5.);
f2.getArray().setInfoOnComponent(0,"bbb");
f2.getArray().setInfoOnComponent(1,"ccc");
- f2.checkCoherency();
+ f2.checkConsistencyLight();
#
f3=MEDCouplingFieldDouble.MeldFields(f2,f1);
- f3.checkCoherency();
+ f3.checkConsistencyLight();
self.assertEqual(5,f3.getNumberOfTuples());
self.assertEqual(3,f3.getNumberOfComponents());
self.assertTrue(f3.getArray().getInfoOnComponent(0)=="bbb");
f4=f2.buildNewTimeReprFromThis(NO_TIME,False);
f5=f1.buildNewTimeReprFromThis(NO_TIME,False);
f6=MEDCouplingFieldDouble.MeldFields(f4,f5);
- f6.checkCoherency();
+ f6.checkConsistencyLight();
self.assertEqual(5,f6.getNumberOfTuples());
self.assertEqual(3,f6.getNumberOfComponents());
self.assertTrue(f6.getArray().getInfoOnComponent(0)=="bbb");
m2.translate(vec);
#
m3=MEDCouplingUMesh.MergeUMeshes([m1,m2]);
- da,b,newNbOfNodes=m3.mergeNodes2(0.01);
+ da,b,newNbOfNodes=m3.mergeNodesCenter(0.01);
self.assertEqual(9,m3.getNumberOfNodes());
expected1=[-0.299,-0.3, 0.201,-0.3, 0.701,-0.3, -0.299,0.2, 0.201,0.2, 0.701,0.2, -0.299,0.7, 0.201,0.7, 0.701,0.7]
for i in xrange(18):
myCoords=DataArrayDouble.New();
myCoords.setValues(targetCoords,9,2);
targetMesh.setCoords(myCoords);
- targetMesh.checkCoherency();
+ targetMesh.checkConsistencyLight();
pass
def testFieldOperatorDivDiffComp1(self):
f2=MEDCouplingFieldDouble.New(ON_CELLS);
f2.setArray(arr);
f2.setMesh(m1);
- f2.checkCoherency();
+ f2.checkConsistencyLight();
#
f3=f1/f2;
self.assertRaises(InterpKernelException,f2.__div__,f1)
- f3.checkCoherency();
+ f3.checkConsistencyLight();
f1/=f2;
#self.assertRaises(InterpKernelException,f2.__idiv__,f1) # mem leaks
self.assertTrue(f1.isEqual(f3,1e-10,1e-10));
pass
self.assertEqual([4, 3, 2, 7, 6, 5, 10, 9, 8, 13, 12, 11],li)
# __setitem__ testing
- da3=da.deepCpy()
+ da3=da.deepCopy()
da2=DataArrayInt.New()
da2.alloc(12,1)
da2.iota(2002)
pass
self.assertTrue(da.isEqual(da2))
da=da3
- da3=da.deepCpy()
+ da3=da.deepCopy()
#
for it in da:
it[:]=5
da.rearrange(1)
self.assertTrue(da.isUniform(5))
da=da3
- da3=da.deepCpy()
+ da3=da.deepCopy()
#
for it in da:
it[:]=[8,9,12]
pass
self.assertEqual([8, 9, 12, 8, 9, 12, 8, 9, 12, 8, 9, 12],da.getValues())
da=da3
- da3=da.deepCpy()
+ da3=da.deepCopy()
#
for it in da:
it[2]=[7]
pass
self.assertEqual([4, 3, 2, 7, 6, 5, 10, 9, 8, 13, 12, 11],li)
# __setitem__ testing
- da3=da.deepCpy()
+ da3=da.deepCopy()
da2=DataArrayDouble.New()
da2.alloc(12,1)
da2.iota(2002)
pass
self.assertTrue(da.isEqual(da2,1e-12))
da=da3
- da3=da.deepCpy()
+ da3=da.deepCopy()
#
for it in da:
it[:]=5
da.rearrange(1)
self.assertTrue(da.isUniform(5,1e-12))
da=da3
- da3=da.deepCpy()
+ da3=da.deepCopy()
#
for it in da:
it[:]=[8,9,12]
pass
self.assertEqual([8, 9, 12, 8, 9, 12, 8, 9, 12, 8, 9, 12],da.getValues())
da=da3
- da3=da.deepCpy()
+ da3=da.deepCopy()
#
for it in da:
it[2]=[7]
self.assertRaises(InterpKernelException,MEDCouplingUMesh.MergeUMeshes,ms+[None]);
self.assertRaises(InterpKernelException,MEDCouplingUMesh.MergeUMeshes,ms+[3.4])
m4=MEDCouplingUMesh.MergeUMeshes(ms);
- m4.checkCoherency();
+ m4.checkConsistencyLight();
self.assertEqual(10,m4.getNumberOfCells());
self.assertEqual(20,m4.getNumberOfNodes());
- self.assertEqual(45,m4.getMeshLength());
+ self.assertEqual(45,m4.getNodalConnectivityArrayLen());
m4bis=MEDCouplingMesh.MergeMeshes(ms);
self.assertTrue(m4.isEqual(m4bis,1e-12))
del m4bis
coo.setValues(sourceCoords,4,3);
coo.setName("My0D");
m=MEDCouplingUMesh.Build0DMeshFromCoords(coo);
- m.checkCoherency();
+ m.checkConsistencyLight();
self.assertEqual(4,m.getNumberOfNodes());
self.assertEqual(4,m.getNumberOfCells());
self.assertEqual(3,m.getSpaceDimension());
m=MEDCouplingDataForTest.build2DTargetMesh_1();
m.setDescription(text1);
self.assertEqual(m.getDescription(),text1);
- m2=m.deepCpy();
+ m2=m.deepCopy();
self.assertTrue(m.isEqual(m2,1e-12));
self.assertEqual(m2.getDescription(),text1);
m2.setDescription("ggg");
f=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME);
f.setTimeUnit(text1);
self.assertEqual(f.getTimeUnit(),text1);
- f2=f.deepCpy();
+ f2=f.deepCopy();
self.assertEqual(f2.getTimeUnit(),text1);
#
pass
self.assertEqual(2,len(dms));
self.assertEqual(6,len(das));
self.assertEqual(5,len(das2));
- mfs2=mfs.deepCpy();
+ mfs2=mfs.deepCopy();
self.assertTrue(mfs.isEqual(mfs2,1e-12,1e-12))
pass
da.iota(0);
da2=da.checkAndPreparePermutation();
self.assertEqual(1,da2.getNumberOfComponents());
- self.assertTrue(da2.isIdentity2(8));
+ self.assertTrue(da2.isIota(8));
#
da=DataArrayInt.New();
da.alloc(8,1);
def testUMeshFindCellIdsOnBoundary1(self):
m=MEDCouplingDataForTest.build3DSurfTargetMesh_1();
da5=m.findCellIdsOnBoundary();
- self.assertTrue(da5.isIdentity2(5));
+ self.assertTrue(da5.isIota(5));
pass
def testMeshSetTime1(self):
self.assertTrue(not m1.isEqual(m2,1e-12));
#
m1.setTime(10.34,55,12);
- m3=m1.deepCpy();
+ m3=m1.deepCopy();
self.assertTrue(m1.isEqual(m3,1e-12));
tmp3,tmp1,tmp2=m3.getTime();
self.assertEqual(55,tmp1);
self.assertEqual(8,tmp1);
self.assertEqual(100,tmp2);
self.assertAlmostEqual(5.67,tmp3,12);
- c=b.deepCpy();
+ c=b.deepCopy();
self.assertTrue(c.isEqual(b,1e-12));
tmp3,tmp1,tmp2=c.getTime();
self.assertEqual(8,tmp1);
da.setValues(vals,5,3);
f1.setArray(da);
#
- self.assertRaises(InterpKernelException,da.applyFunc2,1,"y+z");
+ self.assertRaises(InterpKernelException,da.applyFuncCompo,1,"y+z");
da.setInfoOnComponent(0,"x [m]");
da.setInfoOnComponent(1,"y [mm]");
da.setInfoOnComponent(2,"z [km]");
- self.assertRaises(InterpKernelException, da.applyFunc2, 1, "x+y+zz+zzz");
- self.assertRaises(InterpKernelException, da.applyFunc2, 1, "toto(x+y)");
- self.assertRaises(InterpKernelException, da.applyFunc2, 1, "x/0");
+ self.assertRaises(InterpKernelException, da.applyFuncCompo, 1, "x+y+zz+zzz");
+ self.assertRaises(InterpKernelException, da.applyFuncCompo, 1, "toto(x+y)");
+ self.assertRaises(InterpKernelException, da.applyFuncCompo, 1, "x/0");
- da2=da.applyFunc2(1,"y+z");
+ da2=da.applyFuncCompo(1,"y+z");
self.assertEqual(1,da2.getNumberOfComponents());
self.assertEqual(5,da2.getNumberOfTuples());
expected1=[32.,34.,36.,38.,40.]
#
self.assertEqual(3,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
- f1.applyFunc2(1,"y+z");
+ f1.applyFuncCompo(1,"y+z");
self.assertEqual(1,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
for i in xrange(5):
#
vs=3*[None];
vs[0]="x"; vs[1]="Y"; vs[2]="z";
- self.assertRaises(InterpKernelException, da.applyFunc3, 1, vs, "y+z");
- self.assertRaises(InterpKernelException, da.applyFunc3, 1, vs, "x+Y+z+zz+zzz");
- self.assertRaises(InterpKernelException, da.applyFunc3, 1, vs, "x/0");
+ self.assertRaises(InterpKernelException, da.applyFuncNamedCompo, 1, vs, "y+z");
+ self.assertRaises(InterpKernelException, da.applyFuncNamedCompo, 1, vs, "x+Y+z+zz+zzz");
+ self.assertRaises(InterpKernelException, da.applyFuncNamedCompo, 1, vs, "x/0");
vs[1]="y";
- da2=da.applyFunc3(1,vs,"y+z");
+ da2=da.applyFuncNamedCompo(1,vs,"y+z");
expected1=[32.,34.,36.,38.,40.]
for i in xrange(5):
self.assertAlmostEqual(expected1[i],da2.getIJ(0,i),12);
pass
- self.assertRaises(InterpKernelException, da.applyFunc3, 1, ["x","y","z","a"],"x+a")
+ self.assertRaises(InterpKernelException, da.applyFuncNamedCompo, 1, ["x","y","z","a"],"x+a")
f1.setArray(da);
self.assertEqual(3,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
- f1.applyFunc3(1,vs,"y+z");
+ f1.applyFuncNamedCompo(1,vs,"y+z");
self.assertEqual(1,f1.getNumberOfComponents());
self.assertEqual(5,f1.getNumberOfTuples());
for i in xrange(5):
def testFillFromAnalyticTwo1(self):
m1=MEDCouplingDataForTest.build3DSurfTargetMesh_1();
m1.setTime(3.4,5,6); m1.setTimeUnit("us");
- self.assertRaises(InterpKernelException,m1.fillFromAnalytic2,ON_NODES,1,"y+z");
+ self.assertRaises(InterpKernelException,m1.fillFromAnalyticCompo,ON_NODES,1,"y+z");
m1.getCoords().setInfoOnComponent(0,"x [m]");
m1.getCoords().setInfoOnComponent(1,"y");
m1.getCoords().setInfoOnComponent(2,"z");
- f1=m1.fillFromAnalytic2(ON_NODES,1,"y+z");
+ f1=m1.fillFromAnalyticCompo(ON_NODES,1,"y+z");
self.assertAlmostEqual(3.4,f1.getTime()[0],12) ; self.assertEqual(5,f1.getTime()[1]) ; self.assertEqual(6,f1.getTime()[2])
self.assertEqual("us",f1.getTimeUnit())
self.assertEqual(1,f1.getNumberOfComponents());
m1.setTime(3.4,5,6); m1.setTimeUnit("us");
vs=3*[None];
vs[0]="x"; vs[1]="Y"; vs[2]="z";
- self.assertRaises(InterpKernelException,m1.fillFromAnalytic3,ON_NODES,1,vs,"y+z");
+ self.assertRaises(InterpKernelException,m1.fillFromAnalyticNamedCompo,ON_NODES,1,vs,"y+z");
vs[1]="y";
- f1=m1.fillFromAnalytic3(ON_NODES,1,vs,"y+z");
+ f1=m1.fillFromAnalyticNamedCompo(ON_NODES,1,vs,"y+z");
self.assertAlmostEqual(3.4,f1.getTime()[0],12) ; self.assertEqual(5,f1.getTime()[1]) ; self.assertEqual(6,f1.getTime()[2])
self.assertEqual("us",f1.getTimeUnit())
self.assertEqual(1,f1.getNumberOfComponents());
values1=[7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.]
arr.setValues(values1,nbOfCells,3);
loc=[-0.05,-0.05, 0.55,-0.25, 0.55,0.15, -0.05,0.45, 0.45,0.45]
- f.checkCoherency();
+ f.checkConsistencyLight();
locs=f.getValueOnMulti(loc);
self.assertEqual(5,locs.getNumberOfTuples());
self.assertEqual(3,locs.getNumberOfComponents());
arr.setValues(values2,nbOfNodes,3);
loc2=[0.5432,-0.2432, 0.5478,0.1528, 0.5432,-0.2432, 0.5432,-0.2432]
expected2=[9.0272, 109.0272, 10009.0272, 11.4124,111.4124,10011.4124, 9.0272, 109.0272, 10009.0272, 9.0272, 109.0272, 10009.0272]
- f.checkCoherency();
+ f.checkConsistencyLight();
loc3=DataArrayDouble.New()
loc3.setValues(loc2,4,2);
locs=f.getValueOnMulti(loc3);
d=DataArrayInt.New();
vals1=[2,3,5,6,8,5,5,6,1,-5]
d.setValues(vals1,10,1);
- d2=d.getIdsNotEqual(5);
+ d2=d.findIdsNotEqual(5);
self.assertEqual(7,d2.getNumberOfTuples());
self.assertEqual(1,d2.getNumberOfComponents());
expected1=[0,1,3,4,7,8,9]
self.assertEqual(expected1[i],d2.getIJ(0,i));
pass
d.rearrange(2);
- self.assertRaises(InterpKernelException,d.getIdsNotEqual,5);
+ self.assertRaises(InterpKernelException,d.findIdsNotEqual,5);
vals2=[-4,5,6]
vals3=vals2;
d.rearrange(1);
- d3=d.getIdsNotEqualList(vals3);
+ d3=d.findIdsNotEqualList(vals3);
self.assertEqual(5,d3.getNumberOfTuples());
self.assertEqual(1,d3.getNumberOfComponents());
expected2=[0,1,4,8,9]
mesh.insertNextCell(NORM_HEXGP12,12,conn[0:12])
mesh.finishInsertingCells();
#
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
vols=mesh.getMeasureField(False);
self.assertEqual(1,vols.getNumberOfTuples());
self.assertEqual(1,vols.getNumberOfComponents());
self.assertAlmostEqual(-5.196152422706632,vols.getIJ(0,0),12);
- bary=mesh.getBarycenterAndOwner();
+ bary=mesh.computeCellCenterOfMass();
self.assertEqual(1,bary.getNumberOfTuples());
self.assertEqual(3,bary.getNumberOfComponents());
expected1=[0.,0.,1.]
self.assertTrue(NORM_POLYHED==mesh.getTypeOfCell(0));
mesh.unPolyze();
self.assertTrue(NORM_HEXGP12==mesh.getTypeOfCell(0));
- self.assertEqual(13,mesh.getMeshLength());
+ self.assertEqual(13,mesh.getNodalConnectivityArrayLen());
#
pass
def testCheckCoherencyDeeper1(self):
m=MEDCouplingDataForTest.build3DSourceMesh_1();
- m.checkCoherency();
- m.checkCoherency1();
+ m.checkConsistencyLight();
+ m.checkConsistency();
m.getNodalConnectivity().setIJ(8,0,-1);
- m.checkCoherency();
- self.assertRaises(InterpKernelException,m.checkCoherency1);
+ m.checkConsistencyLight();
+ self.assertRaises(InterpKernelException,m.checkConsistency);
m.getNodalConnectivity().setIJ(8,0,-6);
- m.checkCoherency();
- self.assertRaises(InterpKernelException,m.checkCoherency1);
+ m.checkConsistencyLight();
+ self.assertRaises(InterpKernelException,m.checkConsistency);
m.getNodalConnectivity().setIJ(8,0,9);#9>=NbOfNodes
- m.checkCoherency();
- self.assertRaises(InterpKernelException,m.checkCoherency1);
+ m.checkConsistencyLight();
+ self.assertRaises(InterpKernelException,m.checkConsistency);
m.getNodalConnectivity().setIJ(8,0,8);#OK
- m.checkCoherency();
- m.checkCoherency1();
+ m.checkConsistencyLight();
+ m.checkConsistency();
elts=[1,5]
m.convertToPolyTypes(elts);
- m.checkCoherency();
- m.checkCoherency1();
+ m.checkConsistencyLight();
+ m.checkConsistency();
m.getNodalConnectivity().setIJ(2,0,9);#9>=NbOfNodes
- m.checkCoherency();
- self.assertRaises(InterpKernelException,m.checkCoherency1);
+ m.checkConsistencyLight();
+ self.assertRaises(InterpKernelException,m.checkConsistency);
m.getNodalConnectivity().setIJ(2,0,-3);
- m.checkCoherency();
- self.assertRaises(InterpKernelException,m.checkCoherency1);
+ m.checkConsistencyLight();
+ self.assertRaises(InterpKernelException,m.checkConsistency);
m.getNodalConnectivity().setIJ(2,0,-1);
- m.checkCoherency();
- self.assertRaises(InterpKernelException,m.checkCoherency1);#Throw because cell#0 is not a polyhedron
+ m.checkConsistencyLight();
+ self.assertRaises(InterpKernelException,m.checkConsistency);#Throw because cell#0 is not a polyhedron
m.getNodalConnectivity().setIJ(2,0,4);
- m.checkCoherency();
- m.checkCoherency1();
+ m.checkConsistencyLight();
+ m.checkConsistency();
m.getNodalConnectivity().setIJ(7,0,-1);
- m.checkCoherency();
- m.checkCoherency1();#OK because we are in polyhedron connec
+ m.checkConsistencyLight();
+ m.checkConsistency();#OK because we are in polyhedron connec
m.getNodalConnectivity().setIJ(36,0,14);
- m.checkCoherency();
- self.assertRaises(InterpKernelException,m.checkCoherency1);#Throw beacause now cell 5 is a TETRA4 (14) so mimatch of number index and static type.
+ m.checkConsistencyLight();
+ self.assertRaises(InterpKernelException,m.checkConsistency);#Throw beacause now cell 5 is a TETRA4 (14) so mimatch of number index and static type.
pass
def testUnPolyze2(self):
m2.convertToPolyTypes([2]);
m2.unPolyze();
self.assertEqual(NORM_TETRA4,m2.getTypeOfCell(2));
- self.assertEqual(40,m2.getMeshLength());
+ self.assertEqual(40,m2.getNodalConnectivityArrayLen());
temp2=m2.getNodeIdsOfCell(2);
self.assertEqual(temp2,[0,1,2,3]);
- m2.checkCoherency1();
- m3=m2.deepCpy();
+ m2.checkConsistency();
+ m3=m2.deepCopy();
m2.unPolyze();
self.assertTrue(m3.isEqual(m2,1e-12));
pass
#
d1=DataArrayDouble.New();
self.assertTrue(not d.isEqual(d1,1e-12));
- d1.cpyFrom(d);
+ d1.deepCopyFrom(d);
self.assertTrue(d.isEqual(d1,1e-12));
- d1.cpyFrom(d);
+ d1.deepCopyFrom(d);
self.assertTrue(d.isEqual(d1,1e-12));
d1.rearrange(2);
self.assertTrue(not d.isEqual(d1,1e-12));
- d1.cpyFrom(d);
+ d1.deepCopyFrom(d);
self.assertTrue(d.isEqual(d1,1e-12));
#
d2=d.convertToIntArr();
d4=DataArrayInt.New();
self.assertTrue(not d2.isEqual(d4));
- d4.cpyFrom(d2);
+ d4.deepCopyFrom(d2);
self.assertTrue(d2.isEqual(d4));
- d4.cpyFrom(d2);
+ d4.deepCopyFrom(d2);
self.assertTrue(d2.isEqual(d4));
d4.rearrange(2);
self.assertTrue(not d2.isEqual(d4));
- d4.cpyFrom(d2);
+ d4.deepCopyFrom(d2);
self.assertTrue(d2.isEqual(d4));
pass
def testSortCellsInMEDFileFrmt1(self):
m,m1=MEDCouplingDataForTest.buildPointe_1();
- m2=m.deepCpy()
+ m2=m.deepCopy()
da=DataArrayInt.New()
da.setValues([0,1,2,14,3,12,4,5,15,6,7,8,9,10,11,13],16,1)
daa=da.invertArrayN2O2O2N(16)
vals1=[3,5,1,2,0,8]
expected1=[0,3,8,9,11,11,19]
d.setValues(vals1,6,1);
- d.computeOffsets2();
+ d.computeOffsetsFull();
self.assertEqual(7,d.getNumberOfTuples());
self.assertEqual(1,d.getNumberOfComponents());
for i in xrange(7):
tab=[1.2,1.3,2.2,2.3,3.2,3.3,4.2,4.3,5.2,5.3]
d.setValues(tab,5,2);
f.setArray(d);
- f.checkCoherency();
+ f.checkConsistencyLight();
#
self.assertAlmostEqual(11.209371079592289,f.norm2(),14);
#
tab=[2.3,-1.2,6.3,-7.8,2.9,7.7,2.1,0.,3.6,-7.6]
d.setValues(tab,5,2);
f.setArray(d);
- f.checkCoherency();
+ f.checkConsistencyLight();
#
self.assertAlmostEqual(7.8,f.normMax(),14);
#
expected2=[0,5,14,19,42,49,86,95,108,159]
self.assertEqual(expected1,da.getValues());
self.assertEqual(expected2,dai.getValues());
- m.checkCoherency1()
+ m.checkConsistency()
pass
def testNonRegressionCopyTinyStrings(self):
m=MEDCouplingDataForTest.build2DTargetMesh_1()
f1=m.getMeasureField(True)
f1.getArray().setInfoOnComponent(0,"P [N/m^2]")
- bary=m.getBarycenterAndOwner()
+ bary=m.computeCellCenterOfMass()
f2=f1.buildNewTimeReprFromThis(NO_TIME,False)
f2.setArray(bary)
self.assertRaises(InterpKernelException,f1.copyTinyAttrFrom,f2)
coordsZ.setValues(arrZ,4,1);
mesh.setCoords(coordsX,coordsY,coordsZ);
f=mesh.getMeasureField(True)
- mesh2=mesh.deepCpy()
+ mesh2=mesh.deepCopy()
for myId in [0,1,2,10,11,12,20,21,22]:
f=mesh.getMeasureField(True)
f.changeUnderlyingMesh(mesh2,myId,1e-12);
a.setValues(arr,5,1);
b=DataArrayInt.New();
b.setValues(arrI,3,1);
- ret,newNbTuple=DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2(10,a,b);
+ ret,newNbTuple=DataArrayInt.ConvertIndexArrayToO2N(10,a,b);
expected=[0,1,2,0,3,4,5,4,6,4]
self.assertEqual(10,ret.getNbOfElems());
self.assertEqual(7,newNbTuple);
self.assertEqual(1,ret.getNumberOfComponents());
self.assertEqual(expected,ret.getValues());
- self.assertRaises(InterpKernelException,DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2,9,a,b);
+ self.assertRaises(InterpKernelException,DataArrayInt.ConvertIndexArrayToO2N,9,a,b);
pass
def testDADIReverse1(self):
mesh=MEDCouplingDataForTest.build2DTargetMesh_1();
#
mesh2,desc,descIndx,revDesc,revDescIndx=mesh.buildDescendingConnectivity2();
- mesh2.checkCoherency();
+ mesh2.checkConsistencyLight();
self.assertEqual(1,mesh2.getMeshDimension());
self.assertEqual(13,mesh2.getNumberOfCells());
self.assertEqual(14,revDescIndx.getNbOfElems()); self.assertEqual(14,revDescIndx.getNumberOfTuples());
m1c.setCoordsAt(1,coordsY);
m1=m1c.buildUnstructured()
m1bis=m1.buildPartOfMySelf([3,4,5],False)
- m2=m1.deepCpy()
+ m2=m1.deepCopy()
m2=m2.buildPartOfMySelf([0,1,2],False)
m2.translate([0.5,0.5])
#
myCoords1.setValues(m1Coords,25,2);
m1.setCoords(myCoords1);
#
- m11=m1.deepCpy();
+ m11=m1.deepCopy();
m11.tessellate2D(1.);
self.assertTrue(m11.getCoords().isEqual(m11.getCoords(),1e-12));
expected1=[5,0,3,11,1,5,3,4,12,2,1,11,5,5,15,3,0,5,6,16,4,3,15,5,5,5,0,7,19,5,6,5,19,7,8,20,5,0,1,23,7,5,1,2,24,8,7,23]
self.assertEqual(expected1,m11.getNodalConnectivity().getValues());
self.assertEqual(expected2,m11.getNodalConnectivityIndex().getValues());
#
- m12=m1.deepCpy();
+ m12=m1.deepCopy();
m12.tessellate2D(0.5);
self.assertEqual(41,m12.getNumberOfNodes());
expected3=[5,0,3,25,26,1,5,3,4,27,28,2,1,26,25,5,5,29,30,3,0,5,6,31,32,4,3,30,29,5,5,5,0,7,33,34,5,6,5,34,33,7,8,35,36,5,0,1,37,38,7,5,1,2,39,40,8,7,38,37]
myCoords = DataArrayDouble.New(mcoords, 3, 2)
m1.setCoords(myCoords)
- m2 = m1.deepCpy()
+ m2 = m1.deepCopy()
m2.tessellate2D(0.1)
# If the following raises, the test will fail automatically:
- m2.checkCoherency1(0.0) # eps param not used
+ m2.checkConsistency(0.0) # eps param not used
def testIntersect2DMeshesTmp4(self):
m1Coords=[0.,0.,1.,0.,1.5,0.,0.,1.,0.,1.5,-1.,0.,-1.5,0.,0.,-1,0.,-1.5,0.5,0.,1.25,0.,0.70710678118654757,0.70710678118654757,1.0606601717798214,1.0606601717798214,0.,0.5,0.,1.25,-0.70710678118654757,0.70710678118654757,-1.0606601717798214,1.0606601717798214,-0.5,0.,-1.25,0.,-0.70710678118654757,-0.70710678118654757,-1.0606601717798214,-1.0606601717798214,0.,-0.5,0.,-1.25,0.70710678118654757,-0.70710678118654757,1.0606601717798214,-1.0606601717798214];
da2=DataArrayDouble.New();
da2.setValues(data2,5,2);
#
- dac=da.deepCpy();
- dac.setContigPartOfSelectedValues2(1,da2,2,4,1);
+ dac=da.deepCopy();
+ dac.setContigPartOfSelectedValuesSlice(1,da2,2,4,1);
expected3=[1.,11.,0.,30.,11.,41.,4.,14.,5.,15.,6.,16.,7.,17.]
for i in xrange(14):
self.assertAlmostEqual(expected3[i],dac.getIJ(0,i),14);
pass
#
- dac=da.deepCpy();
- self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues2,3,da2,0,5,1);
- self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues2,0,da2,4,6,1);
- self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues2,3,da2,5,0,1);
- dac.setContigPartOfSelectedValues2(3,da2,1,5,1);
+ dac=da.deepCopy();
+ self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValuesSlice,3,da2,0,5,1);
+ self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValuesSlice,0,da2,4,6,1);
+ self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValuesSlice,3,da2,5,0,1);
+ dac.setContigPartOfSelectedValuesSlice(3,da2,1,5,1);
expected4=[1.,11.,2.,12.,3.,13.,9.,39.,0.,30.,11.,41.,12.,42.]
for i in xrange(14):
self.assertAlmostEqual(expected4[i],dac.getIJ(0,i),14);
#
ids=DataArrayInt.New();
ids.alloc(3,1);
- dac=da.deepCpy();
+ dac=da.deepCopy();
ids.setIJ(0,0,2); ids.setIJ(1,0,0); ids.setIJ(2,0,4);
dac.setContigPartOfSelectedValues(2,da2,ids);
expected5=[1.,11.,2.,12.,0.,30.,8.,38.,12.,42.,6.,16.,7.,17.]
self.assertAlmostEqual(expected5[i],dac.getIJ(0,i),14);
pass
#
- dac=da.deepCpy();
+ dac=da.deepCopy();
ids.setIJ(0,0,2); ids.setIJ(1,0,5); ids.setIJ(2,0,4);
self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues,1,da2,ids);
ids.setIJ(0,0,2); ids.setIJ(1,0,2); ids.setIJ(2,0,-1);
self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues,5,da2,ids);
#
ids.setIJ(0,0,2); ids.setIJ(1,0,2); ids.setIJ(2,0,1);
- dac=da.deepCpy();
+ dac=da.deepCopy();
dac.setContigPartOfSelectedValues(4,da2,ids);
expected6=[1.,11.,2.,12.,3.,13.,4.,14.,0.,30.,0.,30.,9.,39.]
for i in xrange(14):
da2=DataArrayInt.New();
da2.setValues(data2,5,2);
#
- dac=da.deepCpy();
- dac.setContigPartOfSelectedValues2(1,da2,2,4,1);
+ dac=da.deepCopy();
+ dac.setContigPartOfSelectedValuesSlice(1,da2,2,4,1);
expected3=[1,11,0,30,11,41,4,14,5,15,6,16,7,17]
for i in xrange(14):
self.assertEqual(expected3[i],dac.getIJ(0,i));
pass
#
- dac=da.deepCpy();
- self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues2,3,da2,0,5,1);
- self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues2,0,da2,4,6,1);
- self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues2,3,da2,5,0,1);
- dac.setContigPartOfSelectedValues2(3,da2,1,5,1);
+ dac=da.deepCopy();
+ self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValuesSlice,3,da2,0,5,1);
+ self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValuesSlice,0,da2,4,6,1);
+ self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValuesSlice,3,da2,5,0,1);
+ dac.setContigPartOfSelectedValuesSlice(3,da2,1,5,1);
expected4=[1,11,2,12,3,13,9,39,0,30,11,41,12,42]
for i in xrange(14):
self.assertEqual(expected4[i],dac.getIJ(0,i));
#
ids=DataArrayInt.New();
ids.alloc(3,1);
- dac=da.deepCpy();
+ dac=da.deepCopy();
ids.setIJ(0,0,2); ids.setIJ(1,0,0); ids.setIJ(2,0,4);
dac.setContigPartOfSelectedValues(2,da2,ids);
expected5=[1,11,2,12,0,30,8,38,12,42,6,16,7,17]
self.assertEqual(expected5[i],dac.getIJ(0,i));
pass
#
- dac=da.deepCpy();
+ dac=da.deepCopy();
ids.setIJ(0,0,2); ids.setIJ(1,0,5); ids.setIJ(2,0,4);
self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues,1,da2,ids);
ids.setIJ(0,0,2); ids.setIJ(1,0,2); ids.setIJ(2,0,-1);
self.assertRaises(InterpKernelException,dac.setContigPartOfSelectedValues,5,da2,ids);
#
ids.setIJ(0,0,2); ids.setIJ(1,0,2); ids.setIJ(2,0,1);
- dac=da.deepCpy();
+ dac=da.deepCopy();
dac.setContigPartOfSelectedValues(4,da2,ids);
expected6=[1,11,2,12,3,13,4,14,0,30,0,30,9,39]
for i in xrange(14):
mesh=MEDCouplingDataForTest.build3DSourceMesh_1();
#
mesh2,desc,descIndx,revDesc,revDescIndx=mesh.buildDescendingConnectivity2();
- mesh2.checkCoherency();
+ mesh2.checkConsistencyLight();
self.assertEqual(2,mesh2.getMeshDimension());
self.assertEqual(30,mesh2.getNumberOfCells());
self.assertEqual(31,revDescIndx.getNbOfElems()); self.assertEqual(31,revDescIndx.getNumberOfTuples());
vec1=[0.,0.,1.]
for i in xrange(18):
vec2=[3.*cos(pi/9.*i),3.*sin(pi/9.*i)];
- m1Cpy=m1.deepCpy();
+ m1Cpy=m1.deepCopy();
m1Cpy.translate(vec2);
self.assertRaises(InterpKernelException,m1Cpy.are2DCellsNotCorrectlyOriented,vec1,False);
m1Cpy.changeSpaceDimension(3);
mesh2D.finishInsertingCells();
myCoords=DataArrayDouble.New(mesh2DCoords,9,3);
mesh2D.setCoords(myCoords);
- mesh2D.checkCoherency();
+ mesh2D.checkConsistencyLight();
#
mesh3DCoords=[-0.3,-0.3,0., -0.3,0.2,0., 0.2,0.2,0., 0.2,-0.3,0., -0.3,-0.3,1., -0.3,0.2,1., 0.2,0.2,1., 0.2,-0.3,1. ]
mesh3DConn=[0,1,2,3,4,5,6,7]
mesh3D.finishInsertingCells();
myCoords3D=DataArrayDouble.New(mesh3DCoords,8,3);
mesh3D.setCoords(myCoords3D);
- mesh3D.checkCoherency();
+ mesh3D.checkConsistencyLight();
#
- mesh3D_2=mesh3D.deepCpy();
- mesh2D_2=mesh2D.deepCpy();
- mesh3D_4=mesh3D.deepCpy();
- mesh2D_4=mesh2D.deepCpy();
+ mesh3D_2=mesh3D.deepCopy();
+ mesh2D_2=mesh2D.deepCopy();
+ mesh3D_4=mesh3D.deepCopy();
+ mesh2D_4=mesh2D.deepCopy();
oldNbOf3DNodes=mesh3D.getNumberOfNodes();
renumNodes=DataArrayInt.New();
renumNodes.alloc(mesh2D.getNumberOfNodes(),1);
coo=DataArrayDouble.Aggregate(mesh3D.getCoords(),mesh2D.getCoords());
mesh3D.setCoords(coo);
mesh2D.setCoords(coo);
- mesh2DCpy=mesh2D.deepCpy()
- mesh2D_3=mesh2D.deepCpy();
+ mesh2DCpy=mesh2D.deepCopy()
+ mesh2D_3=mesh2D.deepCopy();
mesh2D_3.shiftNodeNumbersInConn(oldNbOf3DNodes);
mesh2D.renumberNodesInConn(renumNodes);
mesh2DCpy.renumberNodesInConn(renumNodes.getValues());
self.assertEqual(8+i,da2.getIJ(i,0));
pass
#
- mesh2D_5=mesh2D_4.deepCpy();
+ mesh2D_5=mesh2D_4.deepCopy();
mesh2D_5.translate([1.,0.,0.]);
meshes=[mesh3D_4,mesh2D_4,mesh2D_5];
MEDCouplingUMesh.PutUMeshesOnSameAggregatedCoords(meshes);
self.assertTrue(mesh3D_4.getCoords().getHiddenCppPointer()==mesh2D_4.getCoords().getHiddenCppPointer());
self.assertTrue(mesh2D_4.getCoords().getHiddenCppPointer()==mesh2D_5.getCoords().getHiddenCppPointer());
- mesh3D_4.checkCoherency(); mesh2D_4.checkCoherency(); mesh2D_5.checkCoherency();
+ mesh3D_4.checkConsistencyLight(); mesh2D_4.checkConsistencyLight(); mesh2D_5.checkConsistencyLight();
self.assertEqual(26,mesh3D_4.getNumberOfNodes());
self.assertEqual(3,mesh3D_4.getSpaceDimension());
self.assertEqual(9,mesh3D_4.getNodalConnectivity().getNumberOfTuples());
pass
#
MEDCouplingUMesh.MergeNodesOnUMeshesSharingSameCoords(meshes,1e-12);
- mesh3D_4.checkCoherency(); mesh2D_4.checkCoherency(); mesh2D_5.checkCoherency();
+ mesh3D_4.checkConsistencyLight(); mesh2D_4.checkConsistencyLight(); mesh2D_5.checkConsistencyLight();
self.assertTrue(mesh3D_4.getCoords().getHiddenCppPointer()==mesh2D_4.getCoords().getHiddenCppPointer());
self.assertTrue(mesh2D_4.getCoords().getHiddenCppPointer()==mesh2D_5.getCoords().getHiddenCppPointer());
self.assertEqual(19,mesh3D_4.getNumberOfNodes());
mesh2D.finishInsertingCells();
myCoords=DataArrayDouble.New(mesh2DCoords,5,2);
mesh2D.setCoords(myCoords);
- mesh2D.checkCoherency();
+ mesh2D.checkConsistencyLight();
#
v=mesh2D.checkButterflyCells();
self.assertTrue(v.empty());
def testSwigDADISub1(self):
mesh3D,mesh2D=MEDCouplingDataForTest.build3DExtrudedUMesh_1();
- bary=mesh3D.getBarycenterAndOwner()
+ bary=mesh3D.computeCellCenterOfMass()
bary=bary[:,:2]
pts=bary.getDifferentValues(1e-12)
expected=[[0,6,12],[1,7,13],[2,8,14],[3,9,15],[4,10,16],[5,11,17]]
bary2=bary[:,:2]
bary2[:]-=pt
norm=bary2.magnitude()
- self.assertEqual(expected[pos],norm.getIdsInRange(-1.,1e-5).getValues())
+ self.assertEqual(expected[pos],norm.findIdsInRange(-1.,1e-5).getValues())
pass
expected2=[[3.,54.],[-141.,180.],[21.,54.],[39.,72.],[-15.,90.],[21.,90.]]
for pos,pt in enumerate(pts):
m.finishInsertingCells();
coordsDa=DataArrayDouble.New(coords,331,2);
m.setCoords(coordsDa);
- m.checkCoherency();
+ m.checkConsistencyLight();
#
da=m.convexEnvelop2D();
- m.checkCoherency()
+ m.checkConsistencyLight()
self.assertEqual(coordsDa.getHiddenCppPointer(),m.getCoords().getHiddenCppPointer())
daC=da.buildComplement(m.getNumberOfCells());
expected2=DataArrayInt.New([271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,302,303,304,305,306,307,308,309,310,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330]);
ref=271*[184.69493088478035]+3*[-61.564976961404426,-92.34746544254946,-92.34746544259811,-92.34746544253488,-92.3474654425349,-92.34746544180479,-92.34746544253493,-92.3474654419026,-92.34746544190256,-92.34746544253491]+2*[61.564976961404426,-92.34746544254946,-92.34746544259811,-92.34746544253488,-92.3474654425349,-92.34746544180479,-92.34746544253493,-92.3474654419026,-92.34746544190256,-92.34746544253491]+[-61.564976961404426,-92.34746544254946,-92.34746544259811,-92.34746544253488,-92.3474654425349,-92.34746544180479,-92.34746544253493,-92.3474654419026,-92.34746544190256,-92.34746544253491]
vals-=DataArrayDouble.New(ref)
vals.abs()
- theTest=vals.getIdsInRange(-1.,1e-7)
- self.assertTrue(theTest.isIdentity2(331))
+ theTest=vals.findIdsInRange(-1.,1e-7)
+ self.assertTrue(theTest.isIota(331))
pass
def testSwigDAIOp8(self):
self.assertEqual(0,da.index(7))
self.assertEqual(10,da.index(47))
self.assertTrue(14 not in da)
- self.assertEqual(5,da.search([9,9]))
- self.assertEqual(-1,da.search([5,8]))
+ self.assertEqual(5,da.findIdSequence([9,9]))
+ self.assertEqual(-1,da.findIdSequence([5,8]))
da.rearrange(2)
self.assertTrue([47,16] not in da)
self.assertTrue([5,6] not in da)
self.assertRaises(InterpKernelException,arr.sort,False)
arr.rearrange(1);
arr.setValues(values,6,1)
- arr1=arr.deepCpy();
- arr2=arr.deepCpy();
+ arr1=arr.deepCopy();
+ arr2=arr.deepCopy();
arr1.sort(True);
expected1=[1,2,4,5,6,7]
self.assertEqual(6,arr1.getNumberOfTuples());
self.assertRaises(InterpKernelException,ard.sort,False)
ard.rearrange(1);
ard.setValues(valuesD,6,1)
- ard1=ard.deepCpy();
- ard2=ard.deepCpy();
+ ard1=ard.deepCopy();
+ ard2=ard.deepCopy();
ard1.sort(True);
expected3=[1.,2.,4.,5.,6.,7.]
self.assertEqual(6,ard1.getNumberOfTuples());
vecs=DataArrayDouble.New([2.,3.,4.,5.,6.,7.],3,2)
expected1=[[2.,3.,3.,3.,3.,4.,2.,4.0],[4.,5.,5.,5.,5.,6.,4.,6.0],[6.,7.,7.,7.,7.,8.,6.,8.0]]
for pos,vec in enumerate(vecs):
- m2=m.deepCpy()
+ m2=m.deepCopy()
m2.translate(vec)
self.assertTrue(m2.getCoords().isEqual(DataArrayDouble.New(expected1[pos],4,2),1e-12))
pass
for pos,vec in enumerate(vecs):
- m2=m.deepCpy()
+ m2=m.deepCopy()
m2.translate(vec.buildDADouble())
self.assertTrue(m2.getCoords().isEqual(DataArrayDouble.New(expected1[pos],4,2),1e-12))
pass
dad[:,1]=angles
#
dad2=dad.fromPolarToCart()
- dads=[dad2.deepCpy() for elt in 7*[None]]
+ dads=[dad2.deepCopy() for elt in 7*[None]]
#
translationToPerform=[[0.01,0.02],[3./2.*radius,-radius*sqrt(3.)/2],[3./2.*radius,radius*sqrt(3.)/2],[0.,radius*sqrt(3.)],[-3./2.*radius,radius*sqrt(3.)/2],[-3./2.*radius,-radius*sqrt(3.)/2],[0.,-radius*sqrt(3.)]]
for d,t in zip(dads,translationToPerform):
arr=DataArrayDouble(mesh3D.getNumberOfCells(),2)
arr.rearrange(1) ; arr.iota(2.) ; arr.rearrange(2)
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
expected1=DataArrayInt([1,3,4,7,9,10,13,15,16])
self.assertTrue(expected1.isEqual(ids))
arr2=arr[expected1]
f.setArray(arr)
#
f2=f.buildSubPart([1,5,9])
- f2.checkCoherency()
+ f2.checkConsistencyLight()
cI=m.computeNbOfNodesPerCell()
- cI.computeOffsets2()
+ cI.computeOffsetsFull()
sel=DataArrayInt([1,5,9])
res=sel.buildExplicitArrByRanges(cI)
arr2=arr[res]
m.finishInsertingCells();
coords=DataArrayDouble(coord,6,3);
m.setCoords(coords);
- m.checkCoherency();
+ m.checkConsistencyLight();
#
vol=m.getMeasureField(ON_CELLS);
self.assertEqual(1,vol.getArray().getNumberOfTuples());
f.setMesh(umesh);
srcVals=DataArrayDouble.New(srcFieldValsOnPoints,nbOfInputPoints,1);
f.setArray(srcVals);
- f.checkCoherency();
+ f.checkConsistencyLight();
#
res0=f.getValueOn(targetPointCoordsX[:1]);
self.assertAlmostEqual(targetFieldValsExpected[0],res0[0],10)
if 1 in cells:
baseMesh.insertNextCell(NORM_QPOLYG, connec3)
baseMesh.finishInsertingCells()
- baseMesh.checkCoherency()
+ baseMesh.checkConsistencyLight()
return baseMesh
eps = 1.0e-7
m3.mergeNodes(eps)
m3.convertDegeneratedCells()
m3.zipCoords()
- m4 = m3.deepCpy()
+ m4 = m3.deepCopy()
m5, _, _ = MEDCouplingUMesh.Intersect2DMeshes(m3, m4, eps)
m5.mergeNodes(eps)
# Check coordinates:
tr=[[0.,0.],[2.,0.], [0.,2.],[2.,2.],[4.,2.],[6.,2.],[8.,2.],[10.,2.],[12.,2.],[0.,4.],[2.,4.],[4.,4.],[6.,4.],[8.,4.],[10.,4.],[12.,4.],[14.,4.],[16.,4.],[18.,4.],[20.,4.],[22.,4.]]
ms=2*[mQ4]+7*[mQ8]+11*[mT3]
- ms[:]=(elt.deepCpy() for elt in ms)
+ ms[:]=(elt.deepCopy() for elt in ms)
for m,t in zip(ms,tr):
d=m.getCoords() ; d+= t
pass
self.assertEqual(46,f.getNumberOfTuplesExpected())
vals=DataArrayDouble.New(46*3,1) ; vals.iota(7.7) ; vals.rearrange(3)
f.setArray(vals)
- f.checkCoherency()
+ f.checkConsistencyLight()
#f.getLocalizationOfDiscr()
self.assertRaises(InterpKernelException,f.getGaussLocalizationIdOfOneType,NORM_QUAD8) #throw because several loc
self.assertEqual([1,2],f.getGaussLocalizationIdsOfOneType(NORM_QUAD8))
self.assertEqual([0,0,1,1,2,1,2,2,2,3,3,3,3,3,4,4,4,4,4,4],f.getDiscretization().getArrayOfDiscIds().getValues())
fc=f[[1,2,3,8]]
- fc.checkCoherency()
+ fc.checkConsistencyLight()
self.assertTrue(DataArrayDouble([13.7,14.7,15.7,16.7,17.7,18.7,19.7,20.7,21.7,22.7,23.7,24.7,25.7,26.7,27.7,28.7,29.7,30.7,31.7,32.7,33.7,34.7,35.7,36.7,82.7,83.7,84.7,85.7,86.7,87.7,88.7,89.7,90.7,91.7,92.7,93.7],12,3).isEqual(fc.getArray(),1e-10))
fc.renumberCells([3,2,0,1])
self.assertTrue(DataArrayDouble([28.7, 29.7, 30.7, 31.7, 32.7, 33.7, 34.7, 35.7, 36.7, 82.7, 83.7, 84.7, 85.7, 86.7, 87.7, 88.7, 89.7, 90.7, 91.7, 92.7, 93.7, 19.7, 20.7, 21.7, 22.7, 23.7, 24.7, 25.7, 26.7, 27.7, 13.7, 14.7, 15.7, 16.7, 17.7, 18.7],12,3).isEqual(fc.getArray(),1e-10))
self.assertEqual(d.getNumberOfTuples(),9)
self.assertEqual(d.getNbOfElemAllocated(),16)
self.assertTrue(d.isEqual(DataArrayDouble([0.,1.,2.,3.,4.,5.,6.,7.,4.44]),1e-12))
- e=d.deepCpy()
+ e=d.deepCopy()
self.assertEqual(e.getNumberOfTuples(),9)
self.assertEqual(e.getNbOfElemAllocated(),9)
self.assertTrue(e.isEqual(DataArrayDouble([0.,1.,2.,3.,4.,5.,6.,7.,4.44]),1e-12))
self.assertEqual(d.getNumberOfTuples(),9)
self.assertEqual(d.getNbOfElemAllocated(),16)
self.assertTrue(d.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,444])))
- e=d.deepCpy()
+ e=d.deepCopy()
self.assertEqual(e.getNumberOfTuples(),9)
self.assertEqual(e.getNbOfElemAllocated(),9)
self.assertTrue(e.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,444])))
expected1=DataArrayDouble([0.16666666666666666,0.3333333333333333,0.5,1.,1.])
for v in vects:
for i in xrange(nbOfDisc):
- mm=m.deepCpy()
+ mm=m.deepCopy()
mm.rotate([0.,0.,0.],[0.3,0.7,0.2],float(i)/float(nbOfDisc)*2*pi)
- mm2=mm.deepCpy()
+ mm2=mm.deepCopy()
self.assertTrue(mm.getMeasureField(False).getArray().isEqual(expected1,1e-14))
self.assertTrue(mm.findAndCorrectBadOriented3DCells().empty())
self.assertTrue(mm.isEqual(mm2,1e-14))
pass
pass
#
- mOK=m.deepCpy()
+ mOK=m.deepCopy()
m0=MEDCouplingUMesh("m",3) ; m0.allocateCells(0); m0.insertNextCell(NORM_TETRA4,[0,2,1,3]); #Not well oriented
m1=MEDCouplingUMesh("m",3) ; m1.allocateCells(0); m1.insertNextCell(NORM_PYRA5,[0,1,2,3,4]); #Well oriented
m2=MEDCouplingUMesh("m",3) ; m2.allocateCells(0); m2.insertNextCell(NORM_PENTA6,[0,1,2,3,4,5]); #Well oriented
expected2=DataArrayDouble([-0.16666666666666666,0.3333333333333333,0.5,-1.,-1.])
for v in vects:
for i in xrange(nbOfDisc):
- mm=m.deepCpy()
+ mm=m.deepCopy()
mm.rotate([0.,0.,0.],[0.3,0.7,0.2],float(i)/float(nbOfDisc)*2*pi)
- mm2=mm.deepCpy() ; mm3=mm.deepCpy() ; mm3.convertAllToPoly()
+ mm2=mm.deepCopy() ; mm3=mm.deepCopy() ; mm3.convertAllToPoly()
self.assertTrue(mm3.getMeasureField(False).getArray().isEqual(expected2,1e-14))
self.assertTrue(mm.getMeasureField(False).getArray().isEqual(expected2,1e-14))
self.assertTrue(mm.findAndCorrectBadOriented3DCells().isEqual(DataArrayInt([0,3,4])))
mOK.setCoords(mm.getCoords())
self.assertTrue(mm.isEqual(mOK,1e-14))
self.assertTrue(mm.getMeasureField(False).getArray().isEqual(expected1,1e-14))
- mmm=mm.deepCpy()
+ mmm=mm.deepCopy()
self.assertTrue(mmm.findAndCorrectBadOriented3DCells().empty())
mm.convertAllToPoly()
self.assertTrue(mm.getMeasureField(False).getArray().isEqual(expected1,1e-14))
expected3=DataArrayDouble([0.16666666666666666,-0.3333333333333333,-0.5,1.,1.])
for v in vects:
for i in xrange(nbOfDisc):
- mm=m.deepCpy()
+ mm=m.deepCopy()
mm.rotate([0.,0.,0.],[0.3,0.7,0.2],float(i)/float(nbOfDisc)*2*pi)
- mm2=mm.deepCpy() ; mm3=mm.deepCpy() ; mm3.convertAllToPoly()
+ mm2=mm.deepCopy() ; mm3=mm.deepCopy() ; mm3.convertAllToPoly()
self.assertTrue(mm3.getMeasureField(False).getArray().isEqual(expected3,1e-14))
self.assertTrue(mm.getMeasureField(False).getArray().isEqual(expected3,1e-14))
self.assertTrue(mm.findAndCorrectBadOriented3DCells().isEqual(DataArrayInt([1,2])))
mOK.setCoords(mm.getCoords())
self.assertTrue(mm.isEqual(mOK,1e-14))
self.assertTrue(mm.getMeasureField(False).getArray().isEqual(expected1,1e-14))
- mmm=mm.deepCpy()
+ mmm=mm.deepCopy()
self.assertTrue(mmm.findAndCorrectBadOriented3DCells().empty())
mm.convertAllToPoly()
self.assertTrue(mm.getMeasureField(False).getArray().isEqual(expected1,1e-14))
mesh.insertNextCell(NORM_POLYHED,conn3)
mesh.setCoords(coords)
mesh.orientCorrectlyPolyhedrons()
- self.assertTrue(mesh.getBarycenterAndOwner().isEqual(DataArrayDouble([-0.10803,0.,0.3385],1,3),1e-12))
+ self.assertTrue(mesh.computeCellCenterOfMass().isEqual(DataArrayDouble([-0.10803,0.,0.3385],1,3),1e-12))
pass
pass
m.setCoords(coords)
m.allocateCells(0)
m.insertNextCell(NORM_QUAD4,[0,1,2,3])
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual([4,0,1,2,3],m.getNodalConnectivity().getValues())
a,b=m.distanceToPoint([5.,2.,0.1])
self.assertAlmostEqual(0.1,a,14) ; self.assertEqual(0,b)
self.assertAlmostEqual(sqrt(2*2+4*4),a,14) ; self.assertEqual(0,b)
m.allocateCells(0)
m.insertNextCell(NORM_POLYGON,[0,1,2,3])
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual([5,0,1,2,3],m.getNodalConnectivity().getValues())
a,b=m.distanceToPoint([11.,3.,4.])
self.assertAlmostEqual(sqrt(3*3+4*4),a,14) ; self.assertEqual(0,b)
#
n,ni=m.computeNeighborsOfCells()
a,b=MEDCouplingUMesh.ComputeSpreadZoneGraduallyFromSeed(0,n,ni)
- self.assertEqual(13,b) ; self.assertTrue(a.isIdentity2(125))
+ self.assertEqual(13,b) ; self.assertTrue(a.isIota(125))
a,b=MEDCouplingUMesh.ComputeSpreadZoneGraduallyFromSeed([1],n,ni)
- self.assertEqual(12,b) ; self.assertTrue(a.isIdentity2(125))
+ self.assertEqual(12,b) ; self.assertTrue(a.isIota(125))
a,b=MEDCouplingUMesh.ComputeSpreadZoneGraduallyFromSeed((2,),n,ni)
- self.assertEqual(11,b) ; self.assertTrue(a.isIdentity2(125))
+ self.assertEqual(11,b) ; self.assertTrue(a.isIota(125))
a,b=MEDCouplingUMesh.ComputeSpreadZoneGraduallyFromSeed(DataArrayInt([3]),n,ni)
- self.assertEqual(12,b) ; self.assertTrue(a.isIdentity2(125))
+ self.assertEqual(12,b) ; self.assertTrue(a.isIota(125))
pass
def testSwigUMeshInsertNextCell1(self):
m.setNodeGridStructure([2,3])
coords=DataArrayDouble([0.,0., 2.,0., 0.,1., 1.9,1.1, 0.3,1.9, 2.2,2.1],6,2)
m.setCoords(coords)
- m.checkCoherency()
- m0=m.deepCpy()
+ m.checkConsistencyLight()
+ m0=m.deepCopy()
self.assertTrue(m0.isEqual(m,1e-12))
m.getCoords().setInfoOnComponents(["X [m]","Y [m]"])
self.assertTrue(not m0.isEqual(m,1e-12))
- m0=m.deepCpy()
+ m0=m.deepCopy()
self.assertTrue(m0.isEqual(m,1e-12))
self.assertEqual(m.getNodeGridStructure(),(2,3))
pass
c4=c1+[6.,0.,0.]
c=DataArrayDouble.Aggregate([c1,c2,c3,c4])
m.setCoords(c)
- m.checkCoherency1()
+ m.checkConsistency()
#
- m1=m.deepCpy()
+ m1=m.deepCopy()
d1=m1.simplexize(PLANAR_FACE_5)
- m1.checkCoherency1()
+ m1.checkConsistency()
vol1=m1.getMeasureField(ON_CELLS).getArray()
self.assertTrue(vol1.isEqual(DataArrayDouble([1./6, 1./6, 1./6,1./6, 1./6, 1./3,1./6, 1./6, 1./6, 1./6, 1./3, 1./6]),1e-12))
self.assertEqual(m1.getNodalConnectivity().getValues(),[14,0,1,2,3,14,4,9,5,6,14,4,8,9,11,14,4,7,11,6,14,9,11,10,6,14,4,9,6,11,14,12,17,13,14,14,12,16,17,19,14,12,15,19,14,14,17,19,18,14,14,12,17,14,19,14,20,21,22,23])
self.assertEqual(m1.getNodalConnectivityIndex().getValues(),[0,5,10,15,20,25,30,35,40,45,50,55,60])
self.assertTrue(d1.isEqual(DataArrayInt([0,1,1,1,1,1,2,2,2,2,2,3])))
#
- m2=m.deepCpy()
+ m2=m.deepCopy()
d2=m2.simplexize(PLANAR_FACE_6)
- m2.checkCoherency1()
+ m2.checkConsistency()
vol2=m2.getMeasureField(ON_CELLS).getArray()
self.assertTrue(vol2.isEqual(DataArrayDouble([1./6, 1./6, 1./6,1./6, 1./6, 1./6,1./6,1./6, 1./6, 1./6, 1./6, 1./6,1./6,1./6]),1e-12))
self.assertEqual(m2.getNodalConnectivity().getValues(),[14,0,1,2,3,14,4,9,5,10,14,4,5,6,10,14,4,8,9,10,14,4,11,8,10,14,4,6,7,10,14,4,7,11,10,14,12,17,13,18,14,12,13,14,18,14,12,16,17,18,14,12,19,16,18,14,12,14,15,18,14,12,15,19,18,14,20,21,22,23])
cl=MEDCouplingCurveLinearMesh()
cl.setCoords(coo)
cl.setNodeGridStructure([4,3])
- cl.checkCoherency1()
+ cl.checkConsistency()
li1=[1.,2.,4.,0.5,1.,2.]
self.assertTrue(cl.getMeasureField(False).getArray().isEqual(DataArrayDouble(li1),1e-14))
self.assertTrue(u.getMeasureField(False).getArray().isEqual(DataArrayDouble(li1),1e-14))
li1_1=[0.5,0.5,2.,0.5,5.,0.5,0.5,1.25,2.,1.25,5.,1.25]
- self.assertTrue(cl.getBarycenterAndOwner().isEqual(DataArrayDouble(li1_1,6,2),1e-14))
- self.assertTrue(u.getBarycenterAndOwner().isEqual(DataArrayDouble(li1_1,6,2),1e-14))
+ self.assertTrue(cl.computeCellCenterOfMass().isEqual(DataArrayDouble(li1_1,6,2),1e-14))
+ self.assertTrue(u.computeCellCenterOfMass().isEqual(DataArrayDouble(li1_1,6,2),1e-14))
#3D
c.setCoords(arr1,arr2,arr2)
u=c.buildUnstructured()
cl=MEDCouplingCurveLinearMesh()
cl.setCoords(coo)
cl.setNodeGridStructure([4,3,3])
- cl.checkCoherency1()
+ cl.checkConsistency()
li2=[1.,2.,4.,0.5, 1.,2.,0.5,1.,2.,0.25,0.5,1.]
li2_1=[0.5,0.5,0.5,2.,0.5,0.5,5.,0.5,0.5,0.5,1.25,0.5,2.,1.25,0.5,5.,1.25,0.5,0.5,0.5,1.25,2.,0.5,1.25,5.,0.5,1.25,0.5,1.25,1.25,2.,1.25,1.25,5.,1.25,1.25]
self.assertTrue(cl.getMeasureField(False).getArray().isEqual(DataArrayDouble(li2),1e-14))
self.assertTrue(u.getMeasureField(False).getArray().isEqual(DataArrayDouble(li2),1e-14))
- self.assertTrue(cl.getBarycenterAndOwner().isEqual(DataArrayDouble(li2_1,12,3),1e-14))
- self.assertTrue(u.getBarycenterAndOwner().isEqual(DataArrayDouble(li2_1,12,3),1e-14))
+ self.assertTrue(cl.computeCellCenterOfMass().isEqual(DataArrayDouble(li2_1,12,3),1e-14))
+ self.assertTrue(u.computeCellCenterOfMass().isEqual(DataArrayDouble(li2_1,12,3),1e-14))
#1D spaceDim 1
coo=DataArrayDouble(5) ; coo.iota(0.)
coo=coo*coo
cl.setCoords(coo)
cl.setNodeGridStructure([5])
- cl.checkCoherency1()
+ cl.checkConsistency()
li3=[1.,3.,5.,7.]
li3_1=[0.5,2.5,6.5,12.5]
self.assertTrue(cl.getMeasureField(False).getArray().isEqual(DataArrayDouble(li3),1e-14))
self.assertTrue(cl.buildUnstructured().getMeasureField(False).getArray().isEqual(DataArrayDouble(li3),1e-14))
- self.assertTrue(cl.getBarycenterAndOwner().isEqual(DataArrayDouble(li3_1),1e-14))
- self.assertTrue(cl.buildUnstructured().getBarycenterAndOwner().isEqual(DataArrayDouble(li3_1),1e-14))
+ self.assertTrue(cl.computeCellCenterOfMass().isEqual(DataArrayDouble(li3_1),1e-14))
+ self.assertTrue(cl.buildUnstructured().computeCellCenterOfMass().isEqual(DataArrayDouble(li3_1),1e-14))
#1D spaceDim 2
coo=DataArrayDouble.Meld(coo,coo)
cl.setCoords(coo)
- cl.checkCoherency1()
+ cl.checkConsistency()
li4=[sqrt(2.)*elt for elt in [1.,3.,5.,7.]]
li4_1=[0.5,0.5,2.5,2.5,6.5,6.5,12.5,12.5]
self.assertEqual(2,cl.getSpaceDimension())
self.assertEqual(5,cl.getNumberOfNodes())
self.assertTrue(cl.getMeasureField(False).getArray().isEqual(DataArrayDouble(li4),1e-14))
self.assertTrue(cl.buildUnstructured().getMeasureField(False).getArray().isEqual(DataArrayDouble(li4),1e-14))
- self.assertTrue(cl.getBarycenterAndOwner().isEqual(DataArrayDouble(li4_1,4,2),1e-14))
- self.assertTrue(cl.buildUnstructured().getBarycenterAndOwner().isEqual(DataArrayDouble(li4_1,4,2),1e-14))
+ self.assertTrue(cl.computeCellCenterOfMass().isEqual(DataArrayDouble(li4_1,4,2),1e-14))
+ self.assertTrue(cl.buildUnstructured().computeCellCenterOfMass().isEqual(DataArrayDouble(li4_1,4,2),1e-14))
pass
def testSwig2CurveLinearMeshNonRegression1(self):
self.assertTrue(vol.isEqual(DataArrayDouble([0.11450000709295281, 0.10583334351579375,0.11149999939029423,0.08866666863113633, 0.1404166805123294,0.1250000135352219,0.1270833433481557,0.13258334288001067]),1e-12))
self.assertTrue(vol.isEqual(m.buildUnstructured().getMeasureField(False).getArray(),1e-12))
#
- self.assertTrue(m.getBarycenterAndOwner().isEqual(m.buildUnstructured().getBarycenterAndOwner(),1e-12))
+ self.assertTrue(m.computeCellCenterOfMass().isEqual(m.buildUnstructured().computeCellCenterOfMass(),1e-12))
pass
def testSwig2NonRegressionDASetSelectedComponents1(self):
# 2D
m2D=MEDCouplingDataForTest.build2DTargetMesh_1()
m2D.convertLinearCellsToQuadratic(0)
- m2D.checkCoherency1()
+ m2D.checkConsistency()
self.assertEqual(m2D.getNodalConnectivity().getValues(),[8,0,3,4,1,9,10,11,12,6,1,4,2,11,13,14,6,4,5,2,15,16,13,8,6,7,4,3,17,18,10,19,8,7,8,5,4,20,21,15,18])
self.assertEqual(m2D.getNodalConnectivityIndex().getValues(),[0,9,16,23,32,41])
self.assertTrue(m2D.getCoords().isEqual(coordsExp,1e-14))
# 1D
m1D=MEDCouplingDataForTest.build2DTargetMesh_1().buildDescendingConnectivity()[0]
m1D.convertLinearCellsToQuadratic(0)
- m1D.checkCoherency1()
+ m1D.checkConsistency()
self.assertEqual(m1D.getNodalConnectivity().getValues(),[2,0,3,9,2,3,4,10,2,4,1,11,2,1,0,12,2,4,2,13,2,2,1,14,2,4,5,15,2,5,2,16,2,6,7,17,2,7,4,18,2,3,6,19,2,7,8,20,2,8,5,21])
self.assertEqual(m1D.getNodalConnectivityIndex().getValues(),[0,4,8,12,16,20,24,28,32,36,40,44,48,52])
self.assertTrue(m1D.getCoords().isEqual(coordsExp,1e-14))
cooTmp=m2D.getCoords()[:]
m3D=m2D.buildExtrudedMesh(m1D,0)
m3D.convertLinearCellsToQuadratic(0)
- m3D.checkCoherency1()
+ m3D.checkConsistency()
# check of new m3D content
coordsExp2=[coordsExp.changeNbOfComponents(3,i) for i in xrange(4)]
coordsExp3=[DataArrayDouble.Meld(cooTmp[:,[0,1]],cooTmp[:,2]+(0.5+float(i))) for i in xrange(3)]
self.assertEqual(len(m3D.getCoords()),115)
a,b=c.findCommonTuples(1e-14)
self.assertEqual(len(b),len(coordsExp4)+1)
- e,f=DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2(2*115,a,b)
+ e,f=DataArrayInt.ConvertIndexArrayToO2N(2*115,a,b)
self.assertEqual(f,115)
self.assertTrue(e.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,0,1,2,3,4,5,6,7,8,36,37,38,39,48,49,53,54,58,59,60,66,67,44,47,52,45,46,57,64,65,70,9,10,11,12,13,14,15,16,17,40,41,42,43,50,51,55,56,61,62,63,68,69,75,78,81,76,77,84,88,89,92,18,19,20,21,22,23,24,25,26,71,72,73,74,79,80,82,83,85,86,87,90,91,97,100,103,98,99,106,110,111,114,27,28,29,30,31,32,33,34,35,93,94,95,96,101,102,104,105,107,108,109,112,113])))
self.assertTrue(DataArrayInt([30,0,3,4,1,9,12,13,10,36,37,38,39,40,41,42,43,44,45,46,47,25,1,4,2,10,13,11,38,48,49,42,50,51,47,46,52,25,4,5,2,13,14,11,53,54,48,55,56,50,46,57,52,30,6,7,4,3,15,16,13,12,58,59,37,60,61,62,41,63,64,65,46,45,30,7,8,5,4,16,17,14,13,66,67,53,59,68,69,55,62,65,70,57,46,30,9,12,13,10,18,21,22,19,40,41,42,43,71,72,73,74,75,76,77,78,25,10,13,11,19,22,20,42,50,51,73,79,80,78,77,81,25,13,14,11,22,23,20,55,56,50,82,83,79,77,84,81,30,15,16,13,12,24,25,22,21,61,62,41,63,85,86,72,87,88,89,77,76,30,16,17,14,13,25,26,23,22,68,69,55,62,90,91,82,86,89,92,84,77,30,18,21,22,19,27,30,31,28,71,72,73,74,93,94,95,96,97,98,99,100,25,19,22,20,28,31,29,73,79,80,95,101,102,100,99,103,25,22,23,20,31,32,29,82,83,79,104,105,101,99,106,103,30,24,25,22,21,33,34,31,30,85,86,72,87,107,108,94,109,110,111,99,98,30,25,26,23,22,34,35,32,31,90,91,82,86,112,113,104,108,111,114,106,99]).isEqual(m3D.getNodalConnectivity()))
def testSwig2ConvertLinearCellsToQuadratic2(self):
m2D=MEDCouplingDataForTest.build2DTargetMesh_1()
ret=m2D.convertLinearCellsToQuadratic(1)
- self.assertTrue(ret.isIdentity2(5))
- m2D.checkCoherency1()
+ self.assertTrue(ret.isIota(5))
+ m2D.checkConsistency()
coordsExp=DataArrayDouble([-0.3,-0.3,0.2,-0.3,0.7,-0.3,-0.3,0.2,0.2,0.2,0.7,0.2,-0.3,0.7,0.2,0.7,0.7,0.7,-0.3,-0.05,-0.05,0.2,0.2,-0.05,-0.05,-0.3,0.45,-0.05,0.45,-0.3,0.45,0.2,0.7,-0.05,-0.05,0.7,0.2,0.45,-0.3,0.45,0.45,0.7,0.7,0.45,-0.05,-0.05,0.3666666666666667,-0.1333333333333333,0.5333333333333332,0.03333333333333334,-0.05,0.45,0.45,0.45],27,2)
self.assertTrue(m2D.getCoords().isEqual(coordsExp,1e-14))
self.assertTrue(m2D.getNodalConnectivity().isEqual(DataArrayInt([9,0,3,4,1,9,10,11,12,22,7,1,4,2,11,13,14,23,7,4,5,2,15,16,13,24,9,6,7,4,3,17,18,10,19,25,9,7,8,5,4,20,21,15,18,26])))
cooTmp=m2D.getCoords()[:]
m3D=m2D.buildExtrudedMesh(m1D,0)
ret=m3D.convertLinearCellsToQuadratic(1)
- self.assertTrue(ret.isIdentity2(4))
- m3D.checkCoherency1()
+ self.assertTrue(ret.isIota(4))
+ m3D.checkConsistency()
coordsExp2=DataArrayDouble([-0.3,-0.3,0.0,0.2,-0.3,0.0,-0.3,0.2,0.0,0.2,0.2,0.0,-0.3,0.7,0.0,0.2,0.7,0.0,-0.3,-0.3,1.0,0.2,-0.3,1.0,-0.3,0.2,1.0,0.2,0.2,1.0,-0.3,0.7,1.0,0.2,0.7,1.0,-0.3,-0.3,2.0,0.2,-0.3,2.0,-0.3,0.2,2.0,0.2,0.2,2.0,-0.3,0.7,2.0,0.2,0.7,2.0,-0.3,-0.05,0.0,-0.05,0.2,0.0,0.2,-0.05,0.0,-0.05,-0.3,0.0,-0.3,-0.05,1.0,-0.05,0.2,1.0,0.2,-0.05,1.0,-0.05,-0.3,1.0,-0.3,-0.3,0.5,-0.3,0.2,0.5,0.2,0.2,0.5,0.2,-0.3,0.5,-0.05,0.7,0.0,0.2,0.45,0.0,-0.3,0.45,0.0,-0.05,0.7,1.0,0.2,0.45,1.0,-0.3,0.45,1.0,-0.3,0.7,0.5,0.2,0.7,0.5,-0.3,-0.05,2.0,-0.05,0.2,2.0,0.2,-0.05,2.0,-0.05,-0.3,2.0,-0.3,-0.3,1.5,-0.3,0.2,1.5,0.2,0.2,1.5,0.2,-0.3,1.5,-0.05,0.7,2.0,0.2,0.45,2.0,-0.3,0.45,2.0,-0.3,0.7,1.5,0.2,0.7,1.5,-0.05,-0.05,0.0,-0.3,-0.05,0.5,-0.05,0.2,0.5,0.2,-0.05,0.5,-0.05,-0.3,0.5,-0.05,-0.05,1.0,-0.05,0.45,0.0,-0.05,0.7,0.5,0.2,0.45,0.5,-0.3,0.45,0.5,-0.05,0.45,1.0,-0.3,-0.05,1.5,-0.05,0.2,1.5,0.2,-0.05,1.5,-0.05,-0.3,1.5,-0.05,-0.05,2.0,-0.05,0.7,1.5,0.2,0.45,1.5,-0.3,0.45,1.5,-0.05,0.45,2.0,-0.05,-0.05,0.5,-0.05,0.45,0.5,-0.05,-0.05,1.5,-0.05,0.45,1.5],75,3)
self.assertTrue(m3D.getCoords().isEqual(coordsExp2,1e-14))
self.assertTrue(m3D.getNodalConnectivity().isEqual(DataArrayInt([27,0,2,3,1,6,8,9,7,18,19,20,21,22,23,24,25,26,27,28,29,51,52,53,54,55,56,71,27,4,5,3,2,10,11,9,8,30,31,19,32,33,34,23,35,36,37,28,27,57,58,59,53,60,61,72,27,6,8,9,7,12,14,15,13,22,23,24,25,38,39,40,41,42,43,44,45,56,62,63,64,65,66,73,27,10,11,9,8,16,17,15,14,33,34,23,35,46,47,39,48,49,50,44,43,61,67,68,63,69,70,74])))
arr2=DataArrayDouble(len(arr),2)
arr2[:,0]=arr ; arr2[:,1]=arr+100
f.setArray(arr2)
- f.checkCoherency()
+ f.checkConsistencyLight()
res=f.integral(False)
# a=25./81 ; b=40./81 ; c=64./81
# p1=0.11169079483905 ; p2=0.0549758718227661
for elt in l: elt.reverse()
d2i=DataArrayDouble.Meld(l)
ids1=pts.findClosestTupleId(d2i)
- idsExpectedI=idsExpected.deepCpy() ; idsExpectedI.reverse()
+ idsExpectedI=idsExpected.deepCopy() ; idsExpectedI.reverse()
self.assertTrue(idsExpectedI.isEqual(ids1))
#
l=[pts[:,i] for i in [0,1]]
self.assertTrue(idsExpected2.isEqual(ids2))
#
ids3=ptsi.findClosestTupleId(d2i)
- idsExpected3=idsExpected2.deepCpy() ; idsExpected3.reverse()
+ idsExpected3=idsExpected2.deepCopy() ; idsExpected3.reverse()
self.assertTrue(idsExpected3.isEqual(ids3))
pass
self.assertEqual(2,d.getNumberOfTuples())
self.assertEqual(26,d.getNbOfElems())
self.assertEqual(13,d.getNumberOfComponents())
- dd=d.deepCpy()
+ dd=d.deepCopy()
self.assertTrue(d.isEqual(dd))
dd.setIJ(0,3,'d')
self.assertTrue(not d.isEqual(dd))
d.rearrange(2)
#
dd.rearrange(2)
- dd2=dd.deepCpy()
+ dd2=dd.deepCopy()
dd.renumberInPlace([3,1,2,4,0,11,10,9,8,7,5,12,6])
self.assertEqual(dd.toStrList(),['IJ','Cd','EF','AB','GH','UV','YZ','ST','QR','OP','MN','KL','WX'])
dd.renumberInPlaceR([3,1,2,4,0,11,10,9,8,7,5,12,6])
e=dd.renumberAndReduce([1,1,1,1,1,1,1,2,0,0,0,0,0],3)
self.assertEqual(['YZ','MN','OP'],e.toStrList())
self.assertEqual(['GH','IJ'],dd.selectByTupleIdSafe([3,4]).toStrList())
- self.assertEqual(['AB','GH','MN','ST','YZ'],dd.selectByTupleId2(0,13,3).toStrList())
+ self.assertEqual(['AB','GH','MN','ST','YZ'],dd.selectByTupleIdSafeSlice(0,13,3).toStrList())
dd3=dd.changeNbOfComponents(3,"G")
self.assertEqual(['ABG','CdG','EFG','GHG','IJG','KLG','MNG','OPG','QRG','STG','UVG','WXG','YZG'],dd3.toStrList())
dd3.rearrange(1) ; self.assertEqual("G",dd3.back()) ; dd3.rearrange(3)
self.assertRaises(InterpKernelException,dd3.getIJSafe,0,6)
self.assertEqual("d",dd3.getIJSafe(1,1))
dd3.rearrange(1)
- e=dd3.getIdsEqual("Y")
+ e=dd3.findIdsEqual("Y")
self.assertTrue(e.isEqual(DataArrayInt([3,4,8,9,13,14,18,19,23,24,28,29,33,34,38,39,43,44,48,49,53,54,58,59,60,63,64])))
- e=dd3.getIdsNotEqual("Y")
+ e=dd3.findIdsNotEqual("Y")
self.assertTrue(e.isEqual(DataArrayInt([0,1,2,5,6,7,10,11,12,15,16,17,20,21,22,25,26,27,30,31,32,35,36,37,40,41,42,45,46,47,50,51,52,55,56,57,61,62])))
self.assertEqual(("d",6),dd3.getMaxValue())
self.assertEqual(("A",0),dd3.getMinValue())
- self.assertEqual(26,dd3.search("LGYYM"))
- self.assertEqual(-1,dd3.search("LGYYN"))
+ self.assertEqual(26,dd3.findIdSequence("LGYYM"))
+ self.assertEqual(-1,dd3.findIdSequence("LGYYN"))
dd3.rearrange(5)
- self.assertEqual(7,dd3.locateTuple("OPGYY"))
+ self.assertEqual(7,dd3.findIdFirstEqualTuple("OPGYY"))
self.assertTrue("OPGYY" in dd3)
self.assertEqual(7,dd3.index("OPGYY"))
- self.assertEqual(-1,dd3.locateTuple("OPGYP"))
+ self.assertEqual(-1,dd3.findIdFirstEqualTuple("OPGYP"))
dd3.rearrange(1)
- self.assertEqual(2,dd3.locateValue("OPGYY"))
+ self.assertEqual(2,dd3.findIdFirstEqual("OPGYY"))
self.assertTrue(dd3.presenceOfValue("OPGYY"))
self.assertTrue("O" in dd3)
self.assertTrue(not dd3.presenceOfValue("z"))
def testSwig2GaussMeasureAndIntegral(self):
ft=MEDCouplingDataForTest.buildFieldOnGauss_1()
mea=ft.buildMeasureField(False)
- mea.checkCoherency()
+ mea.checkConsistencyLight()
self.assertTrue(mea.getArray().isEqual(DataArrayDouble([-0.08504076274779823,-0.06378057206084897,-0.08504076274779869,-0.10630095343474463,-0.12756114412169625,-0.10630095343474734,-0.0637805720608491,-0.0850407627477968,-0.1063009534347449,-0.0850407627477994,-0.10630095343474809,-0.1275611441216954,-0.037205333702161475,-0.037205333702161475,-0.037205333702161475,-0.037205333702161475,-0.047835429045636084,-0.047835429045636084,-0.047835429045636084,-0.047835429045636084,-0.05846552438911087,-0.05846552438911087,-0.05846552438911087,-0.05846552438911087,-0.037205333702161725,-0.037205333702161725,-0.037205333702161725,-0.037205333702161725,-0.047835429045635834,-0.047835429045635834,-0.047835429045635834,-0.047835429045635834,-0.05846552438911058,-0.05846552438911058,-0.05846552438911058,-0.05846552438911058,-0.03879154890291829,-0.03879154890291829,-0.03879154890291829,-0.04120270848015563,-0.04120270848015563,-0.04120270848015563,-0.03393028948486933,-0.03393028948486933,-0.03393028948486933,-0.03151955746491709,-0.03151955746491709,-0.03151955746491709,-0.02424752187358276,-0.02424752187358276,-0.02424752187358276,-0.026657914642918758,-0.026657914642918758,-0.026657914642918758,-0.04120270848015456,-0.04120270848015456,-0.04120270848015456,-0.03879154890291757,-0.03879154890291757,-0.03879154890291757,-0.031519557464916595,-0.031519557464916595,-0.031519557464916595,-0.03393028948487046,-0.03393028948487046,-0.03393028948487046,-0.0266579146429191,-0.0266579146429191,-0.0266579146429191,-0.024247521873582645,-0.024247521873582645,-0.024247521873582645,-0.01851718920904466,-0.01851718920904466,-0.01851718920904466,-0.01851718920904466,-0.029627502734471456,-0.029627502734471456,-0.029627502734471456,-0.029627502734471456,-0.04740400437515433,-0.015150427534672922,-0.015150427534672922,-0.015150427534672922,-0.015150427534672922,-0.024240684055476674,-0.024240684055476674,-0.024240684055476674,-0.024240684055476674,-0.038785094488762675,-0.011783665860301345,-0.011783665860301345,-0.011783665860301345,-0.011783665860301345,-0.018853865376482152,-0.018853865376482152,-0.018853865376482152,-0.018853865376482152,-0.030166184602371443,-0.018517189209044892,-0.018517189209044892,-0.018517189209044892,-0.018517189209044892,-0.029627502734471827,-0.029627502734471827,-0.029627502734471827,-0.029627502734471827,-0.04740400437515492,-0.015150427534672776,-0.015150427534672776,-0.015150427534672776,-0.015150427534672776,-0.02424068405547644,-0.02424068405547644,-0.02424068405547644,-0.02424068405547644,-0.03878509448876231,-0.011783665860301277,-0.011783665860301277,-0.011783665860301277,-0.011783665860301277,-0.01885386537648204,-0.01885386537648204,-0.01885386537648204,-0.01885386537648204,-0.030166184602371266]),1e-14))
f=MEDCouplingFieldDouble(ft)
arr=DataArrayDouble(126,2)
arr[:,1]=range(126)
arr[:,1]+=1000
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(DataArrayDouble(f.integral(False)).isEqual(DataArrayDouble([-211.66121638700983,-4863.9563007698835]),1e-11))
self.assertTrue(DataArrayDouble(f.getWeightedAverageValue()).isEqual(DataArrayDouble([45.4960858131136,1045.496085813114]),1e-11))
self.assertTrue(DataArrayDouble(f.normL1()).isEqual(DataArrayDouble([45.49608581311362,1045.496085813114]),1e-11))
#
d=DataArrayInt([0,3,7,9,15,18])
e=DataArrayInt([0,1,2,3,7,8,15,16,17])
- a,b=d.searchRangesInListOfIds(e)
+ a,b=d.findIdsRangesInListOfIds(e)
self.assertTrue(a.isEqual(DataArrayInt([0,2,4])))
self.assertTrue(b.isEqual(DataArrayInt([0,1,2,7,8,15,16,17])))
pass
def testSwigDAPow1(self):
d=DataArrayInt(10)
d.iota(0)
- d1=d.deepCpy()
+ d1=d.deepCopy()
d.setIJ(2,0,-2)
self.assertTrue((d**2).isEqual(DataArrayInt([0,1,4,9,16,25,36,49,64,81])))
self.assertTrue((d**3).isEqual(DataArrayInt([0,1,-8,27,64,125,216,343,512,729])))
#
d=DataArrayDouble(10)
d.iota(0)
- d1=d.deepCpy()
+ d1=d.deepCopy()
d.setIJ(2,0,-2.)
self.assertTrue((d**2).isEqual(DataArrayDouble([0,1,4,9,16,25,36,49,64,81]),1e-12))
self.assertTrue((d**3).isEqual(DataArrayDouble([0,1,-8,27,64,125,216,343,512,729]),1e-12))
self.assertTrue(d2.isEqual(DataArrayDouble([1,1,1./2,1./sqrt(27.)]),1e-14))
d3=-1./d1[1:5]
self.assertTrue((3**d3).isEqual(DataArrayDouble([0.3333333333333333,0.5773502691896257,0.6933612743506348,0.7598356856515925]),1e-14))
- d4=d3.deepCpy() ; d4.abs()
+ d4=d3.deepCopy() ; d4.abs()
self.assertTrue((d4**d3).isEqual(DataArrayDouble([1.,sqrt(2.),1.4422495703074083,sqrt(2.)]),1e-14))
d4**=d3
self.assertTrue(d4.isEqual(DataArrayDouble([1.,sqrt(2.),1.4422495703074083,sqrt(2.)]),1e-14))
m2.allocateCells(0)
m2.insertNextCell(NORM_POLYGON,[0,1,2])
m2.setCoords(coo)
- m2.checkCoherency1()
+ m2.checkConsistency()
#
coo2=DataArrayDouble([0.,0.,0.,0.,0.,0.,0.,0.,2.],3,3)
m1=MEDCouplingUMesh("mesh",1)
m1.insertNextCell(NORM_SEG2,[0,1])
m1.insertNextCell(NORM_SEG2,[1,2])
m1.setCoords(coo2)
- m1.checkCoherency1()
+ m1.checkConsistency()
#
m3=m2.buildExtrudedMesh(m1,0)
m3.insertNextCell(NORM_POLYHED,[3,4,5,-1,8,7,6,-1,4,3,6,7,-1,5,4,7,8,-1,5,4,-1,3,5,8,6])# addition of face #4 with null surface
- self.assertTrue(m3.getBarycenterAndOwner().isEqual(DataArrayDouble([0.3333333333333333,0.3333333333333333,0.,0.3333333333333333,0.3333333333333333,1.,0.3333333333333333,0.3333333333333333,1.],3,3),1e-13))
+ self.assertTrue(m3.computeCellCenterOfMass().isEqual(DataArrayDouble([0.3333333333333333,0.3333333333333333,0.,0.3333333333333333,0.3333333333333333,1.,0.3333333333333333,0.3333333333333333,1.],3,3),1e-13))
m4,a,b,c,d=m3.buildDescendingConnectivity()
- self.assertTrue(m4.getBarycenterAndOwner().isEqual(DataArrayDouble([0.3333333333333333,0.3333333333333333,0.,0.3333333333333333,0.3333333333333333,0.,0.5,0.,0.,0.5,0.5,0.,0.,0.5,0.,0.3333333333333333,0.3333333333333333,2.,0.5,0.,1.,0.5,0.5,1.,0.,0.5,1.,0.5,0.5,0.],10,3),1e-13))
+ self.assertTrue(m4.computeCellCenterOfMass().isEqual(DataArrayDouble([0.3333333333333333,0.3333333333333333,0.,0.3333333333333333,0.3333333333333333,0.,0.5,0.,0.,0.5,0.5,0.,0.,0.5,0.,0.3333333333333333,0.3333333333333333,2.,0.5,0.,1.,0.5,0.5,1.,0.,0.5,1.,0.5,0.5,0.],10,3),1e-13))
pass
def testSwigRepr1(self):
m.insertNextCell(NORM_POLYHED,[4,5,0,1,6,7,-1,19,18,13,12,17,16,-1,5,4,16,17,-1,0,5,17,12,-1,1,0,12,13,-1,6,1,13,18,-1,7,6,18,19,-1,4,7,19,16])
m.insertNextCell(NORM_POLYHED,[9,10,11,3,2,8,-1,20,14,15,23,22,21,-1,10,9,21,22,-1,11,10,22,23,-1,3,11,23,15,-1,2,3,15,14,-1,8,2,14,20,-1,9,8,20,21])
m.setCoords(coo)
- m.checkCoherency1()
+ m.checkConsistency()
#
dReference=DataArrayDouble([(34.900130952189848,0.,200),(17.450065476094931,30.2244,200.)])
self.assertTrue(m.computeIsoBarycenterOfNodesPerCell().isEqual(dReference,1e-12))
m.allocateCells(0)
m.insertNextCell(NORM_HEXA20,[0,3,5,1,12,18,16,14,7,4,6,2,19,17,15,13,8,11,10,9])
m.setCoords(coo)
- m.checkCoherency1()
+ m.checkConsistency()
#
a,b,c,d,e=m.buildDescendingConnectivity()
m2=MEDCouplingUMesh('mesh',2)
#
NodeField_read=MEDCouplingFieldDouble.MergeFields([NodeField0,NodeField1])
NodeField_read.mergeNodes(1e-10)
- NodeFieldCpy=NodeField.deepCpy()
+ NodeFieldCpy=NodeField.deepCopy()
NodeFieldCpy.mergeNodes(1e-10)
- NodeField.checkCoherency()
+ NodeField.checkConsistencyLight()
self.assertTrue(not NodeField.getArray().isUniform(0.,1e-12))
NodeField.substractInPlaceDM(NodeField_read,10,1e-12)
self.assertTrue(NodeField.getArray().isUniform(0.,1e-12))
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
ff=f+2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(2,9),(3,10),(4,11),(5,12),(6,13)]),1e-12))
ff=f+arr
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,7),(2,10),(4,13),(6,16),(8,19)]),1e-12))
self.assertRaises(InterpKernelException,f.__add__,f2)
f2.setArray(arr)
ff=f+f2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,7),(2,10),(4,13),(6,16),(8,19)]),1e-12))
ff=f+[5,8]
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(5,15),(6,16),(7,17),(8,18),(9,19)]),1e-12))
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
ff=f-2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(-2,5),(-1,6),(0,7),(1,8),(2,9)]),1e-12))
ff=f-arr
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,7),(0,6),(0,5),(0,4),(0,3)]),1e-12))
self.assertRaises(InterpKernelException,f.__sub__,f2)
f2.setArray(arr)
ff=f-f2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,7),(0,6),(0,5),(0,4),(0,3)]),1e-12))
ff=f-[5,8]
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(-5,-1),(-4,0),(-3,1),(-2,2),(-1,3)]),1e-12))
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
ff=f*2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,14),(2,16),(4,18),(6,20),(8,22)]),1e-12))
ff=f*arr
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,0),(1,16),(4,36),(9,60),(16,88)]),1e-12))
self.assertRaises(InterpKernelException,f.__mul__,f2)
f2.setArray(arr)
ff=f*f2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,0),(1,16),(4,36),(9,60),(16,88)]),1e-12))
ff=f*[5,8]
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,56),(5,64),(10,72),(15,80),(20,88)]),1e-12))
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
self.assertRaises(InterpKernelException,f.__div__,0)
ff=f/2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,3.5),(0.5,4),(1,4.5),(1.5,5),(2,5.5)]),1e-12))
ff=f/arr
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,3.5),(0.5,2),(0.6666666666666666,1.5),(0.75,1.25),(0.8,1.1)]),1e-12))
self.assertRaises(InterpKernelException,f.__div__,f2)
f2.setArray(arr)
ff=f/f2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,3.5),(0.5,2),(0.6666666666666666,1.5),(0.75,1.25),(0.8,1.1)]),1e-12))
ff=f/[5,8]
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,0.875),(0.2,1),(0.4,1.125),(0.6,1.25),(0.8,1.375)]),1e-12))
f.getArray().alloc(5,1)
f.getArray()[:]=range(2,7)
ff=f**2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([4,9,16,25,36]),1e-12))
ff=f**arr
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([2,3,64,25,1]),1e-12))
f2.setArray(arr)
ff=f**f2
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([2,3,64,25,1]),1e-12))
## MEDCouplingFieldDouble.__iadd__
m=MEDCouplingDataForTest.build2DTargetMesh_1()
self.assertRaises(InterpKernelException,f.__iadd__,f2)
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
- f.checkCoherency()
+ f.checkConsistencyLight()
f+=2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(2,9),(3,10),(4,11),(5,12),(6,13)]),1e-12))
f+=arr
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(2,9),(4,12),(6,15),(8,18),(10,21)]),1e-12))
f2.setArray(arr)
f+=f2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(2,9),(5,14),(8,19),(11,24),(14,29)]),1e-12))
f+=[0.1,0.2]
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(2.1,9.2),(5.1,14.2),(8.1,19.2),(11.1,24.2),(14.1,29.2)]),1e-12))
## MEDCouplingFieldDouble.__isub__
m=MEDCouplingDataForTest.build2DTargetMesh_1()
self.assertRaises(InterpKernelException,f.__isub__,f2)
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
- f.checkCoherency()
+ f.checkConsistencyLight()
f-=2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(-2,5),(-1,6),(0,7),(1,8),(2,9)]),1e-12))
f-=arr
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(-2,5),(-2,4),(-2,3),(-2,2),(-2,1)]),1e-12))
f2.setArray(arr)
f-=f2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(-2,5),(-3,2),(-4,-1),(-5,-4),(-6,-7)]),1e-12))
f-=[0.1,0.2]
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(-2.1,4.8),(-3.1,1.8),(-4.1,-1.2),(-5.1,-4.2),(-6.1,-7.2)]),1e-12))
## MEDCouplingFieldDouble.__imul__
m=MEDCouplingDataForTest.build2DTargetMesh_1()
self.assertRaises(InterpKernelException,f.__imul__,f2)
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
- f.checkCoherency()
+ f.checkConsistencyLight()
f*=2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,14),(2,16),(4,18),(6,20),(8,22)]),1e-12))
f*=arr
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,0),(2,32),(8,72),(18,120),(32,176)]),1e-12))
f2.setArray(arr)
f*=f2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,0),(2,64),(16,288),(54,720),(128,1408)]),1e-12))
f*=[0.1,0.2]
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,0),(0.2,12.8),(1.6,57.6),(5.4,144),(12.8,281.6)]),1e-12))
## MEDCouplingFieldDouble.__idiv__
m=MEDCouplingDataForTest.build2DTargetMesh_1()
self.assertRaises(InterpKernelException,f.__idiv__,f2)
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
- f.checkCoherency()
+ f.checkConsistencyLight()
f/=2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,3.5),(0.5,4),(1,4.5),(1.5,5),(2,5.5)]),1e-12))
f/=arr
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,1.75),(0.25,1),(0.3333333333333333,0.75),(0.375,0.625),(0.4,0.55)]),1e-12))
f2.setArray(arr)
f/=f2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,0.875),(0.125,0.25),(0.1111111111111111,0.125),(0.09375,0.078125),(0.08,0.055)]),1e-12))
f/=[0.1,0.2]
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,4.375),(1.25,1.25),(1.1111111111111111,0.625),(0.9375,0.390625),(0.8,0.275)]),1e-12))
## MEDCouplingFieldDouble.__ipow__
m=MEDCouplingDataForTest.build2DTargetMesh_1()
self.assertRaises(InterpKernelException,f.__ipow__,f2)
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
- f.checkCoherency()
+ f.checkConsistencyLight()
f**=2
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertTrue(f.getArray().isEqual(DataArrayDouble([(0,49),(1,64),(4,81),(9,100),(16,121)]),1e-12))
## MEDCouplingFieldDouble.__radd__
m=MEDCouplingDataForTest.build2DTargetMesh_1()
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
ff=2+f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(2,9),(3,10),(4,11),(5,12),(6,13)]),1e-12))
ff=arr+f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,7),(2,10),(4,13),(6,16),(8,19)]),1e-12))
self.assertRaises(InterpKernelException,f.__radd__,f2)
ff=[5,8]+f
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
ff=2-f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(2,-5),(1,-6),(0,-7),(-1,-8),(-2,-9)]),1e-12))
ff=arr-f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,-7),(0,-6),(0,-5),(0,-4),(0,-3)]),1e-12))
self.assertRaises(InterpKernelException,f.__rsub__,f2)
### MEDCouplingFieldDouble.__rmul__
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(5) ; f.getArray()[:,1]=f.getArray()[:,0]+7
ff=2*f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,14),(2,16),(4,18),(6,20),(8,22)]),1e-12))
ff=arr*f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(0,0),(1,16),(4,36),(9,60),(16,88)]),1e-12))
self.assertRaises(InterpKernelException,f.__rmul__,f2)
ff=f*[5,8]
f.getArray().alloc(5,2)
f.getArray()[:,0]=range(1,6) ; f.getArray()[:,1]=f.getArray()[:,0]+7
ff=2/f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(2,0.25),(1,0.22222222222222221),(0.66666666666666663,0.20000000000000001),(0.5,0.18181818181818182),(0.40000000000000002,0.16666666666666666)]),1e-12))
ff=arr/f
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue(ff.getArray().isEqual(DataArrayDouble([(1,0.25),(1,0.44444444444444442),(1,0.59999999999999998),(1,0.72727272727272729),(1,0.83333333333333337)]),1e-12))
self.assertRaises(InterpKernelException,f.__rdiv__,f2)
pass
f.setMesh(m)
arr=DataArrayDouble(5,2) ; arr[:,0]=range(7,12) ; arr[:,1]=100+arr[:,0]
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
ff=f[1:-1:2]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([1,3],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(2,ff.getMesh().getNumberOfCells())
self.assertTrue(m.buildPartOfMySelf([2,3,4],True).isEqual(a,1e-12))
self.assertEqual(b,slice(2,5,1))
ff=f[2:]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([2,3,4],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
self.assertTrue(ff.getArray().isEqual(arr[[2,3,4]],1e-12))
#
ff=f[-2:0:-1]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([3,2,1],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
f.setMesh(m)
arr=DataArrayDouble(9,2) ; arr[:,0]=range(7,16) ; arr[:,1]=100+arr[:,0]
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
ff=f[1:-1:2]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([1,3],False)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(6,ff.getMesh().getNumberOfNodes())
self.assertTrue(2,ff.getMesh().getNumberOfCells())
self.assertTrue(m.buildPartOfMySelf([2,3,4],False).isEqual(a,1e-12))
self.assertTrue(b.isEqual(DataArrayInt([2,3,4,5,6,7,8])))
ff=f[2:]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([2,3,4],False)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(7,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
self.assertTrue(ff.getArray().isEqual(arr[[2,3,4,5,6,7,8]],1e-12))
#
ff=f[-2:0:-1]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([3,2,1],False)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(7,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
f.setMesh(m)
arr=DataArrayDouble(18,2) ; arr[:,0]=range(7,25) ; arr[:,1]=100+arr[:,0]
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
ff=f[1:-1:2]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([1,3],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(2,ff.getMesh().getNumberOfCells())
self.assertTrue(m.buildPartOfMySelf([2,3,4],True).isEqual(a,1e-12))
self.assertEqual(b,slice(7,18,1))
ff=f[2:]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([2,3,4],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
self.assertTrue(ff.getArray().isEqual(arr[[7,8,9,10,11,12,13,14,15,16,17]],1e-12))
#
ff=f[-2:0:-1]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([3,2,1],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
f.setGaussLocalizationOnCells([2],[0,0,1,0,1,0],[1.1,1.1,2.2,2.2,3.,3.,4.,4.,5.,5.],[0.1,0.1,0.4,0.3,0.1]);
arr=DataArrayDouble(16,2) ; arr[:,0]=range(7,23) ; arr[:,1]=100+arr[:,0]
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
ff=f[1:-1:2]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([1,3],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(2,ff.getMesh().getNumberOfCells())
self.assertTrue(m.buildPartOfMySelf([2,3,4],True).isEqual(a,1e-12))
self.assertEqual(b,slice(6,16,1))
ff=f[2:]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([2,3,4],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
self.assertTrue(ff.getArray().isEqual(arr[[6,7,8,9,10,11,12,13,14,15]],1e-12))
#
ff=f[-2:0:-1]
- ff.checkCoherency()
+ ff.checkConsistencyLight()
self.assertTrue((m.buildPartOfMySelf([3,2,1],True)).isEqual(ff.getMesh(),1e-12))
self.assertTrue(9,ff.getMesh().getNumberOfNodes())
self.assertTrue(3,ff.getMesh().getNumberOfCells())
f=MEDCouplingFieldDouble(ON_CELLS)
f.setMesh(MEDCouplingDataForTest.build2DTargetMesh_1())
f.applyFunc(3,700.)
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertEqual(3,f.getArray().getNumberOfComponents())
f.getArray().rearrange(1)
self.assertTrue(f.getArray().isUniform(700.,1e-10))
f.getArray().rearrange(3)
- f.checkCoherency()
+ f.checkConsistencyLight()
f.applyFunc(4,800.)
- f.checkCoherency()
+ f.checkConsistencyLight()
self.assertEqual(4,f.getArray().getNumberOfComponents())
f.getArray().rearrange(1)
self.assertTrue(f.getArray().isUniform(800.,1e-10))
f.getArray().rearrange(4)
- f.checkCoherency()
+ f.checkConsistencyLight()
pass
def testSwig2ComputeTupleIdsNearTupleBug1(self):
mesh1.allocateCells(0);
mesh1.finishInsertingCells();
# mesh 2
- mesh2=mesh1.deepCpy();
+ mesh2=mesh1.deepCopy();
coordsArr=DataArrayDouble.New(coords2,4,1);
mesh2.setCoords(coordsArr);
field = mesh1.fillFromAnalytic(ON_NODES,1,"x")
- field.checkCoherency()
+ field.checkConsistencyLight()
levOfCheck = 10
field.changeUnderlyingMesh( mesh2, levOfCheck, 1e-13, 0 )
self.assertTrue( field.getArray().getValues() == coords2 )
for i in xrange(24):
m.insertNextCell(NORM_QUAD4,conn[4*i:4*i+4])
pass
- m.checkCoherency1()
+ m.checkConsistency()
m0=m[3] ; m0.zipCoords()
expectedDist=0.8452994616207476
a,b=m0.distanceToPoint(pt)
d=d.fromPolarToCart()
d+=zeBary
m=MEDCouplingUMesh("quad8",2) ; m.allocateCells() ; m.insertNextCell(NORM_QUAD8,range(8)) ; m.setCoords(d)
- self.assertTrue(m.getBarycenterAndOwner().isEqual(DataArrayDouble(zeBary,1,2),1e-13))
+ self.assertTrue(m.computeCellCenterOfMass().isEqual(DataArrayDouble(zeBary,1,2),1e-13))
self.assertAlmostEqual(float(m.getMeasureField(False).getArray()),pi*zeRadius*zeRadius,12)
tri32D=m.buildDescendingConnectivity()[0][0] ; tri32D.zipCoords()
# spaceDim=3 QUAD8 becomes QUAD4 ... for the moment
m.setCoords(m.getCoords().changeNbOfComponents(3,0.))
- m2=m.deepCpy()
+ m2=m.deepCopy()
m2.convertQuadraticCellsToLinear()
self.assertAlmostEqual(float(m.getMeasureField(False).getArray()),float(m2.getMeasureField(False).getArray()),12)
- self.assertTrue(m.getBarycenterAndOwner().isEqual(m2.getBarycenterAndOwner(),1e-13))
+ self.assertTrue(m.computeCellCenterOfMass().isEqual(m2.computeCellCenterOfMass(),1e-13))
#TRI6 representing a circle of center zeBary and radius zeRadius
zeBary=[5,6]
zeRadius=3
d=d.fromPolarToCart()
d+=zeBary
m=MEDCouplingUMesh("tri6",2) ; m.allocateCells() ; m.insertNextCell(NORM_TRI6,range(6)) ; m.setCoords(d)
- self.assertTrue(m.getBarycenterAndOwner().isEqual(DataArrayDouble(zeBary,1,2),1e-13))
+ self.assertTrue(m.computeCellCenterOfMass().isEqual(DataArrayDouble(zeBary,1,2),1e-13))
self.assertAlmostEqual(float(m.getMeasureField(False).getArray()),pi*zeRadius*zeRadius,12)
# spaceDim=3 TRI6 becomes TRI3 ... for the moment
m.setCoords(m.getCoords().changeNbOfComponents(3,0.))
- m2=m.deepCpy()
+ m2=m.deepCopy()
m2.convertQuadraticCellsToLinear()
self.assertAlmostEqual(float(m.getMeasureField(False).getArray()),float(m2.getMeasureField(False).getArray()),12)
- self.assertTrue(m.getBarycenterAndOwner().isEqual(m2.getBarycenterAndOwner(),1e-13))
+ self.assertTrue(m.computeCellCenterOfMass().isEqual(m2.computeCellCenterOfMass(),1e-13))
# QPOLYG representing a circle of center zeBary and radius zeRadius
zeBary=[5,6]
zeRadius=3
d=d.fromPolarToCart()
d+=zeBary
m=MEDCouplingUMesh("qpolyg",2) ; m.allocateCells() ; m.insertNextCell(NORM_QPOLYG,range(10)) ; m.setCoords(d)
- self.assertTrue(m.getBarycenterAndOwner().isEqual(DataArrayDouble(zeBary,1,2),1e-13))
+ self.assertTrue(m.computeCellCenterOfMass().isEqual(DataArrayDouble(zeBary,1,2),1e-13))
self.assertAlmostEqual(float(m.getMeasureField(False).getArray()),pi*zeRadius*zeRadius,12)
# spaceDim=3 QPOLYG becomes POLYG ... for the moment
m.setCoords(m.getCoords().changeNbOfComponents(3,0.))
- m2=m.deepCpy()
- m2.convertQuadraticCellsToLinear() ; m2.checkCoherency1()
+ m2=m.deepCopy()
+ m2.convertQuadraticCellsToLinear() ; m2.checkConsistency()
self.assertTrue(m2.getAllGeoTypes()==[NORM_POLYGON] and m2.getNodalConnectivity().getValues()==[5,0,1,2,3,4])
self.assertAlmostEqual(float(m.getMeasureField(False).getArray()),float(m2.getMeasureField(False).getArray()),12)
- self.assertTrue(m.getBarycenterAndOwner().isEqual(m2.getBarycenterAndOwner(),1e-13))
+ self.assertTrue(m.computeCellCenterOfMass().isEqual(m2.computeCellCenterOfMass(),1e-13))
# TRI3
self.assertAlmostEqual(float(tri32D.getMeasureField(False).getArray()),(87+100)*pi/180*zeRadius,13)
exp=DataArrayDouble(1,2) ; exp[:,0]=3 ; exp[:,1]=(87-100)/2. ; exp[:,1]*=pi/180. ; exp=exp.fromPolarToCart() ; exp+=DataArrayDouble([5,6],1,2)
- self.assertTrue(tri32D.getBarycenterAndOwner().isEqual(exp,1e-12))
+ self.assertTrue(tri32D.computeCellCenterOfMass().isEqual(exp,1e-12))
# spaceDim=3 TRI3 becomes TRI2 ... for the moment
tri32D.changeSpaceDimension(3)
- tri2=tri32D.deepCpy() ; tri2.convertQuadraticCellsToLinear()
+ tri2=tri32D.deepCopy() ; tri2.convertQuadraticCellsToLinear()
self.assertAlmostEqual(float(tri32D.getMeasureField(False).getArray()),float(tri2.getMeasureField(False).getArray()),13)
- self.assertTrue(tri32D.getBarycenterAndOwner().isEqual(tri2.getBarycenterAndOwner(),1e-12))
+ self.assertTrue(tri32D.computeCellCenterOfMass().isEqual(tri2.computeCellCenterOfMass(),1e-12))
tri32D.changeSpaceDimension(1)
self.assertAlmostEqual(float(tri32D.getMeasureField(False).getArray()),-0.67795240172962323,12)
pass
dataArray[:]=0.
dataArray[0]=[0.,1,3]
m.setCoords(dataArray[0])
- m1=m.deepCpy()
+ m1=m.deepCopy()
m.rotate([0.,0.,3.],[1.,0.,0.],0.5*pi)
self.assertTrue(m.getCoords().isEqual(DataArrayDouble([0.,0.,4.],1,3),1e-15))
#
vec=[[1.,0.,0.],[(1.,0.,0.)],DataArrayDouble([1.,0.,0.],1,3),list(d2)[0]]
for p in pts:
for v in vec:
- m2=m1.deepCpy()
+ m2=m1.deepCopy()
m2.rotate(p,v,0.5*pi)
self.assertTrue(m2.getCoords().isEqual(DataArrayDouble([0.,0.,4.],1,3),1e-15))
pass
f=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f.setMesh(m)
f.fillFromAnalytic(1,formula)
f.setName("Field1") ; f.setTime(1.1,1,-1)
- f.checkCoherency()
+ f.checkConsistencyLight()
#
arr=f.getArray()
arr2=DataArrayDouble(len(arr),2) ; arr2[:,0]=arr
arr2=DataArrayDouble(len(arr),2) ; arr2[:,0]=arr ; arr2[:,1]=2*arr
f.setArray(arr2)
- f.checkCoherency()
+ f.checkConsistencyLight()
# here the compact code to obviously put field on cell to nodes
rn,rni=f.getMesh().getReverseNodalConnectivity()
arr2=f.getArray()[rn]
maxNbCSN=nbOfCellsSharingNodes.getMaxValue()[0]
arr3=DataArrayDouble(f.getMesh().getNumberOfNodes(),f.getArray().getNumberOfComponents()) ; arr3[:]=0.
for i in xrange(1,maxNbCSN+1):
- ids=nbOfCellsSharingNodes.getIdsEqual(i)
+ ids=nbOfCellsSharingNodes.findIdsEqual(i)
if len(ids)==0:
continue
for j in range(i):
pass
fNode=MEDCouplingFieldDouble(ON_NODES,ONE_TIME) ; fNode.setMesh(m)
fNode.setName("Field1Node") ; fNode.setTime(1.1,1,-1)
- fNode.setArray(arr3) ; fNode.checkCoherency()
+ fNode.setArray(arr3) ; fNode.checkConsistencyLight()
self.assertTrue(arr3.isEqual(arr4,1e-12))
#
d=DataArrayInt.Range(0,20,1)
ids=DataArrayInt([])
self.assertEqual(len(a[ids]),0)
self.assertEqual(len(b[ids]),0)
- a2=a.deepCpy() ; a2[ids]+=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
- a2=a.deepCpy() ; a2[ids]*=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
- a2=a.deepCpy() ; a2[ids]/=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
- a2=a.deepCpy() ; a2[ids]-=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
+ a2=a.deepCopy() ; a2[ids]+=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
+ a2=a.deepCopy() ; a2[ids]*=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
+ a2=a.deepCopy() ; a2[ids]/=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
+ a2=a.deepCopy() ; a2[ids]-=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15))
pass
def testSwig2CheckAndPreparePermutation1(self):
self.assertTrue(DataArrayInt([6]).isEqual(m.computeNbOfNodesPerCell()))
self.assertTrue(DataArrayInt([5]).isEqual(m.computeNbOfFacesPerCell()))
m.__repr__() ; m.__str__()
- m.checkCoherency()
- m.checkCoherency1()
+ m.checkConsistencyLight()
+ m.checkConsistency()
#
cm=MEDCouplingCMesh() ; cm.setName("m")
arr0=DataArrayDouble(6) ; arr0.iota()
m1c=m1.convertIntoSingleGeoTypeMesh()
self.assertTrue(isinstance(m1c,MEDCoupling1SGTUMesh))
self.assertEqual(m1c.getCoords().getHiddenCppPointer(),m.getCoords().getHiddenCppPointer())
- m1c.checkCoherency1()
+ m1c.checkConsistency()
self.assertTrue(m1c.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,2,1,7,8,3,2,8,9,4,3,9,10,5,4,10,11])))
self.assertEqual(20,m1c.getNodalConnectivityLength())
self.assertTrue(m.isEqual(m1c,1e-12))
self.assertTrue(not m.isEqual(m1c,1e-12))
m.getNodalConnectivity().setIJ(1,0,0)
self.assertTrue(m.isEqual(m1c,1e-12))
- m1c.setCoords(m.getCoords().deepCpy())
+ m1c.setCoords(m.getCoords().deepCopy())
self.assertTrue(m.isEqual(m1c,1e-12))
m1c.getCoords().setIJ(0,1,0.1)
self.assertTrue(not m.isEqual(m1c,1e-12))
m.setName("m2")
self.assertTrue(not m.isEqual(m1c,1e-12) and m.isEqualWithoutConsideringStr(m1c,1e-12))
#
- m.checkCoherency() ; m.checkCoherency1() ; m.checkCoherency1()
+ m.checkConsistencyLight() ; m.checkConsistency() ; m.checkConsistency()
self.assertEqual(m.getMeshDimension(),2)
self.assertTrue(m.giveCellsWithType(NORM_QUAD4).isEqual(DataArrayInt([0,1,2,3,4])))
self.assertTrue(m.giveCellsWithType(NORM_TRI3).isEqual(DataArrayInt([])))
self.assertTrue(m.computeIsoBarycenterOfNodesPerCell().isEqual(DataArrayDouble([(0.5,0.5,0),(1.5,0.5,0),(2.5,0.5,0),(3.5,0.5,0),(4.5,0.5,0)]),1e-13))
##
ref=m.getCoords().getHiddenCppPointer()
- mcpy=m.deepCpy() ; mcpy.insertNextCell([1,0,6,7])
- c=m.getNodalConnectivity().deepCpy()
+ mcpy=m.deepCopy() ; mcpy.insertNextCell([1,0,6,7])
+ c=m.getNodalConnectivity().deepCopy()
o2n=DataArrayInt([2,0,1,4,3])
m.renumberCells(o2n,False)
c.rearrange(4) ; c.renumberInPlace(o2n) ; c.rearrange(1)
self.assertTrue(m2.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,2,1,7,8,3,2,8,9,4,3,9,10,5,4,10,11,1,0,6,7,26,25,31,32,27,26,32,33,25,24,30,31,29,28,34,35,28,27,33,34])))
##
mu=m.buildUnstructured()
- mu.checkCoherency1()
+ mu.checkConsistency()
self.assertEqual(mu.getCoords().getHiddenCppPointer(),m.getCoords().getHiddenCppPointer())
self.assertEqual(2,mu.getMeshDimension())
self.assertEqual([NORM_QUAD4],mu.getAllGeoTypes())
self.assertTrue(mu.getNodalConnectivityIndex().isEqual(DataArrayInt([0,5,10,15,20,25])))
##
for typ in [0,1]:
- mcpy2=m.deepCpy() ; umcpy2=mcpy2.buildUnstructured()
+ mcpy2=m.deepCopy() ; umcpy2=mcpy2.buildUnstructured()
ids=mcpy2.simplexize(typ) ; ids2=umcpy2.simplexize(typ)
self.assertTrue(ids.isEqual(ids2))
mcpy3=umcpy2.convertIntoSingleGeoTypeMesh()
um1=um.convertIntoSingleGeoTypeMesh()
self.assertEqual(8,um1.getNumberOfNodesPerCell())
for typ in [PLANAR_FACE_5,PLANAR_FACE_6]:
- mcpy2=um1.deepCpy() ; umcpy2=mcpy2.buildUnstructured()
+ mcpy2=um1.deepCopy() ; umcpy2=mcpy2.buildUnstructured()
ids=mcpy2.simplexize(typ) ; ids2=umcpy2.simplexize(typ)
self.assertTrue(ids.isEqual(ids2))
mcpy3=umcpy2.convertIntoSingleGeoTypeMesh()
self.assertEqual(m3.getCoords().getHiddenCppPointer(),mcpy.getCoords().getHiddenCppPointer())
self.assertTrue(m3.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,2,1,7,8,3,2,8,9,4,3,9,10,5,4,10,11,1,0,6,7,2,1,7,8,3,2,8,9,1,0,6,7,5,4,10,11,4,3,9,10])))
##
- ref=mcpy.getCoords().deepCpy()
+ ref=mcpy.getCoords().deepCopy()
c3=mcpy.getNodalConnectivity()[:]
- mcpy.getNodalConnectivity().setIJ(int(c3.getIdsEqual(11)),0,24)
+ mcpy.getNodalConnectivity().setIJ(int(c3.findIdsEqual(11)),0,24)
c2=DataArrayDouble.Aggregate([mcpy.getCoords(),mcpy.getCoords()[11:]])
mcpy.setCoords(c2)
- mcpy.checkCoherency1()
+ mcpy.checkConsistency()
a,b=mcpy.getNodeIdsInUse()
self.assertEqual(12,b)
self.assertTrue(a.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,8,9,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])))
self.assertTrue(ids.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,8,9,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])))
self.assertTrue(mcpy.getCoords().isEqual(ref[:12],1e-12))
self.assertTrue(mcpy.getNodalConnectivity().isEqual(c3))
- mcpy.checkCoherency1()
+ mcpy.checkConsistency()
##
m4=mcpy[DataArrayInt([0,3,4])]
m5=mcpy.buildPartOfMySelfKeepCoords(DataArrayInt([0,3,4]))
self.assertTrue(m6.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,3,2,8,9,5,4,10,11])))
##
mcpy.setCoords(DataArrayDouble.Aggregate([mcpy.getCoords(),mcpy.getCoords()]))
- mcpy.checkCoherency1()
+ mcpy.checkConsistency()
##
- mcppy=mcpy.deepCpyConnectivityOnly()
+ mcppy=mcpy.deepCopyConnectivityOnly()
self.assertTrue(mcppy.isEqual(mcpy,1e-12))
self.assertTrue(mcppy.getCoords().getHiddenCppPointer()==mcpy.getCoords().getHiddenCppPointer())
self.assertTrue(mcppy.getNodalConnectivity().isEqual(mcpy.getNodalConnectivity()))
##
self.assertTrue(mcpy.fillCellIdsToKeepFromNodeIds(DataArrayInt([6,7]),False).isEqual(DataArrayInt([0,1,5])))
##
- mcpy2=mcpy.deepCpy()
+ mcpy2=mcpy.deepCopy()
self.assertEqual([None,None],mcpy.checkGeoEquivalWith(mcpy2,1,1e-12))#fast equal
mcpy.checkFastEquivalWith(mcpy2,1e-12)
mcpy2.renumberCells([0,2,4,3,1,5])
self.assertEqual(a1[3:].front(),11)
self.assertEqual(a1[4:].convertToDblArr().front(),14.)
a1c=DataArrayInt([5,7,1,2, 8,11,0, 5,6,3,12, 1,5,2, 13,12,11,7, 6,1,0, 20,21,19,17])
- d,e=MEDCouplingUMesh.ExtractFromIndexedArrays2(1,5,2,a1c,a1)
+ d,e=MEDCouplingUMesh.ExtractFromIndexedArraysSlice(1,5,2,a1c,a1)
self.assertTrue(d.isEqual(DataArrayInt([8,11,0,1,5,2])))
self.assertTrue(e.isEqual(DataArrayInt([0,3,6])))
#
self.assertTrue(DataArrayInt([8]).isEqual(m.computeNbOfNodesPerCell()))
self.assertTrue(DataArrayInt([2]).isEqual(m.computeNbOfFacesPerCell()))
m.__repr__() ; m.__str__()
- m.checkCoherency()
- m.checkCoherency1()
+ m.checkConsistencyLight()
+ m.checkConsistency()
#
cm=MEDCouplingCMesh() ; cm.setName("m")
arr0=DataArrayDouble(6) ; arr0.iota()
arr1=DataArrayDouble([0,1])
cm.setCoords(arr0,arr1,arr1) ; um=cm.buildUnstructured() ; um.convertAllToPoly()
- um2=um.deepCpyConnectivityOnly()
+ um2=um.deepCopyConnectivityOnly()
self.assertTrue(um2.isEqual(um,1e-12))
self.assertEqual(um2.getCoords().getHiddenCppPointer(),um.getCoords().getHiddenCppPointer())
self.assertTrue(um2.getNodalConnectivity().isEqual(um.getNodalConnectivity()))
m.insertNextCell([3,2,8,9])
m.insertNextCell([4,3,9,10,-1,5,3,9])
m.insertNextCell([5,4,10,11,-1,11,10,-1,5])
- m.checkCoherency()
- m.checkCoherency1()
+ m.checkConsistencyLight()
+ m.checkConsistency()
self.assertEqual(5,m.getNumberOfCells())
self.assertTrue(m.getNodalConnectivityIndex().isEqual(DataArrayInt([0,8,19,23,31,40])))
self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([1,0,6,7,-1,7,6,1,2,1,7,8,-1,2,1,-1,8,-1,7,3,2,8,9,4,3,9,10,-1,5,3,9,5,4,10,11,-1,11,10,-1,5])))
#
- m4=m.deepCpy()
+ m4=m.deepCopy()
self.assertTrue(m.isEqual(m4,1e-12))
m4.getNodalConnectivity().setIJ(2,0,5)
self.assertTrue(not m.isEqual(m4,1e-12))
self.assertTrue(DataArrayDouble([(0.5714285714285714,0.5714285714285714,0),(1.5,0.5,0),(2.5,0.5,0),(3.5714285714285712,0.42857142857142855,0),(4.5714285714285712,0.5714285714285714,0)]).isEqual(f,1e-14))
mu0=m.buildUnstructured()
o2n=[1,2,0,4,3]
- m2=m.deepCpy()
- m3=m.deepCpyConnectivityOnly()
+ m2=m.deepCopy()
+ m3=m.deepCopyConnectivityOnly()
self.assertTrue(m3.isEqual(m,1e-12))
self.assertEqual(m3.getCoords().getHiddenCppPointer(),m.getCoords().getHiddenCppPointer())
self.assertTrue(m3.getNodalConnectivity().getHiddenCppPointer()!=m.getNodalConnectivity().getHiddenCppPointer())
self.assertTrue(mcpy0.getNodalConnectivity().isEqual(DataArrayInt([31,3,2,8,9,31,1,0,6,7,-1,7,6,1,31,2,1,7,8,-1,2,1,-1,8,-1,7,31,5,4,10,11,-1,11,10,-1,5,31,4,3,9,10,-1,5,3,9])))
self.assertTrue(mcpy0.getNodalConnectivityIndex().isEqual(DataArrayInt([0,5,14,26,36,45])))
self.assertEqual(mcpy0.getAllGeoTypes(),[NORM_POLYHED])
- mcpy0.checkCoherency()
- mcpy0.checkCoherency1()
+ mcpy0.checkConsistencyLight()
+ mcpy0.checkConsistency()
mcpy1=mcpy0.convertIntoSingleGeoTypeMesh()
self.assertTrue(mcpy1.isEqual(m,1e-12))
#
self.assertTrue(m_mrg2.isPacked())
self.assertEqual(120,m_mrg2.getNodalConnectivityIndex().popBackSilent())
self.assertEqual(m_mrg2.getNumberOfCells(),14)
- m_mrg2.checkCoherency1()
+ m_mrg2.checkConsistency()
self.assertTrue(not m_mrg2.isPacked())
m_mrg4,b=m_mrg2.copyWithNodalConnectivityPacked()
self.assertTrue(not b)
- m_mrg4.checkCoherency1()
+ m_mrg4.checkConsistency()
self.assertEqual(m_mrg4.getNumberOfCells(),14)
self.assertTrue(m_mrg4.getNodalConnectivityIndex().isEqual(m_mrg2.getNodalConnectivityIndex()))
self.assertEqual(len(m_mrg4.getNodalConnectivity()),111)
self.assertEqual(27,c.getNumberOfCells())
self.assertEqual(40,c.getNumberOfNodes())
self.assertEqual(2,c.getMeshDimension())
- c.checkCoherency()
+ c.checkConsistencyLight()
#
arr2=MEDCouplingStructuredMesh.BuildExplicitIdsFrom([9,3],[(1,5),(0,3)])
self.assertTrue(arr2.isEqual(DataArrayInt([1,2,3,4,10,11,12,13,19,20,21,22])))
# CMesh
c2=c.buildStructuredSubPart([(1,5),(0,3)])
- c2.checkCoherency()
+ c2.checkConsistencyLight()
self.assertTrue(isinstance(c2,MEDCouplingCMesh))
self.assertEqual(12,c2.getNumberOfCells())
self.assertEqual(20,c2.getNumberOfNodes())
self.assertTrue(c2.getCoordsAt(1).isEqual(DataArrayDouble([3.,4.,5.,6.]),1e-12))
#
a,b=c.buildPartAndReduceNodes(d20)
- a.checkCoherency()
+ a.checkConsistencyLight()
exp2=DataArrayInt([-1,0,1,2,3,4,-1,-1,-1,-1,-1,5,6,7,8,9,-1,-1,-1,-1,-1,10,11,12,13,14,-1,-1,-1,-1,-1,15,16,17,18,19,-1,-1,-1,-1])
self.assertTrue(exp2.isEqual(b))
self.assertTrue(isinstance(a,MEDCouplingCMesh))
c2=MEDCouplingCurveLinearMesh() ; c2.setName("toto")
c2.setCoords(c.buildUnstructured().getCoords())
c2.setNodeGridStructure([10,4])
- c2.checkCoherency()
+ c2.checkConsistencyLight()
a,b=c2.buildPartAndReduceNodes(d20)
- a.checkCoherency()
+ a.checkConsistencyLight()
self.assertTrue(exp2.isEqual(b))
self.assertTrue(isinstance(a,MEDCouplingCurveLinearMesh))
self.assertTrue(a.buildUnstructured().isEqual(c2.buildUnstructured().buildPartAndReduceNodes(d20)[0],1e-12))
self.assertTrue(m12.isEqual(m11,1e-12))
m12.setCoords(m0.getCoords()) # m12 is not OK geometrically but the aim of the test is only connectivity values
m3=MEDCoupling1GTUMesh.AggregateOnSameCoordsToUMesh([m12,m0])
- m3.checkCoherency()
+ m3.checkConsistencyLight()
self.assertEqual(m3.getCoords().getHiddenCppPointer(),m12.getCoords().getHiddenCppPointer())
self.assertTrue(m3.getNodalConnectivity().isEqual(DataArrayInt([18,1,0,3,4,10,9,12,13,18,2,1,4,5,11,10,13,14,18,4,3,6,7,13,12,15,16,18,5,4,7,8,14,13,16,17,18,10,9,12,13,19,18,21,22,18,11,10,13,14,20,19,22,23,18,13,12,15,16,22,21,24,25,18,14,13,16,17,23,22,25,26,31,0,1,3,4,2,-1,1,5,6,7,0,-1,0,7,8,10,11,9,2,-1,1,5,12,14,15,13,3,-1,16,9,2,4,17,-1,4,3,13,18,17,-1,5,6,19,21,20,12,-1,6,7,8,23,22,19,-1,23,24,10,8,-1,25,11,9,16,-1,24,26,25,11,10,-1,12,14,20,-1,27,28,29,15,13,18,-1,14,15,29,30,21,20,-1,26,27,18,17,16,25,-1,22,19,21,30,31,-1,22,31,28,27,26,24,23,-1,31,30,29,28,31,0,7,8,10,11,9,2,-1,32,0,7,35,34,33,-1,32,0,2,37,36,-1,35,7,8,40,39,38,-1,2,37,41,9,-1,40,8,10,44,43,42,-1,41,9,11,44,43,-1,44,11,10,-1,32,33,45,47,46,36,-1,33,34,48,45,-1,35,34,48,50,49,38,-1,41,43,42,46,36,37,-1,38,39,51,49,-1,39,40,42,46,47,52,51,-1,45,47,52,50,48,-1,52,51,49,50,31,6,7,8,23,22,19,-1,6,35,7,-1,6,35,38,19,-1,35,7,8,40,39,38,-1,53,22,19,38,39,54,-1,23,53,54,40,8,-1,53,22,23,-1,39,54,40,31,35,34,48,50,49,38,-1,6,35,34,56,55,5,-1,6,35,38,19,-1,34,56,57,59,58,48,-1,60,61,21,19,38,49,-1,62,50,48,58,-1,60,63,64,62,50,49,-1,5,6,19,21,20,12,-1,55,5,12,65,-1,66,67,65,55,56,57,-1,63,66,57,59,64,-1,64,62,58,59,-1,60,63,66,67,68,61,-1,61,68,20,21,-1,67,68,20,12,65])))
self.assertTrue(m3.getNodalConnectivityIndex().isEqual(DataArrayInt([0,9,18,27,36,45,54,63,72,186,286,330,423])))
m.insertNextCell(NORM_PENTA6,[1,2,0,4,5,3])
st=m.getCoords().getHiddenCppPointer()
c,a,b=m.tetrahedrize(PLANAR_FACE_5)
- c.checkCoherency1()
+ c.checkConsistency()
self.assertTrue(a.isEqual(DataArrayInt([0,0,0])))
self.assertEqual(0,b)
self.assertEqual(m.getCoords().getHiddenCppPointer(),c.getCoords().getHiddenCppPointer())
m2.allocateCells()
m2.insertNextCell(NORM_HEXGP12,[3,2,1,0,5,4,9,8,7,6,11,10])
c,a,b=m2.tetrahedrize(PLANAR_FACE_5)
- c.checkCoherency1()
+ c.checkConsistency()
self.assertTrue(a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0])))
self.assertEqual(0,b)
self.assertEqual(c.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer())
m3.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4])
st=m3.getCoords().getHiddenCppPointer()
c,a,b=m3.tetrahedrize(PLANAR_FACE_5)
- c.checkCoherency1()
+ c.checkConsistency()
a.isEqual(DataArrayInt([0,0,0,0,0]))
self.assertEqual(0,b)
self.assertEqual(m3.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer())
m4.allocateCells(0)
m4.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4])
c,a,b=m4.tetrahedrize(PLANAR_FACE_6)
- c.checkCoherency1()
+ c.checkConsistency()
a.isEqual(DataArrayInt([0,0,0,0,0,0]))
self.assertEqual(0,b)
self.assertEqual(c.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer())
m4.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4])
st=m4.getCoords().getHiddenCppPointer()
c,a,b=m4.tetrahedrize(GENERAL_24)
- c.checkCoherency1()
+ c.checkConsistency()
a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))
self.assertEqual(7,b)
self.assertTrue(c.getCoords().getHiddenCppPointer()!=coords.getHiddenCppPointer())
m6.insertNextCell(NORM_HEXA8,[3,2,1,0,7,6,5,4])
st=m6.getCoords().getHiddenCppPointer()
c,a,b=m6.tetrahedrize(GENERAL_48)
- c.checkCoherency1()
+ c.checkConsistency()
a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))
self.assertEqual(19,b)
self.assertTrue(c.getCoords().getHiddenCppPointer()!=coords.getHiddenCppPointer())
m7.allocateCells()
m7.insertNextCell(NORM_POLYHED,[3,2,1,0,5,4,-1,9,10,11,6,7,8,-1,3,9,8,2,-1,2,8,7,1,-1,1,7,6,0,-1,0,6,11,5,-1,5,11,10,4,-1,4,10,9,3])
c,a,b=m7.tetrahedrize(PLANAR_FACE_5)
- c.checkCoherency1()
+ c.checkConsistency()
self.assertTrue(a.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])))
self.assertEqual(9,b)
self.assertTrue(c.getNodalConnectivity().isEqual(DataArrayInt([3,2,12,20,2,1,12,20,1,0,12,20,0,5,12,20,5,4,12,20,4,3,12,20,9,10,13,20,10,11,13,20,11,6,13,20,6,7,13,20,7,8,13,20,8,9,13,20,3,9,14,20,9,8,14,20,8,2,14,20,2,3,14,20,2,8,15,20,8,7,15,20,7,1,15,20,1,2,15,20,1,7,16,20,7,6,16,20,6,0,16,20,0,1,16,20,0,6,17,20,6,11,17,20,11,5,17,20,5,0,17,20,5,11,18,20,11,10,18,20,10,4,18,20,4,5,18,20,4,10,19,20,10,9,19,20,9,3,19,20,3,4,19,20])))
st=m8.getCoords().getHiddenCppPointer()
c,a,b=m8.tetrahedrize(PLANAR_FACE_5)
self.assertEqual(m8.getCoords().getHiddenCppPointer(),coords.getHiddenCppPointer())
- c.checkCoherency1()
+ c.checkConsistency()
self.assertTrue(a.isEqual(DataArrayInt([0,0])))
self.assertEqual(0,b)
self.assertTrue(c.getNodalConnectivity().isEqual(DataArrayInt([3,2,1,7,3,1,0,7])))
mesh.setCoords(srcPointCoordsXY);
f.setMesh(mesh);
f.setArray(srcFieldValsOnPoints);
- f.checkCoherency();
+ f.checkConsistencyLight();
#
res0=f.getValueOn([-0.5,-0.5]);
self.assertAlmostEqual(targetFieldValsExpected.getIJ(0,0),res0[0],10)
srcFieldValsOnPoints2=DataArrayDouble(4,2) ; srcFieldValsOnPoints2[:,0]=srcFieldValsOnPoints[:4] ; srcFieldValsOnPoints2[:,1]=2*srcFieldValsOnPoints[:4]
n0=srcFieldValsOnPoints2.toNumPyArray() ; n0=n0.reshape(4,2) ; n0=np.matrix(n0)
#
- f=MEDCouplingFieldDouble.New(ON_NODES_KR,ONE_TIME) ; f.setMesh(mesh) ; f.setArray(srcFieldValsOnPoints2) ; f.checkCoherency()
+ f=MEDCouplingFieldDouble.New(ON_NODES_KR,ONE_TIME) ; f.setMesh(mesh) ; f.setArray(srcFieldValsOnPoints2) ; f.checkConsistencyLight()
self.assertTrue(DataArrayDouble(np.array((m0*n0))).isEqual(f.getValueOnMulti(pts3),1e-14))
pass
#
def testSwig2MergeFieldsOnFieldsHavingNoMesh(self):
a=DataArrayDouble(4) ; a.iota() ; a*=1.5
c=MEDCouplingCMesh() ; c.setCoords(a,a) ; f1=c.getMeasureField(False)
- f1.setMesh(None) ; f2=f1.deepCpy() ; f2*=2
+ f1.setMesh(None) ; f2=f1.deepCopy() ; f2*=2
f3=MEDCouplingFieldDouble.MergeFields(f1,f2)
daExp=DataArrayDouble([2.25,2.25,2.25,2.25,2.25,2.25,2.25,2.25,2.25,4.5,4.5,4.5,4.5,4.5,4.5,4.5,4.5,4.5])
self.assertTrue(f3.getArray().isEqual(daExp,1e-12))
m.changeSpaceDimension(3)
m.orientCorrectly2DCells([0.,0.,-1.],False)
#
- m.checkCoherency()
+ m.checkConsistencyLight()
self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([6,3,2,0,4,5,1, 32,3,2,0,4,5,1])))
self.assertTrue(m.getNodalConnectivityIndex().isEqual(DataArrayInt([0,7,14])))
m.changeSpaceDimension(2)
src.insertNextCell(NORM_HEXA8,[4,5,7,6,12,13,15,14])
src.insertNextCell(NORM_HEXA8,[8,9,12,11,16,17,20,19])
src.insertNextCell(NORM_HEXA8,[9,10,13,12,17,18,21,20])
- src.checkCoherency1()
+ src.checkConsistency()
# trg is useless here but I keep it in case of MEDCouplingRemapper were expected to do something about warped NORM_HEXA8
trgCoo=DataArrayDouble([0.0960891897852753,0.105088620541845,6.8598,0.0599574480546212,0.118434267436059,6.8598,0.113514510609589,0.14874473653263,6.8598,0.0831322609794463,0.167319109733883,6.8598,0.0960891897852753,0.105088620541845,6.92146666666667,0.0599574480546212,0.118434267436059,6.92146666666667,0.113514510609589,0.14874473653263,6.92146666666667,0.0831322609794463,0.167319109733883,6.92146666666667],8,3)
trg=MEDCouplingUMesh("MESH",3) ; trg.setCoords(trgCoo)
pts=lambd*eqFaces[:,:-1]+srcFace.getCoords()[conn[:,nodeIdInCell]]#pts represent the projection of the last points of each NORM_QUAD4 to the plane defined by the 3 first points of the NORM_QUAD4 cell
shouldBeZero=(pts*eqFaces[:,:-1]).sumPerTuple()+eqFaces[:,3]# this line is useless only to be sure that pts are on the plane.
check=(pts-srcFace.getCoords()[conn[:,nodeIdInCell]]).magnitude() # check contains the distance of the last point to its plane
- idsToTest=check.getIdsNotInRange(0.,1e-10)
+ idsToTest=check.findIdsNotInRange(0.,1e-10)
self.assertTrue(idsToTest.isEqual(DataArrayInt([17,18,19,20,22,23,24])))
- idsToTest2=idsToTest.getIdsNotInRange(18,22)
+ idsToTest2=idsToTest.findIdsNotInRange(18,22)
self.assertTrue(idsToTest2.isEqual(DataArrayInt([0,4,5,6])))
idsToTest2.rearrange(2)
self.assertTrue(idsToTest2.sumPerTuple().isEqual(DataArrayInt([4,11])))
coords1=DataArrayDouble([(-0.5,0.5,-0.5),(0.5,-0.5,-0.5),(-0.5,-0.5,0.5),(-0.5,-0.5,-0.5),(0.5,-0.5,0.5),(-0.5,0.5,0.5),(0.5,0.5,0.5),(0.5,0.5,-0.5)])
m1=MEDCouplingUMesh("m1",3) ; m1.setCoords(coords1)
m1.allocateCells() ; m1.insertNextCell(NORM_HEXA8,[7,1,3,0,6,4,2,5])
- m1.checkCoherency()
+ m1.checkConsistencyLight()
#
- m2=m1.deepCpy() ; m2.setName("m2")
+ m2=m1.deepCopy() ; m2.setName("m2")
#
trs=[[0.,0.,-1.],[0.,0.,1.],[1.,0.,0.],[0.,-1.,0.],[-1.,0.,0.],[0.,1.,0.]]
for i,t in enumerate(trs):
for j in xrange(64):
j2=(j//16) ; j1=((j%16)//4) ; j0=(j%4)
- m11=m1.deepCpy()
+ m11=m1.deepCopy()
m11.rotate([0.,0.,0.],[0.,0.,1.],float(j0)*pi/2)
m11.rotate([0.,0.,0.],[0.,1.,0.],float(j1)*pi/2)
m11.rotate([0.,0.,0.],[1.,0.,0.],float(j2)*pi/2)
d=DataArrayDouble([4,-5,2,6.1,-7.33,1,-1,3e2,0.07,-0.009,-6,-1e30],4,3)
d.setInfoOnComponents(["XX [m]","YYY [km]","ABSJJ [MW]"])
d0=d.computeAbs()
- dExp=d.deepCpy() ; dExp.abs()
+ dExp=d.deepCopy() ; dExp.abs()
self.assertTrue(dExp.isEqual(d0,1e-12))
e=d0-DataArrayDouble([4,5,2,6.1,7.33,1,1,3e2,0.07,0.009,6,1e30],4,3)
self.assertAlmostEqual(0.,e.normMin(),13)
di=DataArrayInt([3,-12,5,6,14,16,-23,100,23,-1,0,-6],4,3)
di.setInfoOnComponents(["XX [m]","YYY [km]","ABSJJ [MW]"])
d0i=di.computeAbs()
- diExp=di.deepCpy() ; diExp.abs()
+ diExp=di.deepCopy() ; diExp.abs()
self.assertTrue(diExp.isEqual(d0i))
self.assertEqual([3,12,5,6,14,16,23,100,23,1,0,6],d0i.getValues())
pass
m=MEDCouplingUMesh("Intersect2D",2) ; m.setCoords(coo) ; m.allocateCells()
m.insertNextCell(NORM_POLYGON,[6,3,4,5])
m.insertNextCell(NORM_POLYGON,[4,0,1,2,6,5])
- m.checkCoherency1()
+ m.checkConsistency()
#
self.assertTrue(m.getCellsContainingPoint((0.4,-0.4),1e-12).isEqual(DataArrayInt([0])))
self.assertTrue(m.getCellsContainingPoint((-0.4,-0.4),1e-12).isEqual(DataArrayInt([1])))
m.insertNextCell(NORM_QPOLYG,[15,1,2,3,16,20,6,7,19,17])
m.insertNextCell(NORM_QPOLYG,[15,5,8,16,22,10,21,18])
m.insertNextCell(NORM_QPOLYG,[16,3,0,1,15,19,11,12,20,18])
- m.checkCoherency1()
+ m.checkConsistency()
self.assertTrue(m.getCellsContainingPoint([0.,0.27],1e-12).isEqual(DataArrayInt([2])))
pass
def testSwig2DAIGetIdsEqualTuple1(self):
da=DataArrayInt([0,7,1,2,4,1,2,1,1,2,0,1,2,1,5,1,1,2],9,2)
- self.assertTrue(da.getIdsEqualTuple([1,2]).isEqual(DataArrayInt([1,4,8])))
- self.assertTrue(da.getIdsEqualTuple((1,2)).isEqual(DataArrayInt([1,4,8])))
- self.assertTrue(da.getIdsEqualTuple(DataArrayInt([1,2])).isEqual(DataArrayInt([1,4,8])))
+ self.assertTrue(da.findIdsEqualTuple([1,2]).isEqual(DataArrayInt([1,4,8])))
+ self.assertTrue(da.findIdsEqualTuple((1,2)).isEqual(DataArrayInt([1,4,8])))
+ self.assertTrue(da.findIdsEqualTuple(DataArrayInt([1,2])).isEqual(DataArrayInt([1,4,8])))
da.rearrange(3)
- self.assertRaises(InterpKernelException,da.getIdsEqualTuple,[1,2])# mismatch nb of compo (3) and nb of elts in input tuple (2)
- self.assertTrue(da.getIdsEqualTuple([2,0,1]).isEqual(DataArrayInt([3])))
- self.assertTrue(da.getIdsEqualTuple([2,0,7]).isEqual(DataArrayInt([])))
+ self.assertRaises(InterpKernelException,da.findIdsEqualTuple,[1,2])# mismatch nb of compo (3) and nb of elts in input tuple (2)
+ self.assertTrue(da.findIdsEqualTuple([2,0,1]).isEqual(DataArrayInt([3])))
+ self.assertTrue(da.findIdsEqualTuple([2,0,7]).isEqual(DataArrayInt([])))
da.rearrange(1)
- self.assertTrue(da.getIdsEqualTuple(2).isEqual(DataArrayInt([3,6,9,12,17])))
- self.assertTrue(da.getIdsEqualTuple(2).isEqual(da.getIdsEqual(2)))
+ self.assertTrue(da.findIdsEqualTuple(2).isEqual(DataArrayInt([3,6,9,12,17])))
+ self.assertTrue(da.findIdsEqualTuple(2).isEqual(da.findIdsEqual(2)))
pass
def testSwig2GaussNEStaticInfo1(self):
arr=DataArrayDouble(12) ; arr.iota()
arr=DataArrayDouble.Meld(arr,arr+100.) ; arr.setInfoOnComponents(["aaa","bbb"])
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
#
ref=DataArrayDouble([0.,0.5,1.5,2.5,3.,2.,2.5,3.5,4.5,5.,6.,6.5,7.5,8.5,9.,8.,8.5,9.5,10.5,11.])
ref=DataArrayDouble.Meld(ref,ref+100.) ; ref.setInfoOnComponents(["aaa","bbb"])
f2=f.cellToNodeDiscretization()
- f2.checkCoherency()
+ f2.checkConsistencyLight()
self.assertEqual(f2.getTime()[1:],[5,6])
self.assertAlmostEqual(f2.getTime()[0],1.1,15)
self.assertEqual(f2.getMesh().getHiddenCppPointer(),m.getHiddenCppPointer())
#
u=m.buildUnstructured() ; f.setMesh(u) ; del m
f3=f.cellToNodeDiscretization()
- f3.checkCoherency()
+ f3.checkConsistencyLight()
self.assertEqual(f3.getTime()[1:],[5,6])
self.assertAlmostEqual(f3.getTime()[0],1.1,15)
self.assertEqual(f3.getMesh().getHiddenCppPointer(),u.getHiddenCppPointer())
m.setCoords(cooArr)
m.setConnectivity(DataArrayInt(conn),DataArrayInt(connI))
m.mergeNodes(eps)
- m.checkCoherency()
+ m.checkConsistencyLight()
self.assertTrue(m.conformize2D(eps).isEqual(DataArrayInt([3])))
self.assertEqual(m.getCoords().getHiddenCppPointer(),cooArr.getHiddenCppPointer()) # check that coordinates remain the same here
self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([5,5,2,6,4,5,6,3,0,1,5,4,5,10,8,11,9,5,11,2,5,1,7,10,9])))
m=m.buildUnstructured()
m.convertLinearCellsToQuadratic()
self.assertEqual(42,m.getNumberOfNodes())
- oldCoo=m.getCoords().deepCpy()
+ oldCoo=m.getCoords().deepCopy()
m.conformize2D(eps)
self.assertTrue(m.getCoords()[:42].isEqual(oldCoo,1e-12))
self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([32,2,3,7,6,5,18,19,20,42,43,32,13,12,16,17,14,44,38,23,24,25,32,4,10,11,12,13,8,6,5,26,45,39,44,31,34,42,29,8,9,14,13,8,30,25,31,32,8,8,9,7,6,32,33,20,34,32,5,4,0,1,2,29,35,36,46,43,8,16,12,11,15,38,39,40,41])))
coo=DataArrayDouble([(0,0),(0,0.5),(0,1),(1,1),(1,0),(0.5,0)])
m=MEDCouplingUMesh("mesh",2) ; m.setCoords(coo)
m.allocateCells() ; m.insertNextCell(NORM_POLYGON,[0,1,2,3,4,5])
- m.checkCoherency1()
+ m.checkConsistency()
refPtr=m.getCoords().getHiddenCppPointer()
#
m.colinearize2D(1e-12)
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual(refPtr,m.getCoords().getHiddenCppPointer())
self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([NORM_POLYGON,0,2,3,4])))
self.assertTrue(m.getNodalConnectivityIndex().isEqual(DataArrayInt([0,5])))
c, cI = [DataArrayInt(l) for l in [[NORM_POLYGON, 0,1,2], [0,4]] ]
m.setCoords(coo); m.setConnectivity(c, cI)
m.colinearize2D(1e-10)
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual(c.getValues(), m.getNodalConnectivity().getValues())
self.assertEqual(cI.getValues(), m.getNodalConnectivityIndex().getValues())
c, cI = [DataArrayInt(l) for l in [[NORM_QPOLYG, 0,1, 2,3], [0,5]] ]
m.setCoords(coo); m.setConnectivity(c, cI)
m.colinearize2D(1e-10)
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual(c.getValues(), m.getNodalConnectivity().getValues())
self.assertEqual(cI.getValues(), m.getNodalConnectivityIndex().getValues())
c, cI = [DataArrayInt(l) for l in [[NORM_POLYGON, 0,1,2,3], [0,5]] ]
m.setCoords(coo); m.setConnectivity(c, cI)
m.colinearize2D(1e-10)
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual([NORM_POLYGON, 3,1,2], m.getNodalConnectivity().getValues())
self.assertEqual([0,4], m.getNodalConnectivityIndex().getValues())
c, cI = [DataArrayInt(l) for l in [[NORM_QPOLYG, 0,1,3, 3,2,4], [0,7]] ]
m.setCoords(coo); m.setConnectivity(c, cI)
m.colinearize2D(1e-10)
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual([NORM_QPOLYG, 3,1, 5,2], m.getNodalConnectivity().getValues())
self.assertTrue( m.getCoords()[5].isEqual( DataArrayDouble([(1.5,0.0)]), 1.0e-12 ) )
self.assertEqual([0,5], m.getNodalConnectivityIndex().getValues())
m = MEDCouplingDataForTest.buildCircle2(0.0, 0.0, 1.0)
c, cI = [DataArrayInt(l) for l in [[NORM_QPOLYG, 7,5,3,1, 6,4,2,0], [0,9]] ]
m.colinearize2D(1e-10)
- m.checkCoherency1()
+ m.checkConsistency()
self.assertEqual([NORM_QPOLYG, 3,5, 8,4], m.getNodalConnectivity().getValues())
self.assertTrue( m.getCoords()[8].isEqual( DataArrayDouble([(1.0,0.0)]), 1.0e-12 ) )
self.assertEqual([0,5], m.getNodalConnectivityIndex().getValues())
self.assertTrue(not m.isEqual(m2,1e-12))
m2.setDXYZ(DataArrayDouble((0.5,0.25,1.)))
self.assertTrue(m.isEqual(m2,1e-12))
- m2bis=m2.deepCpy()
+ m2bis=m2.deepCopy()
self.assertTrue(m2bis.isEqual(m2,1e-12))
#
self.assertEqual(6,m2bis.getNumberOfCells())#3,2,4
self.assertEqual(3,m.getMeshDimension())
self.assertAlmostEqual(0.125,m.getMeasureOfAnyCell(),16);
mu=MEDCoupling1SGTUMesh(m.buildUnstructured())
- mu.checkCoherency1()
+ mu.checkConsistency()
cooExp=DataArrayDouble([(1.5,3.5,2.5),(2,3.5,2.5),(2.5,3.5,2.5),(1.5,3.75,2.5),(2,3.75,2.5),(2.5,3.75,2.5),(1.5,3.5,3.5),(2,3.5,3.5),(2.5,3.5,3.5),(1.5,3.75,3.5),(2,3.75,3.5),(2.5,3.75,3.5),(1.5,3.5,4.5),(2,3.5,4.5),(2.5,3.5,4.5),(1.5,3.75,4.5),(2,3.75,4.5),(2.5,3.75,4.5),(1.5,3.5,5.5),(2,3.5,5.5),(2.5,3.5,5.5),(1.5,3.75,5.5),(2,3.75,5.5),(2.5,3.75,5.5)]) ; cooExp.setInfoOnComponents(["X [m]","Y [m]","Z [m]"])
self.assertTrue(isinstance(mu,MEDCoupling1SGTUMesh))
self.assertEqual(NORM_HEXA8,mu.getCellModelEnum())
self.assertTrue(mu.getCoords().isEqual(cooExp,1e-12))
self.assertTrue(mu.getNodalConnectivity().isEqual(DataArrayInt([1,0,3,4,7,6,9,10,2,1,4,5,8,7,10,11,7,6,9,10,13,12,15,16,8,7,10,11,14,13,16,17,13,12,15,16,19,18,21,22,14,13,16,17,20,19,22,23])))
- bary=m.getBarycenterAndOwner()
+ bary=m.computeCellCenterOfMass()
baryExp=DataArrayDouble([(1.75,3.625,3),(2.25,3.625,3),(1.75,3.625,4),(2.25,3.625,4),(1.75,3.625,5),(2.25,3.625,5)]) ; baryExp.setInfoOnComponents(["X [m]","Y [m]","Z [m]"])
self.assertTrue(bary.isEqual(baryExp,1e-12))
#
c=m.convertToCartesian()
- c.checkCoherency()
+ c.checkConsistencyLight()
self.assertEqual([1.1,0,3],c.getTime())
self.assertEqual("ms",c.getTimeUnit())
self.assertEqual(3,c.getMeshDimension())
self.assertEqual(12,m4.getNumberOfNodes())
self.assertEqual(6,m4.getNumberOfCells())
mu=MEDCoupling1SGTUMesh(m4.buildUnstructured())
- mu.checkCoherency1()
+ mu.checkConsistency()
self.assertTrue(isinstance(mu,MEDCoupling1SGTUMesh))
self.assertEqual(NORM_QUAD4,mu.getCellModelEnum())
coordsExp=DataArrayDouble([(1.5,2.5,3.5),(2,2.5,3.5),(2.5,2.5,3.5),(1.5,2.5,3.75),(2,2.5,3.75),(2.5,2.5,3.75),(1.5,2.5,4),(2,2.5,4),(2.5,2.5,4),(1.5,2.5,4.25),(2,2.5,4.25),(2.5,2.5,4.25)]) ; coordsExp.setInfoOnComponents(["X [km]","Y [km]","Z [km]"])
self.assertEqual(m0.getNumberOfCols(),3)
self.assertEqual(m0.getNbOfElems(),6)
ref=m0.getData().getHiddenCppPointer()
- m00=m0.deepCpy()
+ m00=m0.deepCopy()
self.assertTrue(m0.isEqual(m00,1e-12))
m00.getData().setIJ(0,0,2.1)
self.assertTrue(not m0.isEqual(m00,1e-12))
self.assertEqual(m0.getNumberOfCols(),3)
self.assertTrue(m0.getData().isEqual(DataArrayDouble([2,3,4,5,1,6]),1e-12))
#m0np=m0.getData().toNumPyArray() ; m0np=matrix(m0np.reshape(m0.getNumberOfRows(),m0.getNumberOfCols()))
- m1=m0.deepCpy()
+ m1=m0.deepCopy()
self.assertEqual(m1.getNumberOfRows(),2)
self.assertEqual(m1.getNumberOfCols(),3)
self.assertTrue(m1.getData().isEqual(DataArrayDouble([2,3,4,5,1,6]),1e-12))
- m11=m0.deepCpy() ; m11+=m1
+ m11=m0.deepCopy() ; m11+=m1
self.assertEqual(m11.getNumberOfRows(),2)
self.assertEqual(m11.getNumberOfCols(),3)
self.assertTrue(m11.getData().isEqual(DataArrayDouble([4,6,8,10,2,12]),1e-12))
fine=DataArrayDouble(3*2*3*4*4*4) ; fine.iota(0) #X=3,Y=2,Z=3 refined by 4
MEDCouplingIMesh.SpreadCoarseToFine(coarse,[5,7,5],fine,[(1,4),(2,4),(1,4)],[4,4,4])
self.assertTrue(fine.isEqual(DataArrayDouble([46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,46.,46.,46.,46.,47.,47.,47.,47.,48.,48.,48.,48.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,51.,51.,51.,51.,52.,52.,52.,52.,53.,53.,53.,53.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,81.,81.,81.,81.,82.,82.,82.,82.,83.,83.,83.,83.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,86.,86.,86.,86.,87.,87.,87.,87.,88.,88.,88.,88.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,116.,116.,116.,116.,117.,117.,117.,117.,118.,118.,118.,118.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.,121.,121.,121.,121.,122.,122.,122.,122.,123.,123.,123.,123.]),1e-12))
- f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",3,DataArrayInt([6,8,6]),[0.,0.,0.],DataArrayDouble((1.,1.,1.)))) ; f.setArray(coarse) ; f.setName("tutu") ; f.checkCoherency()
- f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",3,DataArrayInt([13,9,13]),[1.,2.,1.],DataArrayDouble((0.25,0.25,0.25)))) ; f.setArray(fine) ; f.setName("tutu") ; f.checkCoherency()
+ f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",3,DataArrayInt([6,8,6]),[0.,0.,0.],DataArrayDouble((1.,1.,1.)))) ; f.setArray(coarse) ; f.setName("tutu") ; f.checkConsistencyLight()
+ f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",3,DataArrayInt([13,9,13]),[1.,2.,1.],DataArrayDouble((0.25,0.25,0.25)))) ; f.setArray(fine) ; f.setName("tutu") ; f.checkConsistencyLight()
# 1D
coarse=DataArrayDouble(5) ; coarse.iota(0) #X=5
fine=DataArrayDouble(3*4) ; fine.iota(0) #X=3 refined by 4
def testSwig2AMR4(self):
"""This test focuses on MEDCouplingCartesianAMRMesh.createPatchesFromCriterion method. To test it a field containing 0 everywhere except in the annulus (centered on the center of the mesh) value is 1."""
im=MEDCouplingIMesh("mesh",2,[51,51],[0.,0.],[0.04,0.04])
- b=im.getBarycenterAndOwner() ; b-=[1.,1.] ; b=b.magnitude()
- ids=b.getIdsInRange(0.4,0.7)
+ b=im.computeCellCenterOfMass() ; b-=[1.,1.] ; b=b.magnitude()
+ ids=b.findIdsInRange(0.4,0.7)
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(im) ; f.setName("toto") ; arr=DataArrayDouble(im.getNumberOfCells()) ; arr[:]=0. ; arr[ids]=1. ; f.setArray(arr)
# f.write("test.vti")
amr=MEDCouplingCartesianAMRMesh(MEDCouplingIMesh("mesh",2,[51,51],[0.,0.],[0.04,0.04]))
fine=DataArrayDouble((3*4+2*1)*(2*4+2*1)) ; fine.iota(1000) #X=3,Y=2 refined by 4
MEDCouplingIMesh.SpreadCoarseToFineGhost(coarse,[5,7],fine,[(1,4),(2,4)],[4,4],1)
self.assertTrue(fine.isEqual(DataArrayDouble([15.,16.,16.,16.,16.,17.,17.,17.,17.,18.,18.,18.,18.,19.,22.,23.,23.,23.,23.,24.,24.,24.,24.,25.,25.,25.,25.,26.,22.,23.,23.,23.,23.,24.,24.,24.,24.,25.,25.,25.,25.,26.,22.,23.,23.,23.,23.,24.,24.,24.,24.,25.,25.,25.,25.,26.,22.,23.,23.,23.,23.,24.,24.,24.,24.,25.,25.,25.,25.,26.,29.,30.,30.,30.,30.,31.,31.,31.,31.,32.,32.,32.,32.,33.,29.,30.,30.,30.,30.,31.,31.,31.,31.,32.,32.,32.,32.,33.,29.,30.,30.,30.,30.,31.,31.,31.,31.,32.,32.,32.,32.,33.,29.,30.,30.,30.,30.,31.,31.,31.,31.,32.,32.,32.,32.,33.,36.,37.,37.,37.,37.,38.,38.,38.,38.,39.,39.,39.,39.,40.]),1e-12))
- f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",2,DataArrayInt([8,10]),[0.,0.],DataArrayDouble((1.,1.)))) ; f.setArray(coarse) ; f.setName("tutu") ; f.checkCoherency()
+ f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",2,DataArrayInt([8,10]),[0.,0.],DataArrayDouble((1.,1.)))) ; f.setArray(coarse) ; f.setName("tutu") ; f.checkConsistencyLight()
coarse.iota(-1000)
fine2=DataArrayDouble.Meld(fine,3*fine) ; coarse2=DataArrayDouble.Meld(coarse,3*coarse)
MEDCouplingIMesh.CondenseFineToCoarseGhost([5,7],fine,[(1,4),(2,4)],[4,4],coarse,1)
MEDCouplingIMesh.CondenseFineToCoarseGhost([5,7],fine2,[(1,4),(2,4)],[4,4],coarse2,1)
- f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",2,DataArrayInt([8,10]),[0.,0.],DataArrayDouble((1.,1.)))) ; f.setArray(coarse) ; f.setName("tutu") ; f.checkCoherency()
+ f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(MEDCouplingIMesh("",2,DataArrayInt([8,10]),[0.,0.],DataArrayDouble((1.,1.)))) ; f.setArray(coarse) ; f.setName("tutu") ; f.checkConsistencyLight()
coarseExp=DataArrayDouble([-1000.,-999.,-998.,-997.,-996.,-995.,-994.,-993.,-992.,-991.,-990.,-989.,-988.,-987.,-986.,-985.,-984.,-983.,-982.,-981.,-980.,-979.,-978.,368.,384.,400.,-974.,-973.,-972.,-971.,480.,496.,512.,-967.,-966.,-965.,-964.,-963.,-962.,-961.,-960.,-959.,-958.,-957.,-956.,-955.,-954.,-953.,-952.,-951.,-950.,-949.,-948.,-947.,-946.,-945.,-944.,-943.,-942.,-941.,-940.,-939.,-938.])
self.assertTrue(coarse.isEqual(coarseExp,1e-12))
self.assertTrue(coarse2[:,0].isEqual(coarseExp,1e-12))
da4=DataArrayDouble((1*4+2)*(3*4+2)) ; da4.iota() ; da4[:]+=0.8
self.assertEqual(5,amr.getNumberOfPatches())
l=[da0,da1,da2,da3,da4]
- lCpy=[elt.deepCpy() for elt in l]
+ lCpy=[elt.deepCopy() for elt in l]
l2=[DataArrayDouble.Meld(elt,3*elt) for elt in l]
amr.fillCellFieldOnPatchGhostAdv(0,da,1,l,False)
amr.fillCellFieldOnPatchGhostAdv(0,DataArrayDouble.Meld(da,3*da),1,l2,False)
amr.fillCellFieldOnPatchOnlyOnGhostZone(0,da,lCpy[0],1)
#
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(amr.getImageMesh().buildWithGhost(1)) ; f.setArray(da) ; f.setName("all")
- f0=MEDCouplingFieldDouble(ON_CELLS) ; f0.setMesh(amr[0].getMesh().getImageMesh().buildWithGhost(1)) ; f0.setArray(da0) ; f0.setName("p0") ; f0.checkCoherency()
- f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(amr[1].getMesh().getImageMesh().buildWithGhost(1)) ; f1.setArray(da1) ; f1.setName("p1") ; f1.checkCoherency()
- f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setMesh(amr[2].getMesh().getImageMesh().buildWithGhost(1)) ; f2.setArray(da2) ; f2.setName("p2") ; f2.checkCoherency()
- f3=MEDCouplingFieldDouble(ON_CELLS) ; f3.setMesh(amr[3].getMesh().getImageMesh().buildWithGhost(1)) ; f3.setArray(da3) ; f3.setName("p3") ; f3.checkCoherency()
- f4=MEDCouplingFieldDouble(ON_CELLS) ; f4.setMesh(amr[4].getMesh().getImageMesh().buildWithGhost(1)) ; f4.setArray(da4) ; f4.setName("p4") ; f4.checkCoherency()
+ f0=MEDCouplingFieldDouble(ON_CELLS) ; f0.setMesh(amr[0].getMesh().getImageMesh().buildWithGhost(1)) ; f0.setArray(da0) ; f0.setName("p0") ; f0.checkConsistencyLight()
+ f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(amr[1].getMesh().getImageMesh().buildWithGhost(1)) ; f1.setArray(da1) ; f1.setName("p1") ; f1.checkConsistencyLight()
+ f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setMesh(amr[2].getMesh().getImageMesh().buildWithGhost(1)) ; f2.setArray(da2) ; f2.setName("p2") ; f2.checkConsistencyLight()
+ f3=MEDCouplingFieldDouble(ON_CELLS) ; f3.setMesh(amr[3].getMesh().getImageMesh().buildWithGhost(1)) ; f3.setArray(da3) ; f3.setName("p3") ; f3.checkConsistencyLight()
+ f4=MEDCouplingFieldDouble(ON_CELLS) ; f4.setMesh(amr[4].getMesh().getImageMesh().buildWithGhost(1)) ; f4.setArray(da4) ; f4.setName("p4") ; f4.checkConsistencyLight()
#
da0Exp=DataArrayDouble([28.8,16.9,16.9,16.9,16.9,17.9,17.9,17.9,17.9,18.9,18.9,18.9,18.9,25.7,34.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,31.7,40.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,37.7,46.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,43.7,52.8,23.9,23.9,23.9,23.9,24.9,24.9,24.9,24.9,25.9,25.9,25.9,25.9,49.7,58.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,7.6,64.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,13.6,70.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,19.6,76.8,30.9,30.9,30.9,30.9,31.9,31.9,31.9,31.9,32.9,32.9,32.9,32.9,25.6,36.9,37.9,37.9,37.9,37.9,38.9,38.9,38.9,38.9,39.9,39.9,39.9,39.9,40.9])
da0Exp2=DataArrayDouble([15.9,16.9,16.9,16.9,16.9,17.9,17.9,17.9,17.9,18.9,18.9,18.9,18.9,19.9,22.9,15.2,16.2,17.2,18.2,19.2,20.2,21.2,22.2,23.2,24.2,25.2,26.2,26.9,22.9,29.2,30.2,31.2,32.2,33.2,34.2,35.2,36.2,37.2,38.2,39.2,40.2,26.9,22.9,43.2,44.2,45.2,46.2,47.2,48.2,49.2,50.2,51.2,52.2,53.2,54.2,26.9,22.9,57.2,58.2,59.2,60.2,61.2,62.2,63.2,64.2,65.2,66.2,67.2,68.2,26.9,29.9,71.2,72.2,73.2,74.2,75.2,76.2,77.2,78.2,79.2,80.2,81.2,82.2,33.9,29.9,85.2,86.2,87.2,88.2,89.2,90.2,91.2,92.2,93.2,94.2,95.2,96.2,33.9,29.9,99.2,100.2,101.2,102.2,103.2,104.2,105.2,106.2,107.2,108.2,109.2,110.2,33.9,29.9,113.2,114.2,115.2,116.2,117.2,118.2,119.2,120.2,121.2,122.2,123.2,124.2,33.9,36.9,37.9,37.9,37.9,37.9,38.9,38.9,38.9,38.9,39.9,39.9,39.9,39.9,40.9])
da1=DataArrayDouble(1*4+2) ; da1.iota() ; da1[:]+=0.4
self.assertEqual(2,amr.getNumberOfPatches())
l=[da0,da1]
- lCpy=[elt.deepCpy() for elt in l]
+ lCpy=[elt.deepCopy() for elt in l]
l2=[DataArrayDouble.Meld(elt,3*elt) for elt in l]
amr.fillCellFieldOnPatchGhostAdv(0,da,1,l,False)
amr.fillCellFieldOnPatchGhostAdv(0,DataArrayDouble.Meld(da,3*da),1,l2,False)
amr.fillCellFieldOnPatchOnlyOnGhostZone(0,da,lCpy[0],1)
#
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(amr.getImageMesh().buildWithGhost(1)) ; f.setArray(da) ; f.setName("all")
- f0=MEDCouplingFieldDouble(ON_CELLS) ; f0.setMesh(amr[0].getMesh().getImageMesh().buildWithGhost(1)) ; f0.setArray(da0) ; f0.setName("p0") ; f0.checkCoherency()
- f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(amr[1].getMesh().getImageMesh().buildWithGhost(1)) ; f1.setArray(da1) ; f1.setName("p1") ; f1.checkCoherency()
+ f0=MEDCouplingFieldDouble(ON_CELLS) ; f0.setMesh(amr[0].getMesh().getImageMesh().buildWithGhost(1)) ; f0.setArray(da0) ; f0.setName("p0") ; f0.checkConsistencyLight()
+ f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(amr[1].getMesh().getImageMesh().buildWithGhost(1)) ; f1.setArray(da1) ; f1.setName("p1") ; f1.checkConsistencyLight()
#
da0Exp=DataArrayDouble([4.4,2.9,2.9,2.9,2.9,3.9,3.9,3.9,3.9,4.9,4.9,4.9,4.9,5.9])
da0Exp2=DataArrayDouble([1.9,1.2,2.2,3.2,4.2,5.2,6.2,7.2,8.2,9.2,10.2,11.2,12.2,5.9])
self.assertTrue(m.getCoords().isEqualWithoutConsideringStr(DataArrayDouble([0.,0.,1.,0.,2.,0.,3.,0.,4.,0.,5.,0.,0.,1.,1.,1.,2.,1.,3.,1.,4.,1.,5.,1.,0.,2.,1.,2.,2.,2.,3.,2.,4.,2.,5.,2.,0.,3.,1.,3.,4.,3.,5.,3.,0.,4.,1.,4.,2.,4.,3.,4.,4.,4.,1.,5.,2.,5.,3.,5.,4.,5.,5.,5.,1.,6.,2.,6.,3.,6.,4.,6.,5.,6.,1.,2.,1.25,2.,1.5,2.,1.75,2.,2.,2.,2.25,2.,2.5,2.,2.75,2.,3.,2.,3.25,2.,3.5,2.,3.75,2.,4.,2.,1.,2.25,1.25,2.25,1.5,2.25,1.75,2.25,2.,2.25,2.25,2.25,2.5,2.25,2.75,2.25,3.,2.25,3.25,2.25,3.5,2.25,3.75,2.25,4.,2.25,1.,2.5,1.25,2.5,1.5,2.5,1.75,2.5,2.,2.5,2.25,2.5,2.5,2.5,2.75,2.5,3.,2.5,3.25,2.5,3.5,2.5,3.75,2.5,4.,2.5,1.,2.75,1.25,2.75,1.5,2.75,1.75,2.75,2.,2.75,2.25,2.75,2.5,2.75,2.75,2.75,3.,2.75,3.25,2.75,3.5,2.75,3.75,2.75,4.,2.75,1.,3.,1.25,3.,1.5,3.,1.75,3.,2.,3.,2.25,3.,2.5,3.,2.75,3.,3.,3.,3.25,3.,3.5,3.,3.75,3.,4.,3.,1.,3.25,1.25,3.25,1.5,3.25,1.75,3.25,2.,3.25,2.25,3.25,2.5,3.25,2.75,3.25,3.,3.25,3.25,3.25,3.5,3.25,3.75,3.25,4.,3.25,1.,3.5,1.25,3.5,1.5,3.5,1.75,3.5,2.,3.5,2.25,3.5,2.5,3.5,2.75,3.5,3.,3.5,3.25,3.5,3.5,3.5,1.,3.75,1.25,3.75,1.5,3.75,1.75,3.75,2.,3.75,2.25,3.75,2.5,3.75,2.75,3.75,3.,3.75,3.25,3.75,3.5,3.75,1.,4.,1.25,4.,1.5,4.,1.75,4.,2.,4.,2.25,4.,2.5,4.,2.75,4.,3.,4.,3.25,4.,3.5,4.,3.5,3.25,3.625,3.25,3.75,3.25,3.875,3.25,4.,3.25,3.5,3.375,3.625,3.375,3.75,3.375,3.875,3.375,4.,3.375,3.5,3.5,3.625,3.5,3.75,3.5,3.875,3.5,4.,3.5,3.5,3.625,3.625,3.625,3.75,3.625,3.875,3.625,4.,3.625,3.5,3.75,3.625,3.75,3.75,3.75,3.875,3.75,4.,3.75,3.5,3.875,3.625,3.875,3.75,3.875,3.875,3.875,4.,3.875,3.5,4.,3.625,4.,3.75,4.,3.875,4.,4.,4.,4.25,3.,4.5,3.,4.75,3.,5.,3.,4.25,3.25,4.5,3.25,4.75,3.25,5.,3.25,4.25,3.5,4.5,3.5,4.75,3.5,5.,3.5,4.25,3.75,4.5,3.75,4.75,3.75,5.,3.75,4.25,4.,4.5,4.,4.75,4.,5.,4.,4.,4.25,4.25,4.25,4.5,4.25,4.75,4.25,5.,4.25,4.,4.5,4.25,4.5,4.5,4.5,4.75,4.5,5.,4.5,4.,4.75,4.25,4.75,4.5,4.75,4.75,4.75,5.,4.75,4.,5.,4.25,5.,4.5,5.,4.75,5.,5.,5.,4.,3.,4.125,3.,4.25,3.,4.,3.125,4.125,3.125,4.25,3.125,4.,3.25,4.125,3.25,4.25,3.25,4.,3.375,4.125,3.375,4.25,3.375,4.,3.5,4.125,3.5,4.25,3.5,4.,3.625,4.125,3.625,4.25,3.625,4.,3.75,4.125,3.75,4.25,3.75,4.,3.875,4.125,3.875,4.25,3.875,4.,4.,4.125,4.,4.25,4.,4.,4.125,4.125,4.125,4.25,4.125,4.,4.25,4.125,4.25,4.25,4.25,0.,4.,0.25,4.,0.5,4.,0.75,4.,0.,4.25,0.25,4.25,0.5,4.25,0.75,4.25,0.,4.5,0.25,4.5,0.5,4.5,0.75,4.5,0.,4.75,0.25,4.75,0.5,4.75,0.75,4.75,1.,4.75,0.,5.,0.25,5.,0.5,5.,0.75,5.,1.,5.,0.,5.25,0.25,5.25,0.5,5.25,0.75,5.25,1.,5.25,0.,5.5,0.25,5.5,0.5,5.5,0.75,5.5,1.,5.5,0.,5.75,0.25,5.75,0.5,5.75,0.75,5.75,1.,5.75,0.,6.,0.25,6.,0.5,6.,0.75,6.,1.,6.,0.75,4.,0.875,4.,1.,4.,0.75,4.125,0.875,4.125,1.,4.125,0.75,4.25,0.875,4.25,1.,4.25,0.75,4.375,0.875,4.375,1.,4.375,0.75,4.5,0.875,4.5,1.,4.5,0.75,4.625,0.875,4.625,1.,4.625,0.75,4.75,0.875,4.75,1.,4.75],319,2),1e-12))
# the test is here ! To be called after iteration with no remesh
att.synchronizeAllGhostZones()
- f=att.buildCellFieldOnWithGhost(amr,"Field") ; f.checkCoherency()
- ftmp=att.buildCellFieldOnWithoutGhost(amr,"Field") ; ftmp.checkCoherency() ; self.assertTrue(ftmp.getArray().isEqualWithoutConsideringStr(DataArrayDouble([8.1,9.1,10.1,11.1,12.1,15.1,16.1,17.1,18.1,19.1,22.1,23.1,24.1,25.1,26.1,29.1,30.1,31.1,32.1,33.1,36.1,37.1,38.1,39.1,40.1,43.1,44.1,45.1,46.1,47.1]),1e-12))
+ f=att.buildCellFieldOnWithGhost(amr,"Field") ; f.checkConsistencyLight()
+ ftmp=att.buildCellFieldOnWithoutGhost(amr,"Field") ; ftmp.checkConsistencyLight() ; self.assertTrue(ftmp.getArray().isEqualWithoutConsideringStr(DataArrayDouble([8.1,9.1,10.1,11.1,12.1,15.1,16.1,17.1,18.1,19.1,22.1,23.1,24.1,25.1,26.1,29.1,30.1,31.1,32.1,33.1,36.1,37.1,38.1,39.1,40.1,43.1,44.1,45.1,46.1,47.1]),1e-12))
f0=att.buildCellFieldOnWithGhost(amr[0].getMesh(),"Field")
f1=att.buildCellFieldOnWithGhost(amr[1].getMesh(),"Field")
f2=att.buildCellFieldOnWithGhost(amr[2].getMesh(),"Field")
MEDCouplingStructuredMesh.AssignPartOfFieldOfDoubleUsing([3,4],da,[(1,3),(2,3)],DataArrayDouble([7.7,8.8]))
self.assertTrue(da.isEqual(DataArrayDouble([0.,1.,2.,3.,4.,5.,6.,7.7,8.8,9.,10.,11.]),1e-12))
att=MEDCouplingAMRAttribute(amr,[("YY",1)],szGhost)
- att.spillNatures([ConservativeVolumic])
+ att.spillNatures([IntensiveMaximum])
att.alloc()
yy=att.getFieldOn(amr,"YY") ; yy.iota(0.01)
yy=att.getFieldOn(amr[0].getMesh(),"YY") ; yy.iota(0.02)
yy=att.getFieldOn(amr[1][2].getMesh(),"YY") ; yy.iota(0.09)
yy=att.getFieldOn(amr[1][3].getMesh(),"YY") ; yy.iota(0.10)
yy=att.getFieldOn(amr[2].getMesh(),"YY") ; yy.iota(0.11)
- att2=att.deepCpy() ; att3=att2.deepCpy() ; att4=att3.deepCpy() ; att5=att4.deepCpy() ; att6=att5.deepCpy()
+ att2=att.deepCopy() ; att3=att2.deepCopy() ; att4=att3.deepCopy() ; att5=att4.deepCopy() ; att6=att5.deepCopy()
###
att.synchronizeFineToCoarseBetween(2,1)
###
m.setCoords(DataArrayDouble([-1., -1., -1., 1., 1., 1., 1., -1.0],4,2))
c, cI = [NORM_POLYGON, 0, 1, 2, 3], [0, 5]
m.setConnectivity(DataArrayInt(c), DataArrayInt(cI))
- m.checkCoherency()
+ m.checkConsistencyLight()
coords2 = [0., 1.3, -1.3, 0., -0.6, 0.6, 0., -1.3, -0.5, -0.5]
connec2, cI2 = [NORM_SEG3, 0, 1, 2, NORM_SEG3, 1, 3, 4], [0,4,8]
m_line = MEDCouplingUMesh("seg", 1)
c = [NORM_POLYGON, 4, 5, 6, 7, NORM_POLYGON, 0, 1, 5, 4, NORM_POLYGON, 1, 2, 3, 0, 4, 7, 6, 5]
cI = [0, 5, 10, 19]
m.setConnectivity(DataArrayInt(c), DataArrayInt(cI))
- m.checkCoherency()
+ m.checkConsistencyLight()
coords2 = [-1., 0.25, 1., 0.25]
connec2, cI2 = [NORM_SEG2, 0, 1], [0,3]
m_line = MEDCouplingUMesh.New("seg", 1)
m_line.setCoords(DataArrayDouble(coords2, len(coords2)/2, 2))
m_line.setConnectivity(DataArrayInt(connec2), DataArrayInt(cI2))
- m_line2 = m_line.deepCpy()
- m2 = m.deepCpy()
+ m_line2 = m_line.deepCopy()
+ m2 = m.deepCopy()
a, b, c, d = MEDCouplingUMesh.Intersect2DMeshWith1DLine(m, m_line, eps)
self.assertTrue(a.getCoords().getHiddenCppPointer()==b.getCoords().getHiddenCppPointer())
self.assertTrue(a.getCoords()[:m.getNumberOfNodes()].isEqual(m.getCoords(),1e-12))
c = [NORM_QPOLYG, 8, 9, 10, 11, 12, 13, 14, 15, NORM_QPOLYG, 3, 1, 10, 9, 2, 17, 13, 16, NORM_QPOLYG, 1, 7, 5, 3, 9, 8, 11, 10, 0, 6, 4, 16, 12, 15, 14, 17]
cI = [0, 9, 18, 35]
m.setConnectivity(DataArrayInt(c), DataArrayInt(cI))
- m.checkCoherency()
+ m.checkConsistencyLight()
coords2 = [-2., 1., 2., 1.0]
connec2, cI2 = [NORM_SEG2, 0, 1], [0,3]
m_line = MEDCouplingUMesh("seg", 1)
c = [NORM_QPOLYG, 15, 13, 11, 9, 14, 12, 10, 8, NORM_QPOLYG, 7, 5, 13, 15, 6, 17, 14, 16, NORM_QPOLYG, 5, 3, 1, 7, 15, 9, 11, 13, 4, 2, 0, 16, 8, 10, 12, 17]
cI = [0, 9, 18, 35]
m.setConnectivity(DataArrayInt(c), DataArrayInt(cI))
- m.checkCoherency()
+ m.checkConsistencyLight()
coords2 = [-2., 0., 2., 0.]
connec2, cI2 = [NORM_SEG2, 0, 1], [0,3]
m_line = MEDCouplingUMesh.New("seg", 1)
c = [NORM_QPOLYG, 8, 9, 10, 11, 12, 13, 14, 15, NORM_QPOLYG, 3, 1, 10, 9, 2, 17, 13, 16, NORM_QPOLYG, 1, 7, 5, 3, 9, 8, 11, 10, 0, 6, 4, 16, 12, 15, 14, 17]
cI = [0, 9, 18, 35]
m.setConnectivity(DataArrayInt(c), DataArrayInt(cI))
- m.checkCoherency()
+ m.checkConsistencyLight()
coords2 = [(-2., 1.),(2.,1.),(0.,1)]
connec2, cI2 = [NORM_SEG2, 0, 2, NORM_SEG2, 2, 1], [0,3,6]
m_line = MEDCouplingUMesh("seg", 1)
c = [NORM_QPOLYG, 8, 9, 10, 11, 12, 13, 14, 15, NORM_QPOLYG, 3, 1, 10, 9, 2, 17, 13, 16, NORM_QPOLYG, 1, 7, 5, 3, 9, 8, 11, 10, 0, 6, 4, 16, 12, 15, 14, 17]
cI = [0, 9, 18, 35]
m.setConnectivity(DataArrayInt(c), DataArrayInt(cI))
- m.checkCoherency()
+ m.checkConsistencyLight()
coords2 = [1., 2., 1., -2.]
connec2, cI2 = [NORM_SEG2, 0, 1], [0,3]
m_line = MEDCouplingUMesh("seg", 1)
coords2 = DataArrayDouble([float(i) for i in range(32)], 16,2)
m2.setCoords(coords2);
m2.setConnectivity(c, cI);
- m2.checkCoherency1(1.0e-8);
+ m2.checkConsistency(1.0e-8);
# Shuffle a bit :-)
m2.renumberCells(DataArrayInt([0,3,6,8,1,4,7,5,2]), True);
m3.setCoords(coord3)
m3.setConnectivity(conn3A, cI)
- m3.checkCoherency1(1.0e-8)
+ m3.checkConsistency(1.0e-8)
res2 = m3.orderConsecutiveCells1D()
expRes2 = [0,1,2]
self.assertEqual(m3.getNumberOfCells(),res2.getNumberOfTuples())
def testSwig2PartDefinitionComposeWith1(self):
f=PartDefinition.New(DataArrayInt([0,1,2,3,6,7,8,9]))
g=PartDefinition.New(4,14,1)
- g2=g.deepCpy()
+ g2=g.deepCopy()
self.assertTrue(g2.isEqual(g)[0])
h=f.composeWith(g)
self.assertTrue(isinstance(h,DataArrayPartDefinition))
self.assertTrue(isinstance(p2,SlicePartDefinition))
self.assertEqual(p2.getSlice(),slice(2,11,4))
self.assertTrue(p2.isEqual(SlicePartDefinition(2,11,4))[0])
- self.assertTrue(p2.isEqual(p2.deepCpy())[0])
+ self.assertTrue(p2.isEqual(p2.deepCopy())[0])
self.assertTrue(not p2.isEqual(SlicePartDefinition(1,11,4))[0])
self.assertTrue(not p2.isEqual(SlicePartDefinition(2,10,4))[0])
self.assertTrue(not p2.isEqual(SlicePartDefinition(2,11,3))[0])
def testSwig2DAIGetIdsStrictlyNegative1(self):
d=DataArrayInt([4,-5,-1,0,3,99,-7])
- self.assertTrue(d.getIdsStrictlyNegative().isEqual(DataArrayInt([1,2,6])))
+ self.assertTrue(d.findIdsStricltyNegative().isEqual(DataArrayInt([1,2,6])))
pass
def testSwig2DAIReplaceOneValByInThis1(self):
arrZ=DataArrayDouble([0.,1.3,2.1,2.4])
m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY,arrZ) ; m=m.buildUnstructured()
f=m.computeDiameterField()
- f.checkCoherency()
+ f.checkConsistencyLight()
exp=DataArrayDouble([1.8411952639521971,1.5937377450509227,1.5297058540778357,1.705872210923198,1.4352700094407325,1.3638181696985856,2.0273134932713295,1.8055470085267789,1.7492855684535902,1.5297058540778357,1.2206555615733703,1.1357816691600546,1.3638181696985856,1.004987562112089,0.9,1.7492855684535902,1.4866068747318506,1.4177446878757824,1.3379088160259651,0.9695359714832656,0.8602325267042626,1.1445523142259597,0.6782329983125266,0.5099019513592785,1.5842979517754858,1.2884098726725124,1.208304597359457])
self.assertTrue(exp.isEqual(f.getArray(),1e-12))
m1=m[::2]
m2.simplexize(PLANAR_FACE_5)
m3=MEDCouplingUMesh.MergeUMeshesOnSameCoords(m1,m2)
f=m3.computeDiameterField()
- f.checkCoherency()
+ f.checkConsistencyLight()
exp2=DataArrayDouble([1.8411952639521971,1.5297058540778357,1.4352700094407325,2.0273134932713295,1.7492855684535902,1.2206555615733703,1.3638181696985856,0.9,1.4866068747318506,1.3379088160259651,0.8602325267042626,0.6782329983125266,1.5842979517754858,1.208304597359457,1.47648230602334,1.47648230602334,1.47648230602334,1.47648230602334,1.47648230602334,1.7029386365926402,1.7029386365926402,1.7029386365926402,1.7029386365926402,1.7029386365926402,1.3601470508735445,1.3601470508735445,1.3601470508735445,1.3601470508735445,1.3601470508735445,1.70293863659264,1.70293863659264,1.70293863659264,1.70293863659264,1.70293863659264,1.3601470508735445,1.3601470508735445,1.3601470508735445,1.3601470508735445,1.3601470508735445,1.063014581273465,1.063014581273465,1.063014581273465,1.063014581273465,1.063014581273465,1.0,1.0,1.0,1.0,1.0,1.5556349186104046,1.5556349186104046,1.5556349186104046,1.5556349186104046,1.5556349186104046,1.3601470508735443,1.3601470508735443,1.3601470508735443,1.3601470508735443,1.3601470508735443,0.9219544457292886,0.9219544457292886,0.9219544457292886,0.9219544457292886,0.9219544457292886,1.140175425099138,1.140175425099138,1.140175425099138,1.140175425099138,1.140175425099138,0.5,0.5,0.5,0.5,0.5,1.2529964086141667,1.2529964086141667,1.2529964086141667,1.2529964086141667,1.2529964086141667])
self.assertTrue(exp2.isEqual(f.getArray(),1e-12))
# TRI3 - spacedim = 2
m=MEDCouplingCurveLinearMesh()
m.setCoords(arr)
m.setNodeGridStructure([3,2])
- m.checkCoherency()
+ m.checkConsistencyLight()
self.assertEqual(m.getMeshDimension(),2)
self.assertEqual(m.getSpaceDimension(),2)
self.assertTrue(not "mismatch" in m.__str__())
pass
def testSwig2BugComputeOffsets1(self):
- """Non regression test. computeOffsets2 on empty array must return 0."""
+ """Non regression test. computeOffsetsFull on empty array must return 0."""
d=DataArrayInt([3])
- d.computeOffsets2()
+ d.computeOffsetsFull()
self.assertTrue(d.isEqual(DataArrayInt([0,3])))
d=DataArrayInt([])
d.computeOffsets()
self.assertTrue(d.isEqual(DataArrayInt([])))
d=DataArrayInt([])
- d.computeOffsets2()
+ d.computeOffsetsFull()
self.assertTrue(d.isEqual(DataArrayInt([0]))) # <- bug was here
pass
%{
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingCMesh.hxx"
#include "MEDCouplingIMesh.hxx"
#include "MEDCouplingCurveLinearMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldTemplate.hxx"
#include "MEDCouplingGaussLocalization.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingMultiFields.hxx"
#include "MEDCouplingFieldOverTime.hxx"
#include "MEDCouplingDefinitionTime.hxx"
#include "InterpKernelAutoPtr.hxx"
#include "BoxSplittingOptions.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace INTERP_KERNEL;
%}
%template(svec) std::vector<std::string>;
////////////////////
-%typemap(out) ParaMEDMEM::MEDCouplingMesh*
+%typemap(out) MEDCoupling::MEDCouplingMesh*
{
$result=convertMesh($1,$owner);
}
//$$$$$$$$$$$$$$$$$$
////////////////////
-%typemap(out) ParaMEDMEM::MEDCouplingPointSet*
+%typemap(out) MEDCoupling::MEDCouplingPointSet*
{
$result=convertMesh($1,$owner);
}
//$$$$$$$$$$$$$$$$$$
////////////////////
-%typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
+%typemap(out) MEDCoupling::MEDCoupling1GTUMesh*
{
$result=convertMesh($1,$owner);
}
//$$$$$$$$$$$$$$$$$$
////////////////////
-%typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh*
+%typemap(out) MEDCoupling::MEDCouplingStructuredMesh*
{
$result=convertMesh($1,$owner);
}
//$$$$$$$$$$$$$$$$$$
////////////////////
-%typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization*
+%typemap(out) MEDCoupling::MEDCouplingFieldDiscretization*
{
$result=convertFieldDiscretization($1,$owner);
}
//$$$$$$$$$$$$$$$$$$
////////////////////
-%typemap(out) ParaMEDMEM::MEDCouplingMultiFields*
+%typemap(out) MEDCoupling::MEDCouplingMultiFields*
{
$result=convertMultiFields($1,$owner);
}
//$$$$$$$$$$$$$$$$$$
////////////////////
-%typemap(out) ParaMEDMEM::PartDefinition*
+%typemap(out) MEDCoupling::PartDefinition*
{
$result=convertPartDefinition($1,$owner);
}
%feature("autodoc", "1");
%feature("docstring");
-%newobject ParaMEDMEM::MEDCouplingField::buildMeasureField;
-%newobject ParaMEDMEM::MEDCouplingField::getLocalizationOfDiscr;
-%newobject ParaMEDMEM::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::New;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::inverse;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::trace;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::deviator;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::extractSlice3D;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::dot;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::max;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPartRange;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__div__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__pow__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__radd__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__rsub__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__rmul__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::__rdiv__;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::clone;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::deepCpy;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::nodeToCellDiscretization;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::cellToNodeDiscretization;
-%newobject ParaMEDMEM::MEDCouplingFieldDouble::getValueOnMulti;
-%newobject ParaMEDMEM::MEDCouplingFieldTemplate::New;
-%newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
-%newobject ParaMEDMEM::MEDCouplingMesh::clone;
-%newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
-%newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
-%newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
-%newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfFacesPerCell;
-%newobject ParaMEDMEM::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
-%newobject ParaMEDMEM::MEDCouplingMesh::buildPartRange;
-%newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
-%newobject ParaMEDMEM::MEDCouplingMesh::getCoordinatesAndOwner;
-%newobject ParaMEDMEM::MEDCouplingMesh::getBarycenterAndOwner;
-%newobject ParaMEDMEM::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
-%newobject ParaMEDMEM::MEDCouplingMesh::buildOrthogonalField;
-%newobject ParaMEDMEM::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
-%newobject ParaMEDMEM::MEDCouplingMesh::mergeMyselfWith;
-%newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic;
-%newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic2;
-%newobject ParaMEDMEM::MEDCouplingMesh::fillFromAnalytic3;
-%newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField;
-%newobject ParaMEDMEM::MEDCouplingMesh::simplexize;
-%newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured;
-%newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes;
-%newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer;
-%newobject ParaMEDMEM::MEDCouplingPointSet::getCellsInBoundingBox;
-%newobject ParaMEDMEM::MEDCouplingPointSet::findBoundaryNodes;
-%newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh;
-%newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray;
-%newobject ParaMEDMEM::MEDCouplingPointSet::buildPartOfMySelf2;
-%newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType;
-%newobject ParaMEDMEM::MEDCouplingPointSet::zipConnectivityTraducer;
-%newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
-%newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
-%newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
-%newobject ParaMEDMEM::MEDCouplingPointSet::deepCpyConnectivityOnly;
-%newobject ParaMEDMEM::MEDCouplingPointSet::getBoundingBoxForBBTree;
-%newobject ParaMEDMEM::MEDCouplingPointSet::computeFetchedNodeIds;
-%newobject ParaMEDMEM::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
-%newobject ParaMEDMEM::MEDCouplingPointSet::computeDiameterField;
-%newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
-%newobject ParaMEDMEM::MEDCouplingUMesh::New;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
-%newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
-%newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
-%newobject ParaMEDMEM::MEDCouplingUMesh::explode3DMeshTo1D;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildSpreadZonesWithPoly;
-%newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes;
-%newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
-%newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGradually;
-%newobject ParaMEDMEM::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
-%newobject ParaMEDMEM::MEDCouplingUMesh::conformize2D;
-%newobject ParaMEDMEM::MEDCouplingUMesh::colinearize2D;
-%newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
-%newobject ParaMEDMEM::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
-%newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField;
-%newobject ParaMEDMEM::MEDCouplingUMesh::convertLinearCellsToQuadratic;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getEdgeRatioField;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getAspectRatioField;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getWarpField;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getSkewField;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getPartBarycenterAndOwner;
-%newobject ParaMEDMEM::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getPartMeasureField;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField;
-%newobject ParaMEDMEM::MEDCouplingUMesh::keepCellIdsByType;
-%newobject ParaMEDMEM::MEDCouplingUMesh::Build0DMeshFromCoords;
-%newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
-%newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
-%newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
-%newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
-%newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary;
-%newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getCellIdsCrossingPlane;
-%newobject ParaMEDMEM::MEDCouplingUMesh::convexEnvelop2D;
-%newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
-%newobject ParaMEDMEM::MEDCouplingUMesh::generateGraph;
-%newobject ParaMEDMEM::MEDCouplingUMesh::orderConsecutiveCells1D;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
-%newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
-%newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
-%newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
-%newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
-%newobject ParaMEDMEM::MEDCoupling1GTUMesh::getNodalConnectivity;
-%newobject ParaMEDMEM::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
-%newobject ParaMEDMEM::MEDCoupling1SGTUMesh::New;
-%newobject ParaMEDMEM::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
-%newobject ParaMEDMEM::MEDCoupling1SGTUMesh::computeDualMesh;
-%newobject ParaMEDMEM::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
-%newobject ParaMEDMEM::MEDCoupling1SGTUMesh::sortHexa8EachOther;
-%newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
-%newobject ParaMEDMEM::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
-%newobject ParaMEDMEM::MEDCoupling1DGTUMesh::New;
-%newobject ParaMEDMEM::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
-%newobject ParaMEDMEM::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
-%newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
-%newobject ParaMEDMEM::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
-%newobject ParaMEDMEM::MEDCouplingExtrudedMesh::New;
-%newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTUnstructured;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
-%newobject ParaMEDMEM::MEDCouplingStructuredMesh::ComputeCornersGhost;
-%newobject ParaMEDMEM::MEDCouplingCMesh::New;
-%newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
-%newobject ParaMEDMEM::MEDCouplingCMesh::buildCurveLinear;
-%newobject ParaMEDMEM::MEDCouplingIMesh::New;
-%newobject ParaMEDMEM::MEDCouplingIMesh::asSingleCell;
-%newobject ParaMEDMEM::MEDCouplingIMesh::buildWithGhost;
-%newobject ParaMEDMEM::MEDCouplingIMesh::convertToCartesian;
-%newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::New;
-%newobject ParaMEDMEM::MEDCouplingCurveLinearMesh::getCoords;
-%newobject ParaMEDMEM::MEDCouplingMultiFields::New;
-%newobject ParaMEDMEM::MEDCouplingMultiFields::deepCpy;
-%newobject ParaMEDMEM::MEDCouplingFieldOverTime::New;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::deepCpy;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getGodFather;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getFather;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatch;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::__getitem__;
-%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
-%newobject ParaMEDMEM::MEDCouplingDataForGodFather::getMyGodFather;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::New;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpy;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::getFieldOn;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::projectTo;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
-%newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
-%newobject ParaMEDMEM::DenseMatrix::New;
-%newobject ParaMEDMEM::DenseMatrix::deepCpy;
-%newobject ParaMEDMEM::DenseMatrix::shallowCpy;
-%newobject ParaMEDMEM::DenseMatrix::getData;
-%newobject ParaMEDMEM::DenseMatrix::matVecMult;
-%newobject ParaMEDMEM::DenseMatrix::MatVecMult;
-%newobject ParaMEDMEM::DenseMatrix::__add__;
-%newobject ParaMEDMEM::DenseMatrix::__sub__;
-%newobject ParaMEDMEM::DenseMatrix::__mul__;
-%newobject ParaMEDMEM::PartDefinition::New;
-%newobject ParaMEDMEM::PartDefinition::toDAI;
-%newobject ParaMEDMEM::PartDefinition::__add__;
-%newobject ParaMEDMEM::PartDefinition::composeWith;
-%newobject ParaMEDMEM::PartDefinition::tryToSimplify;
-%newobject ParaMEDMEM::DataArrayPartDefinition::New;
-%newobject ParaMEDMEM::SlicePartDefinition::New;
+%newobject MEDCoupling::MEDCouplingField::buildMeasureField;
+%newobject MEDCoupling::MEDCouplingField::getLocalizationOfDiscr;
+%newobject MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds;
+%newobject MEDCoupling::MEDCouplingFieldDouble::New;
+%newobject MEDCoupling::MEDCouplingFieldDouble::getArray;
+%newobject MEDCoupling::MEDCouplingFieldDouble::getEndArray;
+%newobject MEDCoupling::MEDCouplingFieldDouble::MergeFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::MeldFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::doublyContractedProduct;
+%newobject MEDCoupling::MEDCouplingFieldDouble::determinant;
+%newobject MEDCoupling::MEDCouplingFieldDouble::eigenValues;
+%newobject MEDCoupling::MEDCouplingFieldDouble::eigenVectors;
+%newobject MEDCoupling::MEDCouplingFieldDouble::inverse;
+%newobject MEDCoupling::MEDCouplingFieldDouble::trace;
+%newobject MEDCoupling::MEDCouplingFieldDouble::deviator;
+%newobject MEDCoupling::MEDCouplingFieldDouble::magnitude;
+%newobject MEDCoupling::MEDCouplingFieldDouble::maxPerTuple;
+%newobject MEDCoupling::MEDCouplingFieldDouble::keepSelectedComponents;
+%newobject MEDCoupling::MEDCouplingFieldDouble::extractSlice3D;
+%newobject MEDCoupling::MEDCouplingFieldDouble::DotFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::dot;
+%newobject MEDCoupling::MEDCouplingFieldDouble::CrossProductFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::crossProduct;
+%newobject MEDCoupling::MEDCouplingFieldDouble::MaxFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::max;
+%newobject MEDCoupling::MEDCouplingFieldDouble::MinFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::AddFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::SubstractFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::MultiplyFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::DivideFields;
+%newobject MEDCoupling::MEDCouplingFieldDouble::min;
+%newobject MEDCoupling::MEDCouplingFieldDouble::negate;
+%newobject MEDCoupling::MEDCouplingFieldDouble::findIdsInRange;
+%newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPart;
+%newobject MEDCoupling::MEDCouplingFieldDouble::buildSubPartRange;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__getitem__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__neg__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__add__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__sub__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__mul__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__div__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__pow__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__radd__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__rsub__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__rmul__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::__rdiv__;
+%newobject MEDCoupling::MEDCouplingFieldDouble::clone;
+%newobject MEDCoupling::MEDCouplingFieldDouble::cloneWithMesh;
+%newobject MEDCoupling::MEDCouplingFieldDouble::deepCopy;
+%newobject MEDCoupling::MEDCouplingFieldDouble::buildNewTimeReprFromThis;
+%newobject MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization;
+%newobject MEDCoupling::MEDCouplingFieldDouble::cellToNodeDiscretization;
+%newobject MEDCoupling::MEDCouplingFieldDouble::getValueOnMulti;
+%newobject MEDCoupling::MEDCouplingFieldTemplate::New;
+%newobject MEDCoupling::MEDCouplingMesh::deepCopy;
+%newobject MEDCoupling::MEDCouplingMesh::clone;
+%newobject MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
+%newobject MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig;
+%newobject MEDCoupling::MEDCouplingMesh::computeNbOfNodesPerCell;
+%newobject MEDCoupling::MEDCouplingMesh::computeNbOfFacesPerCell;
+%newobject MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell;
+%newobject MEDCoupling::MEDCouplingMesh::buildPartRange;
+%newobject MEDCoupling::MEDCouplingMesh::giveCellsWithType;
+%newobject MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner;
+%newobject MEDCoupling::MEDCouplingMesh::computeCellCenterOfMass;
+%newobject MEDCoupling::MEDCouplingMesh::computeIsoBarycenterOfNodesPerCell;
+%newobject MEDCoupling::MEDCouplingMesh::buildOrthogonalField;
+%newobject MEDCoupling::MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds;
+%newobject MEDCoupling::MEDCouplingMesh::mergeMyselfWith;
+%newobject MEDCoupling::MEDCouplingMesh::fillFromAnalytic;
+%newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo;
+%newobject MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo;
+%newobject MEDCoupling::MEDCouplingMesh::getMeasureField;
+%newobject MEDCoupling::MEDCouplingMesh::simplexize;
+%newobject MEDCoupling::MEDCouplingMesh::buildUnstructured;
+%newobject MEDCoupling::MEDCouplingMesh::MergeMeshes;
+%newobject MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer;
+%newobject MEDCoupling::MEDCouplingPointSet::getCellsInBoundingBox;
+%newobject MEDCoupling::MEDCouplingPointSet::findBoundaryNodes;
+%newobject MEDCoupling::MEDCouplingPointSet::buildBoundaryMesh;
+%newobject MEDCoupling::MEDCouplingPointSet::MergeNodesArray;
+%newobject MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice;
+%newobject MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType;
+%newobject MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer;
+%newobject MEDCoupling::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
+%newobject MEDCoupling::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
+%newobject MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes;
+%newobject MEDCoupling::MEDCouplingPointSet::deepCopyConnectivityOnly;
+%newobject MEDCoupling::MEDCouplingPointSet::getBoundingBoxForBBTree;
+%newobject MEDCoupling::MEDCouplingPointSet::computeFetchedNodeIds;
+%newobject MEDCoupling::MEDCouplingPointSet::ComputeNbOfInteractionsWithSrcCells;
+%newobject MEDCoupling::MEDCouplingPointSet::computeDiameterField;
+%newobject MEDCoupling::MEDCouplingPointSet::__getitem__;
+%newobject MEDCoupling::MEDCouplingUMesh::New;
+%newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivity;
+%newobject MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex;
+%newobject MEDCoupling::MEDCouplingUMesh::__iter__;
+%newobject MEDCoupling::MEDCouplingUMesh::cellsByType;
+%newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity;
+%newobject MEDCoupling::MEDCouplingUMesh::buildDescendingConnectivity2;
+%newobject MEDCoupling::MEDCouplingUMesh::explode3DMeshTo1D;
+%newobject MEDCoupling::MEDCouplingUMesh::buildExtrudedMesh;
+%newobject MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly;
+%newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshes;
+%newobject MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords;
+%newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGradually;
+%newobject MEDCoupling::MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed;
+%newobject MEDCoupling::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
+%newobject MEDCoupling::MEDCouplingUMesh::conformize2D;
+%newobject MEDCoupling::MEDCouplingUMesh::colinearize2D;
+%newobject MEDCoupling::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes;
+%newobject MEDCoupling::MEDCouplingUMesh::sortCellsInMEDFileFrmt;
+%newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForMEDFileFrmt;
+%newobject MEDCoupling::MEDCouplingUMesh::convertCellArrayPerGeoType;
+%newobject MEDCoupling::MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec;
+%newobject MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField;
+%newobject MEDCoupling::MEDCouplingUMesh::convertLinearCellsToQuadratic;
+%newobject MEDCoupling::MEDCouplingUMesh::getEdgeRatioField;
+%newobject MEDCoupling::MEDCouplingUMesh::getAspectRatioField;
+%newobject MEDCoupling::MEDCouplingUMesh::getWarpField;
+%newobject MEDCoupling::MEDCouplingUMesh::getSkewField;
+%newobject MEDCoupling::MEDCouplingUMesh::getPartBarycenterAndOwner;
+%newobject MEDCoupling::MEDCouplingUMesh::computePlaneEquationOf3DFaces;
+%newobject MEDCoupling::MEDCouplingUMesh::getPartMeasureField;
+%newobject MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField;
+%newobject MEDCoupling::MEDCouplingUMesh::keepCellIdsByType;
+%newobject MEDCoupling::MEDCouplingUMesh::Build0DMeshFromCoords;
+%newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells;
+%newobject MEDCoupling::MEDCouplingUMesh::findAndCorrectBadOriented3DCells;
+%newobject MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh;
+%newobject MEDCoupling::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh;
+%newobject MEDCoupling::MEDCouplingUMesh::findCellIdsOnBoundary;
+%newobject MEDCoupling::MEDCouplingUMesh::computeSkin;
+%newobject MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis;
+%newobject MEDCoupling::MEDCouplingUMesh::getCellIdsCrossingPlane;
+%newobject MEDCoupling::MEDCouplingUMesh::convexEnvelop2D;
+%newobject MEDCoupling::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
+%newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf2DMesh;
+%newobject MEDCoupling::MEDCouplingUMesh::buildUnionOf3DMesh;
+%newobject MEDCoupling::MEDCouplingUMesh::generateGraph;
+%newobject MEDCoupling::MEDCouplingUMesh::orderConsecutiveCells1D;
+%newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
+%newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
+%newobject MEDCoupling::MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic;
+%newobject MEDCoupling::MEDCouplingUMeshCellByTypeEntry::__iter__;
+%newobject MEDCoupling::MEDCouplingUMeshCellEntry::__iter__;
+%newobject MEDCoupling::MEDCoupling1GTUMesh::New;
+%newobject MEDCoupling::MEDCoupling1GTUMesh::getNodalConnectivity;
+%newobject MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::New;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::computeDualMesh;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::sortHexa8EachOther;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes;
+%newobject MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords;
+%newobject MEDCoupling::MEDCoupling1DGTUMesh::New;
+%newobject MEDCoupling::MEDCoupling1DGTUMesh::getNodalConnectivityIndex;
+%newobject MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis;
+%newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes;
+%newobject MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords;
+%newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::New;
+%newobject MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh;
+%newobject MEDCoupling::MEDCouplingStructuredMesh::ComputeCornersGhost;
+%newobject MEDCoupling::MEDCouplingCMesh::New;
+%newobject MEDCoupling::MEDCouplingCMesh::getCoordsAt;
+%newobject MEDCoupling::MEDCouplingCMesh::buildCurveLinear;
+%newobject MEDCoupling::MEDCouplingIMesh::New;
+%newobject MEDCoupling::MEDCouplingIMesh::asSingleCell;
+%newobject MEDCoupling::MEDCouplingIMesh::buildWithGhost;
+%newobject MEDCoupling::MEDCouplingIMesh::convertToCartesian;
+%newobject MEDCoupling::MEDCouplingCurveLinearMesh::New;
+%newobject MEDCoupling::MEDCouplingCurveLinearMesh::getCoords;
+%newobject MEDCoupling::MEDCouplingMultiFields::New;
+%newobject MEDCoupling::MEDCouplingMultiFields::deepCopy;
+%newobject MEDCoupling::MEDCouplingFieldOverTime::New;
+%newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::getMesh;
+%newobject MEDCoupling::MEDCouplingCartesianAMRPatchGen::__getitem__;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getImageMesh;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatch;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPatchAtPosition;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::getMeshAtPosition;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMeshGen::__getitem__;
+%newobject MEDCoupling::MEDCouplingCartesianAMRMesh::New;
+%newobject MEDCoupling::MEDCouplingDataForGodFather::getMyGodFather;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::New;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::deepCopy;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::deepCpyWithoutGodFather;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::getFieldOn;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::projectTo;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
+%newobject MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost;
+%newobject MEDCoupling::DenseMatrix::New;
+%newobject MEDCoupling::DenseMatrix::deepCopy;
+%newobject MEDCoupling::DenseMatrix::shallowCpy;
+%newobject MEDCoupling::DenseMatrix::getData;
+%newobject MEDCoupling::DenseMatrix::matVecMult;
+%newobject MEDCoupling::DenseMatrix::MatVecMult;
+%newobject MEDCoupling::DenseMatrix::__add__;
+%newobject MEDCoupling::DenseMatrix::__sub__;
+%newobject MEDCoupling::DenseMatrix::__mul__;
+%newobject MEDCoupling::PartDefinition::New;
+%newobject MEDCoupling::PartDefinition::toDAI;
+%newobject MEDCoupling::PartDefinition::__add__;
+%newobject MEDCoupling::PartDefinition::composeWith;
+%newobject MEDCoupling::PartDefinition::tryToSimplify;
+%newobject MEDCoupling::DataArrayPartDefinition::New;
+%newobject MEDCoupling::SlicePartDefinition::New;
%feature("unref") MEDCouplingPointSet "$this->decrRef();"
%feature("unref") MEDCouplingMesh "$this->decrRef();"
%feature("unref") MEDCoupling1GTUMesh "$this->decrRef();"
%feature("unref") MEDCoupling1SGTUMesh "$this->decrRef();"
%feature("unref") MEDCoupling1DGTUMesh "$this->decrRef();"
-%feature("unref") MEDCouplingExtrudedMesh "$this->decrRef();"
+%feature("unref") MEDCouplingMappedExtrudedMesh "$this->decrRef();"
%feature("unref") MEDCouplingCMesh "$this->decrRef();"
%feature("unref") MEDCouplingIMesh "$this->decrRef();"
%feature("unref") MEDCouplingCurveLinearMesh "$this->decrRef();"
%feature("unref") SlicePartDefinition "$this->decrRef();"
%rename(assign) *::operator=;
-%ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
-%ignore ParaMEDMEM::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
-%ignore ParaMEDMEM::MEDCouplingGaussLocalization::fillWithValues;
-%ignore ParaMEDMEM::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
+%ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationIntInfo;
+%ignore MEDCoupling::MEDCouplingGaussLocalization::pushTinySerializationDblInfo;
+%ignore MEDCoupling::MEDCouplingGaussLocalization::fillWithValues;
+%ignore MEDCoupling::MEDCouplingGaussLocalization::buildNewInstanceFromTinyInfo;
%nodefaultctor;
};
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
std::string getTimeUnit() const;
virtual MEDCouplingMeshType getType() const throw(INTERP_KERNEL::Exception);
bool isStructured() const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingMesh *clone(bool recDeepCpy) const throw(INTERP_KERNEL::Exception);
virtual bool isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
virtual bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
virtual void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception);
virtual void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
virtual void copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
- virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
- virtual void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistency(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
virtual int getNumberOfCells() const throw(INTERP_KERNEL::Exception);
virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
virtual int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
virtual int getMeshDimension() const throw(INTERP_KERNEL::Exception);
virtual DataArrayDouble *getCoordinatesAndOwner() const throw(INTERP_KERNEL::Exception);
- virtual DataArrayDouble *getBarycenterAndOwner() const throw(INTERP_KERNEL::Exception);
+ virtual DataArrayDouble *computeCellCenterOfMass() const throw(INTERP_KERNEL::Exception);
virtual DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDouble *fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingFieldDouble *fillFromAnalyticCompo(TypeOfField t, int nbOfComp, const std::string& func) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingFieldDouble *fillFromAnalyticNamedCompo(TypeOfField t, int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDouble *buildOrthogonalField() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception);
int spaceDim=self->getSpaceDimension();
const char msg[]="Python wrap of MEDCouplingMesh::getCellsContainingPoint : ";
const double *pos=convertObjToPossibleCpp5_Safe(p,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
+ MCAuto<DataArrayInt> elts,eltsIndex;
self->getCellsContainingPoints(pos,nbOfPoints,eps,elts,eltsIndex);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *getCellsContainingPoints(PyObject *p, double eps) const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elts,eltsIndex;
+ MCAuto<DataArrayInt> elts,eltsIndex;
int spaceDim=self->getSpaceDimension();
void *da=0;
- int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
+ int res1=SWIG_ConvertPtr(p,&da,SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
self->getCellsContainingPoints(da2->getConstPointer(),size,eps,elts,eltsIndex);
}
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elts.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(eltsIndex.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)elts.size(),1);
std::copy(elts.begin(),elts.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
virtual PyObject *getReverseNodalConnectivity() const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
+ MCAuto<DataArrayInt> d0=DataArrayInt::New();
+ MCAuto<DataArrayInt> d1=DataArrayInt::New();
self->getReverseNodalConnectivity(d0,d1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *cellCor, *nodeCor;
self->checkGeoEquivalWith(other,levOfCheck,prec,cellCor,nodeCor);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
return res;
}
DataArrayInt *cellCor=0,*nodeCor=0;
self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_MEDCoupling__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
return res;
}
DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
MEDCouplingMesh *ret=self->buildPart(tmp,tmp+szArr);
if(sw==3)//DataArrayInt
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
MEDCouplingMesh *ret=self->buildPartAndReduceNodes(tmp,tmp+szArr,arr);
if(sw==3)//DataArrayInt
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
//
PyObject *res = PyList_New(2);
PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
- PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ PyObject *obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
PyList_SetItem(res,0,obj0);
PyList_SetItem(res,1,obj1);
return res;
PyObject *obj0=convertMesh(ret, SWIG_POINTER_OWN | 0 );
PyObject *obj1=0;
if(arr)
- obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
else
obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
PyTuple_SetItem(res,0,obj0);
{
std::vector<int> code;
std::vector<const DataArrayInt *> idsPerType;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li2,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",idsPerType);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li2,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",idsPerType);
convertPyToNewIntArr4(li,1,3,code);
return self->checkTypeConsistencyAndContig(code,idsPerType);
}
//
PyObject *ret1=PyList_New(idsInPflPerType.size());
for(std::size_t j=0;j<idsInPflPerType.size();j++)
- PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1);
int n=idsPerType.size();
PyObject *ret2=PyList_New(n);
for(int i=0;i<n;i++)
- PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret2,i,SWIG_NewPointerObj(SWIG_as_voidptr(idsPerType[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,2,ret2);
return ret;
}
DataArrayDouble *a1Tmp(0);
self->serialize(a0Tmp,a1Tmp);
PyObject *ret(PyTuple_New(2));
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(a0Tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(a1Tmp),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
{
- PyObject *ret0(ParaMEDMEM_MEDCouplingMesh_getTinySerializationInformation(self));
- PyObject *ret1(ParaMEDMEM_MEDCouplingMesh_serialize(self));
+ PyObject *ret0(MEDCoupling_MEDCouplingMesh_getTinySerializationInformation(self));
+ PyObject *ret1(MEDCoupling_MEDCouplingMesh_serialize(self));
PyObject *ret(PyTuple_New(2));
PyTuple_SetItem(ret,0,ret0);
PyTuple_SetItem(ret,1,ret1);
throw INTERP_KERNEL::Exception(MSG);
PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
void *argp(0);
- int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
+ int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
b0=reinterpret_cast<DataArrayInt *>(argp);
- status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ status=SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
b1=reinterpret_cast<DataArrayDouble *>(argp);
static MEDCouplingMesh *MergeMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingMesh *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,"MEDCouplingMesh",tmp);
+ std::vector<const MEDCoupling::MEDCouplingMesh *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,"MEDCouplingMesh",tmp);
return MEDCouplingMesh::MergeMeshes(tmp);
}
}
%include "NormalizedGeometricTypes"
%include "MEDCouplingNatureOfFieldEnum"
//
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingNatureOfField
{
// the MEDCouplingTimeDiscretization classes are not swigged : in case the file can help
// include "MEDCouplingTimeDiscretization.i"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingGaussLocalization
{
int getDimension() const throw(INTERP_KERNEL::Exception);
int getNumberOfPtsInRefCell() const throw(INTERP_KERNEL::Exception);
std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
- void checkCoherency() const throw(INTERP_KERNEL::Exception);
+ void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const throw(INTERP_KERNEL::Exception);
//
const std::vector<double>& getRefCoords() const throw(INTERP_KERNEL::Exception);
//== MEDCouplingPointSet
-namespace ParaMEDMEM
+namespace MEDCoupling
{
- class MEDCouplingPointSet : public ParaMEDMEM::MEDCouplingMesh
+ class MEDCouplingPointSet : public MEDCoupling::MEDCouplingMesh
{
public:
void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception);
void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
virtual void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingPointSet *buildPartOfMySelfSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception);
virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception);
static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception);
virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const throw(INTERP_KERNEL::Exception);
virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingPointSet *deepCopyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
virtual void renumberNodesWithOffsetInConn(int offset) throw(INTERP_KERNEL::Exception);
virtual bool areAllNodesFetched() const throw(INTERP_KERNEL::Exception);
int newNbOfNodes;
DataArrayInt *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
return res;
}
DataArrayInt *comm, *commIndex;
self->findCommonNodes(prec,limitTupleId,comm,commIndex);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return res;
}
DataArrayDouble *ret1=self->getCoords();
if (ret1)
ret1->incrRef();
- return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0);
+ return SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0);
}
PyObject *buildPartOfMySelf(PyObject *li, bool keepCoords=true) const throw(INTERP_KERNEL::Exception)
MEDCouplingPointSet *ret=self->buildPartOfMySelf(tmp,tmp+szArr,keepCoords);
if(sw==3)//DataArrayInt
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
MEDCouplingPointSet *ret=self->buildPartOfMySelfNode(tmp,tmp+szArr,fullyIn);
if(sw==3)//DataArrayInt
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords(tmp,tmp+szArr);
if(sw==3)//DataArrayInt
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
- virtual PyObject *buildPartOfMySelfKeepCoords2(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoords2(start,end,step);
+ MEDCouplingPointSet *ret=self->buildPartOfMySelfKeepCoordsSlice(start,end,step);
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
MEDCouplingPointSet *ret=self->buildFacePartOfMySelfNode(tmp,tmp+szArr,fullyIn);
if(sw==3)//DataArrayInt
{
- void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
- DataArrayInt *argpt=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ void *argp; SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
+ DataArrayInt *argpt=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
std::string name=argpt->getName();
if(!name.empty())
ret->setName(name.c_str());
self->renumberNodes(tmp,newNbOfNodes);
}
- void renumberNodes2(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
+ void renumberNodesCenter(PyObject *li, int newNbOfNodes) throw(INTERP_KERNEL::Exception)
{
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
- self->renumberNodes2(tmp,newNbOfNodes);
+ self->renumberNodesCenter(tmp,newNbOfNodes);
}
PyObject *findNodesOnLine(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)nodes.size(),1);
std::copy(nodes.begin(),nodes.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *findNodesOnPlane(PyObject *pt, PyObject *vec, double eps) const throw(INTERP_KERNEL::Exception)
{
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)nodes.size(),1);
std::copy(nodes.begin(),nodes.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getNodeIdsNearPoint(PyObject *pt, double eps) const throw(INTERP_KERNEL::Exception)
const char msg[]="Python wrap of MEDCouplingPointSet::getNodeIdsNearPoint : ";
const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,1,spaceDim,true);
DataArrayInt *ret=self->getNodeIdsNearPoint(pos,eps);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getNodeIdsNearPoints(PyObject *pt, int nbOfPoints, double eps) const throw(INTERP_KERNEL::Exception)
const double *pos=convertObjToPossibleCpp5_Safe(pt,sw,val,a,aa,bb,msg,nbOfPoints,spaceDim,true);
self->getNodeIdsNearPoints(pos,nbOfPoints,eps,c,cI);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
self->getNodeIdsNearPoints(ptPtr,nbOfTuples,eps,c,cI);
//
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
const double *tmp=convertObjToPossibleCpp5_Safe(bbox,sw,val,a,aa,bb,msg,spaceDim,2,true);
//
DataArrayInt *elems=self->getCellsInBoundingBox(tmp,eps);
- return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(elems),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
void duplicateNodesInCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
DataArrayInt *v0=0,*v1=0;
self->findCommonCells(compType,startCellId,v0,v1);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return res;
}
virtual void renumberNodesInConn(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
int ret1=-1;
DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
return ret;
}
int ret2;
DataArrayInt *ret0=self->mergeNodes(precision,ret1,ret2);
PyObject *res = PyList_New(3);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(res,1,SWIG_From_bool(ret1));
PyList_SetItem(res,2,SWIG_From_int(ret2));
return res;
}
- virtual PyObject *mergeNodes2(double precision) throw(INTERP_KERNEL::Exception)
+ virtual PyObject *mergeNodesCenter(double precision) throw(INTERP_KERNEL::Exception)
{
bool ret1;
int ret2;
- DataArrayInt *ret0=self->mergeNodes2(precision,ret1,ret2);
+ DataArrayInt *ret0=self->mergeNodesCenter(precision,ret1,ret2);
PyObject *res = PyList_New(3);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(res,1,SWIG_From_bool(ret1));
PyList_SetItem(res,2,SWIG_From_int(ret2));
return res;
DataArrayInt *getCellIdsLyingOnNodes(PyObject *li, bool fullyIn) const throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
int nbc=self->getNumberOfCells();
convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
}
case 3:
{
- return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
+ return self->buildPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,true);
}
case 4:
{
int sz;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
- ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
+ MEDCoupling::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo);
for(int i=0;i<sz;i++)
PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
}
int sz;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
int sw,nbNodes=0;
- double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
+ double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
std::vector<double> val3;
const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
"Rotate2DAlg",2,true,nbNodes);
if(sw!=2 && sw!=3)
throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate2DAlg : try another overload method !");
- ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
+ MEDCoupling::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,const_cast<double *>(coo));
}
static void Rotate3DAlg(PyObject *center, PyObject *vect, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
INTERP_KERNEL::AutoCPtr<double> coo=convertPyToNewDblArr2(coords,&sz);
INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
- ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
+ MEDCoupling::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,coo);
for(int i=0;i<sz;i++)
PyList_SetItem(coords,i,PyFloat_FromDouble(coo[i]));
}
int sz,sz2;
INTERP_KERNEL::AutoCPtr<double> c=convertPyToNewDblArr2(center,&sz);
int sw,nbNodes=0;
- double val0; ParaMEDMEM::DataArrayDouble *val1=0; ParaMEDMEM::DataArrayDoubleTuple *val2=0;
+ double val0; MEDCoupling::DataArrayDouble *val1=0; MEDCoupling::DataArrayDoubleTuple *val2=0;
std::vector<double> val3;
const double *coo=convertObjToPossibleCpp5_Safe2(coords,sw,val0,val1,val2,val3,
"Rotate3DAlg",3,true,nbNodes);
if(sw!=2 && sw!=3)
throw INTERP_KERNEL::Exception("Invalid call to MEDCouplingPointSet::Rotate3DAlg : try another overload method !");
INTERP_KERNEL::AutoCPtr<double> v=convertPyToNewDblArr2(vect,&sz2);
- ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
+ MEDCoupling::MEDCouplingPointSet::Rotate3DAlg(c,v,angle,nbNodes,const_cast<double *>(coo));
}
}
};
{
MEDCouplingUMeshCell *ret=self->nextt();
if(ret)
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCell,0|0);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCell,0|0);
else
{
PyErr_SetString(PyExc_StopIteration,"No more data.");
{
MEDCouplingUMeshCellEntry *ret=self->nextt();
if(ret)
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMeshCellEntry,SWIG_POINTER_OWN | 0);
else
{
PyErr_SetString(PyExc_StopIteration,"No more data.");
//== MEDCouplingUMesh
- class MEDCouplingUMesh : public ParaMEDMEM::MEDCouplingPointSet
+ class MEDCouplingUMesh : public MEDCoupling::MEDCouplingPointSet
{
public:
static MEDCouplingUMesh *New() throw(INTERP_KERNEL::Exception);
static MEDCouplingUMesh *New(const char *meshName, int meshDim) throw(INTERP_KERNEL::Exception);
- void checkCoherency() const throw(INTERP_KERNEL::Exception);
+ void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
void setMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
void finishInsertingCells() throw(INTERP_KERNEL::Exception);
MEDCouplingUMeshCellByTypeEntry *cellsByType() throw(INTERP_KERNEL::Exception);
void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true) throw(INTERP_KERNEL::Exception);
INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
- void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
- int getMeshLength() const throw(INTERP_KERNEL::Exception);
+ void setPartOfMySelfSlice(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception);
+ int getNodalConnectivityArrayLen() const throw(INTERP_KERNEL::Exception);
void computeTypes() throw(INTERP_KERNEL::Exception);
std::string reprConnectivityOfThis() const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception);
std::string cppRepr() const throw(INTERP_KERNEL::Exception);
DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception);
DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception);
- ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
int nbc=self->getNumberOfCells();
convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
int nbc=self->getNumberOfCells();
convertObjToPossibleCpp2(li,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
}
case 3:
{
- self->setPartOfMySelf2(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
+ self->setPartOfMySelfSlice(slic.first,slic.second.first,slic.second.second,otherOnSameCoordsThanThis);
break;
}
case 4:
int nbOfDepthPeelingPerformed=0;
DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
PyObject *res=PyTuple_New(2);
- PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
return res;
}
DataArrayInt *v0=0,*v1=0;
MEDCouplingUMesh::FindCommonCellsAlg(compType,startCellId,nodal,nodalI,revNodal,revNodalI,v0,v1);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(v0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(v1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return res;
}
DataArrayInt *ret1=0;
DataArrayDouble *ret0=self->distanceToPoints(pts,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1(0);
MEDCoupling1SGTUMesh *ret0(self->tetrahedrize(policy,ret1,ret2));
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
return ret;
}
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)cells.size(),1);
std::copy(cells.begin(),cells.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *splitByType() const throw(INTERP_KERNEL::Exception)
int sz=ms.size();
PyObject *ret = PyList_New(sz);
for(int i=0;i<sz;i++)
- PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
return ret;
}
int sz=retCpp.size();
PyObject *ret=PyList_New(sz);
for(int i=0;i<sz;i++)
- PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
int size;
INTERP_KERNEL::AutoPtr<int> tmp=convertPyToNewIntArr2(ids,&size);
MEDCouplingUMesh *ret=self->keepSpecifiedCells(type,tmp,tmp+size);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 );
}
bool checkConsecutiveCellTypesAndOrder(PyObject *li) const throw(INTERP_KERNEL::Exception)
DataArrayInt *tmp0=0,*tmp1=0,*tmp2=0;
self->findNodesToDuplicate(otherDimM1OnSameCoords,tmp0,tmp1,tmp2);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(tmp2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *tmp0=0,*tmp1=0;
self->findCellIdsLyingOn(otherDimM1OnSameCoords,tmp0,tmp1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
convertObjToPossibleCpp2(li,self->getNumberOfNodes(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
DataArrayInt *tmp0,*tmp1=0;
tmp0=self->getLevArrPerCellTypes(order,(INTERP_KERNEL::NormalizedCellType *)order+sz,tmp1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(tmp0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret0=0,*ret1=0;
self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
+ std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
DataArrayInt *ret1=0,*ret2=0;
MEDCouplingUMesh *ret0=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(meshes,ret1,ret2);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
+ std::vector<const MEDCoupling::MEDCouplingUMesh *> meshes;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
{
int sz;
std::vector<const MEDCouplingUMesh *> meshes;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
std::vector<DataArrayInt *> corr;
MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
sz=corr.size();
PyObject *ret1=PyList_New(sz);
for(int i=0;i<sz;i++)
- PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyObject *ret=PyList_New(2);
- PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(ret,1,ret1);
return ret;
}
static void PutUMeshesOnSameAggregatedCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
{
std::vector<MEDCouplingUMesh *> meshes;
- convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords(meshes);
}
static void MergeNodesOnUMeshesSharingSameCoords(PyObject *ms, double eps) throw(INTERP_KERNEL::Exception)
{
std::vector<MEDCouplingUMesh *> meshes;
- convertFromPyObjVectorOfObj<ParaMEDMEM::MEDCouplingUMesh *>(ms,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords(meshes,eps);
}
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
if(!arrIndx)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::RemoveIdsFromIndexedArrays : null pointer as arrIndex !");
convertObjToPossibleCpp2(li,arrIndx->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
if(!arrIndxIn)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : null pointer as arrIndxIn !");
convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ExtractFromIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
}
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
- static PyObject *ExtractFromIndexedArrays2(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ static PyObject *ExtractFromIndexedArraysSlice(int strt, int stp, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
{
DataArrayInt *arrOut=0,*arrIndexOut=0;
- MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
+ MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
- static PyObject *ExtractFromIndexedArrays2(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
+ static PyObject *ExtractFromIndexedArraysSlice(PyObject *slic, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn) throw(INTERP_KERNEL::Exception)
{
if(!PySlice_Check(slic))
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : the first param is not a pyslice !");
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
Py_ssize_t strt=2,stp=2,step=2;
PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
if(!arrIndxIn)
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : last array is null !");
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
arrIndxIn->checkAllocated();
if(arrIndxIn->getNumberOfComponents()!=1)
- throw INTERP_KERNEL::Exception("ExtractFromIndexedArrays2 (wrap) : number of components of last argument must be equal to one !");
- GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArrays2 (wrap) : Invalid slice regarding nb of elements !");
+ throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
+ GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
DataArrayInt *arrOut=0,*arrIndexOut=0;
- MEDCouplingUMesh::ExtractFromIndexedArrays2(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
+ MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
if(!arrIndxIn)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : null pointer as arrIndex !");
convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArrays : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
}
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(arrOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(arrIndexOut),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
if(!arrIndxIn)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx : null pointer as arrIndex !");
convertObjToPossibleCpp2(li,arrIndxIn->getNumberOfTuples()-1,sw,singleVal,multiVal,slic,daIntTyypp);
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)cells.size(),1);
std::copy(cells.begin(),cells.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
void orientCorrectly2DCells(PyObject *vec, bool polyOnly) throw(INTERP_KERNEL::Exception)
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)cells.size(),1);
std::copy(cells.begin(),cells.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getFastAveragePlaneOfThis() const throw(INTERP_KERNEL::Exception)
static MEDCouplingUMesh *MergeUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingUMesh *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
+ std::vector<const MEDCoupling::MEDCouplingUMesh *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",tmp);
return MEDCouplingUMesh::MergeUMeshes(tmp);
}
PyObject *ret0Py=ret0?Py_True:Py_False;
Py_XINCREF(ret0Py);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
- PyObject *areCellsIncludedIn2(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
+ PyObject *areCellsIncludedInPolicy7(const MEDCouplingUMesh *other) const throw(INTERP_KERNEL::Exception)
{
DataArrayInt *ret1;
- bool ret0=self->areCellsIncludedIn2(other,ret1);
+ bool ret0=self->areCellsIncludedInPolicy7(other,ret1);
PyObject *ret=PyTuple_New(2);
PyObject *ret0Py=ret0?Py_True:Py_False;
Py_XINCREF(ret0Py);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *explode3DMeshTo1D() const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
+ MCAuto<DataArrayInt> d0=DataArrayInt::New();
+ MCAuto<DataArrayInt> d1=DataArrayInt::New();
+ MCAuto<DataArrayInt> d2=DataArrayInt::New();
+ MCAuto<DataArrayInt> d3=DataArrayInt::New();
MEDCouplingUMesh *m=self->explode3DMeshTo1D(d0,d1,d2,d3);
PyObject *ret=PyTuple_New(5);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *buildDescendingConnectivity() const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
+ MCAuto<DataArrayInt> d0=DataArrayInt::New();
+ MCAuto<DataArrayInt> d1=DataArrayInt::New();
+ MCAuto<DataArrayInt> d2=DataArrayInt::New();
+ MCAuto<DataArrayInt> d3=DataArrayInt::New();
MEDCouplingUMesh *m=self->buildDescendingConnectivity(d0,d1,d2,d3);
PyObject *ret=PyTuple_New(5);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *buildDescendingConnectivity2() const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d2=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d3=DataArrayInt::New();
+ MCAuto<DataArrayInt> d0=DataArrayInt::New();
+ MCAuto<DataArrayInt> d1=DataArrayInt::New();
+ MCAuto<DataArrayInt> d2=DataArrayInt::New();
+ MCAuto<DataArrayInt> d3=DataArrayInt::New();
MEDCouplingUMesh *m=self->buildDescendingConnectivity2(d0,d1,d2,d3);
PyObject *ret=PyTuple_New(5);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(m),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *neighbors=0,*neighborsIdx=0;
self->computeNeighborsOfCells(neighbors,neighborsIdx);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *neighbors=0,*neighborsIdx=0;
self->computeNeighborsOfNodes(neighbors,neighborsIdx);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *neighbors=0,*neighborsIdx=0;
MEDCouplingUMesh::ComputeNeighborsOfCellsAdv(desc,descI,revDesc,revDescI,neighbors,neighborsIdx);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(neighbors),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(neighborsIdx),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d1=DataArrayInt::New();
+ MCAuto<DataArrayInt> d0=DataArrayInt::New();
+ MCAuto<DataArrayInt> d1=DataArrayInt::New();
DataArrayInt *d2,*d3,*d4,*dd5;
MEDCouplingUMesh *mOut=self->emulateMEDMEMBDC(nM1LevMesh,d0,d1,d2,d3,d4,dd5);
PyObject *ret=PyTuple_New(7);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mOut),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d0.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(d1.retn()),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(d2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(d3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(d4),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(dd5),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *cellNb1=0,*cellNb2=0;
MEDCouplingUMesh *mret=MEDCouplingUMesh::Intersect2DMeshes(m1,m2,eps,cellNb1,cellNb2);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(mret),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellNb2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *cellIdInMesh2D(0),*cellIdInMesh1D(0);
MEDCouplingUMesh::Intersect2DMeshWith1DLine(mesh2D,mesh1D,eps,splitMesh2D,splitMesh1D,cellIdInMesh2D,cellIdInMesh1D);
PyObject *ret(PyTuple_New(4));
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh2D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(splitMesh1D),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh2D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellIdInMesh1D),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *cellIds=0;
MEDCouplingUMesh *ret0=self->buildSlice3D(orig,vect,eps,cellIds);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *cellIds=0;
MEDCouplingUMesh *ret0=self->buildSlice3DSurf(orig,vect,eps,cellIds);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
//== MEDCouplingUMesh End
- //== MEDCouplingExtrudedMesh
+ //== MEDCouplingMappedExtrudedMesh
- class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
+ class MEDCouplingMappedExtrudedMesh : public MEDCoupling::MEDCouplingMesh
{
public:
- static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *build3DUnstructuredMesh() const throw(INTERP_KERNEL::Exception);
%extend {
- MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
+ MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception)
{
- return MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
+ return MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,cell2DId);
}
- MEDCouplingExtrudedMesh()
+ MEDCouplingMappedExtrudedMesh()
{
- return MEDCouplingExtrudedMesh::New();
+ return MEDCouplingMappedExtrudedMesh::New();
}
static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
{
- return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingExtrudedMesh");
+ return NewMethWrapCallInitOnlyIfEmptyDictInInput(cls,args,"MEDCouplingMappedExtrudedMesh");
}
std::string __str__() const throw(INTERP_KERNEL::Exception)
DataArrayInt *ret=self->getMesh3DIds();
if(ret)
ret->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
}
};
- //== MEDCouplingExtrudedMesh End
+ //== MEDCouplingMappedExtrudedMesh End
- class MEDCoupling1GTUMesh : public ParaMEDMEM::MEDCouplingPointSet
+ class MEDCoupling1GTUMesh : public MEDCoupling::MEDCouplingPointSet
{
public:
static MEDCoupling1GTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
INTERP_KERNEL::NormalizedCellType getCellModelEnum() const throw(INTERP_KERNEL::Exception);
int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
virtual void allocateCells(int nbOfCells=0) throw(INTERP_KERNEL::Exception);
- virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyOfConnectivity() const throw(INTERP_KERNEL::Exception);
%extend
{
virtual void insertNextCell(PyObject *li) throw(INTERP_KERNEL::Exception)
static MEDCouplingUMesh *AggregateOnSameCoordsToUMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector< const MEDCoupling1GTUMesh *> parts;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1GTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1GTUMesh,"MEDCoupling1GTUMesh",parts);
return MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(parts);
}
}
//== MEDCoupling1SGTUMesh
- class MEDCoupling1SGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
+ class MEDCoupling1SGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
{
public:
static MEDCoupling1SGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
DataArrayInt *cellPerm(0),*nodePerm(0);
MEDCouplingCMesh *retCpp(self->structurizeMe(cellPerm,nodePerm,eps));
PyObject *ret(PyTuple_New(3));
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cellPerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(nodePerm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
static MEDCoupling1SGTUMesh *Merge1SGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
+ std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
return MEDCoupling1SGTUMesh::Merge1SGTUMeshes(tmp);
}
static MEDCoupling1SGTUMesh *Merge1SGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCoupling1SGTUMesh *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
+ std::vector<const MEDCoupling::MEDCoupling1SGTUMesh *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1SGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,"MEDCoupling1SGTUMesh",tmp);
return MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(tmp);
}
}
//== MEDCoupling1DGTUMesh
- class MEDCoupling1DGTUMesh : public ParaMEDMEM::MEDCoupling1GTUMesh
+ class MEDCoupling1DGTUMesh : public MEDCoupling::MEDCoupling1GTUMesh
{
public:
static MEDCoupling1DGTUMesh *New(const std::string& name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception);
Py_XINCREF(ret0Py);
PyObject *ret=PyTuple_New(3);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
PyObject *ret=PyTuple_New(2);
PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1Py);
return ret;
}
static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
+ std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
}
static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
+ std::vector<const MEDCoupling::MEDCoupling1DGTUMesh *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
}
static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+ std::vector<const MEDCoupling::DataArrayInt *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
}
}
//== MEDCoupling1DGTUMeshEnd
- class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
+ class MEDCouplingStructuredMesh : public MEDCoupling::MEDCouplingMesh
{
public:
int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
//== MEDCouplingCMesh
- class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
+ class MEDCouplingCMesh : public MEDCoupling::MEDCouplingStructuredMesh
{
public:
static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
//== MEDCouplingCurveLinearMesh
- class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
+ class MEDCouplingCurveLinearMesh : public MEDCoupling::MEDCouplingStructuredMesh
{
public:
static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
//== MEDCouplingIMesh
- class MEDCouplingIMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
+ class MEDCouplingIMesh : public MEDCoupling::MEDCouplingStructuredMesh
{
public:
static MEDCouplingIMesh *New() throw(INTERP_KERNEL::Exception);
MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
+ return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
}
static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
- class MEDCouplingField : public ParaMEDMEM::RefCountObject, public ParaMEDMEM::TimeLabel
+ class MEDCouplingField : public MEDCoupling::RefCountObject, public MEDCoupling::TimeLabel
{
public:
- virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
virtual bool areCompatibleForMerge(const MEDCouplingField *other) const throw(INTERP_KERNEL::Exception);
virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const throw(INTERP_KERNEL::Exception);
virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
- void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
+ void setMesh(const MEDCoupling::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
void setName(const char *name) throw(INTERP_KERNEL::Exception);
std::string getDescription() const throw(INTERP_KERNEL::Exception);
void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
DataArrayInt *ret1=0;
MEDCouplingMesh *ret0=0;
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
}
PyObject *res = PyList_New(2);
PyList_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyList_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
return res;
}
PyObject *res=PyTuple_New(2);
PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
if(ret1)
- PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
else
{
PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)tmp.size(),1);
std::copy(tmp.begin(),tmp.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
int getNumberOfTuplesExpectedRegardingCode(PyObject *code, PyObject *idsPerType) const throw(INTERP_KERNEL::Exception)
std::vector<int> inp0;
convertPyToNewIntArr4(code,1,3,inp0);
std::vector<const DataArrayInt *> inp1;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
}
}
};
- class MEDCouplingFieldTemplate : public ParaMEDMEM::MEDCouplingField
+ class MEDCouplingFieldTemplate : public MEDCoupling::MEDCouplingField
{
public:
static MEDCouplingFieldTemplate *New(const MEDCouplingFieldDouble& f) throw(INTERP_KERNEL::Exception);
}
};
- class MEDCouplingFieldDouble : public ParaMEDMEM::MEDCouplingField
+ class MEDCouplingFieldDouble : public MEDCoupling::MEDCouplingField
{
public:
static MEDCouplingFieldDouble *New(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME);
std::string writeVTK(const std::string& fileName, bool isBinary=true) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *clone(bool recDeepCpy) const;
MEDCouplingFieldDouble *cloneWithMesh(bool recDeepCpy) const;
- MEDCouplingFieldDouble *deepCpy() const;
- MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *deepCopy() const;
+ MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *nodeToCellDiscretization() const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *cellToNodeDiscretization() const throw(INTERP_KERNEL::Exception);
TypeOfTimeDiscretization getTimeDiscretization() const throw(INTERP_KERNEL::Exception);
void changeUnderlyingMesh(const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
void substractInPlaceDM(const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15) throw(INTERP_KERNEL::Exception);
bool mergeNodes(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
- bool mergeNodes2(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
+ bool mergeNodesCenter(double eps, double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
bool zipCoords(double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
bool zipConnectivity(int compType,double epsOnVals=1e-15) throw(INTERP_KERNEL::Exception);
bool simplexize(int policy) throw(INTERP_KERNEL::Exception);
void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble &operator=(double value) throw(INTERP_KERNEL::Exception);
void fillFromAnalytic(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void fillFromAnalytic2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void fillFromAnalytic3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void fillFromAnalyticCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void fillFromAnalyticNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
void applyFunc(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFunc2(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
- void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFuncCompo(int nbOfComp, const std::string& func) throw(INTERP_KERNEL::Exception);
+ void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func) throw(INTERP_KERNEL::Exception);
void applyFunc(int nbOfComp, double val) throw(INTERP_KERNEL::Exception);
void applyFunc(const std::string& func) throw(INTERP_KERNEL::Exception);
void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
double integral(int compId, bool isWAbs) const throw(INTERP_KERNEL::Exception);
double normL1(int compId) const throw(INTERP_KERNEL::Exception);
double normL2(int compId) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *buildSubPartRange(int begin, int end, int step) const throw(INTERP_KERNEL::Exception);
static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
for(int i=0;i<sz;i++)
{
if(arrs[i])
- PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
else
- PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 ));
+ PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 ));
}
return ret;
}
void setArrays(PyObject *ls) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayDouble *> tmp;
- convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
+ convertFromPyObjVectorOfObj<const DataArrayDouble *>(ls,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
int sz=tmp.size();
std::vector<DataArrayDouble *> arrs(sz);
for(int i=0;i<sz;i++)
throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDouble::getValueOnMulti : lying on a null mesh !");
//
int sw,nbPts;
- double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
+ double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
mesh->getSpaceDimension(),true,nbPts);
return self->getValueOnMulti(inp,nbPts);
void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
if(self->getArray()!=0)
- ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
+ MEDCoupling_DataArrayDouble_setValues__SWIG_0(self->getArray(),li,nbOfTuples,nbOfComp);
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::New();
- ParaMEDMEM_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
+ MCAuto<DataArrayDouble> arr=DataArrayDouble::New();
+ MEDCoupling_DataArrayDouble_setValues__SWIG_0(arr,li,nbOfTuples,nbOfComp);
self->setArray(arr);
}
}
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
const MEDCouplingMesh *mesh=self->getMesh();
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::buildSubPart : field lies on a null mesh !");
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
if(!self->getArray())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
try
{ convertObjToPossibleCpp2(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
catch(INTERP_KERNEL::Exception& e)
{ std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret0=ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,elt0);
+ MCAuto<MEDCouplingFieldDouble> ret0=MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,elt0);
DataArrayDouble *ret0Arr=ret0->getArray();
if(!ret0Arr)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array exists to apply restriction on component on it !");
case 1:
{
std::vector<int> v2(1,singleVal);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
+ MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
ret0->setArray(aarr);
return ret0.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
+ MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(multiVal));
ret0->setArray(aarr);
return ret0.retn();
}
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=slic.first+i*slic.second.second;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
+ MCAuto<DataArrayDouble> aarr(ret0Arr->keepSelectedComponents(v2));
ret0->setArray(aarr);
return ret0.retn();
}
}
else
- return ParaMEDMEM_MEDCouplingFieldDouble_buildSubPart(self,li);
+ return MEDCoupling_MEDCouplingFieldDouble_buildSubPart(self,li);
}
PyObject *getMaxValue2() const throw(INTERP_KERNEL::Exception)
double r1=self->getMaxValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
double r1=self->getMinValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
MEDCouplingFieldDouble *__add__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
}
MEDCouplingFieldDouble *__radd__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___radd__Impl(self,obj);
}
MEDCouplingFieldDouble *__sub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
const char msg2[]="in MEDCouplingFieldDouble.__sub__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
return (*self)-(*other);
else
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
ret->applyLin(1.,-val);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),a);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Substract(self->getArray(),aaa);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
MEDCouplingFieldDouble *__rsub__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(self,obj);
}
MEDCouplingFieldDouble *__mul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
}
MEDCouplingFieldDouble *__rmul__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(self,obj);
}
MEDCouplingFieldDouble *__div__(PyObject *obj) throw(INTERP_KERNEL::Exception)
const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
return (*self)/(*other);
else
throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble.__div__ : trying to divide by zero !");
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
ret->applyLin(1./val,0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),a);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Divide(self->getArray(),aaa);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
MEDCouplingFieldDouble *__rdiv__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(self,obj);
}
MEDCouplingFieldDouble *__pow__(PyObject *obj) throw(INTERP_KERNEL::Exception)
const char msg2[]="in MEDCouplingFieldDouble.__pow__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
return (*self)^(*other);
else
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->getArray()->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->getArray()->deepCopy();
ret->applyPow(val);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),a);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::Pow(self->getArray(),aaa);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
const char msg2[]="in MEDCouplingFieldDouble.__iadd__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
*self+=*other;
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(a);
*self+=*ret2;
Py_XINCREF(trueSelf);
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(aaa);
*self+=*ret2;
Py_XINCREF(trueSelf);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->getArray()->addEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
const char msg2[]="in MEDCouplingFieldDouble.__isub__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
*self-=*other;
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(a);
*self-=*ret2;
Py_XINCREF(trueSelf);
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(aaa);
*self-=*ret2;
Py_XINCREF(trueSelf);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->getArray()->substractEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
const char msg2[]="in MEDCouplingFieldDouble.__imul__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
*self*=*other;
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(a);
*self*=*ret2;
Py_XINCREF(trueSelf);
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(aaa);
*self*=*ret2;
Py_XINCREF(trueSelf);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->getArray()->multiplyEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
const char msg2[]="in MEDCouplingFieldDouble.__idiv__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
*self/=*other;
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(a);
*self/=*ret2;
Py_XINCREF(trueSelf);
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(aaa);
*self/=*ret2;
Py_XINCREF(trueSelf);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->getArray()->divideEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
const char msg2[]="in MEDCouplingFieldDouble.__ipow__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
*self^=*other;
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(a);
*self^=*ret2;
Py_XINCREF(trueSelf);
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret2=self->clone(false);
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(aaa);
*self^=*ret2;
Py_XINCREF(trueSelf);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->getArray()->powEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const MEDCouplingFieldDouble *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
return MEDCouplingFieldDouble::MergeFields(tmp);
}
static std::string WriteVTK(const char *fileName, PyObject *li, bool isBinary=true) throw(INTERP_KERNEL::Exception)
{
std::vector<const MEDCouplingFieldDouble *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
return MEDCouplingFieldDouble::WriteVTK(fileName,tmp,isBinary);
}
ret0->incrRef();
std::size_t sz(ret1.size());
PyObject *ret(PyTuple_New(2));
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyObject *ret1Py(PyList_New(sz));
for(std::size_t i=0;i<sz;i++)
{
if(ret1[i])
ret1[i]->incrRef();
- PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret1Py,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret1[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
}
PyTuple_SetItem(ret,1,ret1Py);
return ret;
PyObject *__getnewargs__() throw(INTERP_KERNEL::Exception)
{// put an empty dict in input to say to __new__ to call __init__...
- self->checkCoherency();
+ self->checkConsistencyLight();
PyObject *ret(PyTuple_New(1));
PyObject *ret0(PyDict_New());
{
PyObject *__getstate__() const throw(INTERP_KERNEL::Exception)
{
- self->checkCoherency();
- PyObject *ret0(ParaMEDMEM_MEDCouplingFieldDouble_getTinySerializationInformation(self));
- PyObject *ret1(ParaMEDMEM_MEDCouplingFieldDouble_serialize(self));
+ self->checkConsistencyLight();
+ PyObject *ret0(MEDCoupling_MEDCouplingFieldDouble_getTinySerializationInformation(self));
+ PyObject *ret1(MEDCoupling_MEDCouplingFieldDouble_serialize(self));
const MEDCouplingMesh *mesh(self->getMesh());
if(mesh)
mesh->incrRef();
// mesh
PyObject *elt2(PyTuple_GetItem(inp,2));
void *argp=0;
- int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMesh,0|0));
+ int status(SWIG_ConvertPtr(elt2,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingMesh,0|0));
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
self->setMesh(reinterpret_cast< const MEDCouplingUMesh * >(argp));
throw INTERP_KERNEL::Exception(MSG);
PyObject *b0py(PyTuple_GetItem(elt1,0)),*b1py(PyTuple_GetItem(elt1,1));
void *argp(0);
- int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0));
+ int status(SWIG_ConvertPtr(b0py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
b0=reinterpret_cast<DataArrayInt *>(argp);
- convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayDouble *>(b1py,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",b1);
+ convertFromPyObjVectorOfObj<MEDCoupling::DataArrayDouble *>(b1py,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",b1);
}
self->checkForUnserialization(a1,b0,b1);
// useless here to call resizeForUnserialization because arrays are well resized.
{
public:
int getNumberOfFields() const;
- MEDCouplingMultiFields *deepCpy() const;
+ MEDCouplingMultiFields *deepCopy() const;
virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception);
virtual bool isEqual(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
virtual bool isEqualWithoutConsideringStr(const MEDCouplingMultiFields *other, double meshPrec, double valsPrec) const;
- virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
%extend
{
std::string __str__() const throw(INTERP_KERNEL::Exception)
}
static MEDCouplingMultiFields *New(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
+ std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
int sz=tmp.size();
std::vector<MEDCouplingFieldDouble *> fs(sz);
for(int i=0;i<sz;i++)
}
MEDCouplingMultiFields(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
+ std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
int sz=tmp.size();
std::vector<MEDCouplingFieldDouble *> fs(sz);
for(int i=0;i<sz;i++)
if(fields[i])
{
fields[i]->incrRef();
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(fields[i]),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
}
else
{
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 ));
}
}
return res;
if(ret)
{
ret->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
}
else
- return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, 0 );
}
PyObject *getMeshes() const throw(INTERP_KERNEL::Exception)
{
}
else
{
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
}
}
return res;
}
else
{
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, 0 ));
}
}
//
if(ms[i])
{
ms[i]->incrRef();
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
}
else
{
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
}
}
return res;
if(ms[i])
{
ms[i]->incrRef();
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(ms[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
}
else
{
- PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 ));
+ PyList_SetItem(res,i,SWIG_NewPointerObj(SWIG_as_voidptr(0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 ));
}
PyList_SetItem(res2,i,convertIntArrToPyList2(refs[i]));
}
{
MEDCouplingFieldOverTime(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
+ std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
int sz=tmp.size();
std::vector<MEDCouplingFieldDouble *> fs(sz);
for(int i=0;i<sz;i++)
}
static MEDCouplingFieldOverTime *New(PyObject *li) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::MEDCouplingFieldDouble *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
+ std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
int sz=tmp.size();
std::vector<MEDCouplingFieldDouble *> fs(sz);
for(int i=0;i<sz;i++)
}
// agy : don't know why typemap fails here ??? let it in the extend section
- PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
+ PyObject *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception)
{
- return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 );
+ return convertCartesianAMRMesh(self->deepCopy(father), SWIG_POINTER_OWN | 0 );
}
MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector<int>& pos) const throw(INTERP_KERNEL::Exception)
MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
{
std::vector<const DataArrayDouble *> inp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",inp);
return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
}
void fillCellFieldOnPatchGhostAdv(int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, PyObject *arrsOnPatches, bool isConservative=true) const throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
+ std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
self->fillCellFieldOnPatchGhostAdv(patchId,cellFieldOnThis,ghostLev,arrsOnPatches2,isConservative);
}
void fillCellFieldOnPatchOnlyGhostAdv(int patchId, int ghostLev, PyObject *arrsOnPatches) const
{
- std::vector<const ParaMEDMEM::DataArrayDouble *> arrsOnPatches2;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
+ std::vector<const MEDCoupling::DataArrayDouble *> arrsOnPatches2;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayDouble *>(arrsOnPatches,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",arrsOnPatches2);
self->fillCellFieldOnPatchOnlyGhostAdv(patchId,ghostLev,arrsOnPatches2);
}
MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
+ return MEDCoupling_MEDCouplingCartesianAMRMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
}
MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh) throw(INTERP_KERNEL::Exception)
{
public:
int getNumberOfLevels() const throw(INTERP_KERNEL::Exception);
- MEDCouplingAMRAttribute *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDCouplingAMRAttribute *deepCopy() const throw(INTERP_KERNEL::Exception);
MEDCouplingAMRAttribute *deepCpyWithoutGodFather() const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
+ return MEDCoupling_MEDCouplingAMRAttribute_New(gf,fieldNames,ghostLev);
}
DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
int sz((int)ret.size());
PyObject *retPy(PyList_New(sz));
for(int i=0;i<sz;i++)
- PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
return retPy;
}
}
public:
static DenseMatrix *New(int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
static DenseMatrix *New(DataArrayDouble *array, int nbRows, int nbCols) throw(INTERP_KERNEL::Exception);
- DenseMatrix *deepCpy() const throw(INTERP_KERNEL::Exception);
+ DenseMatrix *deepCopy() const throw(INTERP_KERNEL::Exception);
DenseMatrix *shallowCpy() const throw(INTERP_KERNEL::Exception);
//
int getNumberOfRows() const throw(INTERP_KERNEL::Exception);
DenseMatrix *__add__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM::DenseMatrix::Add(self,other);
+ return MEDCoupling::DenseMatrix::Add(self,other);
}
DenseMatrix *__sub__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM::DenseMatrix::Substract(self,other);
+ return MEDCoupling::DenseMatrix::Substract(self,other);
}
DenseMatrix *__mul__(const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM::DenseMatrix::Multiply(self,other);
+ return MEDCoupling::DenseMatrix::Multiply(self,other);
}
DenseMatrix *__mul__(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM::DenseMatrix::Multiply(self,other);
+ return MEDCoupling::DenseMatrix::Multiply(self,other);
}
PyObject *___iadd___(PyObject *trueSelf, const DenseMatrix *other) throw(INTERP_KERNEL::Exception)
virtual int getNumberOfElems() const throw(INTERP_KERNEL::Exception);
virtual std::string getRepr() const throw(INTERP_KERNEL::Exception);
virtual PartDefinition *composeWith(const PartDefinition *other) const throw(INTERP_KERNEL::Exception);
- virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
virtual PartDefinition *tryToSimplify() const throw(INTERP_KERNEL::Exception);
%extend
{
return ret;
}
- virtual PyObject *deepCpy() const throw(INTERP_KERNEL::Exception)
+ virtual PyObject *deepCopy() const throw(INTERP_KERNEL::Exception)
{
- return convertPartDefinition(self->deepCpy(),SWIG_POINTER_OWN | 0);
+ return convertPartDefinition(self->deepCopy(),SWIG_POINTER_OWN | 0);
}
}
protected:
MCData *_pt_mc;
};
-typedef struct PyCallBackDataArraySt<ParaMEDMEM::DataArrayInt> PyCallBackDataArrayInt;
-typedef struct PyCallBackDataArraySt<ParaMEDMEM::DataArrayDouble> PyCallBackDataArrayDouble;
+typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayInt> PyCallBackDataArrayInt;
+typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayDouble> PyCallBackDataArrayDouble;
extern "C"
{
{
if(self->_pt_mc)
{
- ParaMEDMEM::MemArray<int>& mma=self->_pt_mc->accessToMemArray();
+ MEDCoupling::MemArray<int>& mma=self->_pt_mc->accessToMemArray();
mma.destroy();
}
Py_XINCREF(Py_None);
{
if(self->_pt_mc)
{
- ParaMEDMEM::MemArray<double>& mma=self->_pt_mc->accessToMemArray();
+ MEDCoupling::MemArray<double>& mma=self->_pt_mc->accessToMemArray();
mma.destroy();
}
Py_XINCREF(Py_None);
if(itemSize!=PyArray_STRIDE(elt0,1))
throw INTERP_KERNEL::Exception("Input numpy array has stride that mismatches the item size ! Data are not packed in the right way for DataArrays for component #1 !");
const char *data=PyArray_BYTES(elt0);
- typename ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<MCData> ret=MCData::New();
+ typename MEDCoupling::MCAuto<MCData> ret=MCData::New();
if(PyArray_ISBEHAVED(elt0))//aligned and writeable and in machine byte-order
{
PyArrayObject *elt0C=reinterpret_cast<PyArrayObject *>(elt0);
std::size_t nbOfElems(sz0*sz1);
T *dataCpy=(T*)malloc(sizeof(T)*nbOfElems);
std::copy(reinterpret_cast<const T*>(data),reinterpret_cast<const T*>(data)+nbOfElems,dataCpy);
- ret->useArray(dataCpy,true,ParaMEDMEM::C_DEALLOC,sz0,sz1);
+ ret->useArray(dataCpy,true,MEDCoupling::C_DEALLOC,sz0,sz1);
return ret.retn();
}
- typename ParaMEDMEM::MemArray<T>& mma=ret->accessToMemArray();
+ typename MEDCoupling::MemArray<T>& mma=ret->accessToMemArray();
if(eltOwning==NULL)
{
PyCallBackDataArraySt<MCData> *cb=PyObject_GC_New(PyCallBackDataArraySt<MCData>,pytype);
cb->_pt_mc=ret;
- ret->useArray(reinterpret_cast<const T *>(data),true,ParaMEDMEM::C_DEALLOC,sz0,sz1);
+ ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::C_DEALLOC,sz0,sz1);
PyObject *ref=PyWeakref_NewRef(deepestObj,(PyObject *)cb);
void **objs=new void *[2]; objs[0]=cb; objs[1]=ref;
mma.setParameterForDeallocator(objs);
}
else
{
- ret->useArray(reinterpret_cast<const T *>(data),true,ParaMEDMEM::C_DEALLOC,sz0,sz1);
+ ret->useArray(reinterpret_cast<const T *>(data),true,MEDCoupling::C_DEALLOC,sz0,sz1);
PyObject *ref=PyWeakref_NewRef(reinterpret_cast<PyObject *>(eltOwning),NULL);
- typename ParaMEDMEM::MemArray<T>::Deallocator tmp(ParaMEDMEM::MemArray<T>::CDeallocator);
+ typename MEDCoupling::MemArray<T>::Deallocator tmp(MEDCoupling::MemArray<T>::CDeallocator);
void **tmp2 = reinterpret_cast<void**>(&tmp); // MSVC2010 does not support constructor()
void **objs=new void *[2]; objs[0]=ref; objs[1]=*tmp2;
mma.setParameterForDeallocator(objs);
}
}
else if(PyArray_ISBEHAVED_RO(elt0))
- ret->useArray(reinterpret_cast<const T *>(data),false,ParaMEDMEM::CPP_DEALLOC,sz0,sz1);
+ ret->useArray(reinterpret_cast<const T *>(data),false,MEDCoupling::CPP_DEALLOC,sz0,sz1);
return ret.retn();
}
std::ostringstream oss; oss << MCDataStr << "::toNumPyArray : this is not allocated !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- ParaMEDMEM::MemArray<T>& mem=self->accessToMemArray();
+ MEDCoupling::MemArray<T>& mem=self->accessToMemArray();
if(nbComp==0)
{
std::ostringstream oss; oss << MCDataStr << "::toNumPyArray : number of components of this is 0 ! Should be > 0 !";
if(mem.getDeallocator()!=numarrdeal)
{// case for the first call of toNumPyArray
PyObject *ref(PyWeakref_NewRef(ret,NULL));
- typename ParaMEDMEM::MemArray<T>::Deallocator tmp(mem.getDeallocator());
+ typename MEDCoupling::MemArray<T>::Deallocator tmp(mem.getDeallocator());
void **tmp2 = reinterpret_cast<void**>(&tmp); // MSVC2010 does not support constructor()
void **objs=new void *[2]; objs[0]=reinterpret_cast<void*>(ref); objs[1]=*tmp2;
mem.setParameterForDeallocator(objs);
return ToNumPyArrayUnderground<MCData,T>(self,npyObjectType,MCDataStr,self->getNumberOfTuples(),self->getNumberOfComponents());
}
-SWIGINTERN PyObject *ParaMEDMEM_DataArrayInt_toNumPyArray(ParaMEDMEM::DataArrayInt *self);
-SWIGINTERN PyObject *ParaMEDMEM_DataArrayDouble_toNumPyArray(ParaMEDMEM::DataArrayDouble *self);
+SWIGINTERN PyObject *MEDCoupling_DataArrayInt_toNumPyArray(MEDCoupling::DataArrayInt *self);
+SWIGINTERN PyObject *MEDCoupling_DataArrayDouble_toNumPyArray(MEDCoupling::DataArrayDouble *self);
PyObject *ToCSRMatrix(const std::vector<std::map<int,double> >& m, int nbCols) throw(INTERP_KERNEL::Exception)
{
int nbRows((int)m.size());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayInt> indPtr(ParaMEDMEM::DataArrayInt::New()),indices(ParaMEDMEM::DataArrayInt::New());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> data(ParaMEDMEM::DataArrayDouble::New());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> indPtr(MEDCoupling::DataArrayInt::New()),indices(MEDCoupling::DataArrayInt::New());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> data(MEDCoupling::DataArrayDouble::New());
indPtr->alloc(nbRows+1,1);
int *intPtr_ptr(indPtr->getPointer()); intPtr_ptr[0]=0; intPtr_ptr++;
int sz2(0);
*indices_ptr=(*it1).first;
*data_ptr=(*it1).second;
}
- PyObject *a(ParaMEDMEM_DataArrayDouble_toNumPyArray(data)),*b(ParaMEDMEM_DataArrayInt_toNumPyArray(indices)),*c(ParaMEDMEM_DataArrayInt_toNumPyArray(indPtr));
+ PyObject *a(MEDCoupling_DataArrayDouble_toNumPyArray(data)),*b(MEDCoupling_DataArrayInt_toNumPyArray(indices)),*c(MEDCoupling_DataArrayInt_toNumPyArray(indPtr));
//
PyObject *args(PyTuple_New(1)),*args0(PyTuple_New(3)),*kw(PyDict_New()),*kw1(PyTuple_New(2));
PyTuple_SetItem(args0,0,a); PyTuple_SetItem(args0,1,b); PyTuple_SetItem(args0,2,c); PyTuple_SetItem(args,0,args0);
#endif
-static PyObject *convertDataArrayChar(ParaMEDMEM::DataArrayChar *dac, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertDataArrayChar(MEDCoupling::DataArrayChar *dac, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!dac)
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::DataArrayByte *>(dac))
- ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayByte,owner);
- if(dynamic_cast<ParaMEDMEM::DataArrayAsciiChar *>(dac))
- ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayByte *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayByte,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayAsciiChar *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of DataArrayChar on downcast !");
return ret;
}
-static PyObject *convertDataArray(ParaMEDMEM::DataArray *dac, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertDataArray(MEDCoupling::DataArray *dac, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!dac)
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::DataArrayDouble *>(dac))
- ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,owner);
- if(dynamic_cast<ParaMEDMEM::DataArrayInt *>(dac))
- ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,owner);
- if(dynamic_cast<ParaMEDMEM::DataArrayByte *>(dac))
- ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayByte,owner);
- if(dynamic_cast<ParaMEDMEM::DataArrayAsciiChar *>(dac))
- ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayDouble *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayDouble,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayInt *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayInt,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayByte *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayByte,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayAsciiChar *>(dac))
+ ret=SWIG_NewPointerObj((void*)dac,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of DataArray on downcast !");
return ret;
return ret;
}
-//convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(pyLi,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh")
+//convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(pyLi,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh")
template<class T>
static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, const char *typeStr, typename std::vector<T>& ret)
{
*
* switch between (int,vector<int>,DataArrayInt)
*/
-static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, ParaMEDMEM::DataArrayInt *& daIntTyypp, ParaMEDMEM::DataArrayIntTuple *&daIntTuple) throw(INTERP_KERNEL::Exception)
+static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, MEDCoupling::DataArrayInt *& daIntTyypp, MEDCoupling::DataArrayIntTuple *&daIntTuple) throw(INTERP_KERNEL::Exception)
{
sw=-1;
if(PyInt_Check(value))
return;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
if(SWIG_IsOK(status))
{
- daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
sw=3;
return;
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
if(SWIG_IsOK(status))
{
- daIntTuple=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp);
+ daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
sw=4;
return ;
}
*
* switch between (int,vector<int>,DataArrayInt)
*/
-static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, ParaMEDMEM::DataArrayDouble *& daIntTyypp) throw(INTERP_KERNEL::Exception)
+static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, MEDCoupling::DataArrayDouble *& daIntTyypp) throw(INTERP_KERNEL::Exception)
{
sw=-1;
if(PyFloat_Check(value))
return;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception("5 types accepted : double float, integer, tuple of double float or int, list of double float or int, DataArrayDouble");
- daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
+ daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
sw=3;
}
*
* switch between (int,vector<int>,DataArrayInt)
*/
-static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, ParaMEDMEM::DataArrayDoubleTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
+static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp, std::vector<double>& stdvecTyypp, MEDCoupling::DataArrayDoubleTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
{
sw=-1;
if(PyFloat_Check(value))
return;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception("5 types accepted : double float, integer, tuple of double float or int, list of double float or int, DataArrayDoubleTuple");
- daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
+ daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
sw=3;
}
*
* switch between (int,vector<int>,DataArrayInt)
*/
-static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, ParaMEDMEM::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception)
+static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception)
{
const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayInt, DataArrayIntTuple";
sw=-1;
return ;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
if(SWIG_IsOK(status))
{
- daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
if(!daIntTyypp)
{
std::ostringstream oss; oss << msg << " Instance in null !";
sw=4;
return ;
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
if(SWIG_IsOK(status))
{
- ParaMEDMEM::DataArrayIntTuple *tmp=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp);
+ MEDCoupling::DataArrayIntTuple *tmp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
if(!tmp)
{
std::ostringstream oss; oss << msg << " Instance in null !";
/*!
* Idem than convertObjToPossibleCpp2
*/
-static void convertObjToPossibleCpp2WithNegIntInterp(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, ParaMEDMEM::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception)
+static void convertObjToPossibleCpp2WithNegIntInterp(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayInt *& daIntTyypp) throw(INTERP_KERNEL::Exception)
{
convertObjToPossibleCpp2(value,nbelem,sw,iTyypp,stdvecTyypp,p,daIntTyypp);
if(sw==1)
* if python slice -> cpp pair sw=3
* if python DataArrayIntTuple -> cpp DataArrayIntTuple sw=4 . WARNING The returned pointer can be the null pointer !
*/
-static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, ParaMEDMEM::DataArrayIntTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
+static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayIntTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
{
sw=-1;
if(PyInt_Check(value))
return ;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception("4 types accepted : integer, tuple of integer, list of integer, slice, DataArrayIntTuple");
- daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp);
+ daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
sw=4;
}
* if python not null pointer of DataArrayChar -> cpp DataArrayChar sw=4
* switch between (int,string,vector<string>,DataArrayChar)
*/
-static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::string& sType, std::vector<std::string>& vsType, ParaMEDMEM::DataArrayChar *& dacType) throw(INTERP_KERNEL::Exception)
+static void convertObjToPossibleCpp6(PyObject *value, int& sw, char& cTyp, std::string& sType, std::vector<std::string>& vsType, MEDCoupling::DataArrayChar *& dacType) throw(INTERP_KERNEL::Exception)
{
const char *msg="4 types accepted : string, list or tuple of strings having same size, not null DataArrayChar instance.";
sw=-1;
return;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayChar,0|0);
if(SWIG_IsOK(status))
{
- dacType=reinterpret_cast< ParaMEDMEM::DataArrayChar * >(argp);
+ dacType=reinterpret_cast< MEDCoupling::DataArrayChar * >(argp);
if(!dacType)
{
std::ostringstream oss; oss << msg << " Instance in null !";
*/
static void convertObjToPossibleCpp3(PyObject *value, int nbTuple, int nbCompo, int& sw, int& it, int& ic, std::vector<int>& vt, std::vector<int>& vc,
std::pair<int, std::pair<int,int> >& pt, std::pair<int, std::pair<int,int> >& pc,
- ParaMEDMEM::DataArrayInt *&dt, ParaMEDMEM::DataArrayInt *&dc) throw(INTERP_KERNEL::Exception)
+ MEDCoupling::DataArrayInt *&dt, MEDCoupling::DataArrayInt *&dc) throw(INTERP_KERNEL::Exception)
{
if(!PyTuple_Check(value))
{
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector<double>& f)
+static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f)
{
sw=-1;
if(PyFloat_Check(value))
return;
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(SWIG_IsOK(status))
{
- d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
+ d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
sw=2;
return ;
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
if(SWIG_IsOK(status))
{
- e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
+ e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
sw=3;
return ;
}
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector<double>& f,
+static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
const char *msg, int nbTuplesExpected, int nbCompExpected, bool throwIfNullPt) throw(INTERP_KERNEL::Exception)
{
sw=-1;
catch(INTERP_KERNEL::Exception& exc) { throw exc; }
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(SWIG_IsOK(status))
{
- d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
+ d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
sw=2;
if(d)
{
return 0;
}
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
if(SWIG_IsOK(status))
{
- e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
+ e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
sw=3;
if(e->getNumberOfCompo()==nbCompExpected)
{
* if value list[int,double] -> cpp std::vector<double> sw=4
* if value tuple[int,double] -> cpp std::vector<double> sw=4
*/
-static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, double& val, ParaMEDMEM::DataArrayDouble *&d, ParaMEDMEM::DataArrayDoubleTuple *&e, std::vector<double>& f,
+static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, double& val, MEDCoupling::DataArrayDouble *&d, MEDCoupling::DataArrayDoubleTuple *&e, std::vector<double>& f,
const char *msg, int nbCompExpected, bool throwIfNullPt, int& nbTuples) throw(INTERP_KERNEL::Exception)
{
sw=-1;
return &f[0];
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(SWIG_IsOK(status))
{
- d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
+ d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
sw=2;
if(d)
{
{ nbTuples=0; return 0; }
}
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
if(SWIG_IsOK(status))
{
- e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
+ e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
sw=3;
if(e)
{
static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int& sw, double& val, std::vector<double>& f,
const char *msg, bool throwIfNullPt, int& nbTuples) throw(INTERP_KERNEL::Exception)
{
- ParaMEDMEM::DataArrayDouble *d=0;
- ParaMEDMEM::DataArrayDoubleTuple *e=0;
+ MEDCoupling::DataArrayDouble *d=0;
+ MEDCoupling::DataArrayDoubleTuple *e=0;
sw=-1;
if(PyFloat_Check(value))
{
return &f[0];
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(SWIG_IsOK(status))
{
- d=reinterpret_cast< ParaMEDMEM::DataArrayDouble * >(argp);
+ d=reinterpret_cast< MEDCoupling::DataArrayDouble * >(argp);
sw=2;
if(d)
{
{ nbTuples=0; return 0; }
}
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,0|0);
if(SWIG_IsOK(status))
{
- e=reinterpret_cast< ParaMEDMEM::DataArrayDoubleTuple * >(argp);
+ e=reinterpret_cast< MEDCoupling::DataArrayDoubleTuple * >(argp);
sw=3;
if(e)
{
return &stdvecTyypp[0];
}
void *argp;
- int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
+ int status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
if(SWIG_IsOK(status))
{
- ParaMEDMEM::DataArrayInt *daIntTyypp=reinterpret_cast< ParaMEDMEM::DataArrayInt * >(argp);
+ MEDCoupling::DataArrayInt *daIntTyypp=reinterpret_cast< MEDCoupling::DataArrayInt * >(argp);
if(daIntTyypp)
{
sw=3; sz=daIntTyypp->getNbOfElems();
return 0;
}
}
- status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,0|0);
+ status=SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,0|0);
if(SWIG_IsOK(status))
{
- ParaMEDMEM::DataArrayIntTuple *daIntTuple=reinterpret_cast< ParaMEDMEM::DataArrayIntTuple * >(argp);
+ MEDCoupling::DataArrayIntTuple *daIntTuple=reinterpret_cast< MEDCoupling::DataArrayIntTuple * >(argp);
sw=4; sz=daIntTuple->getNumberOfCompo();
return daIntTuple->getConstPointer();
}
throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayInt, DataArrayIntTuple");
}
-static ParaMEDMEM::DataArray *CheckAndRetrieveDataArrayInstance(PyObject *obj, const char *msg)
+static MEDCoupling::DataArray *CheckAndRetrieveDataArrayInstance(PyObject *obj, const char *msg)
{
void *aBasePtrVS=0;
- int status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArray,0|0);
+ int status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArray,0|0);
if(!SWIG_IsOK(status))
{
- status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0);
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0);
if(!SWIG_IsOK(status))
{
- status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,0|0);
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0);
if(!SWIG_IsOK(status))
{
- status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar,0|0);
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar,0|0);
if(!SWIG_IsOK(status))
{
- status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_ParaMEDMEM__DataArrayByte,0|0);
+ status=SWIG_ConvertPtr(obj,&aBasePtrVS,SWIGTYPE_p_MEDCoupling__DataArrayByte,0|0);
std::ostringstream oss; oss << msg << " ! Accepted instances are DataArrayDouble, DataArrayInt, DataArrayAsciiChar, DataArrayByte !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
}
}
- return reinterpret_cast< ParaMEDMEM::DataArray * >(aBasePtrVS);
+ return reinterpret_cast< MEDCoupling::DataArray * >(aBasePtrVS);
}
myCoords=DataArrayDouble.New();
myCoords.setValues(coords,11,2);
ret.setCoords(myCoords);
- ret.checkCoherency();
+ ret.checkConsistencyLight();
return ret;
def build2DTargetMesh_4(cls):
for i in xrange(30,36):
m.insertNextCell(NORM_QUAD8,conn[i])
pass
- fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH1RB") ; fff.setNature(ConservativeVolumic)
+ fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH1RB") ; fff.setNature(IntensiveMaximum)
fff.setMesh(m)
fff.setGaussLocalizationOnCells(range(0,12),[0.,0.,1.,0.,0.,1.],[0.3333333333333333,0.3333333333333333],[0.5])
fff.setGaussLocalizationOnCells(range(12,18),[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[-0.577350269189626,-0.577350269189626,0.577350269189626,-0.577350269189626,0.577350269189626,0.577350269189626,-0.577350269189626,0.577350269189626],[1.,1.,1.,1.])
for i in xrange(100,120):
m.insertNextCell(NORM_QUAD8,conn[i])
pass
- fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH2RB") ; fff.setNature(ConservativeVolumic)
+ fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH2RB") ; fff.setNature(IntensiveMaximum)
fff.setMesh(m)
fff.setGaussLocalizationOnCells(range(0,40),[0.,0.,1.,0.,0.,1.],[0.3333333333333333,0.3333333333333333],[0.5])
fff.setGaussLocalizationOnCells(range(40,60),[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[-0.577350269189626,-0.577350269189626,0.577350269189626,-0.577350269189626,0.577350269189626,0.577350269189626,-0.577350269189626,0.577350269189626],[1.,1.,1.,1.])
pass
m.insertNextCell(NORM_HEXA8,conn[6])
m.insertNextCell(NORM_HEXA8,conn[7])
- fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH13") ; fff.setNature(ConservativeVolumic)
+ fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH13") ; fff.setNature(IntensiveMaximum)
fff.setMesh(m)
fff.setGaussLocalizationOnCells([0],[0.,1.,0.,0.,0.,0.,0.,0.,1.,1.,0.,0.],[0.25,0.25,0.25],[0.16666666666666666])
fff.setGaussLocalizationOnCells([1],[1.,0.,0.,0.,-1.,0.,-1.,0.,0.,0.,1.,0.,0.,0.,1.],[0.5,0.,0.1531754163448146,0.,0.5,0.1531754163448146,-0.5,0.,0.1531754163448146,0.,-0.5,0.1531754163448146,0.,0.,0.6372983346207416],[0.1333333333333333,0.1333333333333333,0.1333333333333333,0.1333333333333333,0.1333333333333333])
pass
m.insertNextCell(NORM_HEXA8,conn[6])
m.insertNextCell(NORM_HEXA8,conn[7])
- fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH23") ; fff.setNature(ConservativeVolumic)
+ fff=MEDCouplingFieldDouble.New(ON_GAUSS_PT) ; fff.setName("CH23") ; fff.setNature(IntensiveMaximum)
fff.setMesh(m)
fff.setGaussLocalizationOnCells([0],[0.,1.,0.,0.,0.,0.,0.,0.,1.,1.,0.,0.],[0.25,0.25,0.25],[0.16666666666666666])
fff.setGaussLocalizationOnCells([1],[1.,0.,0.,0.,-1.,0.,-1.,0.,0.,0.,1.,0.,0.,0.,1.],[0.5,0.,0.1531754163448146,0.,0.5,0.1531754163448146,-0.5,0.,0.1531754163448146,0.,-0.5,0.1531754163448146,0.,0.,0.6372983346207416],[0.1333333333333333,0.1333333333333333,0.1333333333333333,0.1333333333333333,0.1333333333333333])
mesh1.allocateCells(0)
mesh1.finishInsertingCells()
# mesh 2
- mesh2=mesh1.deepCpy()
+ mesh2=mesh1.deepCopy()
mesh2.getCoords().setValues(coords2, 4, 1)
#! [PySnippet_MEDCouplingFieldDouble_substractInPlaceDM_1]
#! [PySnippet_MEDCouplingFieldDouble_substractInPlaceDM_2]
mesh1.allocateCells(0)
mesh1.finishInsertingCells()
# mesh 2
- mesh2=mesh1.deepCpy()
+ mesh2=mesh1.deepCopy()
mesh2.getCoords().setValues(coords2, 4, 1)
#! [PySnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_1]
#! [PySnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2]
# transform the field to a 3D vector field
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
varNames=["a","b"] # names used to refer to X and Y components
- field.applyFunc3( 3, varNames, func ) # require 3 components
+ field.applyFuncNamedCompo( 3, varNames, func ) # require 3 components
self.assertTrue( field.getNumberOfComponents() == 3 ) # 3 components as required
#! [PySnippet_MEDCouplingFieldDouble_applyFunc3_1]
#! [PySnippet_MEDCouplingFieldDouble_applyFunc3_2]
field.setArray( array )
# transform the field to a 3D vector field
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
- field.applyFunc2( 3, func ) # require 3 components
+ field.applyFuncCompo( 3, func ) # require 3 components
self.assertTrue( field.getNumberOfComponents() == 3 ) # 3 components as required
#! [PySnippet_MEDCouplingFieldDouble_applyFunc2_1]
#! [PySnippet_MEDCouplingFieldDouble_applyFunc2_2]
field.setMesh( mesh )
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
varNames=["a","b"] # names used to refer to X and Y coord components
- field.fillFromAnalytic3(3,varNames,func)
+ field.fillFromAnalyticNamedCompo(3,varNames,func)
#! [PySnippet_MEDCouplingFieldDouble_fillFromAnalytic3_2]
#! [PySnippet_MEDCouplingFieldDouble_fillFromAnalytic3_3]
vals1 = field.getArray().getTuple(1) # values of the cell #1
assert len( vals1 ) == 3 # 3 components in the field
#
- bc = mesh.getBarycenterAndOwner() # func is applied to barycenters of cells
+ bc = mesh.computeCellCenterOfMass() # func is applied to barycenters of cells
bc1 = bc.getTuple(1) # coordinates of the second point
#
dist = sqrt( bc1[0]*bc1[0] + bc1[1]*bc1[1] ) # "sqrt( a*a + b*b )"
field = MEDCouplingFieldDouble( ON_CELLS )
field.setMesh( mesh )
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
- field.fillFromAnalytic2(3,func)
+ field.fillFromAnalyticCompo(3,func)
#! [PySnippet_MEDCouplingFieldDouble_fillFromAnalytic2_2]
#! [PySnippet_MEDCouplingFieldDouble_fillFromAnalytic2_3]
vals1 = field.getArray().getTuple(1) # values of the cell #1
assert len( vals1 ) == 3 # 3 components in the field
#
- bc = mesh.getBarycenterAndOwner() # func is applied to barycenters of cells
+ bc = mesh.computeCellCenterOfMass() # func is applied to barycenters of cells
bc1 = bc.getTuple(1) # coordinates of the second point
#
dist = sqrt( bc1[0]*bc1[0] + bc1[1]*bc1[1] ) # "sqrt( a*a + b*b )"
vals1 = field.getArray().getTuple(1) # values of the cell #1
assert len( vals1 ) == 3 # 3 components in the field
#
- bc = mesh.getBarycenterAndOwner() # func is applied to barycenters of cells
+ bc = mesh.computeCellCenterOfMass() # func is applied to barycenters of cells
bc1 = bc.getTuple(1) # coordinates of the second point
#
dist = sqrt( bc1[0]*bc1[0] + bc1[1]*bc1[1] ) # "sqrt( a*a + b*b )"
field = mesh.fillFromAnalytic(ON_CELLS,1,"x+y")
#! [PySnippet_MEDCouplingFieldDouble_getValueOnMulti_1]
#! [PySnippet_MEDCouplingFieldDouble_getValueOnMulti_2]
- bc = mesh.getBarycenterAndOwner() # field values are located at cell barycenters
+ bc = mesh.computeCellCenterOfMass() # field values are located at cell barycenters
valArray = field.getValueOnMulti( bc )
self.assertTrue( valArray.isEqual( field.getArray(), 1e-13 ))
#! [PySnippet_MEDCouplingFieldDouble_getValueOnMulti_2]
field = mesh.fillFromAnalytic(ON_CELLS,1,"x+y")
#! [PySnippet_MEDCouplingFieldDouble_getValueOn_1]
#! [PySnippet_MEDCouplingFieldDouble_getValueOn_2]
- bc = mesh.getBarycenterAndOwner() # field values are located at cell barycenters
+ bc = mesh.computeCellCenterOfMass() # field values are located at cell barycenters
vals = [] # array to collect values returned by getValueOn()
for i,tupl in enumerate( bc ):
vals.extend( field.getValueOn( tupl ) )
#! [PySnippet_MEDCouplingFieldDouble_getValueOnPos_1]
#! [PySnippet_MEDCouplingFieldDouble_getValueOnPos_2]
val11 = field.getValueOnPos( 1,1,-1)
- bc = mesh.getBarycenterAndOwner() # field values are located at cell barycenters
+ bc = mesh.computeCellCenterOfMass() # field values are located at cell barycenters
self.assertTrue( val11[0] == bc[3,0] + bc[3,1] )
#! [PySnippet_MEDCouplingFieldDouble_getValueOnPos_2]
return
#! [PySnippet_MEDCouplingFieldDouble_renumberCells_2]
field = mesh.fillFromAnalytic(ON_CELLS,2,"IVec*x+JVec*y")
values = field.getArray()
- bc = mesh.getBarycenterAndOwner()
+ bc = mesh.computeCellCenterOfMass()
self.assertTrue( values.isEqualWithoutConsideringStr( bc, 1e-13 ))
#! [PySnippet_MEDCouplingFieldDouble_renumberCells_2]
#! [PySnippet_MEDCouplingFieldDouble_renumberCells_3]
field.renumberCells(renumber,False)
mesh2 = field.getMesh() # field now refers to another mesh
values = field.getArray()
- bc = mesh2.getBarycenterAndOwner()
+ bc = mesh2.computeCellCenterOfMass()
self.assertTrue( values.isEqualWithoutConsideringStr( bc, 1e-13 ))
#! [PySnippet_MEDCouplingFieldDouble_renumberCells_3]
return
#! [PySnippet_MEDCouplingMesh_fillFromAnalytic3_2]
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
varNames=["a","b"] # names used to refer to X and Y coord components
- field=mesh.fillFromAnalytic3(ON_CELLS,3,varNames,func)
+ field=mesh.fillFromAnalyticNamedCompo(ON_CELLS,3,varNames,func)
#! [PySnippet_MEDCouplingMesh_fillFromAnalytic3_2]
#! [PySnippet_MEDCouplingMesh_fillFromAnalytic3_3]
vals1 = field.getArray().getTuple(1) # values of the cell #1
assert len( vals1 ) == 3 # 3 components in the field
#
- bc = mesh.getBarycenterAndOwner() # func is applied to barycenters of cells
+ bc = mesh.computeCellCenterOfMass() # func is applied to barycenters of cells
bc1 = bc.getTuple(1) # coordinates of the second point
#
dist = sqrt( bc1[0]*bc1[0] + bc1[1]*bc1[1] ) # "sqrt( a*a + b*b )"
#! [PySnippet_MEDCouplingMesh_fillFromAnalytic2_1]
#! [PySnippet_MEDCouplingMesh_fillFromAnalytic2_2]
func = "IVec * b + JVec * a + KVec * sqrt( a*a + b*b ) + 10"
- field=mesh.fillFromAnalytic2(ON_CELLS,3,func)
+ field=mesh.fillFromAnalyticCompo(ON_CELLS,3,func)
#! [PySnippet_MEDCouplingMesh_fillFromAnalytic2_2]
#! [PySnippet_MEDCouplingMesh_fillFromAnalytic2_3]
vals1 = field.getArray().getTuple(1) # values of the cell #1
assert len( vals1 ) == 3 # 3 components in the field
#
- bc = mesh.getBarycenterAndOwner() # func is applied to barycenters of cells
+ bc = mesh.computeCellCenterOfMass() # func is applied to barycenters of cells
bc1 = bc.getTuple(1) # coordinates of the second point
#
dist = sqrt( bc1[0]*bc1[0] + bc1[1]*bc1[1] ) # "sqrt( a*a + b*b )"
vals1 = field.getArray().getTuple(1) # values of the cell #1
assert len( vals1 ) == 3 # 3 components in the field
#
- bc = mesh.getBarycenterAndOwner() # func is applied to barycenters of cells
+ bc = mesh.computeCellCenterOfMass() # func is applied to barycenters of cells
bc1 = bc.getTuple(1) # coordinates of the second point
#
dist = sqrt( bc1[0]*bc1[0] + bc1[1]*bc1[1] ) # "sqrt( a*a + b*b )"
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2]
coordsArr=DataArrayDouble(coords,5,2)
# coordinates of 5 top nodes
- coordsArr2 = coordsArr.deepCpy()
+ coordsArr2 = coordsArr.deepCopy()
# 3D coordinates of base + top nodes
coordsArr = coordsArr.changeNbOfComponents( 3, 0 )
coordsArr2 = coordsArr2.changeNbOfComponents( 3, 1 )
coords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2]
coordsArr=DataArrayDouble(coords,5,2)
# coordinates of 5 top nodes
- coordsArr2 = coordsArr.deepCpy()
+ coordsArr2 = coordsArr.deepCopy()
# 3D coordinates of base + top nodes
coordsArr = coordsArr.changeNbOfComponents( 3, 0 )
coordsArr2 = coordsArr2.changeNbOfComponents( 3, 1 )
#! [PySnippet_MEDCouplingUMesh_renumberNodes_2]
#! [PySnippet_MEDCouplingUMesh_renumberNodes_3]
coordsArr.setValues(coords,4,2) # restore old nodes
- mesh.renumberNodes2([ 2,1,0,2 ], 3)
+ mesh.renumberNodesCenter([ 2,1,0,2 ], 3)
coordsArr = mesh.getCoords() # get a shorten array
assert coordsArr.getValues() == [0.7,-0.3, 0.2,-0.3, -0.3,0.0]
#! [PySnippet_MEDCouplingUMesh_renumberNodes_3]
# restore coordinates
coordsArr = DataArrayDouble(coords,6,2)
mesh.setCoords(coordsArr)
- # call mergeNodes2()
- mesh.mergeNodes2(0.004)
+ # call mergeNodesCenter()
+ mesh.mergeNodesCenter(0.004)
coordsArr = mesh.getCoords() # retrieve a new shorten coord array
self.assertAlmostEqual( baryCoords2[1], coordsArr.getIJ(0,1), 13 ) # Y of node #0 equals to that of baryCoords2
#! [PySnippet_MEDCouplingUMesh_mergeNodes_3]
coordsArr=DataArrayDouble(coords,4,2)
mesh=MEDCouplingUMesh()
mesh.setCoords(coordsArr)
- initCoords = coordsArr.deepCpy()
+ initCoords = coordsArr.deepCopy()
#! [PySnippet_MEDCouplingPointSet_scale_1]
#! [PySnippet_MEDCouplingPointSet_scale_2]
center = [0.,0.]
coordsArr=DataArrayDouble(coords,4,2)
mesh=MEDCouplingUMesh()
mesh.setCoords(coordsArr)
- initCoords = coordsArr.deepCpy()
+ initCoords = coordsArr.deepCopy()
#! [PySnippet_MEDCouplingPointSet_translate_1]
#! [PySnippet_MEDCouplingPointSet_translate_2]
vector = [1.,1.]
da=DataArrayDouble()
da.alloc( 10, 1 )
da[ :, :] = range(10)
- da2 = da.getIdsInRange( 2.5, 6 )
+ da2 = da.findIdsInRange( 2.5, 6 )
#! [PySnippet_DataArrayDouble_getIdsInRange_1]
return
da.setPartOfValues1( dv, 0,3,2, 1,4,2, True )
#! [Snippet_DataArrayDouble_setPartOfValues1_5]
#! [Snippet_DataArrayDouble_setPartOfValues1_6]
- da2 = da.deepCpy()
+ da2 = da.deepCopy()
da2.fillWithZero()
da2[ 0:3:2, 1:4:2 ] = dv
self.assertTrue( da.isEqual( da2, 1e-20 ))
da.setPartOfValues1( dv, 0,3,2, 1,4,2, True )
#! [Snippet_DataArrayInt_setPartOfValues1_5]
#! [Snippet_DataArrayInt_setPartOfValues1_6]
- da2 = da.deepCpy()
+ da2 = da.deepCopy()
da2.fillWithZero()
da2[ 0:3:2, 1:4:2 ] = dv
self.assertTrue( da.isEqual( da2 ))
da.setPartOfValuesSimple1( dv, 0,3,2, 1,4,2 )
#! [Snippet_DataArrayDouble_setPartOfValuesSimple1_5]
#! [Snippet_DataArrayDouble_setPartOfValuesSimple1_6]
- da2 = da.deepCpy()
+ da2 = da.deepCopy()
da2.fillWithZero()
da2[ 0:3:2, 1:4:2 ] = dv
self.assertTrue( da.isEqual( da2, 1e-20 ))
da.setPartOfValuesSimple1( dv, 0,3,2, 1,4,2 )
#! [Snippet_DataArrayInt_setPartOfValuesSimple1_5]
#! [Snippet_DataArrayInt_setPartOfValuesSimple1_6]
- da2 = da.deepCpy()
+ da2 = da.deepCopy()
da2.fillWithZero()
da2[ 0:3:2, 1:4:2 ] = dv
self.assertTrue( da.isEqual( da2 ))
dv.alloc( 4, 4 )
dv.fillWithZero()
dv.setInfoOnComponents( ["v1","v2","v3","v4"])
- dv2 = dv.deepCpy()
+ dv2 = dv.deepCopy()
dv.setSelectedComponents( da, [1,0] )
#! [Snippet_DataArrayDouble_setSelectedComponents2]
#! [Snippet_DataArrayDouble_setSelectedComponents3]
dv.alloc( 4, 4 )
dv.fillWithZero()
dv.setInfoOnComponents( ["v1","v2","v3","v4"])
- dv2 = dv.deepCpy()
+ dv2 = dv.deepCopy()
dv.setSelectedComponents( da, [1,0] )
#! [Snippet_DataArrayInt_setSelectedComponents2]
#! [Snippet_DataArrayInt_setSelectedComponents3]
da3.setInfoOnComponent(1,"c1da3")
da3.setInfoOnComponent(2,"c2da3")
#
- da1C=da1.deepCpy()
+ da1C=da1.deepCopy()
da1.meldWith(da3)
#! [PySnippet_DataArrayDouble_Meld1_1]
self.assertEqual(2,f2.getMesh().getSpaceDimension())
self.assertEqual(2,f2.getMesh().getMeshDimension())
m2C=f2.getMesh()
- self.assertEqual(13,m2C.getMeshLength())
+ self.assertEqual(13,m2C.getNodalConnectivityArrayLen())
expected2=[0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7]
for i in xrange(12):
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12)
self.assertEqual(2,f2.getMesh().getSpaceDimension())
self.assertEqual(2,f2.getMesh().getMeshDimension())
m2C=f2.getMesh()
- self.assertEqual(8,m2C.getMeshLength())
+ self.assertEqual(8,m2C.getNodalConnectivityArrayLen())
for i in xrange(8):#8 is not an error
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12)
pass
self.assertEqual(2,f2.getMesh().getSpaceDimension())
self.assertEqual(2,f2.getMesh().getMeshDimension())
m2C=f2.getMesh()
- self.assertEqual(8,m2C.getMeshLength())
+ self.assertEqual(8,m2C.getNodalConnectivityArrayLen())
for i in xrange(8):#8 is not an error
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12)
pass
self.assertEqual(2,f2.getMesh().getSpaceDimension())
self.assertEqual(2,f2.getMesh().getMeshDimension())
m2C=f2.getMesh()
- self.assertEqual(13,m2C.getMeshLength())
+ self.assertEqual(13,m2C.getNodalConnectivityArrayLen())
for i in xrange(12):
self.assertAlmostEqual(expected2[i],m2C.getCoords().getIJ(0,i),12)
pass
# ! [PySnippetUMeshStdBuild1_4]
# ! [PySnippetUMeshStdBuild1_5]
# ! [PySnippetUMeshStdBuild1_5]
- mesh.checkCoherency()
+ mesh.checkConsistencyLight()
return
def testExampleCMeshStdBuild1(self):
# ! [PySnippetUMeshAdvBuild1_4]
# ! [PySnippetUMeshAdvBuild1_5]
# ! [PySnippetUMeshAdvBuild1_5]
- mesh.checkCoherency()
+ mesh.checkConsistencyLight()
return
def testExampleDataArrayBuild1(self):
ddd.setInfoOnComponents(["Y [m]","AA [m/s]","GG [MW]"])
# ! [PySnippetDataArrayApplyFunc1_7]
# ! [PySnippetDataArrayApplyFunc1_8]
- ddd1=ddd.applyFunc2(1,"Y+GG")
+ ddd1=ddd.applyFuncCompo(1,"Y+GG")
self.assertTrue(ddd1.isEqual(DataArrayDouble([4.,24.,44.,64.],4,1),1e-12))
# ! [PySnippetDataArrayApplyFunc1_8]
# ! [PySnippetDataArrayApplyFunc1_9]
- ddd1=ddd.applyFunc3(1,["X","Y","Z"],"X+Z")
+ ddd1=ddd.applyFuncNamedCompo(1,["X","Y","Z"],"X+Z")
self.assertTrue(ddd1.isEqual(DataArrayDouble([4.,24.,44.,64.],4,1),1e-12))
# ! [PySnippetDataArrayApplyFunc1_9]
return
//
// Author : Anthony Geay (CEA/DEN)
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::New;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::deepCpy;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clone;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePartRange;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getOffsetArr;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getMeasureField;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::clonePart;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::getValueOnMulti;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
-%newobject ParaMEDMEM::MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::New;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::deepCopy;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::clone;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::clonePartRange;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::getOffsetArr;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::getLocalizationOfDiscValues;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::getMeasureField;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::clonePart;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::getValueOnMulti;
+%newobject MEDCoupling::MEDCouplingFieldDiscretization::computeTupleIdsToSelectFromCellIds;
+%newobject MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingFieldDiscretization : public RefCountObject, public TimeLabel
{
virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const throw(INTERP_KERNEL::Exception);
virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const throw(INTERP_KERNEL::Exception);
virtual bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingFieldDiscretization *deepCpy() const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingFieldDiscretization *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDiscretization *clone() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingFieldDiscretization *clonePartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception);
virtual std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
PyObject *res=PyTuple_New(2);
PyTuple_SetItem(res,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
if(ret1)
- PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
else
{
PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
std::vector<int> inp0;
convertPyToNewIntArr4(code,1,3,inp0);
std::vector<const DataArrayInt *> inp1;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(idsPerType,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",inp1);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(idsPerType,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",inp1);
return self->getNumberOfTuplesExpectedRegardingCode(inp0,inp1);
}
DataArrayInt *ret0=0,*ret1=0;
self->computeMeshRestrictionFromTupleIds(mesh,tupleIdsBg,tupleIdsBg+sz,ret0,ret1);
PyObject *pyRet=PyTuple_New(2);
- PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return pyRet;
}
DataArrayInt *ret=DataArrayInt::New();
ret->alloc((int)tmp.size(),1);
std::copy(tmp.begin(),tmp.end(),ret->getPointer());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
virtual void setGaussLocalizationOnCells(const MEDCouplingMesh *m, PyObject *li, const std::vector<double>& refCoo,
const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
throw INTERP_KERNEL::Exception("Python wrap MEDCouplingFieldDiscretization::getValueOnMulti : null input mesh !");
//
int sw,nbPts;
- double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
+ double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
const double *inp=convertObjToPossibleCpp5_Safe2(loc,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
mesh->getSpaceDimension(),true,nbPts);
return self->getValueOnMulti(arr,mesh,inp,nbPts);
PyObject *old2New, bool check) throw(INTERP_KERNEL::Exception)
{
std::vector<DataArray *> input1;
- convertFromPyObjVectorOfObj<ParaMEDMEM::DataArray *>(arrays,SWIGTYPE_p_ParaMEDMEM__DataArray,"DataArray",input1);
+ convertFromPyObjVectorOfObj<MEDCoupling::DataArray *>(arrays,SWIGTYPE_p_MEDCoupling__DataArray,"DataArray",input1);
//
int sw,sz(-1);
int v0; std::vector<int> v1;
MEDCouplingMesh *ret0=self->buildSubMeshData(mesh,idsBg,idsBg+sz,di);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,convertMesh(ret0, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(di),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(di),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret=const_cast<DataArrayInt *>(self->getArrayOfDiscIds());
if(ret)
ret->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *splitIntoSingleGaussDicrPerCellType() const throw(INTERP_KERNEL::Exception)
PyObject *pyRet1=PyList_New((int)sz);
for(std::size_t i=0;i<sz;i++)
{
- PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
}
PyTuple_SetItem(pyRet,0,pyRet0);
int ret1;
DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
return ret;
}
int ret1(-1),ret2(-1);
DataArrayDouble *ret0=self->computeInverseMatrix(mesh,ret1,ret2);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
return ret;
int ret1(-1),ret2(-1);
DataArrayDouble *ret0=self->computeMatrix(mesh,ret1,ret2);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
return ret;
if(!mesh)
throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts : input mesh is empty !");
int sw,nbPts;
- double v0; ParaMEDMEM::DataArrayDouble *v1(0); ParaMEDMEM::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
+ double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDiscretizationKriging::computeEvaluationMatrixOnGivenPts",
mesh->getSpaceDimension(),true,nbPts);
//
int ret1(-1);
DataArrayDouble *ret0=self->computeEvaluationMatrixOnGivenPts(mesh,inp,nbPts,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
return ret;
}
int ret1(-1);
DataArrayDouble *ret0(self->performDrift(matr,arr,ret1));
PyObject *res(PyTuple_New(2));
- PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
return res;
}
int ret1(-1);
DataArrayDouble *ret0(MEDCouplingFieldDiscretizationKriging::PerformDriftRect(matr,arr,ret1));
PyObject *res(PyTuple_New(2));
- PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
return res;
}
%pythoncode %{
InterpKernelException.__reduce__=INTERPKERNELExceptionReduce
-DataArrayDouble.__new__=classmethod(ParaMEDMEMDataArrayDoublenew)
-DataArrayDouble.__iadd__=ParaMEDMEMDataArrayDoubleIadd
-DataArrayDouble.__isub__=ParaMEDMEMDataArrayDoubleIsub
-DataArrayDouble.__imul__=ParaMEDMEMDataArrayDoubleImul
-DataArrayDouble.__idiv__=ParaMEDMEMDataArrayDoubleIdiv
-DataArrayDouble.__ipow__=ParaMEDMEMDataArrayDoubleIpow
+DataArrayDouble.__new__=classmethod(MEDCouplingDataArrayDoublenew)
+DataArrayDouble.__iadd__=MEDCouplingDataArrayDoubleIadd
+DataArrayDouble.__isub__=MEDCouplingDataArrayDoubleIsub
+DataArrayDouble.__imul__=MEDCouplingDataArrayDoubleImul
+DataArrayDouble.__idiv__=MEDCouplingDataArrayDoubleIdiv
+DataArrayDouble.__ipow__=MEDCouplingDataArrayDoubleIpow
-DataArrayInt.__new__=classmethod(ParaMEDMEMDataArrayIntnew)
-DataArrayInt.__iadd__=ParaMEDMEMDataArrayIntIadd
-DataArrayInt.__isub__=ParaMEDMEMDataArrayIntIsub
-DataArrayInt.__imul__=ParaMEDMEMDataArrayIntImul
-DataArrayInt.__idiv__=ParaMEDMEMDataArrayIntIdiv
-DataArrayInt.__imod__=ParaMEDMEMDataArrayIntImod
-DataArrayInt.__ipow__=ParaMEDMEMDataArrayIntIpow
+DataArrayInt.__new__=classmethod(MEDCouplingDataArrayIntnew)
+DataArrayInt.__iadd__=MEDCouplingDataArrayIntIadd
+DataArrayInt.__isub__=MEDCouplingDataArrayIntIsub
+DataArrayInt.__imul__=MEDCouplingDataArrayIntImul
+DataArrayInt.__idiv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt.__imod__=MEDCouplingDataArrayIntImod
+DataArrayInt.__ipow__=MEDCouplingDataArrayIntIpow
-MEDCouplingFieldDouble.__iadd__=ParaMEDMEMMEDCouplingFieldDoubleIadd
-MEDCouplingFieldDouble.__isub__=ParaMEDMEMMEDCouplingFieldDoubleIsub
-MEDCouplingFieldDouble.__imul__=ParaMEDMEMMEDCouplingFieldDoubleImul
-MEDCouplingFieldDouble.__idiv__=ParaMEDMEMMEDCouplingFieldDoubleIdiv
-MEDCouplingFieldDouble.__ipow__=ParaMEDMEMMEDCouplingFieldDoubleIpow
+MEDCouplingFieldDouble.__iadd__=MEDCouplingFieldDoubleIadd
+MEDCouplingFieldDouble.__isub__=MEDCouplingFieldDoubleIsub
+MEDCouplingFieldDouble.__imul__=MEDCouplingFieldDoubleImul
+MEDCouplingFieldDouble.__idiv__=MEDCouplingFieldDoubleIdiv
+MEDCouplingFieldDouble.__ipow__=MEDCouplingFieldDoubleIpow
-DataArrayDoubleTuple.__iadd__=ParaMEDMEMDataArrayDoubleTupleIadd
-DataArrayDoubleTuple.__isub__=ParaMEDMEMDataArrayDoubleTupleIsub
-DataArrayDoubleTuple.__imul__=ParaMEDMEMDataArrayDoubleTupleImul
-DataArrayDoubleTuple.__idiv__=ParaMEDMEMDataArrayDoubleTupleIdiv
+DataArrayDoubleTuple.__iadd__=MEDCouplingDataArrayDoubleTupleIadd
+DataArrayDoubleTuple.__isub__=MEDCouplingDataArrayDoubleTupleIsub
+DataArrayDoubleTuple.__imul__=MEDCouplingDataArrayDoubleTupleImul
+DataArrayDoubleTuple.__idiv__=MEDCouplingDataArrayDoubleTupleIdiv
-DataArrayIntTuple.__iadd__=ParaMEDMEMDataArrayIntTupleIadd
-DataArrayIntTuple.__isub__=ParaMEDMEMDataArrayIntTupleIsub
-DataArrayIntTuple.__imul__=ParaMEDMEMDataArrayIntTupleImul
-DataArrayIntTuple.__idiv__=ParaMEDMEMDataArrayIntTupleIdiv
-DataArrayIntTuple.__imod__=ParaMEDMEMDataArrayIntTupleImod
+DataArrayIntTuple.__iadd__=MEDCouplingDataArrayIntTupleIadd
+DataArrayIntTuple.__isub__=MEDCouplingDataArrayIntTupleIsub
+DataArrayIntTuple.__imul__=MEDCouplingDataArrayIntTupleImul
+DataArrayIntTuple.__idiv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayIntTuple.__imod__=MEDCouplingDataArrayIntTupleImod
DenseMatrix.__iadd__=ParaMEDMEMDenseMatrixIadd
DenseMatrix.__isub__=ParaMEDMEMDenseMatrixIsub
-MEDCouplingUMesh.__new__=classmethod(ParaMEDMEMMEDCouplingUMeshnew)
-MEDCoupling1DGTUMesh.__new__=classmethod(ParaMEDMEMMEDCoupling1DGTUMeshnew)
-MEDCoupling1SGTUMesh.__new__=classmethod(ParaMEDMEMMEDCoupling1SGTUMeshnew)
-MEDCouplingCurveLinearMesh.__new__=classmethod(ParaMEDMEMMEDCouplingCurveLinearMeshnew)
-MEDCouplingCMesh.__new__=classmethod(ParaMEDMEMMEDCouplingCMeshnew)
-MEDCouplingIMesh.__new__=classmethod(ParaMEDMEMMEDCouplingIMeshnew)
-MEDCouplingExtrudedMesh.__new__=classmethod(ParaMEDMEMMEDCouplingExtrudedMeshnew)
-MEDCouplingFieldDouble.__new__=classmethod(ParaMEDMEMMEDCouplingFieldDoublenew)
+MEDCouplingUMesh.__new__=classmethod(MEDCouplingUMeshnew)
+MEDCoupling1DGTUMesh.__new__=classmethod(MEDCoupling1DGTUMeshnew)
+MEDCoupling1SGTUMesh.__new__=classmethod(MEDCoupling1SGTUMeshnew)
+MEDCouplingCurveLinearMesh.__new__=classmethod(MEDCouplingCurveLinearMeshnew)
+MEDCouplingCMesh.__new__=classmethod(MEDCouplingCMeshnew)
+MEDCouplingIMesh.__new__=classmethod(MEDCouplingIMeshnew)
+MEDCouplingMappedExtrudedMesh.__new__=classmethod(MEDCouplingExtrudedMeshnew)
+MEDCouplingFieldDouble.__new__=classmethod(MEDCouplingFieldDoublenew)
del INTERPKERNELExceptionReduce
-del ParaMEDMEMDataArrayDoublenew
-del ParaMEDMEMDataArrayDoubleIadd
-del ParaMEDMEMDataArrayDoubleIsub
-del ParaMEDMEMDataArrayDoubleImul
-del ParaMEDMEMDataArrayDoubleIdiv
-del ParaMEDMEMMEDCouplingFieldDoubleIadd
-del ParaMEDMEMMEDCouplingFieldDoubleIsub
-del ParaMEDMEMMEDCouplingFieldDoubleImul
-del ParaMEDMEMMEDCouplingFieldDoubleIdiv
-del ParaMEDMEMMEDCouplingFieldDoubleIpow
-del ParaMEDMEMDataArrayIntnew
-del ParaMEDMEMDataArrayIntIadd
-del ParaMEDMEMDataArrayIntIsub
-del ParaMEDMEMDataArrayIntImul
-del ParaMEDMEMDataArrayIntIdiv
-del ParaMEDMEMDataArrayIntImod
-del ParaMEDMEMDataArrayDoubleTupleIadd
-del ParaMEDMEMDataArrayDoubleTupleIsub
-del ParaMEDMEMDataArrayDoubleTupleImul
-del ParaMEDMEMDataArrayDoubleTupleIdiv
-del ParaMEDMEMDataArrayIntTupleIadd
-del ParaMEDMEMDataArrayIntTupleIsub
-del ParaMEDMEMDataArrayIntTupleImul
-del ParaMEDMEMDataArrayIntTupleIdiv
-del ParaMEDMEMDataArrayIntTupleImod
+del MEDCouplingDataArrayDoublenew
+del MEDCouplingDataArrayDoubleIadd
+del MEDCouplingDataArrayDoubleIsub
+del MEDCouplingDataArrayDoubleImul
+del MEDCouplingDataArrayDoubleIdiv
+del MEDCouplingFieldDoubleIadd
+del MEDCouplingFieldDoubleIsub
+del MEDCouplingFieldDoubleImul
+del MEDCouplingFieldDoubleIdiv
+del MEDCouplingFieldDoubleIpow
+del MEDCouplingDataArrayIntnew
+del MEDCouplingDataArrayIntIadd
+del MEDCouplingDataArrayIntIsub
+del MEDCouplingDataArrayIntImul
+del MEDCouplingDataArrayIntIdiv
+del MEDCouplingDataArrayIntImod
+del MEDCouplingDataArrayDoubleTupleIadd
+del MEDCouplingDataArrayDoubleTupleIsub
+del MEDCouplingDataArrayDoubleTupleImul
+del MEDCouplingDataArrayDoubleTupleIdiv
+del MEDCouplingDataArrayIntTupleIadd
+del MEDCouplingDataArrayIntTupleIsub
+del MEDCouplingDataArrayIntTupleImul
+del MEDCouplingDataArrayIntTupleIdiv
+del MEDCouplingDataArrayIntTupleImod
del ParaMEDMEMDenseMatrixIadd
del ParaMEDMEMDenseMatrixIsub
-del ParaMEDMEMMEDCouplingUMeshnew
-del ParaMEDMEMMEDCoupling1DGTUMeshnew
-del ParaMEDMEMMEDCoupling1SGTUMeshnew
-del ParaMEDMEMMEDCouplingCurveLinearMeshnew
-del ParaMEDMEMMEDCouplingCMeshnew
-del ParaMEDMEMMEDCouplingIMeshnew
-del ParaMEDMEMMEDCouplingExtrudedMeshnew
-del ParaMEDMEMMEDCouplingFieldDoublenew
+del MEDCouplingUMeshnew
+del MEDCoupling1DGTUMeshnew
+del MEDCoupling1SGTUMeshnew
+del MEDCouplingCurveLinearMeshnew
+del MEDCouplingCMeshnew
+del MEDCouplingIMeshnew
+del MEDCouplingExtrudedMeshnew
+del MEDCouplingFieldDoublenew
%}
// Author : Anthony Geay (CEA/DEN)
////////////////////
-%typemap(out) ParaMEDMEM::DataArray*
+%typemap(out) MEDCoupling::DataArray*
{
$result=convertDataArray($1,$owner);
}
//$$$$$$$$$$$$$$$$$$
////////////////////
-%typemap(out) ParaMEDMEM::DataArrayChar*
+%typemap(out) MEDCoupling::DataArrayChar*
{
$result=convertDataArrayChar($1,$owner);
}
}
//$$$$$$$$$$$$$$$$$$
-%newobject ParaMEDMEM::DataArray::deepCpy;
-%newobject ParaMEDMEM::DataArray::selectByTupleRanges;
-%newobject ParaMEDMEM::DataArray::selectByTupleId;
-%newobject ParaMEDMEM::DataArray::selectByTupleIdSafe;
-%newobject ParaMEDMEM::DataArray::selectByTupleId2;
-%newobject ParaMEDMEM::DataArray::Aggregate;
-%newobject ParaMEDMEM::DataArrayInt::New;
-%newobject ParaMEDMEM::DataArrayInt::__iter__;
-%newobject ParaMEDMEM::DataArrayInt::convertToDblArr;
-%newobject ParaMEDMEM::DataArrayInt::performCpy;
-%newobject ParaMEDMEM::DataArrayInt::substr;
-%newobject ParaMEDMEM::DataArrayInt::changeNbOfComponents;
-%newobject ParaMEDMEM::DataArrayInt::accumulatePerChunck;
-%newobject ParaMEDMEM::DataArrayInt::checkAndPreparePermutation;
-%newobject ParaMEDMEM::DataArrayInt::transformWithIndArrR;
-%newobject ParaMEDMEM::DataArrayInt::renumber;
-%newobject ParaMEDMEM::DataArrayInt::renumberR;
-%newobject ParaMEDMEM::DataArrayInt::renumberAndReduce;
-%newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2O;
-%newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N;
-%newobject ParaMEDMEM::DataArrayInt::invertArrayO2N2N2OBis;
-%newobject ParaMEDMEM::DataArrayInt::getIdsEqual;
-%newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
-%newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
-%newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
-%newobject ParaMEDMEM::DataArrayInt::getIdsEqualTuple;
-%newobject ParaMEDMEM::DataArrayInt::sumPerTuple;
-%newobject ParaMEDMEM::DataArrayInt::negate;
-%newobject ParaMEDMEM::DataArrayInt::computeAbs;
-%newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
-%newobject ParaMEDMEM::DataArrayInt::getIdsNotInRange;
-%newobject ParaMEDMEM::DataArrayInt::getIdsStrictlyNegative;
-%newobject ParaMEDMEM::DataArrayInt::Aggregate;
-%newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
-%newobject ParaMEDMEM::DataArrayInt::Meld;
-%newobject ParaMEDMEM::DataArrayInt::Add;
-%newobject ParaMEDMEM::DataArrayInt::Substract;
-%newobject ParaMEDMEM::DataArrayInt::Multiply;
-%newobject ParaMEDMEM::DataArrayInt::Divide;
-%newobject ParaMEDMEM::DataArrayInt::Pow;
-%newobject ParaMEDMEM::DataArrayInt::BuildUnion;
-%newobject ParaMEDMEM::DataArrayInt::BuildIntersection;
-%newobject ParaMEDMEM::DataArrayInt::Range;
-%newobject ParaMEDMEM::DataArrayInt::fromNoInterlace;
-%newobject ParaMEDMEM::DataArrayInt::toNoInterlace;
-%newobject ParaMEDMEM::DataArrayInt::buildComplement;
-%newobject ParaMEDMEM::DataArrayInt::buildUnion;
-%newobject ParaMEDMEM::DataArrayInt::buildSubstraction;
-%newobject ParaMEDMEM::DataArrayInt::buildSubstractionOptimized;
-%newobject ParaMEDMEM::DataArrayInt::buildIntersection;
-%newobject ParaMEDMEM::DataArrayInt::buildUnique;
-%newobject ParaMEDMEM::DataArrayInt::buildUniqueNotSorted;
-%newobject ParaMEDMEM::DataArrayInt::deltaShiftIndex;
-%newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
-%newobject ParaMEDMEM::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
-%newobject ParaMEDMEM::DataArrayInt::findRangeIdForEachTuple;
-%newobject ParaMEDMEM::DataArrayInt::findIdInRangeForEachTuple;
-%newobject ParaMEDMEM::DataArrayInt::duplicateEachTupleNTimes;
-%newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
-%newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
-%newobject ParaMEDMEM::DataArrayInt::getDifferentValues;
-%newobject ParaMEDMEM::DataArrayInt::FindPermutationFromFirstToSecond;
-%newobject ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation;
-%newobject ParaMEDMEM::DataArrayInt::__neg__;
-%newobject ParaMEDMEM::DataArrayInt::__add__;
-%newobject ParaMEDMEM::DataArrayInt::__radd__;
-%newobject ParaMEDMEM::DataArrayInt::__sub__;
-%newobject ParaMEDMEM::DataArrayInt::__rsub__;
-%newobject ParaMEDMEM::DataArrayInt::__mul__;
-%newobject ParaMEDMEM::DataArrayInt::__rmul__;
-%newobject ParaMEDMEM::DataArrayInt::__div__;
-%newobject ParaMEDMEM::DataArrayInt::__rdiv__;
-%newobject ParaMEDMEM::DataArrayInt::__mod__;
-%newobject ParaMEDMEM::DataArrayInt::__rmod__;
-%newobject ParaMEDMEM::DataArrayInt::__pow__;
-%newobject ParaMEDMEM::DataArrayInt::__rpow__;
-%newobject ParaMEDMEM::DataArrayIntTuple::buildDAInt;
-%newobject ParaMEDMEM::DataArrayChar::convertToIntArr;
-%newobject ParaMEDMEM::DataArrayChar::renumber;
-%newobject ParaMEDMEM::DataArrayChar::renumberR;
-%newobject ParaMEDMEM::DataArrayChar::renumberAndReduce;
-%newobject ParaMEDMEM::DataArrayChar::changeNbOfComponents;
-%newobject ParaMEDMEM::DataArrayChar::getIdsEqual;
-%newobject ParaMEDMEM::DataArrayChar::getIdsNotEqual;
-%newobject ParaMEDMEM::DataArrayChar::Aggregate;
-%newobject ParaMEDMEM::DataArrayChar::Meld;
-%newobject ParaMEDMEM::DataArrayByte::New;
-%newobject ParaMEDMEM::DataArrayByte::__iter__;
-%newobject ParaMEDMEM::DataArrayByte::performCpy;
-%newobject ParaMEDMEM::DataArrayByteTuple::buildDAByte;
-%newobject ParaMEDMEM::DataArrayChar::substr;
-%newobject ParaMEDMEM::DataArrayAsciiChar::New;
-%newobject ParaMEDMEM::DataArrayAsciiChar::__iter__;
-%newobject ParaMEDMEM::DataArrayAsciiChar::performCpy;
-%newobject ParaMEDMEM::DataArrayAsciiCharTuple::buildDAAsciiChar;
-%newobject ParaMEDMEM::DataArrayDouble::New;
-%newobject ParaMEDMEM::DataArrayDouble::__iter__;
-%newobject ParaMEDMEM::DataArrayDouble::convertToIntArr;
-%newobject ParaMEDMEM::DataArrayDouble::performCpy;
-%newobject ParaMEDMEM::DataArrayDouble::Aggregate;
-%newobject ParaMEDMEM::DataArrayDouble::Meld;
-%newobject ParaMEDMEM::DataArrayDouble::Dot;
-%newobject ParaMEDMEM::DataArrayDouble::CrossProduct;
-%newobject ParaMEDMEM::DataArrayDouble::Add;
-%newobject ParaMEDMEM::DataArrayDouble::Substract;
-%newobject ParaMEDMEM::DataArrayDouble::Multiply;
-%newobject ParaMEDMEM::DataArrayDouble::Divide;
-%newobject ParaMEDMEM::DataArrayDouble::Pow;
-%newobject ParaMEDMEM::DataArrayDouble::substr;
-%newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents;
-%newobject ParaMEDMEM::DataArrayDouble::accumulatePerChunck;
-%newobject ParaMEDMEM::DataArrayDouble::getIdsInRange;
-%newobject ParaMEDMEM::DataArrayDouble::getIdsNotInRange;
-%newobject ParaMEDMEM::DataArrayDouble::negate;
-%newobject ParaMEDMEM::DataArrayDouble::computeAbs;
-%newobject ParaMEDMEM::DataArrayDouble::applyFunc;
-%newobject ParaMEDMEM::DataArrayDouble::applyFunc2;
-%newobject ParaMEDMEM::DataArrayDouble::applyFunc3;
-%newobject ParaMEDMEM::DataArrayDouble::doublyContractedProduct;
-%newobject ParaMEDMEM::DataArrayDouble::determinant;
-%newobject ParaMEDMEM::DataArrayDouble::eigenValues;
-%newobject ParaMEDMEM::DataArrayDouble::eigenVectors;
-%newobject ParaMEDMEM::DataArrayDouble::inverse;
-%newobject ParaMEDMEM::DataArrayDouble::trace;
-%newobject ParaMEDMEM::DataArrayDouble::deviator;
-%newobject ParaMEDMEM::DataArrayDouble::magnitude;
-%newobject ParaMEDMEM::DataArrayDouble::maxPerTuple;
-%newobject ParaMEDMEM::DataArrayDouble::sumPerTuple;
-%newobject ParaMEDMEM::DataArrayDouble::computeBBoxPerTuple;
-%newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
-%newobject ParaMEDMEM::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
-%newobject ParaMEDMEM::DataArrayDouble::renumber;
-%newobject ParaMEDMEM::DataArrayDouble::renumberR;
-%newobject ParaMEDMEM::DataArrayDouble::renumberAndReduce;
-%newobject ParaMEDMEM::DataArrayDouble::fromNoInterlace;
-%newobject ParaMEDMEM::DataArrayDouble::toNoInterlace;
-%newobject ParaMEDMEM::DataArrayDouble::fromPolarToCart;
-%newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
-%newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
-%newobject ParaMEDMEM::DataArrayDouble::cartesianize;
-%newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
-%newobject ParaMEDMEM::DataArrayDouble::findClosestTupleId;
-%newobject ParaMEDMEM::DataArrayDouble::computeNbOfInteractionsWith;
-%newobject ParaMEDMEM::DataArrayDouble::duplicateEachTupleNTimes;
-%newobject ParaMEDMEM::DataArrayDouble::__neg__;
-%newobject ParaMEDMEM::DataArrayDouble::__radd__;
-%newobject ParaMEDMEM::DataArrayDouble::__rsub__;
-%newobject ParaMEDMEM::DataArrayDouble::__rmul__;
-%newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
-%newobject ParaMEDMEM::DataArrayDouble::__pow__;
-%newobject ParaMEDMEM::DataArrayDouble::__rpow__;
-%newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
+%newobject MEDCoupling::DataArray::deepCopy;
+%newobject MEDCoupling::DataArray::selectByTupleRanges;
+%newobject MEDCoupling::DataArray::selectByTupleId;
+%newobject MEDCoupling::DataArray::selectByTupleIdSafe;
+%newobject MEDCoupling::DataArray::selectByTupleIdSafeSlice;
+%newobject MEDCoupling::DataArray::Aggregate;
+%newobject MEDCoupling::DataArrayInt::New;
+%newobject MEDCoupling::DataArrayInt::__iter__;
+%newobject MEDCoupling::DataArrayInt::convertToDblArr;
+%newobject MEDCoupling::DataArrayInt::performCopyOrIncrRef;
+%newobject MEDCoupling::DataArrayInt::subArray;
+%newobject MEDCoupling::DataArrayInt::changeNbOfComponents;
+%newobject MEDCoupling::DataArrayInt::accumulatePerChunck;
+%newobject MEDCoupling::DataArrayInt::checkAndPreparePermutation;
+%newobject MEDCoupling::DataArrayInt::transformWithIndArrR;
+%newobject MEDCoupling::DataArrayInt::renumber;
+%newobject MEDCoupling::DataArrayInt::renumberR;
+%newobject MEDCoupling::DataArrayInt::renumberAndReduce;
+%newobject MEDCoupling::DataArrayInt::invertArrayO2N2N2O;
+%newobject MEDCoupling::DataArrayInt::invertArrayN2O2O2N;
+%newobject MEDCoupling::DataArrayInt::invertArrayO2N2N2OBis;
+%newobject MEDCoupling::DataArrayInt::findIdsEqual;
+%newobject MEDCoupling::DataArrayInt::findIdsNotEqual;
+%newobject MEDCoupling::DataArrayInt::findIdsEqualList;
+%newobject MEDCoupling::DataArrayInt::findIdsNotEqualList;
+%newobject MEDCoupling::DataArrayInt::findIdsEqualTuple;
+%newobject MEDCoupling::DataArrayInt::sumPerTuple;
+%newobject MEDCoupling::DataArrayInt::negate;
+%newobject MEDCoupling::DataArrayInt::computeAbs;
+%newobject MEDCoupling::DataArrayInt::findIdsInRange;
+%newobject MEDCoupling::DataArrayInt::findIdsNotInRange;
+%newobject MEDCoupling::DataArrayInt::findIdsStricltyNegative;
+%newobject MEDCoupling::DataArrayInt::Aggregate;
+%newobject MEDCoupling::DataArrayInt::AggregateIndexes;
+%newobject MEDCoupling::DataArrayInt::Meld;
+%newobject MEDCoupling::DataArrayInt::Add;
+%newobject MEDCoupling::DataArrayInt::Substract;
+%newobject MEDCoupling::DataArrayInt::Multiply;
+%newobject MEDCoupling::DataArrayInt::Divide;
+%newobject MEDCoupling::DataArrayInt::Pow;
+%newobject MEDCoupling::DataArrayInt::BuildUnion;
+%newobject MEDCoupling::DataArrayInt::BuildIntersection;
+%newobject MEDCoupling::DataArrayInt::Range;
+%newobject MEDCoupling::DataArrayInt::fromNoInterlace;
+%newobject MEDCoupling::DataArrayInt::toNoInterlace;
+%newobject MEDCoupling::DataArrayInt::buildComplement;
+%newobject MEDCoupling::DataArrayInt::buildUnion;
+%newobject MEDCoupling::DataArrayInt::buildSubstraction;
+%newobject MEDCoupling::DataArrayInt::buildSubstractionOptimized;
+%newobject MEDCoupling::DataArrayInt::buildIntersection;
+%newobject MEDCoupling::DataArrayInt::buildUnique;
+%newobject MEDCoupling::DataArrayInt::buildUniqueNotSorted;
+%newobject MEDCoupling::DataArrayInt::deltaShiftIndex;
+%newobject MEDCoupling::DataArrayInt::buildExplicitArrByRanges;
+%newobject MEDCoupling::DataArrayInt::buildExplicitArrOfSliceOnScaledArr;
+%newobject MEDCoupling::DataArrayInt::findRangeIdForEachTuple;
+%newobject MEDCoupling::DataArrayInt::findIdInRangeForEachTuple;
+%newobject MEDCoupling::DataArrayInt::duplicateEachTupleNTimes;
+%newobject MEDCoupling::DataArrayInt::buildPermutationArr;
+%newobject MEDCoupling::DataArrayInt::buildPermArrPerLevel;
+%newobject MEDCoupling::DataArrayInt::getDifferentValues;
+%newobject MEDCoupling::DataArrayInt::FindPermutationFromFirstToSecond;
+%newobject MEDCoupling::DataArrayInt::CheckAndPreparePermutation;
+%newobject MEDCoupling::DataArrayInt::__neg__;
+%newobject MEDCoupling::DataArrayInt::__add__;
+%newobject MEDCoupling::DataArrayInt::__radd__;
+%newobject MEDCoupling::DataArrayInt::__sub__;
+%newobject MEDCoupling::DataArrayInt::__rsub__;
+%newobject MEDCoupling::DataArrayInt::__mul__;
+%newobject MEDCoupling::DataArrayInt::__rmul__;
+%newobject MEDCoupling::DataArrayInt::__div__;
+%newobject MEDCoupling::DataArrayInt::__rdiv__;
+%newobject MEDCoupling::DataArrayInt::__mod__;
+%newobject MEDCoupling::DataArrayInt::__rmod__;
+%newobject MEDCoupling::DataArrayInt::__pow__;
+%newobject MEDCoupling::DataArrayInt::__rpow__;
+%newobject MEDCoupling::DataArrayIntTuple::buildDAInt;
+%newobject MEDCoupling::DataArrayChar::convertToIntArr;
+%newobject MEDCoupling::DataArrayChar::renumber;
+%newobject MEDCoupling::DataArrayChar::renumberR;
+%newobject MEDCoupling::DataArrayChar::renumberAndReduce;
+%newobject MEDCoupling::DataArrayChar::changeNbOfComponents;
+%newobject MEDCoupling::DataArrayChar::findIdsEqual;
+%newobject MEDCoupling::DataArrayChar::findIdsNotEqual;
+%newobject MEDCoupling::DataArrayChar::Aggregate;
+%newobject MEDCoupling::DataArrayChar::Meld;
+%newobject MEDCoupling::DataArrayByte::New;
+%newobject MEDCoupling::DataArrayByte::__iter__;
+%newobject MEDCoupling::DataArrayByte::performCopyOrIncrRef;
+%newobject MEDCoupling::DataArrayByteTuple::buildDAByte;
+%newobject MEDCoupling::DataArrayChar::subArray;
+%newobject MEDCoupling::DataArrayAsciiChar::New;
+%newobject MEDCoupling::DataArrayAsciiChar::__iter__;
+%newobject MEDCoupling::DataArrayAsciiChar::performCopyOrIncrRef;
+%newobject MEDCoupling::DataArrayAsciiCharTuple::buildDAAsciiChar;
+%newobject MEDCoupling::DataArrayDouble::New;
+%newobject MEDCoupling::DataArrayDouble::__iter__;
+%newobject MEDCoupling::DataArrayDouble::convertToIntArr;
+%newobject MEDCoupling::DataArrayDouble::performCopyOrIncrRef;
+%newobject MEDCoupling::DataArrayDouble::Aggregate;
+%newobject MEDCoupling::DataArrayDouble::Meld;
+%newobject MEDCoupling::DataArrayDouble::Dot;
+%newobject MEDCoupling::DataArrayDouble::CrossProduct;
+%newobject MEDCoupling::DataArrayDouble::Add;
+%newobject MEDCoupling::DataArrayDouble::Substract;
+%newobject MEDCoupling::DataArrayDouble::Multiply;
+%newobject MEDCoupling::DataArrayDouble::Divide;
+%newobject MEDCoupling::DataArrayDouble::Pow;
+%newobject MEDCoupling::DataArrayDouble::subArray;
+%newobject MEDCoupling::DataArrayDouble::changeNbOfComponents;
+%newobject MEDCoupling::DataArrayDouble::accumulatePerChunck;
+%newobject MEDCoupling::DataArrayDouble::findIdsInRange;
+%newobject MEDCoupling::DataArrayDouble::findIdsNotInRange;
+%newobject MEDCoupling::DataArrayDouble::negate;
+%newobject MEDCoupling::DataArrayDouble::computeAbs;
+%newobject MEDCoupling::DataArrayDouble::applyFunc;
+%newobject MEDCoupling::DataArrayDouble::applyFuncCompo;
+%newobject MEDCoupling::DataArrayDouble::applyFuncNamedCompo;
+%newobject MEDCoupling::DataArrayDouble::doublyContractedProduct;
+%newobject MEDCoupling::DataArrayDouble::determinant;
+%newobject MEDCoupling::DataArrayDouble::eigenValues;
+%newobject MEDCoupling::DataArrayDouble::eigenVectors;
+%newobject MEDCoupling::DataArrayDouble::inverse;
+%newobject MEDCoupling::DataArrayDouble::trace;
+%newobject MEDCoupling::DataArrayDouble::deviator;
+%newobject MEDCoupling::DataArrayDouble::magnitude;
+%newobject MEDCoupling::DataArrayDouble::maxPerTuple;
+%newobject MEDCoupling::DataArrayDouble::sumPerTuple;
+%newobject MEDCoupling::DataArrayDouble::computeBBoxPerTuple;
+%newobject MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrix;
+%newobject MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith;
+%newobject MEDCoupling::DataArrayDouble::renumber;
+%newobject MEDCoupling::DataArrayDouble::renumberR;
+%newobject MEDCoupling::DataArrayDouble::renumberAndReduce;
+%newobject MEDCoupling::DataArrayDouble::fromNoInterlace;
+%newobject MEDCoupling::DataArrayDouble::toNoInterlace;
+%newobject MEDCoupling::DataArrayDouble::fromPolarToCart;
+%newobject MEDCoupling::DataArrayDouble::fromCylToCart;
+%newobject MEDCoupling::DataArrayDouble::fromSpherToCart;
+%newobject MEDCoupling::DataArrayDouble::cartesianize;
+%newobject MEDCoupling::DataArrayDouble::getDifferentValues;
+%newobject MEDCoupling::DataArrayDouble::findClosestTupleId;
+%newobject MEDCoupling::DataArrayDouble::computeNbOfInteractionsWith;
+%newobject MEDCoupling::DataArrayDouble::duplicateEachTupleNTimes;
+%newobject MEDCoupling::DataArrayDouble::__neg__;
+%newobject MEDCoupling::DataArrayDouble::__radd__;
+%newobject MEDCoupling::DataArrayDouble::__rsub__;
+%newobject MEDCoupling::DataArrayDouble::__rmul__;
+%newobject MEDCoupling::DataArrayDouble::__rdiv__;
+%newobject MEDCoupling::DataArrayDouble::__pow__;
+%newobject MEDCoupling::DataArrayDouble::__rpow__;
+%newobject MEDCoupling::DataArrayDoubleTuple::buildDADouble;
%feature("unref") DataArray "$this->decrRef();"
%feature("unref") DataArrayDouble "$this->decrRef();"
%feature("unref") DataArrayAsciiChar "$this->decrRef();"
%feature("unref") DataArrayByte "$this->decrRef();"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
virtual int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
virtual std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception);
virtual std::size_t getNbOfElemAllocated() const throw(INTERP_KERNEL::Exception);
- virtual DataArray *deepCpy() const throw(INTERP_KERNEL::Exception);
- virtual DataArray *selectByTupleId2(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
+ virtual DataArray *deepCopy() const throw(INTERP_KERNEL::Exception);
+ virtual DataArray *selectByTupleIdSafeSlice(int bg, int end2, int step) const throw(INTERP_KERNEL::Exception);
virtual void rearrange(int newNbOfCompo) throw(INTERP_KERNEL::Exception);
void checkNbOfTuples(int nbOfTuples, const std::string& msg) const throw(INTERP_KERNEL::Exception);
void checkNbOfComps(int nbOfCompo, const std::string& msg) const throw(INTERP_KERNEL::Exception);
static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception);
static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit) throw(INTERP_KERNEL::Exception);
- static std::string GetAxTypeRepr(MEDCouplingAxisType at) throw(INTERP_KERNEL::Exception);
+ static std::string GetAxisTypeRepr(MEDCouplingAxisType at) throw(INTERP_KERNEL::Exception);
void updateTime() const;
%extend
{
virtual void renumberInPlace(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
virtual void renumberInPlaceR(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
//tuplesSelec in PyObject * because DataArrayInt is not already existing !
virtual void setContigPartOfSelectedValues(int tupleIdStart, PyObject *aBase, PyObject *tuplesSelec) throw(INTERP_KERNEL::Exception)
{
- static const char msg[]="DataArray::setContigPartOfSelectedValues2 : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
- DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 3rd parameter \"aBase\" should be of type DataArray");
+ static const char msg[]="DataArray::setContigPartOfSelectedValuesSlice : 4th parameter \"tuplesSelec\" should be of type DataArrayInt";
+ DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 3rd parameter \"aBase\" should be of type DataArray");
DataArray *tuplesSelecPtr=CheckAndRetrieveDataArrayInstance(tuplesSelec,msg);
DataArrayInt *tuplesSelecPtr2=0;
if(tuplesSelecPtr)
self->setContigPartOfSelectedValues(tupleIdStart,a,tuplesSelecPtr2);
}
- virtual void setContigPartOfSelectedValues2(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
+ virtual void setContigPartOfSelectedValuesSlice(int tupleIdStart, PyObject *aBase, int bg, int end2, int step) throw(INTERP_KERNEL::Exception)
{
- DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValues2 : 2nd parameter \"aBase\" should be of type DataArray");
- self->setContigPartOfSelectedValues2(tupleIdStart,a,bg,end2,step);
+ DataArray *a=CheckAndRetrieveDataArrayInstance(aBase,"DataArray::setContigPartOfSelectedValuesSlice : 2nd parameter \"aBase\" should be of type DataArray");
+ self->setContigPartOfSelectedValuesSlice(tupleIdStart,a,bg,end2,step);
}
virtual DataArray *selectByTupleRanges(PyObject *li) const throw(INTERP_KERNEL::Exception)
virtual DataArray *selectByTupleId(PyObject *li) const throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
virtual DataArray *selectByTupleIdSafe(PyObject *li) const throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
static DataArray *Aggregate(PyObject *arrs) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArray *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArray *>(arrs,SWIGTYPE_p_ParaMEDMEM__DataArray,"DataArray",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArray *>(arrs,SWIGTYPE_p_MEDCoupling__DataArray,"DataArray",tmp);
return DataArray::Aggregate(tmp);
}
static DataArrayDouble *New();
double doubleValue() const throw(INTERP_KERNEL::Exception);
bool empty() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
- void cpyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
+ void deepCopyFrom(const DataArrayDouble& other) throw(INTERP_KERNEL::Exception);
void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
void pushBackSilent(double val) throw(INTERP_KERNEL::Exception);
double popBackSilent() throw(INTERP_KERNEL::Exception);
DataArrayInt *convertToIntArr() const throw(INTERP_KERNEL::Exception);
DataArrayDouble *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
DataArrayDouble *toNoInterlace() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
void transpose() throw(INTERP_KERNEL::Exception);
DataArrayDouble *changeNbOfComponents(int newNbOfComp, double dftValue) const throw(INTERP_KERNEL::Exception);
void meldWith(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception);
DataArrayDouble *applyFunc(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *applyFunc(const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
void applyFuncOnThis(const std::string& func, bool isSafe=true) throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc2(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *applyFuncCompo(int nbOfComp, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const std::string& func, bool isSafe=true) const throw(INTERP_KERNEL::Exception);
void applyFuncFast32(const std::string& func) throw(INTERP_KERNEL::Exception);
void applyFuncFast64(const std::string& func) throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsNotInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception);
static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception);
static DataArrayDouble *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
{
- const char *msgBase="ParaMEDMEM::DataArrayDouble::New : Available API are : \n-DataArrayDouble.New()\n-DataArrayDouble.New([1.,3.,4.])\n-DataArrayDouble.New([1.,3.,4.],3)\n-DataArrayDouble.New([1.,3.,4.,5.],2,2)\n-DataArrayDouble.New([1.,3.,4.,5.,7,8.],3,2)\n-DataArrayDouble.New([(1.,3.),(4.,5.),(7,8.)])\n-DataArrayDouble.New(5)\n-DataArrayDouble.New(5,2)";
+ const char *msgBase="MEDCoupling::DataArrayDouble::New : Available API are : \n-DataArrayDouble.New()\n-DataArrayDouble.New([1.,3.,4.])\n-DataArrayDouble.New([1.,3.,4.],3)\n-DataArrayDouble.New([1.,3.,4.,5.],2,2)\n-DataArrayDouble.New([1.,3.,4.,5.,7,8.],3,2)\n-DataArrayDouble.New([(1.,3.),(4.,5.),(7,8.)])\n-DataArrayDouble.New(5)\n-DataArrayDouble.New(5,2)";
std::string msg(msgBase);
#ifdef WITH_NUMPY
msg+="\n-DataArrayDouble.New(numpy array with dtype=float64)";
int nbOfCompo=PyInt_AS_LONG(elt2);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,nbOfCompo);
ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
else
{//DataArrayDouble.New([1.,3.,4.],3)
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int tmpp1=-1;
std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,nbOfTuples1,tmpp1);
ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
}
else
{// DataArrayDouble.New([1.,3.,4.])
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
int tmpp1=-1,tmpp2=-1;
std::vector<double> tmp=fillArrayWithPyListDbl2(elt0,tmpp1,tmpp2);
ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuples1,nbOfCompo);
return ret.retn();
}
}
else
{//DataArrayDouble.New(5)
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTuples1,1);
return ret.retn();
}
DataArrayDouble(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *elt2=0) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
+ return MEDCoupling_DataArrayDouble_New__SWIG_1(elt0,nbOfTuples,elt2);
}
void pushBackValsSilent(PyObject *li) throw(INTERP_KERNEL::Exception)
void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- const char *msg="ParaMEDMEM::DataArrayDouble::setValues : Available API are : \n-DataArrayDouble.setValues([1.,3.,4.])\n-DataArrayDouble.setValues([1.,3.,4.],3)\n-DataArrayDouble.setValues([1.,3.,4.,5.],2,2)\n-DataArrayDouble.setValues([(1.,1.7),(3.,3.7),(4.,4.7)])\n !";
+ const char *msg="MEDCoupling::DataArrayDouble::setValues : Available API are : \n-DataArrayDouble.setValues([1.,3.,4.])\n-DataArrayDouble.setValues([1.,3.,4.],3)\n-DataArrayDouble.setValues([1.,3.,4.,5.],2,2)\n-DataArrayDouble.setValues([(1.,1.7),(3.,3.7),(4.,4.7)])\n !";
if(PyList_Check(li) || PyTuple_Check(li))
{
if(nbOfTuples)
DataArrayDouble *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayDouble *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayDouble *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
double r1=self->getMaxValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
double r1=self->getMinValue2(tmp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *comm, *commIndex;
self->findCommonTuples(prec,limitNodeId,comm,commIndex);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(comm),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(commIndex),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return res;
}
static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayDouble *> tmp;
- convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
+ convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
return DataArrayDouble::Aggregate(tmp);
}
static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayDouble *> tmp;
- convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",tmp);
+ convertFromPyObjVectorOfObj<const DataArrayDouble *>(li,SWIGTYPE_p_MEDCoupling__DataArrayDouble,"DataArrayDouble",tmp);
return DataArrayDouble::Meld(tmp);
}
int nbComp=self->getNumberOfComponents(),nbTuples=-1;
const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
+ MCAuto<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,CPP_DEALLOC,nbTuples,nbComp);
DataArrayInt *c=0,*cI=0;
self->computeTupleIdsNearTuples(inpu,eps,c,cI);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
PyObject *ret0Py=ret0?Py_True:Py_False;
Py_XINCREF(ret0Py);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *dt1=0,*dc1=0;
int sw;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret;
+ MCAuto<DataArrayDouble> ret;
switch(sw)
{
case 1:
if(nbOfComponents==1)
return PyFloat_FromDouble(self->getIJSafe(it1,0));
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 2:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 3:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 4:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 5:
return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
case 6:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 7:
{
- ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 8:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 9:
{
ret=self->selectByTupleIdSafe(&it1,&it1+1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 10:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 11:
{
- ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 12:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 13:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 14:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 15:
{
- ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 16:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);
std::pair<int, std::pair<int,int> > pt1,pc1;
DataArrayInt *dt1=0,*dc1=0;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp;
+ MCAuto<DataArrayDouble> tmp;
switch(sw2)
{
case 1:
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
- PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(other,tmp);
+ PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___radd__Impl(other,tmp);
Py_XDECREF(tmp);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
}
else
throw INTERP_KERNEL::Exception(msg);
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyLin(1.,val);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 2:
{
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Add(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyLin(1.,val);
return ret.retn();
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
return DataArrayDouble::Add(self,aaa);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Add(self,aaa);
}
default:
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
self->addEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->addEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
- PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
+ PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(other,tmp);
Py_XDECREF(tmp);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
}
else
throw INTERP_KERNEL::Exception(msg);
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyLin(1.,-val);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 2:
{
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Substract(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyLin(-1.,val);
return ret.retn();
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
return DataArrayDouble::Substract(aaa,self);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Substract(aaa,self);
}
default:
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
self->substractEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->substractEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
- PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
+ PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(other,tmp);
Py_XDECREF(tmp);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
}
else
throw INTERP_KERNEL::Exception(msg);
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyLin(val,0.);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 2:
{
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Multiply(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyLin(val,0.);
return ret.retn();
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
return DataArrayDouble::Multiply(self,aaa);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Multiply(self,aaa);
}
default:
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
self->multiplyEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->multiplyEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
//
#ifndef WITHOUT_AUTOFIELD
void *argp;
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
{
- PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, 0 | 0 );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
+ PyObject *tmp=SWIG_NewPointerObj(SWIG_as_voidptr(self),SWIGTYPE_p_MEDCoupling__DataArrayDouble, 0 | 0 );
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(other,tmp);
Py_XDECREF(tmp);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 );
}
else
throw INTERP_KERNEL::Exception(msg);
{
if(val==0.)
throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyLin(1/val,0.);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 2:
{
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,a)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
- return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(DataArrayDouble::Divide(self,aaa)),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyInv(val);
return ret.retn();
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
return DataArrayDouble::Divide(aaa,self);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Divide(aaa,self);
}
default:
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
self->divideEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->divideEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyPow(val);
return ret.retn();
}
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
return DataArrayDouble::Pow(self,aaa);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Pow(self,aaa);
}
default:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->deepCpy();
+ MCAuto<DataArrayDouble> ret=self->deepCopy();
ret->applyRPow(val);
return ret.retn();
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
return DataArrayDouble::Pow(aaa,self);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
return DataArrayDouble::Pow(aaa,self);
}
default:
}
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MCAuto<DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
self->powEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
+ MCAuto<DataArrayDouble> aaa=DataArrayDouble::New(); aaa->useArray(&bb[0],false,CPP_DEALLOC,1,(int)bb.size());
self->powEqual(aaa);
Py_XINCREF(trueSelf);
return trueSelf;
//
self->computeTupleIdsNearTuples(other,eps,c,cI);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(c),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(cI),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
DataArrayDouble *ret0=self->maxPerTupleWithCompoId(ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
throw INTERP_KERNEL::Exception("PyWrap of DataArrayDouble.__getnewargs__ : self is not allocated !");
PyObject *ret(PyTuple_New(1));
PyObject *ret0(PyDict_New());
- PyObject *numpyArryObj(ParaMEDMEM_DataArrayDouble_toNumPyArray(self));
+ PyObject *numpyArryObj(MEDCoupling_DataArrayDouble_toNumPyArray(self));
{// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
PyObject *tmp1(PyInt_FromLong(0));
PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
{
DataArrayDoubleTuple *ret=self->nextt();
if(ret)
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayDoubleTuple,SWIG_POINTER_OWN|0);
else
{
PyErr_SetString(PyExc_StopIteration,"No more data.");
PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayDouble____iadd___(ret,0,obj);
+ MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayDouble____iadd___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayDouble____isub___(ret,0,obj);
+ MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayDouble____isub___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayDouble____imul___(ret,0,obj);
+ MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayDouble____imul___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayDouble____idiv___(ret,0,obj);
+ MCAuto<DataArrayDouble> ret=self->buildDADouble(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayDouble____idiv___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
const double *pt=self->getConstPointer();
int nbc=self->getNumberOfCompo();
convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
int sw1,sw2;
double singleValV;
std::vector<double> multiValV;
- ParaMEDMEM::DataArrayDoubleTuple *daIntTyyppV=0;
+ MEDCoupling::DataArrayDoubleTuple *daIntTyyppV=0;
int nbc=self->getNumberOfCompo();
convertObjToPossibleCpp44(value,sw1,singleValV,multiValV,daIntTyyppV);
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
double *pt=self->getPointer();
convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
switch(sw2)
int intValue() const throw(INTERP_KERNEL::Exception);
int getHashCode() const throw(INTERP_KERNEL::Exception);
bool empty() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
- void cpyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
+ DataArrayInt *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
+ void deepCopyFrom(const DataArrayInt& other) throw(INTERP_KERNEL::Exception);
void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
void pushBackSilent(int val) throw(INTERP_KERNEL::Exception);
int popBackSilent() throw(INTERP_KERNEL::Exception);
DataArrayDouble *convertToDblArr() const throw(INTERP_KERNEL::Exception);
DataArrayInt *fromNoInterlace() const throw(INTERP_KERNEL::Exception);
DataArrayInt *toNoInterlace() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *selectByTupleId2(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *selectByTupleIdSafeSlice(int bg, int end, int step) const throw(INTERP_KERNEL::Exception);
DataArrayInt *checkAndPreparePermutation() const throw(INTERP_KERNEL::Exception);
DataArrayInt *buildPermArrPerLevel() const throw(INTERP_KERNEL::Exception);
- bool isIdentity2(int sizeExpected) const throw(INTERP_KERNEL::Exception);
+ bool isIota(int sizeExpected) const throw(INTERP_KERNEL::Exception);
bool isUniform(int val) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
void transpose() throw(INTERP_KERNEL::Exception);
DataArrayInt *changeNbOfComponents(int newNbOfComp, int dftValue) const throw(INTERP_KERNEL::Exception);
void meldWith(const DataArrayInt *other) throw(INTERP_KERNEL::Exception);
DataArrayIntIterator *iterator() throw(INTERP_KERNEL::Exception);
const int *begin() const throw(INTERP_KERNEL::Exception);
const int *end() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsEqual(int val) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsNotEqual(int val) const throw(INTERP_KERNEL::Exception);
int changeValue(int oldValue, int newValue) throw(INTERP_KERNEL::Exception);
- int locateTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
- int locateValue(int value) const throw(INTERP_KERNEL::Exception);
- int locateValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
- int search(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
+ int findIdFirstEqualTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
+ int findIdFirstEqual(int value) const throw(INTERP_KERNEL::Exception);
+ int findIdFirstEqual(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
+ int findIdSequence(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
bool presenceOfTuple(const std::vector<int>& tupl) const throw(INTERP_KERNEL::Exception);
bool presenceOfValue(int value) const throw(INTERP_KERNEL::Exception);
bool presenceOfValue(const std::vector<int>& vals) const throw(INTERP_KERNEL::Exception);
void applyRModulus(int val) throw(INTERP_KERNEL::Exception);
void applyPow(int val) throw(INTERP_KERNEL::Exception);
void applyRPow(int val) throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsStrictlyNegative() const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsNotInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsStricltyNegative() const throw(INTERP_KERNEL::Exception);
bool checkAllIdsInRange(int vmin, int vmax) const throw(INTERP_KERNEL::Exception);
static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) throw(INTERP_KERNEL::Exception);
static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception);
DataArrayInt *buildUniqueNotSorted() const throw(INTERP_KERNEL::Exception);
DataArrayInt *deltaShiftIndex() const throw(INTERP_KERNEL::Exception);
void computeOffsets() throw(INTERP_KERNEL::Exception);
- void computeOffsets2() throw(INTERP_KERNEL::Exception);
+ void computeOffsetsFull() throw(INTERP_KERNEL::Exception);
DataArrayInt *buildExplicitArrByRanges(const DataArrayInt *offsets) const throw(INTERP_KERNEL::Exception);
DataArrayInt *findRangeIdForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
DataArrayInt *findIdInRangeForEachTuple(const DataArrayInt *ranges) const throw(INTERP_KERNEL::Exception);
static DataArrayInt *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- const char *msgBase="ParaMEDMEM::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n-DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New([1,3,4,5,7,8],3,2)\n-DataArrayInt.New([(1,3),(4,5),(7,8)])\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2)";
+ const char *msgBase="MEDCoupling::DataArrayInt::New : Available API are : \n-DataArrayInt.New()\n-DataArrayInt.New([1,3,4])\n-DataArrayInt.New([1,3,4],3)\n-DataArrayInt.New([1,3,4,5],2,2)\n-DataArrayInt.New([1,3,4,5,7,8],3,2)\n-DataArrayInt.New([(1,3),(4,5),(7,8)])\n-DataArrayInt.New(5)\n-DataArrayInt.New(5,2)";
std::string msg(msgBase);
#ifdef WITH_NUMPY
msg+="\n-DataArrayInt.New(numpy array with dtype=int32)";
int nbOfCompo=PyInt_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
else
{//DataArrayInt.New([1,3,4],3)
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int tmpp1=-1;
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
}
else
{// DataArrayInt.New([1,3,4])
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
int tmpp1=-1,tmpp2=-1;
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples1,nbOfCompo);
return ret.retn();
}
}
else
{//DataArrayInt.New(5)
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples1,1);
return ret.retn();
}
DataArrayInt(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
+ return MEDCoupling_DataArrayInt_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
}
std::string __str__() const throw(INTERP_KERNEL::Exception)
return self->accumulatePerChunck(bg,bg+sz);
}
- DataArrayInt *getIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
+ DataArrayInt *findIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
{
int sw,sz,val;
std::vector<int> val2;
const int *bg(convertObjToPossibleCpp1_Safe(inputTuple,sw,sz,val,val2));
- return self->getIdsEqualTuple(bg,bg+sz);
+ return self->findIdsEqualTuple(bg,bg+sz);
}
PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
return ret;
}
- static PyObject *BuildOld2NewArrayFromSurjectiveFormat2(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
+ static PyObject *ConvertIndexArrayToO2N(int nbOfOldTuples, PyObject *arr, PyObject *arrI) throw(INTERP_KERNEL::Exception)
{
int newNbOfTuples=-1;
int szArr,szArrI,sw,iTypppArr,iTypppArrI;
std::vector<int> stdvecTyyppArr,stdvecTyyppArrI;
const int *arrPtr=convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr);
const int *arrIPtr=convertObjToPossibleCpp1_Safe(arrI,sw,szArrI,iTypppArrI,stdvecTyyppArrI);
- DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
+ DataArrayInt *ret0=MEDCoupling::DataArrayInt::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
return ret;
}
static DataArrayInt *CheckAndPreparePermutation(PyObject *arr) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
int szArr,sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
const int *arrPtr(convertObjToPossibleCpp1_Safe(arr,sw,szArr,iTypppArr,stdvecTyyppArr));
- int *pt(ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
- ret->useArray(pt,true,ParaMEDMEM::C_DEALLOC,szArr,1);
+ int *pt(MEDCoupling::DataArrayInt::CheckAndPreparePermutation(arrPtr,arrPtr+szArr));
+ ret->useArray(pt,true,MEDCoupling::C_DEALLOC,szArr,1);
return ret.retn();
}
void setValues(PyObject *li, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- const char *msg="ParaMEDMEM::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
+ const char *msg="MEDCoupling::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
if(PyList_Check(li) || PyTuple_Check(li))
{
if(nbOfTuples)
{
std::vector<const DataArrayInt *> groups;
std::vector< std::vector<int> > fidsOfGroups;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(gps,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",groups);
- ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(gps,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",groups);
+ MEDCoupling::DataArrayInt *ret0=MEDCoupling::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups);
PyObject *ret = PyList_New(2);
- PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
int sz=fidsOfGroups.size();
PyObject *ret1 = PyList_New(sz);
for(int i=0;i<sz;i++)
void transformWithIndArr(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
}
}
- DataArrayInt *getIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *findIdsEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
int sw;
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
case 1:
- return self->getIdsEqualList(&singleVal,&singleVal+1);
+ return self->findIdsEqualList(&singleVal,&singleVal+1);
case 2:
- return self->getIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
+ return self->findIdsEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
case 4:
- return self->getIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
+ return self->findIdsEqualList(daIntTyypp->begin(),daIntTyypp->end());
default:
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
}
}
- DataArrayInt *getIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ DataArrayInt *findIdsNotEqualList(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
int sw;
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
convertObjToPossibleCpp2(obj,self->getNumberOfTuples(),sw,singleVal,multiVal,slic,daIntTyypp);
switch(sw)
{
case 1:
- return self->getIdsNotEqualList(&singleVal,&singleVal+1);
+ return self->findIdsNotEqualList(&singleVal,&singleVal+1);
case 2:
- return self->getIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
+ return self->findIdsNotEqualList(&multiVal[0],&multiVal[0]+multiVal.size());
case 4:
- return self->getIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
+ return self->findIdsNotEqualList(daIntTyypp->begin(),daIntTyypp->end());
default:
- throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
+ throw INTERP_KERNEL::Exception("DataArrayInt::findIdsNotEqualList : unrecognized type entered, expected list of int, tuple of int or DataArrayInt !");
}
}
{
DataArrayInt *ret0=0,*ret1=0,*ret2=0;
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
self->splitByValueRange(da2->getConstPointer(),da2->getConstPointer()+size,ret0,ret1,ret2);
}
PyObject *ret = PyList_New(3);
- PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *transformWithIndArrR(PyObject *li) const throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayInt *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayInt *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayInt *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayInt *arrI=0;
self->changeSurjectiveFormat(targetNb,arr,arrI);
PyObject *res = PyList_New(2);
- PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
- PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyList_SetItem(res,0,SWIG_NewPointerObj((void*)arr,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
+ PyList_SetItem(res,1,SWIG_NewPointerObj((void*)arrI,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
return res;
}
static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::Meld(tmp);
}
static DataArrayInt *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::Aggregate(tmp);
}
static DataArrayInt *AggregateIndexes(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::AggregateIndexes(tmp);
}
static DataArrayInt *BuildUnion(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::BuildUnion(tmp);
}
static DataArrayInt *BuildIntersection(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayInt *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",tmp);
return DataArrayInt::BuildIntersection(tmp);
}
if(PyInt_Check(obj))
{
int val=(int)PyInt_AS_LONG(obj);
- return self->locateValue(val);
+ return self->findIdFirstEqual(val);
}
else
throw INTERP_KERNEL::Exception("DataArrayInt::index : 'this' contains one component and trying to find an element which is not an integer !");
{
std::vector<int> arr;
convertPyToNewIntArr3(obj,arr);
- return self->locateTuple(arr);
+ return self->findIdFirstEqualTuple(arr);
}
}
}
DataArrayInt *dt1=0,*dc1=0;
int sw;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
+ MCAuto<DataArrayInt> ret;
switch(sw)
{
case 1:
{
if(nbOfComponents==1)
return PyInt_FromLong(self->getIJSafe(it1,0));
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 2:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
case 3:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
case 4:
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
case 5:
return PyInt_FromLong(self->getIJSafe(it1,ic1));
case 6:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 7:
{
- ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 8:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
std::vector<int> v2(1,ic1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 9:
{
ret=self->selectByTupleIdSafe(&it1,&it1+1);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 10:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 11:
{
- ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 12:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 13:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 14:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 15:
{
- ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
+ ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
int nbOfComp=DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2);
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 16:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);
std::pair<int, std::pair<int,int> > pt1,pc1;
DataArrayInt *dt1=0,*dc1=0;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
+ MCAuto<DataArrayInt> tmp;
switch(sw2)
{
case 1:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyLin(1,val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Add(self,aaaa);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Add(self,aaaa);
}
default:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyLin(1,val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Add(self,aaaa);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Add(self,aaaa);
}
default:
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
self->addEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
self->addEqual(aaaa);
Py_XINCREF(trueSelf);
return trueSelf;
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyLin(1,-val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Substract(self,aaaa);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Substract(self,aaaa);
}
default:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyLin(-1,val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Substract(aaaa,self);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Substract(aaaa,self);
}
default:
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
self->substractEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
self->substractEqual(aaaa);
Py_XINCREF(trueSelf);
return trueSelf;
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyLin(val,0);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Multiply(self,aaaa);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Multiply(self,aaaa);
}
default:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyLin(val,0);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Multiply(self,aaaa);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Multiply(self,aaaa);
}
default:
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
self->multiplyEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
self->multiplyEqual(aaaa);
Py_XINCREF(trueSelf);
return trueSelf;
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyDivideBy(val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Divide(self,aaaa);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Divide(self,aaaa);
}
default:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyInv(val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Divide(aaaa,self);
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Divide(aaaa,self);
}
default:
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> bb=DataArrayInt::New(); bb->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
self->divideEqual(bb);
Py_XINCREF(trueSelf);
return trueSelf;
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
self->divideEqual(aaaa);
Py_XINCREF(trueSelf);
return trueSelf;
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyModulus(val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Modulus(self,aaaa);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Modulus(self,aaaa);
}
default:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyRModulus(val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Modulus(aaaa,self);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Modulus(aaaa,self);
}
default:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
self->modulusEqual(aaaa);
Py_XINCREF(trueSelf);
return trueSelf;
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyPow(val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Pow(self,aaaa);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Pow(self,aaaa);
}
default:
{
case 1:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->deepCpy();
+ MCAuto<DataArrayInt> ret=self->deepCopy();
ret->applyRPow(val);
return ret.retn();
}
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
+ MCAuto<DataArrayInt> aaaa=DataArrayInt::New(); aaaa->useArray(&aa[0],false,CPP_DEALLOC,1,(int)aa.size());
return DataArrayInt::Pow(aaaa,self);
}
case 3:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
return DataArrayInt::Pow(aaaa,self);
}
default:
}
case 4:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
+ MCAuto<DataArrayInt> aaaa=aaa->buildDAInt(1,self->getNumberOfComponents());
self->powEqual(aaaa);
Py_XINCREF(trueSelf);
return trueSelf;
PyObject *pyRet1=PyList_New((int)sz);
for(std::size_t i=0;i<sz;i++)
{
- PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
}
PyTuple_SetItem(pyRet,0,pyRet0);
return pyRet;
}
- PyObject *searchRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
+ PyObject *findIdsRangesInListOfIds(const DataArrayInt *listOfIds) const throw(INTERP_KERNEL::Exception)
{
DataArrayInt *ret0=0,*ret1=0;
- self->searchRangesInListOfIds(listOfIds,ret0,ret1);
+ self->findIdsRangesInListOfIds(listOfIds,ret0,ret1);
PyObject *pyRet=PyTuple_New(2);
- PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(pyRet,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(pyRet,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return pyRet;
}
throw INTERP_KERNEL::Exception("PyWrap of DataArrayInt.__getnewargs__ : self is not allocated !");
PyObject *ret(PyTuple_New(1));
PyObject *ret0(PyDict_New());
- PyObject *numpyArryObj(ParaMEDMEM_DataArrayInt_toNumPyArray(self));
+ PyObject *numpyArryObj(MEDCoupling_DataArrayInt_toNumPyArray(self));
{// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
PyObject *tmp1(PyInt_FromLong(0));
PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
{
DataArrayIntTuple *ret=self->nextt();
if(ret)
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayIntTuple,SWIG_POINTER_OWN | 0);
else
{
PyErr_SetString(PyExc_StopIteration,"No more data.");
PyObject *___iadd___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayInt____iadd___(ret,0,obj);
+ MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt____iadd___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
PyObject *___isub___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayInt____isub___(ret,0,obj);
+ MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt____isub___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
PyObject *___imul___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayInt____imul___(ret,0,obj);
+ MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt____imul___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
PyObject *___idiv___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayInt____idiv___(ret,0,obj);
+ MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt____idiv___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
PyObject *___imod___(PyObject *trueSelf, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
- ParaMEDMEM_DataArrayInt____imod___(ret,0,obj);
+ MCAuto<DataArrayInt> ret=self->buildDAInt(1,self->getNumberOfCompo());
+ MEDCoupling_DataArrayInt____imod___(ret,0,obj);
Py_XINCREF(trueSelf);
return trueSelf;
}
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
const int *pt=self->getConstPointer();
int nbc=self->getNumberOfCompo();
convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
int singleValV;
std::vector<int> multiValV;
std::pair<int, std::pair<int,int> > slicV;
- ParaMEDMEM::DataArrayIntTuple *daIntTyyppV=0;
+ MEDCoupling::DataArrayIntTuple *daIntTyyppV=0;
int nbc=self->getNumberOfCompo();
convertObjToPossibleCpp22(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
int singleVal;
std::vector<int> multiVal;
std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
int *pt=self->getPointer();
convertObjToPossibleCpp2WithNegIntInterp(obj,nbc,sw2,singleVal,multiVal,slic,daIntTyypp);
switch(sw2)
virtual DataArrayChar *buildEmptySpecializedDAChar() const throw(INTERP_KERNEL::Exception);
int getHashCode() const throw(INTERP_KERNEL::Exception);
bool empty() const throw(INTERP_KERNEL::Exception);
- void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
+ void deepCopyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
void reserve(std::size_t nbOfElems) throw(INTERP_KERNEL::Exception);
void pushBackSilent(char val) throw(INTERP_KERNEL::Exception);
char popBackSilent() throw(INTERP_KERNEL::Exception);
DataArrayChar *renumberR(const int *new2Old) const throw(INTERP_KERNEL::Exception);
DataArrayChar *renumberAndReduce(const int *old2NewBg, int newNbOfTuple) const throw(INTERP_KERNEL::Exception);
bool isUniform(char val) const throw(INTERP_KERNEL::Exception);
- DataArrayChar *substr(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
+ DataArrayChar *subArray(int tupleIdBg, int tupleIdEnd=-1) const throw(INTERP_KERNEL::Exception);
DataArrayChar *changeNbOfComponents(int newNbOfComp, char dftValue) const throw(INTERP_KERNEL::Exception);
void meldWith(const DataArrayChar *other) throw(INTERP_KERNEL::Exception);
void setPartOfValuesAdv(const DataArrayChar *a, const DataArrayChar *tuplesSelec) throw(INTERP_KERNEL::Exception);
void setIJ(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
void setIJSilent(int tupleId, int compoId, char newVal) throw(INTERP_KERNEL::Exception);
char *getPointer() throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
- int locateTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsEqual(char val) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsNotEqual(char val) const throw(INTERP_KERNEL::Exception);
+ int findIdFirstEqualTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
bool presenceOfTuple(const std::vector<char>& tupl) const throw(INTERP_KERNEL::Exception);
char getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
char getMaxValueInArray() const throw(INTERP_KERNEL::Exception);
char getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception);
char getMinValueInArray() const throw(INTERP_KERNEL::Exception);
- DataArrayInt *getIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
+ DataArrayInt *findIdsInRange(char vmin, char vmax) const throw(INTERP_KERNEL::Exception);
static DataArrayChar *Aggregate(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
static DataArrayChar *Meld(const DataArrayChar *a1, const DataArrayChar *a2) throw(INTERP_KERNEL::Exception);
%extend
DataArrayChar *renumber(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayChar *renumberR(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
DataArrayChar *renumberAndReduce(PyObject *li, int newNbOfTuple) throw(INTERP_KERNEL::Exception)
{
void *da=0;
- int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_ParaMEDMEM__DataArrayInt, 0 | 0 );
+ int res1=SWIG_ConvertPtr(li,&da,SWIGTYPE_p_MEDCoupling__DataArrayInt, 0 | 0 );
if (!SWIG_IsOK(res1))
{
int size;
static DataArrayChar *Aggregate(PyObject *dachs) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
+ std::vector<const MEDCoupling::DataArrayChar *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
return DataArrayChar::Aggregate(tmp);
}
static DataArrayChar *Meld(PyObject *dachs) throw(INTERP_KERNEL::Exception)
{
- std::vector<const ParaMEDMEM::DataArrayChar *> tmp;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayChar *>(dachs,SWIGTYPE_p_ParaMEDMEM__DataArrayChar,"DataArrayChar",tmp);
+ std::vector<const MEDCoupling::DataArrayChar *> tmp;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayChar *>(dachs,SWIGTYPE_p_MEDCoupling__DataArrayChar,"DataArrayChar",tmp);
return DataArrayChar::Meld(tmp);
}
}
public:
static DataArrayByte *New();
DataArrayByteIterator *iterator() throw(INTERP_KERNEL::Exception);
- DataArrayByte *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
+ DataArrayByte *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
char byteValue() const throw(INTERP_KERNEL::Exception);
%extend
{
static DataArrayByte *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- const char *msg="ParaMEDMEM::DataArrayByte::New : Available API are : \n-DataArrayByte.New()\n--DataArrayByte.New([1,3,4])\n-DataArrayByte.New([1,3,4],3)\n-DataArrayByte.New([1,3,4,5],2,2)\n-DataArrayByte.New(5)\n-DataArrayByte.New(5,2) !";
+ const char *msg="MEDCoupling::DataArrayByte::New : Available API are : \n-DataArrayByte.New()\n--DataArrayByte.New([1,3,4])\n-DataArrayByte.New([1,3,4],3)\n-DataArrayByte.New([1,3,4,5],2,2)\n-DataArrayByte.New(5)\n-DataArrayByte.New(5,2) !";
if(PyList_Check(elt0) || PyTuple_Check(elt0))
{
if(nbOfTuples)
int nbOfCompo=PyInt_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
else
{//DataArrayByte.New([1,3,4],3)
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
int tmpp1=-1;
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
}
else
{// DataArrayByte.New([1,3,4])
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
int tmpp1=-1,tmpp2=-1;
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
ret->alloc(nbOfTuples1,nbOfCompo);
return ret.retn();
}
}
else
{//DataArrayByte.New(5)
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> ret=DataArrayByte::New();
+ MCAuto<DataArrayByte> ret=DataArrayByte::New();
ret->alloc(nbOfTuples1,1);
return ret.retn();
}
DataArrayByte(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
+ return MEDCoupling_DataArrayByte_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
}
std::string __repr__() const throw(INTERP_KERNEL::Exception)
return self->presenceOfValue(vals2);
}
- int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
const int *pt=convertObjToPossibleCpp1_Safe(vals,sw,sz,ival,ivval);
std::vector<char> vals2(sz);
std::copy(pt,pt+sz,vals2.begin());
- return self->locateValue(vals2);
+ return self->findIdFirstEqual(vals2);
}
- int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
const int *pt=convertObjToPossibleCpp1_Safe(tupl,sw,sz,ival,ivval);
std::vector<char> vals(sz);
std::copy(pt,pt+sz,vals.begin());
- return self->locateTuple(vals);
+ return self->findIdFirstEqualTuple(vals);
}
- int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
+ int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
{
int sz=-1,sw=-1;
int ival=-1; std::vector<int> ivval;
const int *pt=convertObjToPossibleCpp1_Safe(strOrListOfInt,sw,sz,ival,ivval);
std::vector<char> vals(sz);
std::copy(pt,pt+sz,vals.begin());
- return self->search(vals);
+ return self->findIdSequence(vals);
}
PyObject *getTuple(int tupleId) throw(INTERP_KERNEL::Exception)
if(PyInt_Check(obj))
{
int val=(int)PyInt_AS_LONG(obj);
- return self->locateValue(val);
+ return self->findIdFirstEqual(val);
}
else
throw INTERP_KERNEL::Exception("DataArrayByte::index : 'this' contains one component and trying to find an element which is not an integer !");
}
default:
- return ParaMEDMEM_DataArrayByte_locateTuple(self,obj);
+ return MEDCoupling_DataArrayByte_findIdFirstEqualTuple(self,obj);
}
}
throw INTERP_KERNEL::Exception("DataArrayByte::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
}
default:
- return ParaMEDMEM_DataArrayByte_presenceOfTuple(self,obj);
+ return MEDCoupling_DataArrayByte_presenceOfTuple(self,obj);
}
}
std::pair<int, std::pair<int,int> > pt1,pc1;
DataArrayInt *dt1=0,*dc1=0;
convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
+ MCAuto<DataArrayInt> tmp;
switch(sw2)
{
case 1:
public:
static DataArrayAsciiChar *New();
DataArrayAsciiCharIterator *iterator() throw(INTERP_KERNEL::Exception);
- DataArrayAsciiChar *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
+ DataArrayAsciiChar *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
char asciiCharValue() const throw(INTERP_KERNEL::Exception);
%extend
{
static DataArrayAsciiChar *New(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- const char *msg="ParaMEDMEM::DataArrayAsciiChar::New : Available API are : \n-DataArrayAsciiChar.New()\n-DataArrayAsciiChar.New([1,3,4])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"],\"t\")\n-DataArrayAsciiChar.New([1,3,4],3)\n-DataArrayAsciiChar.New([1,3,4,5],2,2)\n-DataArrayAsciiChar.New(5)\n-DataArrayAsciiChar.New(5,2) !";
+ const char *msg="MEDCoupling::DataArrayAsciiChar::New : Available API are : \n-DataArrayAsciiChar.New()\n-DataArrayAsciiChar.New([1,3,4])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"])\n-DataArrayAsciiChar.New([\"abc\",\"de\",\"fghi\"],\"t\")\n-DataArrayAsciiChar.New([1,3,4],3)\n-DataArrayAsciiChar.New([1,3,4,5],2,2)\n-DataArrayAsciiChar.New(5)\n-DataArrayAsciiChar.New(5,2) !";
if(PyList_Check(elt0) || PyTuple_Check(elt0))
{
if(nbOfTuples)
int nbOfCompo=PyInt_AS_LONG(nbOfComp);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
+ MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,nbOfCompo);
ret->alloc(nbOfTuples1,nbOfCompo); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
return ret.retn();
}
else
{//DataArrayAsciiChar.New([1,3,4],3)
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
+ MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
int tmpp1=-1;
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,nbOfTuples1,tmpp1);
ret->alloc(nbOfTuples1,tmpp1); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
else
{
// DataArrayAsciiChar.New([1,3,4])
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
+ MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
int tmpp1=-1,tmpp2=-1;
std::vector<int> tmp=fillArrayWithPyListInt2(elt0,tmpp1,tmpp2);
ret->alloc(tmpp1,tmpp2); std::copy(tmp.begin(),tmp.end(),ret->getPointer());
int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
if(nbOfCompo<0)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
+ MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
ret->alloc(nbOfTuples1,nbOfCompo);
return ret.retn();
}
}
else
{//DataArrayAsciiChar.New(5)
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
+ MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
ret->alloc(nbOfTuples1,1);
return ret.retn();
}
DataArrayAsciiChar(PyObject *elt0, PyObject *nbOfTuples=0, PyObject *nbOfComp=0) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
+ return MEDCoupling_DataArrayAsciiChar_New__SWIG_1(elt0,nbOfTuples,nbOfComp);
}
std::string __repr__() const throw(INTERP_KERNEL::Exception)
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::presenceOfValue : only strings in input supported !");
}
- int locateValue(PyObject *vals) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqual(PyObject *vals) const throw(INTERP_KERNEL::Exception)
{
if(PyString_Check(vals))
{
Py_ssize_t sz=PyString_Size(vals);
std::vector<char> vals2(sz);
std::copy(PyString_AsString(vals),PyString_AsString(vals)+sz,vals2.begin());
- return self->locateValue(vals2);
+ return self->findIdFirstEqual(vals2);
}
else
- throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateValue : only strings in input supported !");
+ throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqual : only strings in input supported !");
}
- int locateTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
+ int findIdFirstEqualTuple(PyObject *tupl) const throw(INTERP_KERNEL::Exception)
{
if(PyString_Check(tupl))
{
Py_ssize_t sz=PyString_Size(tupl);
std::vector<char> vals(sz);
std::copy(PyString_AsString(tupl),PyString_AsString(tupl)+sz,vals.begin());
- return self->locateTuple(vals);
+ return self->findIdFirstEqualTuple(vals);
}
else
- throw INTERP_KERNEL::Exception("DataArrayAsciiChar::locateTuple : only strings in input supported !");
+ throw INTERP_KERNEL::Exception("DataArrayAsciiChar::findIdFirstEqualTuple : only strings in input supported !");
}
- int search(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
+ int findIdSequence(PyObject *strOrListOfInt) const throw(INTERP_KERNEL::Exception)
{
if(PyString_Check(strOrListOfInt))
{
Py_ssize_t sz=PyString_Size(strOrListOfInt);
std::vector<char> vals(sz);
std::copy(PyString_AsString(strOrListOfInt),PyString_AsString(strOrListOfInt)+sz,vals.begin());
- return self->search(vals);
+ return self->findIdSequence(vals);
}
else
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::search : only strings in input supported !");
Py_ssize_t sz=PyString_Size(obj);
char *pt=PyString_AsString(obj);
if(sz==1)
- return self->locateValue(pt[0]);
+ return self->findIdFirstEqual(pt[0]);
else
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find a string with size different from 1 !");
}
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::index : 'this' contains one component and trying to find an element which is not an integer !");
}
default:
- return ParaMEDMEM_DataArrayAsciiChar_locateTuple(self,obj);
+ return MEDCoupling_DataArrayAsciiChar_findIdFirstEqualTuple(self,obj);
}
}
throw INTERP_KERNEL::Exception("DataArrayAsciiChar::__contains__ : 'this' contains one component and trying to find an element which is not an integer !");
}
default:
- return ParaMEDMEM_DataArrayAsciiChar_presenceOfTuple(self,obj);
+ return MEDCoupling_DataArrayAsciiChar_presenceOfTuple(self,obj);
}
}
int sw,iTypppArr;
std::vector<int> stdvecTyyppArr;
std::pair<int, std::pair<int,int> > sTyyppArr;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
convertObjToPossibleCpp2WithNegIntInterp(obj,self->getNumberOfTuples(),sw,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
switch(sw)
{
case 1:
- return ParaMEDMEM_DataArrayAsciiChar_getTuple(self,iTypppArr);
+ return MEDCoupling_DataArrayAsciiChar_getTuple(self,iTypppArr);
case 2:
return convertDataArrayChar(self->selectByTupleIdSafe(&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size()), SWIG_POINTER_OWN | 0 );
case 3:
- return convertDataArrayChar(self->selectByTupleId2(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
+ return convertDataArrayChar(self->selectByTupleIdSafeSlice(sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second), SWIG_POINTER_OWN | 0 );
case 4:
return convertDataArrayChar(self->selectByTupleIdSafe(daIntTyypp->begin(),daIntTyypp->end()), SWIG_POINTER_OWN | 0 );
default:
int sw1,iTypppArr;
std::vector<int> stdvecTyyppArr;
std::pair<int, std::pair<int,int> > sTyyppArr;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ MEDCoupling::DataArrayInt *daIntTyypp=0;
int nbOfCompo=self->getNumberOfComponents();
int nbOfTuples=self->getNumberOfTuples();
convertObjToPossibleCpp2WithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
//value string
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
return self;
}
//value vector<string>
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
self->setPartOfValues3(tmp,&iTypppArr,&iTypppArr+1,0,nbOfCompo,1,false);
return self;
}
//value string
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
return self;
}
//value vector<string>
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
self->setPartOfValues3(tmp,&stdvecTyyppArr[0],&stdvecTyyppArr[0]+stdvecTyyppArr.size(),0,nbOfCompo,1,false);
return self;
}
//value string
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
return self;
}
//value vector<string>
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
self->setPartOfValues1(tmp,sTyyppArr.first,sTyyppArr.second.first,sTyyppArr.second.second,0,nbOfCompo,1,false);
return self;
}
//value string
case 2:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(sc);
self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
return self;
}
//value vector<string>
case 3:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
+ MCAuto<DataArrayAsciiChar> tmp=DataArrayAsciiChar::New(vsc,' ');
self->setPartOfValues3(tmp,daIntTyypp->begin(),daIntTyypp->end(),0,nbOfCompo,1,false);
return self;
}
{
DataArrayAsciiCharTuple *ret=self->nextt();
if(ret)
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayAsciiCharTuple,SWIG_POINTER_OWN | 0);
else
{
PyErr_SetString(PyExc_StopIteration,"No more data.");
d=DataArrayInt(a)
self.assertEqual(weakref.getweakrefcount(a),1)
self.assertTrue(not a.flags["OWNDATA"])
- self.assertTrue(d.isIdentity2(20))
+ self.assertTrue(d.isIota(20))
a[:]=2 # modifying a and d because a and d share the same chunk of data
self.assertTrue(d.isUniform(2))
del d # d is destroyed, a retrieves its ownership of its initial chunk of data
a=arange(20,dtype=int32)
d=DataArrayInt(a) # d owns data of a
e=DataArrayInt(a) # a not owned -> e only an access to chunk of a
- self.assertTrue(d.isIdentity2(d.getNumberOfTuples()))
- self.assertTrue(e.isIdentity2(e.getNumberOfTuples()))
+ self.assertTrue(d.isIota(d.getNumberOfTuples()))
+ self.assertTrue(e.isIota(e.getNumberOfTuples()))
a[:]=6
self.assertTrue(d.isUniform(6))
self.assertTrue(e.isUniform(6))
del b # no impact on e and f because a is the base of a.
##@@ Ensure a pass of the garbage collector so that the de-allocator of d is called
gc.collect()
- self.assertTrue(f.isIdentity2(f.getNumberOfTuples()))
- self.assertTrue(e.isIdentity2(e.getNumberOfTuples()))
+ self.assertTrue(f.isIota(f.getNumberOfTuples()))
+ self.assertTrue(e.isIota(e.getNumberOfTuples()))
del a # a destroyed, but as c has its base set to a, a exists -> e and f not allocated
##@@ Ensure a pass of the garbage collector so that the de-allocator of d is called
gc.collect()
- self.assertTrue(f.isIdentity2(f.getNumberOfTuples()))
- self.assertTrue(e.isIdentity2(e.getNumberOfTuples()))
+ self.assertTrue(f.isIota(f.getNumberOfTuples()))
+ self.assertTrue(e.isIota(e.getNumberOfTuples()))
del c # c killed -> a killed -> e and d are put into not allocated state
##@@ Ensure a pass of the garbage collector so that the de-allocator of d is called
gc.collect()
b=DataArrayInt(a)
c=DataArrayInt(a)
d=DataArrayInt(a)
- self.assertTrue(b.isIdentity2(10))
- self.assertTrue(c.isIdentity2(10))
- self.assertTrue(d.isIdentity2(10))
+ self.assertTrue(b.isIota(10))
+ self.assertTrue(c.isIota(10))
+ self.assertTrue(d.isIota(10))
c.pushBackSilent(10) # c and a,b are dissociated
- self.assertTrue(b.isIdentity2(10))
- self.assertTrue(c.isIdentity2(11))
- self.assertTrue(d.isIdentity2(10))
+ self.assertTrue(b.isIota(10))
+ self.assertTrue(c.isIota(11))
+ self.assertTrue(d.isIota(10))
del a
gc.collect()
- self.assertTrue(b.isIdentity2(10))
- self.assertTrue(c.isIdentity2(11))
+ self.assertTrue(b.isIota(10))
+ self.assertTrue(c.isIota(11))
self.assertTrue(not d.isAllocated())
del b
gc.collect()
- self.assertTrue(c.isIdentity2(11))
+ self.assertTrue(c.isIota(11))
#
a=arange(10,dtype=int32)
b=DataArrayInt(a)
c=DataArrayInt(a)
- self.assertTrue(b.isIdentity2(10))
- self.assertTrue(c.isIdentity2(10))
+ self.assertTrue(b.isIota(10))
+ self.assertTrue(c.isIota(10))
b.pushBackSilent(10) # c and a,b are dissociated
- self.assertTrue(b.isIdentity2(11))
- self.assertTrue(c.isIdentity2(10))
+ self.assertTrue(b.isIota(11))
+ self.assertTrue(c.isIota(10))
del a
gc.collect()
- self.assertTrue(b.isIdentity2(11))
+ self.assertTrue(b.isIota(11))
self.assertTrue(not c.isAllocated())
del b
gc.collect()
m=m.buildUnstructured()
m.setName("mesh")
m.getCoords().setInfoOnComponents(["aa","bbb","ddddd"])
- m.checkCoherency()
+ m.checkConsistencyLight()
st=cPickle.dumps(m,cPickle.HIGHEST_PROTOCOL)
m2=cPickle.loads(st)
self.assertTrue(m2.isEqual(m,1e-16))
m=m.buildUnstructured()
m.setName("mesh")
m.getCoords().setInfoOnComponents(["aa","bbb","ddddd"])
- m.checkCoherency()
+ m.checkConsistencyLight()
#
a0,a1,a2=m.getTinySerializationInformation()
b0,b1=m.serialize()
#
m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY,arrZ)
m.setName("mesh")
- m.checkCoherency()
+ m.checkConsistencyLight()
st=cPickle.dumps(m,cPickle.HIGHEST_PROTOCOL)
m2=cPickle.loads(st)
self.assertTrue(m2.isEqual(m,1e-16))
@unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
def test8(self):
- """ Test of a MEDCouplingExtrudedMesh pickeling."""
+ """ Test of a MEDCouplingMappedExtrudedMesh pickeling."""
arrX=DataArrayDouble(10) ; arrX.iota() ; arrX.setInfoOnComponents(["aa"])
arrY=DataArrayDouble(5) ; arrY.iota() ; arrY.setInfoOnComponents(["bbb"])
arrZ=DataArrayDouble(7) ; arrZ.iota() ; arrZ.setInfoOnComponents(["cccc"])
mesh2D=m.buildUnstructured() ; del m
#
mesh2D.setCoords(mesh3D.getCoords())
- mesh=MEDCouplingExtrudedMesh(mesh3D,mesh2D,0) ; del mesh3D,mesh2D
- self.assertTrue(isinstance(mesh,MEDCouplingExtrudedMesh))
+ mesh=MEDCouplingMappedExtrudedMesh(mesh3D,mesh2D,0) ; del mesh3D,mesh2D
+ self.assertTrue(isinstance(mesh,MEDCouplingMappedExtrudedMesh))
st=cPickle.dumps(mesh,cPickle.HIGHEST_PROTOCOL)
m2=cPickle.loads(st)
self.assertTrue(m2.isEqual(mesh,1e-16))
def test10(self):
""" Test of a MEDCouplingIMesh pickeling."""
m=MEDCouplingIMesh("mesh",3,DataArrayInt([3,1,4]),DataArrayDouble([1.5,2.5,3.5]),DataArrayDouble((0.5,1.,0.25))) ; m.setAxisUnit("km")
- m.checkCoherency()
+ m.checkConsistencyLight()
st=cPickle.dumps(m,cPickle.HIGHEST_PROTOCOL)
m2=cPickle.loads(st)
self.assertTrue(m2.isEqual(m,1e-16))
b=a[:] ; b.iota(7000.)
f.setArray(DataArrayDouble.Meld(a,b))
f.getArray().setInfoOnComponents(["u1","vv2"])
- f.checkCoherency();
+ f.checkConsistencyLight();
#
st=cPickle.dumps(f,cPickle.HIGHEST_PROTOCOL)
f2=cPickle.loads(st)
ptr=array.getPointer();
f.setArray(array);
f.setName("MyFirstFieldOnGaussPoint");
- f.checkCoherency();
+ f.checkConsistencyLight();
self.assertAlmostEqual(27.,f.getIJK(2,5,0),14);
self.assertAlmostEqual(16.,f.getIJK(1,5,1),14);
#
f.clearGaussLocalizations();
self.assertEqual(0,f.getNbOfGaussLocalization());
- self.assertRaises(InterpKernelException,f.checkCoherency);
+ self.assertRaises(InterpKernelException,f.checkConsistencyLight);
ids1=[0,1,3,4]
self.assertRaises(InterpKernelException,f.setGaussLocalizationOnCells,ids1,_refCoo2,_gsCoo1,_wg1);
self.assertEqual(0,f.getNbOfGaussLocalization());
self.assertEqual(0,f.getGaussLocalizationIdOfOneCell(0));
self.assertEqual(1,f.getGaussLocalizationIdOfOneCell(1));
self.assertEqual(1,f.getGaussLocalizationIdOfOneCell(2));
- self.assertRaises(InterpKernelException,f.checkCoherency);#<- cell 3 has no localization
+ self.assertRaises(InterpKernelException,f.checkConsistencyLight);#<- cell 3 has no localization
ids4=[3]
_gsCoo2=_gsCoo1;
_wg2=_wg1;
self.assertEqual(3,f.getNbOfGaussLocalization());
tmpIds=f.getCellIdsHavingGaussLocalization(0);
self.assertEqual(ids2,list(tmpIds.getValues()));
- self.assertRaises(InterpKernelException,f.checkCoherency);#<- it's always not ok because undelying array not with the good size.
- array2=f.getArray().substr(0,10);
+ self.assertRaises(InterpKernelException,f.checkConsistencyLight);#<- it's always not ok because undelying array not with the good size.
+ array2=f.getArray().subArray(0,10);
f.setArray(array2);
- f.checkCoherency();
+ f.checkConsistencyLight();
####
st=cPickle.dumps(f,cPickle.HIGHEST_PROTOCOL)
f2=cPickle.loads(st)
};
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class TimeLabel
{
};
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
std::vector<const BigMemoryObject *> c(self->getDirectChildren());
PyObject *ret(PyList_New(c.size()));
for(std::size_t i=0;i<c.size();i++)
- PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(c[i]),SWIGTYPE_p_ParaMEDMEM__BigMemoryObject, 0 | 0 ));
+ PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(c[i]),SWIGTYPE_p_MEDCoupling__BigMemoryObject, 0 | 0 ));
return ret;
}
std::vector<const BigMemoryObject *> c(self->getAllTheProgeny());
PyObject *ret(PyList_New(c.size()));
for(std::size_t i=0;i<c.size();i++)
- PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(c[i]),SWIGTYPE_p_ParaMEDMEM__BigMemoryObject, 0 | 0 ));
+ PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(c[i]),SWIGTYPE_p_MEDCoupling__BigMemoryObject, 0 | 0 ));
return ret;
}
static std::size_t GetHeapMemorySizeOfObjs(PyObject *objs) throw(INTERP_KERNEL::Exception)
{
std::vector<const BigMemoryObject *> cppObjs;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::BigMemoryObject *>(objs,SWIGTYPE_p_ParaMEDMEM__BigMemoryObject,"BigMemoryObject",cppObjs);
+ convertFromPyObjVectorOfObj<const MEDCoupling::BigMemoryObject *>(objs,SWIGTYPE_p_MEDCoupling__BigMemoryObject,"BigMemoryObject",cppObjs);
return BigMemoryObject::GetHeapMemorySizeOfObjs(cppObjs);
}
}
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingRemapper.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace INTERP_KERNEL;
%}
-%newobject ParaMEDMEM::MEDCouplingRemapper::transferField;
-%newobject ParaMEDMEM::MEDCouplingRemapper::reverseTransferField;
+%newobject MEDCoupling::MEDCouplingRemapper::transferField;
+%newobject MEDCoupling::MEDCouplingRemapper::reverseTransferField;
%include "MEDCouplingCommon.i"
%include "InterpolationOptions.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
}
%pythoncode %{
-def ParaMEDMEMDataArrayDoublenew(cls,*args):
+def MEDCouplingDataArrayDoublenew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDouble____new___(cls,args)
-def ParaMEDMEMDataArrayDoubleIadd(self,*args):
+def MEDCouplingDataArrayDoubleIadd(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDouble____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIsub(self,*args):
+def MEDCouplingDataArrayDoubleIsub(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDouble____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleImul(self,*args):
+def MEDCouplingDataArrayDoubleImul(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDouble____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleIdiv(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDouble____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIpow(self,*args):
+def MEDCouplingDataArrayDoubleIpow(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDouble____ipow___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoublenew(cls,*args):
+def MEDCouplingFieldDoublenew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingFieldDouble____new___(cls,args)
-def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args):
+def MEDCouplingFieldDoubleIadd(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingFieldDouble____iadd___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args):
+def MEDCouplingFieldDoubleIsub(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingFieldDouble____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args):
+def MEDCouplingFieldDoubleImul(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingFieldDouble____imul___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args):
+def MEDCouplingFieldDoubleIdiv(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingFieldDouble____idiv___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args):
+def MEDCouplingFieldDoubleIpow(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingFieldDouble____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayIntnew(cls,*args):
+def MEDCouplingDataArrayIntnew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayInt____new___(cls,args)
-def ParaMEDMEMDataArrayIntnew(cls,*args):
+def MEDCouplingDataArrayIntnew(cls,*args):
import _MEDCoupling
return _MEDCoupling.DataArrayInt____new___(cls,args)
-def ParaMEDMEMDataArrayIntIadd(self,*args):
+def MEDCouplingDataArrayIntIadd(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayInt____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntIsub(self,*args):
+def MEDCouplingDataArrayIntIsub(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayInt____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntImul(self,*args):
+def MEDCouplingDataArrayIntImul(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayInt____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntIdiv(self,*args):
+def MEDCouplingDataArrayIntIdiv(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayInt____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntImod(self,*args):
+def MEDCouplingDataArrayIntImod(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayInt____imod___(self, self, *args)
-def ParaMEDMEMDataArrayIntIpow(self,*args):
+def MEDCouplingDataArrayIntIpow(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayInt____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
+def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDoubleTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
+def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDoubleTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
+def MEDCouplingDataArrayDoubleTupleImul(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDoubleTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayDoubleTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayIntTupleIadd(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayIntTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
+def MEDCouplingDataArrayIntTupleIsub(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayIntTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImul(self,*args):
+def MEDCouplingDataArrayIntTupleImul(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayIntTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
+def MEDCouplingDataArrayIntTupleIdiv(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayIntTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImod(self,*args):
+def MEDCouplingDataArrayIntTupleImod(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DataArrayIntTuple____imod___(self, self, *args)
def ParaMEDMEMDenseMatrixIadd(self,*args):
def ParaMEDMEMDenseMatrixIsub(self,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.DenseMatrix____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingUMeshnew(cls,*args):
+def MEDCouplingUMeshnew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingUMesh____new___(cls,args)
-def ParaMEDMEMMEDCoupling1DGTUMeshnew(cls,*args):
+def MEDCoupling1DGTUMeshnew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCoupling1DGTUMesh____new___(cls,args)
-def ParaMEDMEMMEDCoupling1SGTUMeshnew(cls,*args):
+def MEDCoupling1SGTUMeshnew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCoupling1SGTUMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingCurveLinearMeshnew(cls,*args):
+def MEDCouplingCurveLinearMeshnew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingCurveLinearMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingCMeshnew(cls,*args):
+def MEDCouplingCMeshnew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingCMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingIMeshnew(cls,*args):
+def MEDCouplingIMeshnew(cls,*args):
import _MEDCouplingRemapper
return _MEDCouplingRemapper.MEDCouplingIMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingExtrudedMeshnew(cls,*args):
+def MEDCouplingExtrudedMeshnew(cls,*args):
import _MEDCouplingRemapper
- return _MEDCouplingRemapper.MEDCouplingExtrudedMesh____new___(cls,args)
+ return _MEDCouplingRemapper.MEDCouplingMappedExtrudedMesh____new___(cls,args)
%}
%include "MEDCouplingFinalize.i"
remapper.setIntersectionType(Triangulation);
self.failUnless(remapper.prepare(sourceMesh,targetMesh,"P0P0")==1);
srcField=MEDCouplingFieldDouble.New(ON_CELLS);
- srcField.setNature(ConservativeVolumic);
+ srcField.setNature(IntensiveMaximum);
srcField.setMesh(sourceMesh);
array=DataArrayDouble.New();
ptr=sourceMesh.getNumberOfCells()*[None]
trgFt.setMesh(targetMesh);
self.assertEqual(1,remapper.prepareEx(srcFt,trgFt));
srcField=MEDCouplingFieldDouble.New(ON_CELLS);
- srcField.setNature(ConservativeVolumic);
+ srcField.setNature(IntensiveMaximum);
srcField.setMesh(sourceMesh);
array=DataArrayDouble.New();
ptr=sourceMesh.getNumberOfCells()*[None]
trgFt.setMesh(targetMesh);
self.assertEqual(1,remapper.prepareEx(srcFt,trgFt));
srcField=MEDCouplingFieldDouble.New(ON_CELLS);
- srcField.setNature(ConservativeVolumic);
+ srcField.setNature(IntensiveMaximum);
srcField.setMesh(sourceMesh);
array=DataArrayDouble.New();
ptr=sourceMesh.getNumberOfCells()*[None]
array.setValues(ptr,sourceMesh.getNumberOfCells(),1);
srcField.setArray(array);
trgfield=MEDCouplingFieldDouble.New(ON_CELLS);
- trgfield.setNature(ConservativeVolumic);
+ trgfield.setNature(IntensiveMaximum);
trgfield.setMesh(targetMesh);
array=DataArrayDouble.New();
ptr=targetMesh.getNumberOfCells()*[None]
trg=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3])
trg.setCoordsAt(0,arr)
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble([10.,30.])
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrSrc)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
trg=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3])
trg.setCoordsAt(0,arr) ; trg.setCoordsAt(1,arr)
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble([10.,30.])
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrSrc)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
src.allocateCells(2) ; src.insertNextCell(NORM_TETRA4,[0,1,2,5]) ; src.insertNextCell(NORM_TETRA4,[3,4,0,6]) ; src.finishInsertingCells()
trg=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3]) ; arr2=DataArrayDouble([-0.7,0.2,0.6,1.2,2.])
trg.setCoordsAt(0,arr) ; trg.setCoordsAt(1,arr) ; trg.setCoordsAt(2,arr2)
- src.checkCoherency1(1e-10)
- trg.checkCoherency()
+ src.checkConsistency(1e-10)
+ trg.checkConsistencyLight()
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble([10.,30.])
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrSrc)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
src=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3])
src.setCoordsAt(0,arr)
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrTrg=DataArrayDouble([10.,30.,40.,70.,80.])
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrTrg)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrTrg)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
src=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3])
src.setCoordsAt(0,arr) ; src.setCoordsAt(1,arr)
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble([10.,30.,40.,70.,80.,110.,130.,140.,170.,180.,210.,230.,240.,270.,280.,310.,330.,340.,370.,380.,410.,430.,440.,470.,480.])
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrSrc)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
trg.allocateCells(2) ; trg.insertNextCell(NORM_TETRA4,[0,1,2,5]) ; trg.insertNextCell(NORM_TETRA4,[3,4,0,6]) ; trg.finishInsertingCells()
src=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.7,-0.1,0.2,0.7,2.,2.3]) ; arr2=DataArrayDouble([-0.7,0.2,0.6,1.2,2.])
src.setCoordsAt(0,arr) ; src.setCoordsAt(1,arr) ; src.setCoordsAt(2,arr2)
- trg.checkCoherency1(1e-10)
- src.checkCoherency()
+ trg.checkConsistency(1e-10)
+ src.checkConsistencyLight()
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble(100) ; arrSrc.iota(7.7)
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrSrc)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
trg=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.9,-0.1,0.15])
trg.setCoordsAt(0,arr)
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrTrg=DataArrayDouble([10.,30.,40.,70.,80.])
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrTrg)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrTrg)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
trg=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.9,-0.1,0.15])
trg.setCoordsAt(0,arr) ; trg.setCoordsAt(1,arr)
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble([10.,30.,40.,70.,80.,110.,130.,140.,170.,180.,210.,230.,240.,270.,280.,310.,330.,340.,370.,380.,410.,430.,440.,470.,480.])
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc)
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrSrc)
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
trg=MEDCouplingCMesh() ; arr=DataArrayDouble([-0.9,-0.1,0.15])
trg.setCoordsAt(0,arr) ; trg.setCoordsAt(1,arr) ; trg.setCoordsAt(2,arr)
fieldSrc=MEDCouplingFieldDouble(ON_CELLS,NO_TIME) ; fieldSrc.setMesh(src) ; arrSrc=DataArrayDouble(125) ; arrSrc.iota(7.7)
- fieldSrc.setNature(Integral) ; fieldSrc.setArray(arrSrc) ; fieldSrc.checkCoherency()
+ fieldSrc.setNature(ExtensiveMaximum) ; fieldSrc.setArray(arrSrc) ; fieldSrc.checkConsistencyLight()
rem=MEDCouplingRemapper()
rem.prepare(src,trg,"P0P0")
trgField=rem.transferField(fieldSrc,-7.)
self.assertAlmostEqual(1.25884086663e-06,mat1[0][1],16) ; self.assertAlmostEqual(1.25884086663e-06,mat2[0][1],16)
#
d=DataArrayDouble([13.45,27.67],2,1)
- f1=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f1.setMesh(src1) ; f1.setArray(d) ; f1.setNature(RevIntegral)
- f2=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f2.setMesh(src2) ; f2.setArray(d) ; f2.setNature(RevIntegral)
+ f1=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f1.setMesh(src1) ; f1.setArray(d) ; f1.setNature(IntensiveConservation)
+ f2=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f2.setMesh(src2) ; f2.setArray(d) ; f2.setNature(IntensiveConservation)
f11=rem1.transferField(f1,1e300) ; f22=rem2.transferField(f2,1e300)
expected1=DataArrayDouble([0.012480539537637884])
self.assertTrue(f11.getArray().isEqual(expected1,1e-15))
self.assertTrue(f22.getArray().isEqual(expected1,1e-15))
#
- f1.setNature(Integral) ; f2.setNature(Integral)
+ f1.setNature(ExtensiveMaximum) ; f2.setNature(ExtensiveMaximum)
f11=rem1.transferField(f1,1e300) ; f22=rem2.transferField(f2,1e300)
#
expected2=DataArrayDouble([41.12])
#
n2o=um.simplexize(PLANAR_FACE_5)
f.setArray(f.getArray()[n2o])
- f.checkCoherency()
- f.setNature(ConservativeVolumic)
+ f.checkConsistencyLight()
+ f.setNature(IntensiveMaximum)
f.setTime(5.6,7,8)
f.setName("toto") ; f.setDescription("aDescription")
p=MEDCouplingRemapper()
def testSwig2MixOfUMesh(self):
arr0=DataArrayDouble([0,1,1.5]) ; arr1=DataArrayDouble([0,1])
sc=MEDCouplingCMesh() ; sc.setCoords(arr0,arr1,arr1)
- tc=sc.deepCpy() ; tc.translate([0.4,0.3,0.3])
+ tc=sc.deepCopy() ; tc.translate([0.4,0.3,0.3])
# umesh-umesh
# 90 (umesh-1sgtumesh)
rem=MEDCouplingRemapper() ; rem.setIntersectionType(Triangulation)
# (umesh-cmesh)
# 167 (1sgtumesh-cmesh)
rem=MEDCouplingRemapper() ; rem.setIntersectionType(Triangulation)
- s=sc.build1SGTUnstructured() ; t=tc.deepCpy()
+ s=sc.build1SGTUnstructured() ; t=tc.deepCopy()
self.assertTrue(isinstance(s,MEDCoupling1SGTUMesh))
self.assertTrue(isinstance(t,MEDCouplingCMesh))
rem.prepare(s,t,"P0P0")
del s,t
# 183 (1dgtumesh-cmesh)
#rem=MEDCouplingRemapper() ; rem.setIntersectionType(Triangulation)
- #s=sc.buildUnstructured() ; s.convertAllToPoly() ; s=MEDCoupling1DGTUMesh(s) ; t=tc.deepCpy()
+ #s=sc.buildUnstructured() ; s.convertAllToPoly() ; s=MEDCoupling1DGTUMesh(s) ; t=tc.deepCopy()
#self.assertTrue(isinstance(s,MEDCoupling1DGTUMesh))
#self.assertTrue(isinstance(t,MEDCouplingCMesh))
#rem.prepare(s,t,"P0P0")
# (cmesh-umesh)
# 122 (cmesh-1sgtumesh)
rem=MEDCouplingRemapper() ; rem.setIntersectionType(Triangulation)
- s=sc.deepCpy() ; t=tc.build1SGTUnstructured()
+ s=sc.deepCopy() ; t=tc.build1SGTUnstructured()
self.assertTrue(isinstance(s,MEDCouplingCMesh))
self.assertTrue(isinstance(t,MEDCoupling1SGTUMesh))
rem.prepare(s,t,"P0P0")
del s,t
# 123 (cmesh-1dgtumesh)
#rem=MEDCouplingRemapper() ; rem.setIntersectionType(Triangulation)
- #s=sc.deepCpy() ; t=tc.buildUnstructured() ; t.convertAllToPoly() ; t=MEDCoupling1DGTUMesh(t)
+ #s=sc.deepCopy() ; t=tc.buildUnstructured() ; t.convertAllToPoly() ; t=MEDCoupling1DGTUMesh(t)
#self.assertTrue(isinstance(s,MEDCouplingCMesh))
#self.assertTrue(isinstance(t,MEDCoupling1DGTUMesh))
#rem.prepare(s,t,"P0P0")
arr=DataArrayDouble(3) ; arr.iota()
m=MEDCouplingCMesh() ; m.setCoords(arr,arr)
src=m.buildUnstructured()
- trg=src.deepCpy() ; trg=trg[[0,1,3]]
+ trg=src.deepCopy() ; trg=trg[[0,1,3]]
trg.getCoords()[:]*=0.5 ; trg.getCoords()[:]+=[0.3,0.25]
# Let's interpolate.
rem=MEDCouplingRemapper()
self.assertAlmostEqual(m[2,2],0.05,12)
self.assertAlmostEqual(m[2,3],0.075,12)
self.assertEqual(diff.getnnz(),0)
- # IntegralGlobConstraint (division by sum of cols)
+ # ExtensiveConservation (division by sum of cols)
colSum=m.sum(axis=0)
# version 0.12.0 # m_0=m*diags(array(1/colSum),[0])
m_0=m*spdiags(array(1/colSum),[0],colSum.shape[1],colSum.shape[1])
self.assertAlmostEqual(m_0[2,2],1.,12)
self.assertAlmostEqual(m_0[2,3],1.,12)
self.assertEqual(m_0.getnnz(),7)
- # ConservativeVolumic (division by sum of rows)
+ # IntensiveMaximum (division by sum of rows)
rowSum=m.sum(axis=1)
# version 0.12.0 # m_1=diags(array(1/rowSum.transpose()),[0])*m
m_1=spdiags(array(1/rowSum.transpose()),[0],rowSum.shape[0],rowSum.shape[0])*m
pass
vals*=1e-5
eps0=DataArrayDouble(m0.data)-vals ; eps0.abs()
- self.assertTrue(eps0.getIdsInRange(1e-17,1e300).empty())
+ self.assertTrue(eps0.findIdsInRange(1e-17,1e300).empty())
self.assertTrue(DataArrayInt(m0.indices).isEqual(DataArrayInt([0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27])))
self.assertTrue(DataArrayInt(m0.indptr).isEqual(DataArrayInt([0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,255,258,261,264,267,270,273,276,279,282,285,288,291,294,297,300,303,306,309,312])))
#
# m is ready
m1,d,di,rd,rdi=m.buildUnstructured().buildDescendingConnectivity()
rdi2=rdi.deltaShiftIndex()
- cellIds=rdi2.getIdsEqual(1)
+ cellIds=rdi2.findIdsEqual(1)
skinAndNonConformCells=m1[cellIds]
skinAndNonConformCells.zipCoords() # at this point skinAndNonConformCells contains non conform cells and skin cells. Now trying to split them in two parts.
#
mat=rem.getCrudeCSRMatrix()
indptr=DataArrayInt(mat.indptr)
indptr2=indptr.deltaShiftIndex()
- cellIdsOfNonConformCells=indptr2.getIdsNotEqual(1)
- cellIdsOfSkin=indptr2.getIdsEqual(1)
+ cellIdsOfNonConformCells=indptr2.findIdsNotEqual(1)
+ cellIdsOfSkin=indptr2.findIdsEqual(1)
self.assertTrue(cellIdsOfSkin.isEqual(DataArrayInt([1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,23])))
self.assertTrue(cellIdsOfNonConformCells.isEqual(DataArrayInt([0,4,18,22])))
pass
fsource.setMesh(source)
arr=DataArrayDouble(len(sourceCoo)) ; arr.iota(0.7) ; arr*=arr
fsource.setArray(arr)
- fsource.setNature(ConservativeVolumic)
+ fsource.setNature(IntensiveMaximum)
#
rem=MEDCouplingRemapper()
rem.setIntersectionType(PointLocator)
srcMesh=m[0].getMesh().buildUnstructured()
srcField=MEDCouplingFieldDouble(ON_CELLS)
fine2=DataArrayDouble(3*2*4*4) ; fine2.iota(0) ; srcField.setArray(fine2)
- srcField.setMesh(srcMesh) ; srcField.setNature(Integral)
+ srcField.setMesh(srcMesh) ; srcField.setNature(ExtensiveMaximum)
#
trgField=MEDCouplingFieldDouble(ON_CELLS)
coarse2=DataArrayDouble(35) ; coarse2.iota(0) ; trgField.setArray(coarse2)
- trgField.setMesh(trgMesh) ; trgField.setNature(Integral)
+ trgField.setMesh(trgMesh) ; trgField.setNature(ExtensiveMaximum)
#
rem=MEDCouplingRemapper()
rem.prepare(srcMesh,trgMesh,"P0P0")
//
// Author : Anthony Geay (CEA/DEN)
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingTimeDiscretization : public TimeLabel, public BigMemoryObject
{
const char *getTimeUnit() const;
virtual void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
virtual void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
- virtual void checkCoherency() const throw(INTERP_KERNEL::Exception);
+ virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
virtual bool areCompatible(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
virtual bool areStrictlyCompatible(const MEDCouplingTimeDiscretization *other, std::string& reason) const throw(INTERP_KERNEL::Exception);
virtual bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
virtual bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
virtual bool isEqual(const MEDCouplingTimeDiscretization *other, double prec) const throw(INTERP_KERNEL::Exception);
virtual bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCpy) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingTimeDiscretization *buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCopy) const throw(INTERP_KERNEL::Exception);
virtual std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
virtual TypeOfTimeDiscretization getEnum() const throw(INTERP_KERNEL::Exception);
virtual void synchronizeTimeWith(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
virtual void divideEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
virtual MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
virtual void powEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
- virtual MEDCouplingTimeDiscretization *performCpy(bool deepCpy) const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
void setTimeTolerance(double val);
double getTimeTolerance() const;
virtual void checkNoTimePresence() const throw(INTERP_KERNEL::Exception);
virtual void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
virtual void applyFunc(int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception);
virtual void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void applyFunc2(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void applyFunc3(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
+ virtual void applyFuncCompo(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
+ virtual void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
virtual void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
virtual void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
virtual void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception);
virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void fillFromAnalytic2(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
- virtual void fillFromAnalytic3(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
+ virtual void fillFromAnalyticCompo(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
+ virtual void fillFromAnalyticNamedCompo(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
//
virtual ~MEDCouplingTimeDiscretization();
};
{
public:
MEDCouplingNoTimeLabel();
- MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCpy);
+ MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCopy);
public:
static const TypeOfTimeDiscretization DISCRETIZATION=NO_TIME;
static const char REPR[];
{
protected:
MEDCouplingConstOnTimeInterval();
- MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCpy);
+ MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCopy);
public:
static const TypeOfTimeDiscretization DISCRETIZATION=CONST_ON_TIME_INTERVAL;
static const char REPR[];
#include "MEDCouplingDataArrayTypemaps.i"
-static PyObject *convertMesh(ParaMEDMEM::MEDCouplingMesh *mesh, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMesh(MEDCoupling::MEDCouplingMesh *mesh, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!mesh)
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingUMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCoupling1SGTUMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1SGTUMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCoupling1DGTUMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingExtrudedMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingExtrudedMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingCMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingCurveLinearMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingIMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingIMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingUMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDCoupling1SGTUMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDCoupling1DGTUMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDCoupling1DGTUMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingMappedExtrudedMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDCouplingMappedExtrudedMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingCMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingCurveLinearMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingIMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDCouplingIMesh,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of mesh on downcast !");
return ret;
}
-static PyObject *convertFieldDiscretization(ParaMEDMEM::MEDCouplingFieldDiscretization *fd, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertFieldDiscretization(MEDCoupling::MEDCouplingFieldDiscretization *fd, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!fd)
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationP0 *>(fd))
- ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationP0,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationP1 *>(fd))
- ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationP1,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationGauss *>(fd))
- ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationGauss,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationGaussNE *>(fd))
- ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationGaussNE,owner);
- if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldDiscretizationKriging *>(fd))
- ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDiscretizationKriging,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldDiscretizationP0 *>(fd))
+ ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDiscretizationP0,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldDiscretizationP1 *>(fd))
+ ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDiscretizationP1,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldDiscretizationGauss *>(fd))
+ ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDiscretizationGauss,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldDiscretizationGaussNE *>(fd))
+ ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDiscretizationGaussNE,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldDiscretizationKriging *>(fd))
+ ret=SWIG_NewPointerObj(reinterpret_cast<void*>(fd),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDiscretizationKriging,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of field discretization on downcast !");
return ret;
}
-static PyObject* convertMultiFields(ParaMEDMEM::MEDCouplingMultiFields *mfs, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject* convertMultiFields(MEDCoupling::MEDCouplingMultiFields *mfs, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!mfs)
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingFieldOverTime *>(mfs))
- ret=SWIG_NewPointerObj((void*)mfs,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldOverTime,owner);
+ if(dynamic_cast<MEDCoupling::MEDCouplingFieldOverTime *>(mfs))
+ ret=SWIG_NewPointerObj((void*)mfs,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldOverTime,owner);
else
- ret=SWIG_NewPointerObj((void*)mfs,SWIGTYPE_p_ParaMEDMEM__MEDCouplingMultiFields,owner);
+ ret=SWIG_NewPointerObj((void*)mfs,SWIGTYPE_p_MEDCoupling__MEDCouplingMultiFields,owner);
return ret;
}
-static PyObject *convertPartDefinition(ParaMEDMEM::PartDefinition *pd, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertPartDefinition(MEDCoupling::PartDefinition *pd, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!pd)
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::DataArrayPartDefinition *>(pd))
- ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_ParaMEDMEM__DataArrayPartDefinition,owner);
+ if(dynamic_cast<MEDCoupling::DataArrayPartDefinition *>(pd))
+ ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__DataArrayPartDefinition,owner);
else
- ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_ParaMEDMEM__SlicePartDefinition,owner);
+ ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_MEDCoupling__SlicePartDefinition,owner);
return ret;
}
-static PyObject *convertCartesianAMRMesh(ParaMEDMEM::MEDCouplingCartesianAMRMeshGen *mesh, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertCartesianAMRMesh(MEDCoupling::MEDCouplingCartesianAMRMeshGen *mesh, int owner) throw(INTERP_KERNEL::Exception)
{
if(!mesh)
{
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRMeshSub *>(mesh))
+ if(dynamic_cast<MEDCoupling::MEDCouplingCartesianAMRMeshSub *>(mesh))
{
- return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMeshSub,owner);
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_MEDCoupling__MEDCouplingCartesianAMRMeshSub,owner);
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRMesh *>(mesh))
+ if(dynamic_cast<MEDCoupling::MEDCouplingCartesianAMRMesh *>(mesh))
{
- return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMesh,owner);
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(mesh),SWIGTYPE_p_MEDCoupling__MEDCouplingCartesianAMRMesh,owner);
}
throw INTERP_KERNEL::Exception("convertCartesianAMRMesh wrap : unrecognized type of cartesian AMR mesh !");
}
-static PyObject *convertDataForGodFather(ParaMEDMEM::MEDCouplingDataForGodFather *data, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertDataForGodFather(MEDCoupling::MEDCouplingDataForGodFather *data, int owner) throw(INTERP_KERNEL::Exception)
{
if(!data)
{
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingAMRAttribute *>(data))
+ if(dynamic_cast<MEDCoupling::MEDCouplingAMRAttribute *>(data))
{
- return SWIG_NewPointerObj(reinterpret_cast<void*>(data),SWIGTYPE_p_ParaMEDMEM__MEDCouplingAMRAttribute,owner);
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(data),SWIGTYPE_p_MEDCoupling__MEDCouplingAMRAttribute,owner);
}
throw INTERP_KERNEL::Exception("convertDataForGodFather wrap : unrecognized data type for AMR !");
}
-static PyObject *convertCartesianAMRPatch(ParaMEDMEM::MEDCouplingCartesianAMRPatchGen *patch, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertCartesianAMRPatch(MEDCoupling::MEDCouplingCartesianAMRPatchGen *patch, int owner) throw(INTERP_KERNEL::Exception)
{
if(!patch)
{
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRPatchGF *>(patch))
+ if(dynamic_cast<MEDCoupling::MEDCouplingCartesianAMRPatchGF *>(patch))
{
- return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatchGF,owner);
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_MEDCoupling__MEDCouplingCartesianAMRPatchGF,owner);
}
- if(dynamic_cast<ParaMEDMEM::MEDCouplingCartesianAMRPatch *>(patch))
+ if(dynamic_cast<MEDCoupling::MEDCouplingCartesianAMRPatch *>(patch))
{
- return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatch,owner);
+ return SWIG_NewPointerObj(reinterpret_cast<void*>(patch),SWIGTYPE_p_MEDCoupling__MEDCouplingCartesianAMRPatch,owner);
}
throw INTERP_KERNEL::Exception("convertCartesianAMRPatch wrap : unrecognized type of cartesian AMR patch !");
}
-static ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___add__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__add__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__add__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- ParaMEDMEM::MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCoupling::MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
return (*self)+(*other);
else
}
//
double val;
- ParaMEDMEM::DataArrayDouble *a;
- ParaMEDMEM::DataArrayDoubleTuple *aa;
+ MEDCoupling::DataArrayDouble *a;
+ MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
int sw;
convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=self->getArray()->deepCpy();
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=self->getArray()->deepCopy();
ret->applyLin(1.,val);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Add(self->getArray(),a);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Add(self->getArray(),a);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Add(self->getArray(),aaa);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Add(self->getArray(),aaa);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=ParaMEDMEM::DataArrayDouble::New(); aaa->useArray(&bb[0],false,ParaMEDMEM::CPP_DEALLOC,1,(int)bb.size());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Add(self->getArray(),aaa);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Add(self->getArray(),aaa);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
}
}
-static ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___radd__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___radd__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___add__Impl(self,obj);
}
-static ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___rsub__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rsub__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__rsub__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__rsub__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- ParaMEDMEM::MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCoupling::MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
return (*other)-(*self);
else
}
//
double val;
- ParaMEDMEM::DataArrayDouble *a;
- ParaMEDMEM::DataArrayDoubleTuple *aa;
+ MEDCoupling::DataArrayDouble *a;
+ MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
int sw;
convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=self->getArray()->deepCpy();
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=self->getArray()->deepCopy();
ret->applyLin(-1.,val);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Substract(a,self->getArray());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Substract(a,self->getArray());
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Substract(aaa,self->getArray());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Substract(aaa,self->getArray());
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=ParaMEDMEM::DataArrayDouble::New(); aaa->useArray(&bb[0],false,ParaMEDMEM::CPP_DEALLOC,1,(int)bb.size());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Substract(aaa,self->getArray());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Substract(aaa,self->getArray());
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
}
}
-static ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+static MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___mul__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__mul__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__mul__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- ParaMEDMEM::MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCoupling::MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
return (*self)*(*other);
else
}
//
double val;
- ParaMEDMEM::DataArrayDouble *a;
- ParaMEDMEM::DataArrayDoubleTuple *aa;
+ MEDCoupling::DataArrayDouble *a;
+ MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
int sw;
convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=self->getArray()->deepCpy();
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=self->getArray()->deepCopy();
ret->applyLin(val,0.);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Multiply(self->getArray(),a);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Multiply(self->getArray(),a);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Multiply(self->getArray(),aaa);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Multiply(self->getArray(),aaa);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=ParaMEDMEM::DataArrayDouble::New(); aaa->useArray(&bb[0],false,ParaMEDMEM::CPP_DEALLOC,1,(int)bb.size());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Multiply(self->getArray(),aaa);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Multiply(self->getArray(),aaa);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
}
}
-ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___rmul__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rmul__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- return ParaMEDMEM_MEDCouplingFieldDouble___mul__Impl(self,obj);
+ return MEDCoupling_MEDCouplingFieldDouble___mul__Impl(self,obj);
}
-ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___rdiv__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling_MEDCouplingFieldDouble___rdiv__Impl(MEDCoupling::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
{
const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__rdiv__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";
const char msg2[]="in MEDCouplingFieldDouble.__div__ : self field has no Array of values set !";
void *argp;
//
- if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,0|0)))
+ if(SWIG_IsOK(SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,0|0)))
{
- ParaMEDMEM::MEDCouplingFieldDouble *other=reinterpret_cast< ParaMEDMEM::MEDCouplingFieldDouble * >(argp);
+ MEDCoupling::MEDCouplingFieldDouble *other=reinterpret_cast< MEDCoupling::MEDCouplingFieldDouble * >(argp);
if(other)
return (*other)/(*self);
else
}
//
double val;
- ParaMEDMEM::DataArrayDouble *a;
- ParaMEDMEM::DataArrayDoubleTuple *aa;
+ MEDCoupling::DataArrayDouble *a;
+ MEDCoupling::DataArrayDoubleTuple *aa;
std::vector<double> bb;
int sw;
convertObjToPossibleCpp5(obj,sw,val,a,aa,bb);
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=self->getArray()->deepCpy();
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=self->getArray()->deepCopy();
ret->applyInv(val);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Divide(a,self->getArray());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Divide(a,self->getArray());
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Divide(aaa,self->getArray());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=aa->buildDADouble(1,self->getNumberOfComponents());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Divide(aaa,self->getArray());
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
{
if(!self->getArray())
throw INTERP_KERNEL::Exception(msg2);
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> aaa=ParaMEDMEM::DataArrayDouble::New(); aaa->useArray(&bb[0],false,ParaMEDMEM::CPP_DEALLOC,1,(int)bb.size());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayDouble> ret=ParaMEDMEM::DataArrayDouble::Divide(aaa,self->getArray());
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingFieldDouble> ret2=self->clone(false);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> aaa=MEDCoupling::DataArrayDouble::New(); aaa->useArray(&bb[0],false,MEDCoupling::CPP_DEALLOC,1,(int)bb.size());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> ret=MEDCoupling::DataArrayDouble::Divide(aaa,self->getArray());
+ MEDCoupling::MCAuto<MEDCoupling::MEDCouplingFieldDouble> ret2=self->clone(false);
ret2->setArray(ret);
return ret2.retn();
}
#include <cstring>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDFileString::MEDFileString(int maxLgth):_max_lgth(maxLgth),_content(new char[maxLgth+1])
{
#include <string>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileString
{
#include "MEDFileData.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDFileData *MEDFileData::New(const std::string& fileName)
{
return new MEDFileData;
}
-MEDFileData *MEDFileData::deepCpy() const
+MEDFileData *MEDFileData::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> fields;
+ MCAuto<MEDFileFields> fields;
if((const MEDFileFields *)_fields)
- fields=_fields->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> meshes;
+ fields=_fields->deepCopy();
+ MCAuto<MEDFileMeshes> meshes;
if((const MEDFileMeshes *)_meshes)
- meshes=_meshes->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileParameters> params;
+ meshes=_meshes->deepCopy();
+ MCAuto<MEDFileParameters> params;
if((const MEDFileParameters *)_params)
- params=_params->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> ret(MEDFileData::New());
+ params=_params->deepCopy();
+ MCAuto<MEDFileData> ret(MEDFileData::New());
ret->_fields=fields; ret->_meshes=meshes; ret->_params=params;
return ret.retn();
}
std::vector< MEDFileMesh * > meshesImpacted;
std::vector< DataArrayInt * > renumParamsOfMeshImpacted;//same size as meshesImpacted
std::vector< std::vector<int> > oldCodeOfMeshImpacted,newCodeOfMeshImpacted;//same size as meshesImpacted
- std::vector<MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > memSaverIfThrow;//same size as meshesImpacted
+ std::vector<MCAuto<DataArrayInt> > memSaverIfThrow;//same size as meshesImpacted
for(int i=0;i<ms->getNumberOfMeshes();i++)
{
MEDFileMesh *m=ms->getMeshAtPos(i);
#ifndef __MEDFILEDATA_HXX__
#define __MEDFILEDATA_HXX__
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDFileParameter.hxx"
#include "MEDFileField.hxx"
#include "MEDFileMesh.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* User class.
public:
MEDLOADER_EXPORT static MEDFileData *New(const std::string& fileName);
MEDLOADER_EXPORT static MEDFileData *New();
- MEDLOADER_EXPORT MEDFileData *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileData *deepCopy() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT MEDFileFields *getFields() const;
MEDFileData();
MEDFileData(const std::string& fileName);
private:
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fields;
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _meshes;
- MEDCouplingAutoRefCountObjectPtr<MEDFileParameters> _params;
+ MCAuto<MEDFileFields> _fields;
+ MCAuto<MEDFileMeshes> _meshes;
+ MCAuto<MEDFileParameters> _params;
};
}
extern med_geometry_type typmai3[34];
extern med_geometry_type typmainoeud[1];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDFileEquivalencePair *MEDFileEquivalencePair::Load(MEDFileEquivalences *father, med_idt fid, const std::string& name, const std::string &desc)
{
if(!father)
throw INTERP_KERNEL::Exception("MEDFileEquivalencePair::Load : father is NULL ! Should not !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> ret(new MEDFileEquivalencePair(father,name,desc));
+ MCAuto<MEDFileEquivalencePair> ret(new MEDFileEquivalencePair(father,name,desc));
ret->load(fid);
return ret.retn();
}
return getFather()->getMesh();
}
-MEDFileEquivalencePair *MEDFileEquivalencePair::deepCpy(MEDFileEquivalences *father) const
+MEDFileEquivalencePair *MEDFileEquivalencePair::deepCopy(MEDFileEquivalences *father) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> ret(new MEDFileEquivalencePair(father,_name,_description));
+ MCAuto<MEDFileEquivalencePair> ret(new MEDFileEquivalencePair(father,_name,_description));
const MEDFileEquivalenceCell *cell(_cell);
if(cell)
- ret->_cell=cell->deepCpy(const_cast<MEDFileEquivalencePair *>(this));
+ ret->_cell=cell->deepCopy(const_cast<MEDFileEquivalencePair *>(this));
const MEDFileEquivalenceNode *node(_node);
if(node)
- ret->_node=node->deepCpy(const_cast<MEDFileEquivalencePair *>(this));
+ ret->_node=node->deepCopy(const_cast<MEDFileEquivalencePair *>(this));
return ret.retn();
}
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceSize,(fid,meshName.c_str(),_name.c_str(),dt,it,MED_NODE,MED_NONE,&ncor));
if(ncor>0)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da(DataArrayInt::New());
+ MCAuto<DataArrayInt> da(DataArrayInt::New());
da->alloc(ncor*2);
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceRd,(fid,meshName.c_str(),_name.c_str(),dt,it,MED_NODE,MED_NONE,da->getPointer()));
da->applyLin(1,-1);
da->rearrange(2);
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceNode> node(new MEDFileEquivalenceNode(this,da));
+ MCAuto<MEDFileEquivalenceNode> node(new MEDFileEquivalenceNode(this,da));
_node=node;
}
_cell=MEDFileEquivalenceCell::Load(fid,this);
void MEDFileEquivalences::pushEquivalence(MEDFileEquivalencePair *elt)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> elta(elt);
+ MCAuto<MEDFileEquivalencePair> elta(elt);
if(elt)
elt->incrRef();
_equ.push_back(elta);
MEDFileEquivalencePair *MEDFileEquivalences::getEquivalenceWithName(const std::string& name)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> >::iterator it=_equ.begin();it!=_equ.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalencePair> >::iterator it=_equ.begin();it!=_equ.end();it++)
{
MEDFileEquivalencePair *elt(*it);
if(elt)
std::vector<std::string> MEDFileEquivalences::getEquivalenceNames() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++)
{
const MEDFileEquivalencePair *elt(*it);
if(elt)
MEDFileEquivalencePair *MEDFileEquivalences::appendEmptyEquivalenceWithName(const std::string& name)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> elt(MEDFileEquivalencePair::New(this,name));
+ MCAuto<MEDFileEquivalencePair> elt(MEDFileEquivalencePair::New(this,name));
_equ.push_back(elt);
return elt;
}
-MEDFileEquivalences *MEDFileEquivalences::deepCpy(MEDFileMesh *owner) const
+MEDFileEquivalences *MEDFileEquivalences::deepCopy(MEDFileMesh *owner) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalences> ret(new MEDFileEquivalences(owner));
+ MCAuto<MEDFileEquivalences> ret(new MEDFileEquivalences(owner));
ret->deepCpyFrom(*this);
return ret.retn();
}
void MEDFileEquivalences::getRepr(std::ostream& oss) const
{
std::size_t ii(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++,ii++)
+ for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++,ii++)
{
const MEDFileEquivalencePair *elt(*it);
oss << "Equivalence #" << ii << " : " ;
void MEDFileEquivalences::killEquivalenceWithName(const std::string& name)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> >::iterator it(_equ.begin());
+ std::vector< MCAuto<MEDFileEquivalencePair> >::iterator it(_equ.begin());
for(;it!=_equ.end();it++)
{
const MEDFileEquivalencePair *elt(*it);
std::ostringstream oss; oss << "MEDFileEquivalences::killEquivalenceAt : Id must be in [0," << sz << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> >::iterator it(_equ.begin());
+ std::vector< MCAuto<MEDFileEquivalencePair> >::iterator it(_equ.begin());
for(int j=0;j<i;it++,j++);
_equ.erase(it);
}
void MEDFileEquivalences::write(med_idt fid) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=_equ.begin();it!=_equ.end();it++)
{
const MEDFileEquivalencePair *elt(*it);
if(elt)
MEDFileEquivalences *MEDFileEquivalences::Load(med_idt fid, int nbOfEq, MEDFileMesh *owner)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalences> ret(new MEDFileEquivalences(owner));
+ MCAuto<MEDFileEquivalences> ret(new MEDFileEquivalences(owner));
if(!owner)
throw INTERP_KERNEL::Exception("MEDFileEquivalences::Load : owner is NULL !");
std::string meshName(owner->getName());
int nstep,nocstpncor;
MEDFILESAFECALLERRD0(MEDequivalenceInfo,(fid,meshName.c_str(),i+1,equ,desc,&nstep,&nocstpncor));
std::string eqName(MEDLoaderBase::buildStringFromFortran(equ,MED_NAME_SIZE)),eqDescName(MEDLoaderBase::buildStringFromFortran(desc,MED_COMMENT_SIZE));
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> eqv(MEDFileEquivalencePair::Load(ret,fid,eqName,eqDescName));
+ MCAuto<MEDFileEquivalencePair> eqv(MEDFileEquivalencePair::Load(ret,fid,eqName,eqDescName));
ret->pushEquivalence(eqv);
}
return ret.retn();
void MEDFileEquivalences::deepCpyFrom(const MEDFileEquivalences& other)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> >::const_iterator it=other._equ.begin();it!=other._equ.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalencePair> >::const_iterator it=other._equ.begin();it!=other._equ.end();it++)
{
const MEDFileEquivalencePair *elt(*it);
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> eltCpy;
+ MCAuto<MEDFileEquivalencePair> eltCpy;
if(elt)
{
- eltCpy=elt->deepCpy(this);
+ eltCpy=elt->deepCopy(this);
}
_equ.push_back(eltCpy);
}
INTERP_KERNEL::AutoPtr<char> name(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
MEDLoaderBase::safeStrCpy(meshName.c_str(),MED_NAME_SIZE,meshName2,getFather()->getMesh()->getTooLongStrPolicy());
MEDLoaderBase::safeStrCpy(equName.c_str(),MED_NAME_SIZE,name,getFather()->getMesh()->getTooLongStrPolicy());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da2(da->deepCpy()); da2->rearrange(1); da2->applyLin(1,1); da2->rearrange(2);
+ MCAuto<DataArrayInt> da2(da->deepCopy()); da2->rearrange(1); da2->applyLin(1,1); da2->rearrange(2);
MEDFILESAFECALLERWR0(MEDequivalenceCorrespondenceWr,(fid,meshName2,name,dt,it,medtype,medgt,da2->getNumberOfTuples(),da2->begin()));
}
return sizeof(MEDFileEquivalenceCellType);
}
-MEDFileEquivalenceCellType *MEDFileEquivalenceCellType::deepCpy(MEDFileEquivalencePair *owner) const
+MEDFileEquivalenceCellType *MEDFileEquivalenceCellType::deepCopy(MEDFileEquivalencePair *owner) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da;
+ MCAuto<DataArrayInt> da;
if(getArray())
- da=getArray()->deepCpy();
+ da=getArray()->deepCopy();
return new MEDFileEquivalenceCellType(owner,_type,da);
}
MEDFileEquivalenceCell *MEDFileEquivalenceCell::Load(med_idt fid, MEDFileEquivalencePair *owner)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCell> ret(new MEDFileEquivalenceCell(owner));
+ MCAuto<MEDFileEquivalenceCell> ret(new MEDFileEquivalenceCell(owner));
ret->load(fid);
if(ret->size()>0)
return ret.retn();
void MEDFileEquivalenceCell::write(med_idt fid) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
{
const MEDFileEquivalenceCellType *ct(*it);
if(ct)
}
}
-MEDFileEquivalenceCell *MEDFileEquivalenceCell::deepCpy(MEDFileEquivalencePair *owner) const
+MEDFileEquivalenceCell *MEDFileEquivalenceCell::deepCopy(MEDFileEquivalencePair *owner) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCell> ret(new MEDFileEquivalenceCell(owner));
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
+ MCAuto<MEDFileEquivalenceCell> ret(new MEDFileEquivalenceCell(owner));
+ for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
{
const MEDFileEquivalenceCellType *elt(*it);
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> eltCpy;
+ MCAuto<MEDFileEquivalenceCellType> eltCpy;
if(elt)
- eltCpy=elt->deepCpy(owner);
+ eltCpy=elt->deepCopy(owner);
ret->_types.push_back(eltCpy);
}
return ret.retn();
void MEDFileEquivalenceCell::getRepr(std::ostream& oss) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
{
const MEDFileEquivalenceCellType *elt(*it);
if(elt)
DataArrayInt *MEDFileEquivalenceCell::getArray(INTERP_KERNEL::NormalizedCellType type)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> >::iterator it=_types.begin();it!=_types.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::iterator it=_types.begin();it!=_types.end();it++)
{
MEDFileEquivalenceCellType *elt(*it);
if(elt && elt->getType()==type)
MEDFileMesh *mm(getMesh());
int totalNbOfCells(mm->getNumberOfCellsAtLevel(meshDimRelToMax));
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(da->deepCpy()); tmp->rearrange(1);
+ MCAuto<DataArrayInt> tmp(da->deepCopy()); tmp->rearrange(1);
int maxv,minv;
tmp->getMinMaxValues(minv,maxv);
if((minv<0 || minv>=totalNbOfCells) || (maxv<0 || maxv>=totalNbOfCells))
for(std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator it=gts.begin();it!=gts.end();it++)
{
endId=startId+mm->getNumberOfCellsWithType(*it);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da0(da->keepSelectedComponents(compS));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids(da0->getIdsInRange(startId,endId));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da1(da->selectByTupleIdSafe(ids->begin(),ids->end()));
+ MCAuto<DataArrayInt> da0(da->keepSelectedComponents(compS));
+ MCAuto<DataArrayInt> ids(da0->findIdsInRange(startId,endId));
+ MCAuto<DataArrayInt> da1(da->selectByTupleIdSafe(ids->begin(),ids->end()));
da1->applyLin(1,-startId);
setArrayForType(*it,da1);
startId=endId;
void MEDFileEquivalenceCell::setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> >::iterator it=_types.begin();it!=_types.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::iterator it=_types.begin();it!=_types.end();it++)
{
MEDFileEquivalenceCellType *elt(*it);
if(elt && elt->getType()==type)
return ;
}
}
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> newElt(new MEDFileEquivalenceCellType(getFather(),type,da));
+ MCAuto<MEDFileEquivalenceCellType> newElt(new MEDFileEquivalenceCellType(getFather(),type,da));
_types.push_back(newElt);
}
std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileEquivalenceCell::getTypes() const
{
std::vector<INTERP_KERNEL::NormalizedCellType> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
+ for(std::vector< MCAuto<MEDFileEquivalenceCellType> >::const_iterator it=_types.begin();it!=_types.end();it++)
{
const MEDFileEquivalenceCellType *elt(*it);
if(elt)
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceSize,(fid,meshName.c_str(),name.c_str(),dt,it,MED_CELL,typmai[i],&ncor));
if(ncor>0)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da(DataArrayInt::New());
+ MCAuto<DataArrayInt> da(DataArrayInt::New());
da->alloc(ncor*2);
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceRd,(fid,meshName.c_str(),name.c_str(),dt,it,MED_CELL,typmai[i],da->getPointer()));
da->applyLin(1,-1);
da->rearrange(2);
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> ct(new MEDFileEquivalenceCellType(getFather(),typmai2[i],da));
+ MCAuto<MEDFileEquivalenceCellType> ct(new MEDFileEquivalenceCellType(getFather(),typmai2[i],da));
_types.push_back(ct);
}
}
writeLL(fid,MED_NODE,MED_NONE);
}
-MEDFileEquivalenceNode *MEDFileEquivalenceNode::deepCpy(MEDFileEquivalencePair *owner) const
+MEDFileEquivalenceNode *MEDFileEquivalenceNode::deepCopy(MEDFileEquivalencePair *owner) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da;
+ MCAuto<DataArrayInt> da;
if(getArray())
- da=getArray()->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceNode> ret(new MEDFileEquivalenceNode(owner,da));
+ da=getArray()->deepCopy();
+ MCAuto<MEDFileEquivalenceNode> ret(new MEDFileEquivalenceNode(owner,da));
return ret.retn();
}
#include "MEDCouplingRefCountObject.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDFileUtilities.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileEquivalenceCell;
class MEDFileEquivalenceNode;
MEDFileEquivalences *getFather() { return _father; }
const MEDFileMesh *getMesh() const;
MEDFileMesh *getMesh();
- MEDFileEquivalencePair *deepCpy(MEDFileEquivalences *father) const;
+ MEDFileEquivalencePair *deepCopy(MEDFileEquivalences *father) const;
bool isEqual(const MEDFileEquivalencePair *other, std::string& what) const;
void getRepr(std::ostream& oss) const;
static MEDFileEquivalencePair *New(MEDFileEquivalences *father, const std::string& name);
MEDFileEquivalences *_father;
std::string _name;
std::string _description;
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCell> _cell;
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceNode> _node;
+ MCAuto<MEDFileEquivalenceCell> _cell;
+ MCAuto<MEDFileEquivalenceNode> _node;
};
class MEDFileEquivalences : public RefCountObject
std::string getMeshName() const;
void pushEquivalence(MEDFileEquivalencePair *elt);
static MEDFileEquivalences *New(MEDFileMesh *owner) { return new MEDFileEquivalences(owner); }
- MEDFileEquivalences *deepCpy(MEDFileMesh *owner) const;
+ MEDFileEquivalences *deepCopy(MEDFileMesh *owner) const;
bool isEqual(const MEDFileEquivalences *other, std::string& what) const;
void getRepr(std::ostream& oss) const;
public:
void deepCpyFrom(const MEDFileEquivalences& other);
private:
MEDFileMesh *_owner;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalencePair> > _equ;
+ std::vector< MCAuto<MEDFileEquivalencePair> > _equ;
};
class MEDFileEquivalenceBase : public RefCountObject
protected:
~MEDFileEquivalenceData() { }
protected:
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _data;
+ MCAuto<DataArrayInt> _data;
};
class MEDFileEquivalenceCellType : public MEDFileEquivalenceData
MEDFileEquivalenceCellType(MEDFileEquivalencePair *owner, INTERP_KERNEL::NormalizedCellType type, DataArrayInt *data):MEDFileEquivalenceData(owner,data),_type(type) { }
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
INTERP_KERNEL::NormalizedCellType getType() const { return _type; }
- MEDFileEquivalenceCellType *deepCpy(MEDFileEquivalencePair *owner) const;
+ MEDFileEquivalenceCellType *deepCopy(MEDFileEquivalencePair *owner) const;
bool isEqual(const MEDFileEquivalenceCellType *other, std::string& what) const;
void getRepr(std::ostream& oss) const;
public:
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
static MEDFileEquivalenceCell *Load(med_idt fid, MEDFileEquivalencePair *owner);
void write(med_idt fid) const;
- MEDFileEquivalenceCell *deepCpy(MEDFileEquivalencePair *owner) const;
+ MEDFileEquivalenceCell *deepCopy(MEDFileEquivalencePair *owner) const;
bool isEqual(const MEDFileEquivalenceCell *other, std::string& what) const;
void getRepr(std::ostream& oss) const;
public:
void load(med_idt fid);
std::string getName() const { return getFather()->getName(); }
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalenceCellType> > _types;
+ std::vector< MCAuto<MEDFileEquivalenceCellType> > _types;
};
class MEDFileEquivalenceNode : public MEDFileEquivalenceData
MEDFileEquivalenceNode(MEDFileEquivalencePair *owner, DataArrayInt *data):MEDFileEquivalenceData(owner,data) { }
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
void write(med_idt fid) const;
- MEDFileEquivalenceNode *deepCpy(MEDFileEquivalencePair *owner) const;
+ MEDFileEquivalenceNode *deepCopy(MEDFileEquivalencePair *owner) const;
bool isEqual(const MEDFileEquivalenceNode *other, std::string& what) const;
void getRepr(std::ostream& oss) const;
private:
extern med_geometry_type typmainoeud[1];
extern med_geometry_type typmai3[34];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64";
const char MEDFileIntField1TSWithoutSDA::TYPE_STR[]="INT32";
_nb_gauss_pt=_w.size();
}
-MEDFileFieldLoc *MEDFileFieldLoc::deepCpy() const
+MEDFileFieldLoc *MEDFileFieldLoc::deepCopy() const
{
return new MEDFileFieldLoc(*this);
}
{
case ON_CELLS:
{
- getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,offset,offset+nbOfCells,1);
+ getOrCreateAndGetArray()->setContigPartOfSelectedValuesSlice(_start,arrr,offset,offset+nbOfCells,1);
_end=_start+nbOfCells;
_nval=nbOfCells;
break;
}
case ON_GAUSS_NE:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=field->getDiscretization()->getOffsetArr(field->getMesh());
+ MCAuto<DataArrayInt> arr=field->getDiscretization()->getOffsetArr(field->getMesh());
const int *arrPtr=arr->getConstPointer();
- getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,arrPtr[offset],arrPtr[offset+nbOfCells],1);
+ getOrCreateAndGetArray()->setContigPartOfSelectedValuesSlice(_start,arrr,arrPtr[offset],arrPtr[offset+nbOfCells],1);
_end=_start+(arrPtr[offset+nbOfCells]-arrPtr[offset]);
_nval=nbOfCells;
break;
if(!disc2)
throw INTERP_KERNEL::Exception("assignFieldNoProfile : invalid call to this method ! Internal Error !");
const DataArrayInt *dai=disc2->getArrayOfDiscIds();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> dai2=disc2->getOffsetArr(field->getMesh());
+ MCAuto<DataArrayInt> dai2=disc2->getOffsetArr(field->getMesh());
const int *dai2Ptr=dai2->getConstPointer();
int nbi=gsLoc.getWeights().size();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da2=dai->selectByTupleId2(offset,offset+nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da3=da2->getIdsEqual(_loc_id);
+ MCAuto<DataArrayInt> da2=dai->selectByTupleIdSafeSlice(offset,offset+nbOfCells,1);
+ MCAuto<DataArrayInt> da3=da2->findIdsEqual(_loc_id);
const int *da3Ptr=da3->getConstPointer();
if(da3->getNumberOfTuples()!=nbOfCells)
{//profile : for gauss even in NoProfile !!!
da3->setName(_profile.c_str());
glob.appendProfile(da3);
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da4=DataArrayInt::New();
+ MCAuto<DataArrayInt> da4=DataArrayInt::New();
_nval=da3->getNbOfElems();
da4->alloc(_nval*nbi,1);
int *da4Ptr=da4->getPointer();
case ON_NODES:
{
_nval=idsInPfl->getNumberOfTuples();
- getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,0,arrr->getNumberOfTuples(),1);
+ getOrCreateAndGetArray()->setContigPartOfSelectedValuesSlice(_start,arrr,0,arrr->getNumberOfTuples(),1);
_end=_start+_nval;
break;
}
}
case ON_GAUSS_NE:
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=field->getDiscretization()->getOffsetArr(mesh);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr2=arr->deltaShiftIndex();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr3=arr2->selectByTupleId(multiTypePfl->begin(),multiTypePfl->end());
- arr3->computeOffsets2();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=idsInPfl->buildExplicitArrByRanges(arr3);
+ MCAuto<DataArrayInt> arr=field->getDiscretization()->getOffsetArr(mesh);
+ MCAuto<DataArrayInt> arr2=arr->deltaShiftIndex();
+ MCAuto<DataArrayInt> arr3=arr2->selectByTupleId(multiTypePfl->begin(),multiTypePfl->end());
+ arr3->computeOffsetsFull();
+ MCAuto<DataArrayInt> tmp=idsInPfl->buildExplicitArrByRanges(arr3);
int trueNval=tmp->getNumberOfTuples();
_nval=idsInPfl->getNumberOfTuples();
getOrCreateAndGetArray()->setContigPartOfSelectedValues(_start,arrr,tmp);
throw INTERP_KERNEL::Exception("addNewEntryIfNecessaryGauss : invalid call to this method ! Internal Error !");
const DataArrayInt *da1=disc2->getArrayOfDiscIds();
const MEDCouplingGaussLocalization& gsLoc=field->getGaussLocalization(_loc_id);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da2=da1->selectByTupleId(idsInPfl->begin(),idsInPfl->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da3=da2->getIdsEqual(_loc_id);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da4=idsInPfl->selectByTupleId(da3->begin(),da3->end());
+ MCAuto<DataArrayInt> da2=da1->selectByTupleId(idsInPfl->begin(),idsInPfl->end());
+ MCAuto<DataArrayInt> da3=da2->findIdsEqual(_loc_id);
+ MCAuto<DataArrayInt> da4=idsInPfl->selectByTupleId(da3->begin(),da3->end());
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> mesh2=mesh->buildPart(multiTypePfl->begin(),multiTypePfl->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=disc2->getOffsetArr(mesh2);
+ MCAuto<MEDCouplingMesh> mesh2=mesh->buildPart(multiTypePfl->begin(),multiTypePfl->end());
+ MCAuto<DataArrayInt> arr=disc2->getOffsetArr(mesh2);
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=DataArrayInt::New();
+ MCAuto<DataArrayInt> tmp=DataArrayInt::New();
int trueNval=0;
for(const int *pt=da4->begin();pt!=da4->end();pt++)
trueNval+=arr->getIJ(*pt+1,0)-arr->getIJ(*pt,0);
oss << "_loc_" << _loc_id;
if(locIds)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da5=locIds->selectByTupleId(da3->begin(),da3->end());
+ MCAuto<DataArrayInt> da5=locIds->selectByTupleId(da3->begin(),da3->end());
da5->setName(oss.str().c_str());
glob.appendProfile(da5);
_profile=oss.str();
}
else
{
- if(!da3->isIdentity2(nbOfEltsInWholeMesh))
+ if(!da3->isIota(nbOfEltsInWholeMesh))
{
da3->setName(oss.str().c_str());
glob.appendProfile(da3);
{
_start=start;
_nval=arrr->getNumberOfTuples();
- getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,0,_nval,1);
+ getOrCreateAndGetArray()->setContigPartOfSelectedValuesSlice(_start,arrr,0,_nval,1);
_end=_start+_nval;
start=_end;
}
return ret;
}
-MEDFileFieldPerMeshPerTypePerDisc *MEDFileFieldPerMeshPerTypePerDisc::deepCpy(MEDFileFieldPerMeshPerType *father) const
+MEDFileFieldPerMeshPerTypePerDisc *MEDFileFieldPerMeshPerTypePerDisc::deepCopy(MEDFileFieldPerMeshPerType *father) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> ret=new MEDFileFieldPerMeshPerTypePerDisc(*this);
+ MCAuto<MEDFileFieldPerMeshPerTypePerDisc> ret=new MEDFileFieldPerMeshPerTypePerDisc(*this);
ret->_father=father;
return ret.retn();
}
const DataArrayPartDefinition *dpd(dynamic_cast<const DataArrayPartDefinition *>(pd));
if(dpd)
{
- dpd->checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> myIds(dpd->toDAI());
+ dpd->checkConsistencyLight();
+ MCAuto<DataArrayInt> myIds(dpd->toDAI());
int a(myIds->getMinValueInArray()),b(myIds->getMaxValueInArray());
myIds->applyLin(1,-a);
int nbOfEltsToLoad(b-a+1);
med_filter filter=MED_FILTER_INIT;
{//TODO : manage int32 !
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> tmp(DataArrayDouble::New());
tmp->alloc(nbOfEltsToLoad,nbOfCompo);
MEDfilterBlockOfEntityCr(fid,/*nentity*/overallNval,/*nvaluesperentity*/nbi,/*nconstituentpervalue*/nbOfCompo,
MED_ALL_CONSTITUENT,MED_FULL_INTERLACE,MED_COMPACT_STMODE,MED_NO_PROFILE,
/*start*/a+1,/*stride*/1,/*count*/1,/*blocksize*/nbOfEltsToLoad,
/*lastblocksize=useless because count=1*/0,&filter);
MEDFILESAFECALLERRD0(MEDfieldValueAdvancedRd,(fid,fieldName.c_str(),iteration,order,menti,mgeoti,&filter,reinterpret_cast<unsigned char *>(tmp->getPointer())));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> feeder(DataArrayDouble::New());
+ MCAuto<DataArrayDouble> feeder(DataArrayDouble::New());
feeder->useExternalArrayWithRWAccess(reinterpret_cast<double *>(startFeedingPtr),_nval,nbOfCompo);
feeder->setContigPartOfSelectedValues(0,tmp,myIds);
}
const DataArrayInt *explicitIdsInMesh,
const std::vector<int>& newCode,
MEDFileFieldGlobsReal& glob, DataArrayDouble *arr,
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >& result)
+ std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >& result)
{
if(entriesOnSameDisc.empty())
return false;
int nbi=szTuples/szEntities;
if(szTuples%szEntities!=0)
throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::RenumberChunks : internal error the splitting into same dicretization failed !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renumTuples=DataArrayInt::New(); renumTuples->alloc(szTuples,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ranges=MEDCouplingUMesh::ComputeRangesFromTypeDistribution(newCode);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > newGeoTypesPerChunk(entriesOnSameDisc.size());
+ MCAuto<DataArrayInt> renumTuples=DataArrayInt::New(); renumTuples->alloc(szTuples,1);
+ MCAuto<DataArrayInt> ranges=MEDCouplingUMesh::ComputeRangesFromTypeDistribution(newCode);
+ std::vector< MCAuto<DataArrayInt> > newGeoTypesPerChunk(entriesOnSameDisc.size());
std::vector< const DataArrayInt * > newGeoTypesPerChunk2(entriesOnSameDisc.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > newGeoTypesPerChunk_bis(entriesOnSameDisc.size());
+ std::vector< MCAuto<DataArrayInt> > newGeoTypesPerChunk_bis(entriesOnSameDisc.size());
std::vector< const DataArrayInt * > newGeoTypesPerChunk3(entriesOnSameDisc.size());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newGeoTypesPerChunk4=DataArrayInt::New(); newGeoTypesPerChunk4->alloc(szEntities,nbi);
+ MCAuto<DataArrayInt> newGeoTypesPerChunk4=DataArrayInt::New(); newGeoTypesPerChunk4->alloc(szEntities,nbi);
int id=0;
for(std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>::const_iterator it=entriesOnSameDisc.begin();it!=entriesOnSameDisc.end();it++,id++)
{
int startOfEltIdOfChunk=(*it)->_start;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newEltIds=explicitIdsInMesh->substr(startOfEltIdOfChunk,startOfEltIdOfChunk+(*it)->_nval);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> rangeIdsForChunk=newEltIds->findRangeIdForEachTuple(ranges);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsInRrangeForChunk=newEltIds->findIdInRangeForEachTuple(ranges);
+ MCAuto<DataArrayInt> newEltIds=explicitIdsInMesh->subArray(startOfEltIdOfChunk,startOfEltIdOfChunk+(*it)->_nval);
+ MCAuto<DataArrayInt> rangeIdsForChunk=newEltIds->findRangeIdForEachTuple(ranges);
+ MCAuto<DataArrayInt> idsInRrangeForChunk=newEltIds->findIdInRangeForEachTuple(ranges);
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=rangeIdsForChunk->duplicateEachTupleNTimes(nbi); rangeIdsForChunk->rearrange(nbi);
+ MCAuto<DataArrayInt> tmp=rangeIdsForChunk->duplicateEachTupleNTimes(nbi); rangeIdsForChunk->rearrange(nbi);
newGeoTypesPerChunk4->setPartOfValues1(tmp,(*it)->_tmp_work1-offset,(*it)->_tmp_work1+(*it)->_nval*nbi-offset,1,0,nbi,1);
//
newGeoTypesPerChunk[id]=rangeIdsForChunk; newGeoTypesPerChunk2[id]=rangeIdsForChunk;
newGeoTypesPerChunk_bis[id]=idsInRrangeForChunk; newGeoTypesPerChunk3[id]=idsInRrangeForChunk;
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newGeoTypesEltIdsAllGather=DataArrayInt::Aggregate(newGeoTypesPerChunk2); newGeoTypesPerChunk.clear(); newGeoTypesPerChunk2.clear();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newGeoTypesEltIdsAllGather2=DataArrayInt::Aggregate(newGeoTypesPerChunk3); newGeoTypesPerChunk_bis.clear(); newGeoTypesPerChunk3.clear();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diffVals=newGeoTypesEltIdsAllGather->getDifferentValues();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renumEltIds=newGeoTypesEltIdsAllGather->buildPermArrPerLevel();
+ MCAuto<DataArrayInt> newGeoTypesEltIdsAllGather=DataArrayInt::Aggregate(newGeoTypesPerChunk2); newGeoTypesPerChunk.clear(); newGeoTypesPerChunk2.clear();
+ MCAuto<DataArrayInt> newGeoTypesEltIdsAllGather2=DataArrayInt::Aggregate(newGeoTypesPerChunk3); newGeoTypesPerChunk_bis.clear(); newGeoTypesPerChunk3.clear();
+ MCAuto<DataArrayInt> diffVals=newGeoTypesEltIdsAllGather->getDifferentValues();
+ MCAuto<DataArrayInt> renumEltIds=newGeoTypesEltIdsAllGather->buildPermArrPerLevel();
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renumTupleIds=newGeoTypesPerChunk4->buildPermArrPerLevel();
+ MCAuto<DataArrayInt> renumTupleIds=newGeoTypesPerChunk4->buildPermArrPerLevel();
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arrPart=arr->substr(offset,offset+szTuples);
+ MCAuto<DataArrayDouble> arrPart=arr->subArray(offset,offset+szTuples);
arrPart->renumberInPlace(renumTupleIds->begin());
arr->setPartOfValues1(arrPart,offset,offset+szTuples,1,0,arrPart->getNumberOfComponents(),1);
bool ret=false;
int offset2=0;
for(int i=0;i<diffVals->getNumberOfTuples();i++,idIt++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=newGeoTypesEltIdsAllGather->getIdsEqual(*idIt);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> subIds=newGeoTypesEltIdsAllGather2->selectByTupleId(ids->begin(),ids->end());
+ MCAuto<DataArrayInt> ids=newGeoTypesEltIdsAllGather->findIdsEqual(*idIt);
+ MCAuto<DataArrayInt> subIds=newGeoTypesEltIdsAllGather2->selectByTupleId(ids->begin(),ids->end());
int nbEntityElts=subIds->getNumberOfTuples();
bool ret2;
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> eltToAdd=MEDFileFieldPerMeshPerTypePerDisc::
- NewObjectOnSameDiscThanPool(type,(INTERP_KERNEL::NormalizedCellType)newCode[3*(*idIt)],subIds,!subIds->isIdentity2(newCode[3*(*idIt)+1]),nbi,
+ MCAuto<MEDFileFieldPerMeshPerTypePerDisc> eltToAdd=MEDFileFieldPerMeshPerTypePerDisc::
+ NewObjectOnSameDiscThanPool(type,(INTERP_KERNEL::NormalizedCellType)newCode[3*(*idIt)],subIds,!subIds->isIota(newCode[3*(*idIt)+1]),nbi,
offset+offset2,
li,glob,ret2);
ret=ret || ret2;
std::size_t MEDFileFieldPerMeshPerType::getHeapMemorySizeWithoutChildren() const
{
- return _field_pm_pt_pd.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc>);
+ return _field_pm_pt_pd.capacity()*sizeof(MCAuto<MEDFileFieldPerMeshPerTypePerDisc>);
}
std::vector<const BigMemoryObject *> MEDFileFieldPerMeshPerType::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
ret.push_back((const MEDFileFieldPerMeshPerTypePerDisc *)*it);
return ret;
}
-MEDFileFieldPerMeshPerType *MEDFileFieldPerMeshPerType::deepCpy(MEDFileFieldPerMesh *father) const
+MEDFileFieldPerMeshPerType *MEDFileFieldPerMeshPerType::deepCopy(MEDFileFieldPerMesh *father) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerType> ret=new MEDFileFieldPerMeshPerType(*this);
+ MCAuto<MEDFileFieldPerMeshPerType> ret=new MEDFileFieldPerMeshPerType(*this);
ret->_father=father;
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++)
{
if((const MEDFileFieldPerMeshPerTypePerDisc *)*it)
- ret->_field_pm_pt_pd[i]=(*it)->deepCpy((MEDFileFieldPerMeshPerType *)ret);
+ ret->_field_pm_pt_pd[i]=(*it)->deepCopy((MEDFileFieldPerMeshPerType *)ret);
}
return ret.retn();
}
void MEDFileFieldPerMeshPerType::assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> pfl2=pfl->deepCpy();
+ MCAuto<DataArrayInt> pfl2=pfl->deepCopy();
if(!arr || !arr->isAllocated())
throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerType::assignNodeFieldProfile : input array is null, or not allocated !");
_field_pm_pt_pd.resize(1);
const DataArrayInt *da=disc2->getArrayOfDiscIds();
if(!da)
throw INTERP_KERNEL::Exception("addNewEntryIfNecessaryGauss (no profile) : no localization ids per cell array available ! The input Gauss node field is maybe invalid !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da2=da->selectByTupleId2(offset,offset+nbOfCells,1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> retTmp=da2->getDifferentValues();
+ MCAuto<DataArrayInt> da2=da->selectByTupleIdSafeSlice(offset,offset+nbOfCells,1);
+ MCAuto<DataArrayInt> retTmp=da2->getDifferentValues();
if(retTmp->presenceOfValue(-1))
throw INTERP_KERNEL::Exception("addNewEntryIfNecessaryGauss : some cells have no dicretization description !");
std::vector<int> ret(retTmp->begin(),retTmp->end());
const DataArrayInt *da=disc2->getArrayOfDiscIds();
if(!da)
throw INTERP_KERNEL::Exception("addNewEntryIfNecessaryGauss : no localization ids per cell array available ! The input Gauss node field is maybe invalid !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da2=da->selectByTupleIdSafe(subCells->getConstPointer(),subCells->getConstPointer()+subCells->getNumberOfTuples());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> retTmp=da2->getDifferentValues();
+ MCAuto<DataArrayInt> da2=da->selectByTupleIdSafe(subCells->getConstPointer(),subCells->getConstPointer()+subCells->getNumberOfTuples());
+ MCAuto<DataArrayInt> retTmp=da2->getDifferentValues();
if(retTmp->presenceOfValue(-1))
throw INTERP_KERNEL::Exception("addNewEntryIfNecessaryGauss : some cells have no dicretization description !");
std::vector<int> ret(retTmp->begin(),retTmp->end());
void MEDFileFieldPerMeshPerType::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
{
(*it)->fillTypesOfFieldAvailable(types);
}
oss << startLine3 << "Entry geometry type #" << id << " is lying on NODES." << std::endl;
oss << startLine3 << "Entry is defined on " << _field_pm_pt_pd.size() << " localizations." << std::endl;
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++)
{
const MEDFileFieldPerMeshPerTypePerDisc *cur=(*it);
if(cur)
void MEDFileFieldPerMeshPerType::getSizes(int& globalSz, int& nbOfEntries) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
{
globalSz+=(*it)->getNumberOfTuples();
}
bool MEDFileFieldPerMeshPerType::presenceOfMultiDiscPerGeoType() const
{
std::size_t nb(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
{
const MEDFileFieldPerMeshPerTypePerDisc *fmtd(*it);
if(fmtd)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
{
std::string tmp=(*it1)->getProfile();
if(!tmp.empty())
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
{
std::string tmp=(*it1)->getLocalization();
if(!tmp.empty() && tmp!=MED_GAUSS_ELNO)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
{
std::string tmp=(*it1)->getProfile();
if(!tmp.empty())
std::vector<std::string> MEDFileFieldPerMeshPerType::getLocsReallyUsedMulti() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
{
std::string tmp=(*it1)->getLocalization();
if(!tmp.empty() && tmp!=MED_GAUSS_ELNO)
void MEDFileFieldPerMeshPerType::changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
(*it1)->changePflsRefsNamesGen(mapOfModif);
}
void MEDFileFieldPerMeshPerType::changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it1=_field_pm_pt_pd.begin();it1!=_field_pm_pt_pd.end();it1++)
(*it1)->changeLocsRefsNamesGen(mapOfModif);
}
if(meshDim!=(int)cm.getDimension())
return ;
}
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
(*it)->getFieldAtLevel(type,glob,dads,pfls,locs,geoTypes);
}
void MEDFileFieldPerMeshPerType::fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const
{
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++)
{
(*it)->fillValues(i,startEntryId,entries);
}
}
-void MEDFileFieldPerMeshPerType::setLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves)
+void MEDFileFieldPerMeshPerType::setLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves)
{
_field_pm_pt_pd=leaves;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
(*it)->setFather(this);
}
bool MEDFileFieldPerMeshPerType::keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its)
{
bool ret(false);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > newPmPtPd;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > newPmPtPd;
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
if((*it)->getType()==tof)
{
newPmPtPd.push_back(*it);
{
if(_field_pm_pt_pd.size()<=idOfDisc)
return false;
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> elt(_field_pm_pt_pd[idOfDisc]);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > newPmPtPd(1,elt);
+ MCAuto<MEDFileFieldPerMeshPerTypePerDisc> elt(_field_pm_pt_pd[idOfDisc]);
+ std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > newPmPtPd(1,elt);
std::pair<int,int> bgEnd; bgEnd.first=_field_pm_pt_pd[idOfDisc]->getStart(); bgEnd.second=_field_pm_pt_pd[idOfDisc]->getEnd();
elt->setNewStart(globalNum);
globalNum=elt->getEnd();
void MEDFileFieldPerMeshPerType::loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
(*it)->loadOnlyStructureOfDataRecursively(fid,start,nasc);
}
void MEDFileFieldPerMeshPerType::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
(*it)->loadBigArray(fid,nasc);
}
void MEDFileFieldPerMeshPerType::writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
{
(*it)->copyOptionsFrom(*this);
(*it)->writeLL(fid,nasc);
std::size_t MEDFileFieldPerMesh::getHeapMemorySizeWithoutChildren() const
{
- return _mesh_name.capacity()+_field_pm_pt.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType >);
+ return _mesh_name.capacity()+_field_pm_pt.capacity()*sizeof(MCAuto< MEDFileFieldPerMeshPerType >);
}
std::vector<const BigMemoryObject *> MEDFileFieldPerMesh::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
ret.push_back((const MEDFileFieldPerMeshPerType *)*it);
return ret;
}
-MEDFileFieldPerMesh *MEDFileFieldPerMesh::deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const
+MEDFileFieldPerMesh *MEDFileFieldPerMesh::deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const
{
- MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > ret=new MEDFileFieldPerMesh(*this);
+ MCAuto< MEDFileFieldPerMesh > ret=new MEDFileFieldPerMesh(*this);
ret->_father=father;
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++,i++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++,i++)
{
if((const MEDFileFieldPerMeshPerType *)*it)
- ret->_field_pm_pt[i]=(*it)->deepCpy((MEDFileFieldPerMesh *)(ret));
+ ret->_field_pm_pt[i]=(*it)->deepCopy((MEDFileFieldPerMesh *)(ret));
}
return ret.retn();
}
oss << startLine << "## Field part (" << id << ") lying on mesh \"" << _mesh_name << "\", Mesh iteration=" << _mesh_iteration << ". Mesh order=" << _mesh_order << "." << std::endl;
oss << startLine << "## Field is defined on " << _field_pm_pt.size() << " types." << std::endl;
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++,i++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++,i++)
{
const MEDFileFieldPerMeshPerType *cur=*it;
if(cur)
void MEDFileFieldPerMesh::loadOnlyStructureOfDataRecursively(med_idt fid, int& start, const MEDFileFieldNameScope& nasc)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->loadOnlyStructureOfDataRecursively(fid,start,nasc);
}
void MEDFileFieldPerMesh::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->loadBigArraysRecursively(fid,nasc);
}
void MEDFileFieldPerMesh::getDimension(int& dim) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->getDimension(dim);
}
void MEDFileFieldPerMesh::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->fillTypesOfFieldAvailable(types);
}
bool MEDFileFieldPerMesh::presenceOfMultiDiscPerGeoType() const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
const MEDFileFieldPerMeshPerType *fpmt(*it);
if(!fpmt)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsed();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
std::vector<std::string> MEDFileFieldPerMesh::getPflsReallyUsedMulti() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsedMulti();
ret.insert(ret.end(),tmp.begin(),tmp.end());
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsed();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
std::vector<std::string> MEDFileFieldPerMesh::getLocsReallyUsedMulti() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsedMulti();
ret.insert(ret.end(),tmp.begin(),tmp.end());
else
otherEntries.push_back(getLeafGivenTypeAndLocId((*it).first.first,(*it).first.second));
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renumDefrag=DataArrayInt::New(); renumDefrag->alloc(arr->getNumberOfTuples(),1); renumDefrag->fillWithZero();
+ MCAuto<DataArrayInt> renumDefrag=DataArrayInt::New(); renumDefrag->alloc(arr->getNumberOfTuples(),1); renumDefrag->fillWithZero();
////////////////////
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> explicitIdsOldInMesh=DataArrayInt::New(); explicitIdsOldInMesh->alloc(sz,1);//sz is a majorant of the real size. A realloc will be done after
+ MCAuto<DataArrayInt> explicitIdsOldInMesh=DataArrayInt::New(); explicitIdsOldInMesh->alloc(sz,1);//sz is a majorant of the real size. A realloc will be done after
int *workI2=explicitIdsOldInMesh->getPointer();
int sz1=0,sz2=0,sid=1;
std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > entriesKeptML=MEDFileFieldPerMeshPerTypePerDisc::SplitPerDiscretization(entriesKept);
for(std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> >::const_iterator itL1=entriesKeptML.begin();itL1!=entriesKeptML.end();itL1++,sid++)
{
// tupleIdOfStartOfNewChuncksV[sid-1]=sz2;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> explicitIdsOldInArr=DataArrayInt::New(); explicitIdsOldInArr->alloc(sz,1);
+ MCAuto<DataArrayInt> explicitIdsOldInArr=DataArrayInt::New(); explicitIdsOldInArr->alloc(sz,1);
int *workI=explicitIdsOldInArr->getPointer();
for(std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>::const_iterator itL2=(*itL1).begin();itL2!=(*itL1).end();itL2++)
{
explicitIdsOldInMesh->reAlloc(sz2);
int tupleIdOfStartOfNewChuncks=arr->getNumberOfTuples()-sz2;
////////////////////
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> permArrDefrag=renumDefrag->buildPermArrPerLevel(); renumDefrag=0;
+ MCAuto<DataArrayInt> permArrDefrag=renumDefrag->buildPermArrPerLevel(); renumDefrag=0;
// perform redispatching of non concerned MEDFileFieldPerMeshPerTypePerDisc
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > otherEntriesNew;
+ std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > otherEntriesNew;
for(std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>::const_iterator it=otherEntries.begin();it!=otherEntries.end();it++)
{
otherEntriesNew.push_back(MEDFileFieldPerMeshPerTypePerDisc::New(*(*it)));
otherEntriesNew.back()->setNewStart(permArrDefrag->getIJ((*it)->getStart(),0));
otherEntriesNew.back()->setLocId((*it)->getGeoType());
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > entriesKeptNew;
+ std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > entriesKeptNew;
std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> entriesKeptNew2;
for(std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>::const_iterator it=entriesKept.begin();it!=entriesKept.end();it++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> elt=MEDFileFieldPerMeshPerTypePerDisc::New(*(*it));
+ MCAuto<MEDFileFieldPerMeshPerTypePerDisc> elt=MEDFileFieldPerMeshPerTypePerDisc::New(*(*it));
int newStart=elt->getLocId();
elt->setLocId((*it)->getGeoType());
elt->setNewStart(newStart);
entriesKeptNew.push_back(elt);
entriesKeptNew2.push_back(elt);
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=arr->renumber(permArrDefrag->getConstPointer());
+ MCAuto<DataArrayDouble> arr2=arr->renumber(permArrDefrag->getConstPointer());
// perform redispatching of concerned MEDFileFieldPerMeshPerTypePerDisc -> values are in arr2
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> explicitIdsNewInMesh=renumO2N->selectByTupleId(explicitIdsOldInMesh->begin(),explicitIdsOldInMesh->end());
+ MCAuto<DataArrayInt> explicitIdsNewInMesh=renumO2N->selectByTupleId(explicitIdsOldInMesh->begin(),explicitIdsOldInMesh->end());
std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > entriesKeptPerDisc=MEDFileFieldPerMeshPerTypePerDisc::SplitPerDiscretization(entriesKeptNew2);
bool ret=false;
for(std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> >::const_iterator it4=entriesKeptPerDisc.begin();it4!=entriesKeptPerDisc.end();it4++)
return false;
// Assign new dispatching
assignNewLeaves(otherEntriesNew);
- arr->cpyFrom(*arr2);
+ arr->deepCopyFrom(*arr2);
return true;
}
*/
void MEDFileFieldPerMesh::keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > > ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ std::vector< MCAuto< MEDFileFieldPerMeshPerType > > ret;
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
std::vector< std::pair<int,int> > its2;
if((*it)->keepOnlySpatialDiscretization(tof,globalNum,its2))
*/
void MEDFileFieldPerMesh::keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > > ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ std::vector< MCAuto< MEDFileFieldPerMeshPerType > > ret;
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
std::vector< std::pair<int,int> > its2;
if((*it)->keepOnlyGaussDiscretization(idOfDisc,globalNum,its2))
_field_pm_pt=ret;
}
-void MEDFileFieldPerMesh::assignNewLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves)
+void MEDFileFieldPerMesh::assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves)
{
- std::map<INTERP_KERNEL::NormalizedCellType,std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc> > > types;
- for( std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >::const_iterator it=leaves.begin();it!=leaves.end();it++)
+ std::map<INTERP_KERNEL::NormalizedCellType,std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc> > > types;
+ for( std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >::const_iterator it=leaves.begin();it!=leaves.end();it++)
types[(INTERP_KERNEL::NormalizedCellType)(*it)->getLocId()].push_back(*it);
//
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > > fieldPmPt(types.size());
- std::map<INTERP_KERNEL::NormalizedCellType,std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc> > >::const_iterator it1=types.begin();
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it2=fieldPmPt.begin();
+ std::vector< MCAuto< MEDFileFieldPerMeshPerType > > fieldPmPt(types.size());
+ std::map<INTERP_KERNEL::NormalizedCellType,std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc> > >::const_iterator it1=types.begin();
+ std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it2=fieldPmPt.begin();
for(;it1!=types.end();it1++,it2++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerType> elt=MEDFileFieldPerMeshPerType::New(this,(INTERP_KERNEL::NormalizedCellType)((*it1).second[0]->getLocId()));
+ MCAuto<MEDFileFieldPerMeshPerType> elt=MEDFileFieldPerMeshPerType::New(this,(INTERP_KERNEL::NormalizedCellType)((*it1).second[0]->getLocId()));
elt->setLeaves((*it1).second);
*it2=elt;
}
void MEDFileFieldPerMesh::changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->changePflsRefsNamesGen(mapOfModif);
}
void MEDFileFieldPerMesh::changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->changeLocsRefsNamesGen(mapOfModif);
}
/*!
* \param [in] mesh is the whole mesh
*/
-MEDCouplingFieldDouble *MEDFileFieldPerMesh::getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+MEDCouplingFieldDouble *MEDFileFieldPerMesh::getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
if(_field_pm_pt.empty())
throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::getFieldOnMeshAtLevel : no types field set !");
std::vector<DataArrayInt *> notNullPflsPerGeoType;
std::vector<int> locs,code;
std::vector<INTERP_KERNEL::NormalizedCellType> geoTypes;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->getFieldAtLevel(mesh->getMeshDimension(),type,glob,dads,pfls,locs,geoTypes);
// Sort by types
SortArraysPerType(glob,type,geoTypes,dads,pfls,locs,code,notNullPflsPerGeoType);
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
//
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > notNullPflsPerGeoType2(notNullPflsPerGeoType.begin(),notNullPflsPerGeoType.end());
+ std::vector< MCAuto<DataArrayInt> > notNullPflsPerGeoType2(notNullPflsPerGeoType.begin(),notNullPflsPerGeoType.end());
std::vector< const DataArrayInt *> notNullPflsPerGeoType3(notNullPflsPerGeoType.begin(),notNullPflsPerGeoType.end());
if(type!=ON_NODES)
{
return finishField(type,glob,dads,locs,mesh,isPfl,arrOut,nasc);
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr2(arr);
+ MCAuto<DataArrayInt> arr2(arr);
return finishField2(type,glob,dads,locs,geoTypes,mesh,arr,isPfl,arrOut,nasc);
}
}
std::vector<DataArrayInt *> notNullPflsPerGeoType;
std::vector<int> locs,code;
std::vector<INTERP_KERNEL::NormalizedCellType> geoTypes;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
(*it)->getFieldAtLevel(mesh->getMeshDimension(),type,glob,dads,pfls,locs,geoTypes);
// Sort by types
SortArraysPerType(glob,type,geoTypes,dads,pfls,locs,code,notNullPflsPerGeoType);
std::ostringstream oss; oss << "MEDFileFieldPerMesh::getFieldOnMeshAtLevelWithPfl : " << "The field \"" << nasc.getName() << "\" exists but not with such spatial discretization or such dimension specified !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > notNullPflsPerGeoType2(notNullPflsPerGeoType.begin(),notNullPflsPerGeoType.end());
+ std::vector< MCAuto<DataArrayInt> > notNullPflsPerGeoType2(notNullPflsPerGeoType.begin(),notNullPflsPerGeoType.end());
std::vector< const DataArrayInt *> notNullPflsPerGeoType3(notNullPflsPerGeoType.begin(),notNullPflsPerGeoType.end());
if(type!=ON_NODES)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=mesh->checkTypeConsistencyAndContig(code,notNullPflsPerGeoType3);
+ MCAuto<DataArrayInt> arr=mesh->checkTypeConsistencyAndContig(code,notNullPflsPerGeoType3);
return finishField4(dads,arr,mesh->getNumberOfCells(),pfl);
}
else
{
int globalSz=0;
int nbOfEntries=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
(*it)->getSizes(globalSz,nbOfEntries);
}
entries.resize(nbOfEntries);
nbOfEntries=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
(*it)->fillValues(nbOfEntries,entries);
}
MEDFileFieldPerMeshPerTypePerDisc *MEDFileFieldPerMesh::getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
if((*it)->getGeoType()==typ)
return (*it)->getLeafGivenLocId(locId);
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(typ);
std::ostringstream oss; oss << "MEDFileFieldPerMesh::getLeafGivenTypeAndLocId : no such geometric type \"" << cm.getRepr() << "\" in this !" << std::endl;
oss << "Possiblities are : ";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
const INTERP_KERNEL::CellModel& cm2=INTERP_KERNEL::CellModel::GetCellModel((*it)->getGeoType());
oss << "\"" << cm2.getRepr() << "\", ";
const MEDFileFieldPerMeshPerTypePerDisc *MEDFileFieldPerMesh::getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
if((*it)->getGeoType()==typ)
return (*it)->getLeafGivenLocId(locId);
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(typ);
std::ostringstream oss; oss << "MEDFileFieldPerMesh::getLeafGivenTypeAndLocId : no such geometric type \"" << cm.getRepr() << "\" in this !" << std::endl;
oss << "Possiblities are : ";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
{
const INTERP_KERNEL::CellModel& cm2=INTERP_KERNEL::CellModel::GetCellModel((*it)->getGeoType());
oss << "\"" << cm2.getRepr() << "\", ";
{
int i=0;
int pos=std::distance(typmai2,std::find(typmai2,typmai2+MED_N_CELL_FIXED_GEO,type));
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it2=_field_pm_pt.begin();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++,i++)
+ std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it2=_field_pm_pt.begin();
+ for(std::vector< MCAuto< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++,i++)
{
INTERP_KERNEL::NormalizedCellType curType=(*it)->getGeoType();
if(type==curType)
*/
MEDCouplingFieldDouble *MEDFileFieldPerMesh::finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
- const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+ const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
isPfl=false;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(type,ONE_TIME);
+ MCAuto<MEDCouplingFieldDouble> ret=MEDCouplingFieldDouble::New(type,ONE_TIME);
ret->setMesh(mesh); ret->setName(nasc.getName().c_str()); ret->setTime(getTime(),getIteration(),getOrder()); ret->setTimeUnit(nasc.getDtUnit().c_str());
- MEDCouplingAutoRefCountObjectPtr<DataArray> da=getOrCreateAndGetArray()->selectByTupleRanges(dads);
+ MCAuto<DataArray> da=getOrCreateAndGetArray()->selectByTupleRanges(dads);
const std::vector<std::string>& infos=getInfo();
da->setInfoOnComponents(infos);
da->setName("");
std::vector<std::pair<int,int> > dads2(1,dads[i]); const std::vector<int> locs2(1,locs[i]);
const std::vector<INTERP_KERNEL::NormalizedCellType> geoTypes2(1,INTERP_KERNEL::NORM_ERROR);
int nbOfElems=ComputeNbOfElems(glob,type,geoTypes2,dads2,locs2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> di=DataArrayInt::New();
+ MCAuto<DataArrayInt> di=DataArrayInt::New();
di->alloc(nbOfElems,1);
di->iota(offset);
const MEDFileFieldLoc& fl=glob->getLocalizationFromId(locs[i]);
MEDCouplingFieldDouble *MEDFileFieldPerMesh::finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
const std::vector<std::pair<int,int> >& dads, const std::vector<int>& locs,
const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
- const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+ const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- if(da->isIdentity2(mesh->getNumberOfCells()))
+ if(da->isIota(mesh->getNumberOfCells()))
return finishField(type,glob,dads,locs,mesh,isPfl,arrOut,nasc);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m2=mesh->buildPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
+ MCAuto<MEDCouplingMesh> m2=mesh->buildPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
m2->setName(mesh->getName().c_str());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=finishField(type,glob,dads,locs,m2,isPfl,arrOut,nasc);
+ MCAuto<MEDCouplingFieldDouble> ret=finishField(type,glob,dads,locs,m2,isPfl,arrOut,nasc);
isPfl=true;
return ret.retn();
}
*/
MEDCouplingFieldDouble *MEDFileFieldPerMesh::finishFieldNode2(const MEDFileFieldGlobsReal *glob,
const std::vector<std::pair<int,int> >& dads, const std::vector<int>& locs,
- const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+ const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- if(da->isIdentity2(mesh->getNumberOfNodes()))
+ if(da->isIota(mesh->getNumberOfNodes()))
return finishField(ON_NODES,glob,dads,locs,mesh,isPfl,arrOut,nasc);
// Treatment of particular case where nodal field on pfl is requested with a meshDimRelToMax=1.
const MEDCouplingUMesh *meshu=dynamic_cast<const MEDCouplingUMesh *>(mesh);
{
if(meshu->getNodalConnectivity()==0)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=finishField(ON_CELLS,glob,dads,locs,mesh,isPfl,arrOut,nasc);
+ MCAuto<MEDCouplingFieldDouble> ret=finishField(ON_CELLS,glob,dads,locs,mesh,isPfl,arrOut,nasc);
int nb=da->getNbOfElems();
const int *ptr=da->getConstPointer();
MEDCouplingUMesh *meshuc=const_cast<MEDCouplingUMesh *>(meshu);
}
}
//
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=finishField(ON_NODES,glob,dads,locs,mesh,isPfl,arrOut,nasc);
+ MCAuto<MEDCouplingFieldDouble> ret=finishField(ON_NODES,glob,dads,locs,mesh,isPfl,arrOut,nasc);
isPfl=true;
DataArrayInt *arr2=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIds=mesh->getCellIdsFullyIncludedInNodeIds(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> mesh2=mesh->buildPartAndReduceNodes(cellIds->getConstPointer(),cellIds->getConstPointer()+cellIds->getNbOfElems(),arr2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr3(arr2);
+ MCAuto<DataArrayInt> cellIds=mesh->getCellIdsFullyIncludedInNodeIds(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
+ MCAuto<MEDCouplingMesh> mesh2=mesh->buildPartAndReduceNodes(cellIds->getConstPointer(),cellIds->getConstPointer()+cellIds->getNbOfElems(),arr2);
+ MCAuto<DataArrayInt> arr3(arr2);
int nnodes=mesh2->getNumberOfNodes();
if(nnodes==(int)da->getNbOfElems())
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da3=da->transformWithIndArrR(arr2->begin(),arr2->end());
+ MCAuto<DataArrayInt> da3=da->transformWithIndArrR(arr2->begin(),arr2->end());
arrOut->renumberInPlace(da3->getConstPointer());
mesh2->setName(mesh->getName().c_str());
ret->setMesh(mesh2);
pflOut=const_cast<DataArrayInt*>(pflIn);
pflOut->incrRef();
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> safePfl(pflOut);
- MEDCouplingAutoRefCountObjectPtr<DataArray> da=getOrCreateAndGetArray()->selectByTupleRanges(dads);
+ MCAuto<DataArrayInt> safePfl(pflOut);
+ MCAuto<DataArray> da=getOrCreateAndGetArray()->selectByTupleRanges(dads);
const std::vector<std::string>& infos=getInfo();
int nbOfComp=infos.size();
for(int i=0;i<nbOfComp;i++)
int nbOfPfls=_pfls.size();
for(int i=0;i<nbOfPfls;i++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cpy=_pfls[i]->deepCpy();
+ MCAuto<DataArrayInt> cpy=_pfls[i]->deepCopy();
cpy->applyLin(1,1,0);
INTERP_KERNEL::AutoPtr<char> pflName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
MEDLoaderBase::safeStrCpy(_pfls[i]->getName().c_str(),MED_NAME_SIZE,pflName,opt.getTooLongStrPolicy());
void MEDFileFieldGlobs::appendGlobs(const MEDFileFieldGlobs& other, double eps)
{
std::vector<std::string> pfls=getPfls();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=other._pfls.begin();it!=other._pfls.end();it++)
+ for(std::vector< MCAuto<DataArrayInt> >::const_iterator it=other._pfls.begin();it!=other._pfls.end();it++)
{
std::vector<std::string>::iterator it2=std::find(pfls.begin(),pfls.end(),(*it)->getName());
if(it2==pfls.end())
}
}
std::vector<std::string> locs=getLocs();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=other._locs.begin();it!=other._locs.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldLoc> >::const_iterator it=other._locs.begin();it!=other._locs.end();it++)
{
std::vector<std::string>::iterator it2=std::find(locs.begin(),locs.end(),(*it)->getName());
if(it2==locs.end())
std::size_t MEDFileFieldGlobs::getHeapMemorySizeWithoutChildren() const
{
- return _file_name.capacity()+_pfls.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>)+_locs.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc>);
+ return _file_name.capacity()+_pfls.capacity()*sizeof(MCAuto<DataArrayInt>)+_locs.capacity()*sizeof(MCAuto<MEDFileFieldLoc>);
}
std::vector<const BigMemoryObject *> MEDFileFieldGlobs::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< DataArrayInt > >::const_iterator it=_pfls.begin();it!=_pfls.end();it++)
+ for(std::vector< MCAuto< DataArrayInt > >::const_iterator it=_pfls.begin();it!=_pfls.end();it++)
ret.push_back((const DataArrayInt *)*it);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++)
ret.push_back((const MEDFileFieldLoc *)*it);
return ret;
}
-MEDFileFieldGlobs *MEDFileFieldGlobs::deepCpy() const
+MEDFileFieldGlobs *MEDFileFieldGlobs::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldGlobs> ret=new MEDFileFieldGlobs(*this);
+ MCAuto<MEDFileFieldGlobs> ret=new MEDFileFieldGlobs(*this);
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++,i++)
+ for(std::vector< MCAuto<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++,i++)
{
if((const DataArrayInt *)*it)
- ret->_pfls[i]=(*it)->deepCpy();
+ ret->_pfls[i]=(*it)->deepCopy();
}
i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++,i++)
{
if((const MEDFileFieldLoc*)*it)
- ret->_locs[i]=(*it)->deepCpy();
+ ret->_locs[i]=(*it)->deepCopy();
}
return ret.retn();
}
*/
MEDFileFieldGlobs *MEDFileFieldGlobs::shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldGlobs> ret=MEDFileFieldGlobs::New();
+ MCAuto<MEDFileFieldGlobs> ret=MEDFileFieldGlobs::New();
for(std::vector<std::string>::const_iterator it1=pfls.begin();it1!=pfls.end();it1++)
{
DataArrayInt *pfl=const_cast<DataArrayInt *>(getProfile((*it1).c_str()));
if(!pfl)
throw INTERP_KERNEL::Exception("MEDFileFieldGlobs::shallowCpyPart : internal error ! pfl null !");
pfl->incrRef();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> pfl2(pfl);
+ MCAuto<DataArrayInt> pfl2(pfl);
ret->_pfls.push_back(pfl2);
}
for(std::vector<std::string>::const_iterator it2=locs.begin();it2!=locs.end();it2++)
if(!loc)
throw INTERP_KERNEL::Exception("MEDFileFieldGlobs::shallowCpyPart : internal error ! loc null !");
loc->incrRef();
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> loc2(loc);
+ MCAuto<MEDFileFieldLoc> loc2(loc);
ret->_locs.push_back(loc2);
}
ret->setFileName(getFileName());
*/
MEDFileFieldGlobs *MEDFileFieldGlobs::deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldGlobs> ret=MEDFileFieldGlobs::New();
+ MCAuto<MEDFileFieldGlobs> ret=MEDFileFieldGlobs::New();
for(std::vector<std::string>::const_iterator it1=pfls.begin();it1!=pfls.end();it1++)
{
DataArrayInt *pfl=const_cast<DataArrayInt *>(getProfile((*it1).c_str()));
if(!pfl)
throw INTERP_KERNEL::Exception("MEDFileFieldGlobs::deepCpyPart : internal error ! pfl null !");
- ret->_pfls.push_back(pfl->deepCpy());
+ ret->_pfls.push_back(pfl->deepCopy());
}
for(std::vector<std::string>::const_iterator it2=locs.begin();it2!=locs.end();it2++)
{
MEDFileFieldLoc *loc=const_cast<MEDFileFieldLoc *>(&getLocalization((*it2).c_str()));
if(!loc)
throw INTERP_KERNEL::Exception("MEDFileFieldGlobs::deepCpyPart : internal error ! loc null !");
- ret->_locs.push_back(loc->deepCpy());
+ ret->_locs.push_back(loc->deepCopy());
}
ret->setFileName(getFileName());
return ret.retn();
void MEDFileFieldGlobs::changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::iterator it=_pfls.begin();it!=_pfls.end();it++)
+ for(std::vector< MCAuto<DataArrayInt> >::iterator it=_pfls.begin();it!=_pfls.end();it++)
{
DataArrayInt *elt(*it);
if(elt)
void MEDFileFieldGlobs::changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::iterator it=_locs.begin();it!=_locs.end();it++)
+ for(std::vector< MCAuto<MEDFileFieldLoc> >::iterator it=_locs.begin();it!=_locs.end();it++)
{
MEDFileFieldLoc *elt(*it);
if(elt)
}
/// @cond INTERNAL
-namespace ParaMEDMEMImpl
+namespace MEDCouplingImpl
{
class LocFinder
{
public:
LocFinder(const std::string& loc):_loc(loc) { }
- bool operator() (const MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc>& loc) { return loc->isName(_loc); }
+ bool operator() (const MCAuto<MEDFileFieldLoc>& loc) { return loc->isName(_loc); }
private:
const std::string &_loc;
};
{
public:
PflFinder(const std::string& pfl):_pfl(pfl) { }
- bool operator() (const MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& pfl) { return _pfl==pfl->getName(); }
+ bool operator() (const MCAuto<DataArrayInt>& pfl) { return _pfl==pfl->getName(); }
private:
const std::string& _pfl;
};
int MEDFileFieldGlobs::getLocalizationId(const std::string& loc) const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=std::find_if(_locs.begin(),_locs.end(),ParaMEDMEMImpl::LocFinder(loc));
+ std::vector< MCAuto<MEDFileFieldLoc> >::const_iterator it=std::find_if(_locs.begin(),_locs.end(),MEDCouplingImpl::LocFinder(loc));
if(it==_locs.end())
{
std::ostringstream oss; oss << "MEDFileFieldGlobs::getLocalisationId : no such localisation name : \"" << loc << "\" Possible localizations are : ";
const DataArrayInt *MEDFileFieldGlobs::getProfile(const std::string& pflName) const
{
std::string pflNameCpp(pflName);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=std::find_if(_pfls.begin(),_pfls.end(),ParaMEDMEMImpl::PflFinder(pflNameCpp));
+ std::vector< MCAuto<DataArrayInt> >::const_iterator it=std::find_if(_pfls.begin(),_pfls.end(),MEDCouplingImpl::PflFinder(pflNameCpp));
if(it==_pfls.end())
{
std::ostringstream oss; oss << "MEDFileFieldGlobs::getProfile: no such profile name : \"" << pflNameCpp << "\" Possible profiles are : ";
DataArrayInt *MEDFileFieldGlobs::getProfile(const std::string& pflName)
{
std::string pflNameCpp(pflName);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::iterator it=std::find_if(_pfls.begin(),_pfls.end(),ParaMEDMEMImpl::PflFinder(pflNameCpp));
+ std::vector< MCAuto<DataArrayInt> >::iterator it=std::find_if(_pfls.begin(),_pfls.end(),MEDCouplingImpl::PflFinder(pflNameCpp));
if(it==_pfls.end())
{
std::ostringstream oss; oss << "MEDFileFieldGlobs::getProfile: no such profile name : \"" << pflNameCpp << "\" Possible profiles are : ";
void MEDFileFieldGlobs::killProfileIds(const std::vector<int>& pflIds)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > newPfls;
+ std::vector< MCAuto<DataArrayInt> > newPfls;
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++,i++)
+ for(std::vector< MCAuto<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++,i++)
{
if(std::find(pflIds.begin(),pflIds.end(),i)==pflIds.end())
newPfls.push_back(*it);
void MEDFileFieldGlobs::killLocalizationIds(const std::vector<int>& locIds)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> > newLocs;
+ std::vector< MCAuto<MEDFileFieldLoc> > newLocs;
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++,i++)
{
if(std::find(locIds.begin(),locIds.end(),i)==locIds.end())
newLocs.push_back(*it);
{
std::map<int,std::vector<int> > m;
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++,i++)
+ for(std::vector< MCAuto<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++,i++)
{
const DataArrayInt *tmp=(*it);
if(tmp)
std::string name(pfl->getName());
if(name.empty())
throw INTERP_KERNEL::Exception("MEDFileFieldGlobs::appendProfile : unsupported profiles with no name !");
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++)
+ for(std::vector< MCAuto<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++)
if(name==(*it)->getName())
{
if(!pfl->isEqual(*(*it)))
std::string name(locName);
if(name.empty())
throw INTERP_KERNEL::Exception("MEDFileFieldGlobs::appendLoc : unsupported localizations with no name !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> obj=MEDFileFieldLoc::New(locName,geoType,refCoo,gsCoo,w);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++)
+ MCAuto<MEDFileFieldLoc> obj=MEDFileFieldLoc::New(locName,geoType,refCoo,gsCoo,w);
+ for(std::vector< MCAuto<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++)
if((*it)->isName(locName))
{
if(!(*it)->isEqual(*obj,1e-12))
{
_globals=other._globals;
if((const MEDFileFieldGlobs *)_globals)
- _globals=other._globals->deepCpy();
+ _globals=other._globals->deepCopy();
}
/*!
{
_field_per_mesh.resize(other._field_per_mesh.size());
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=other._field_per_mesh.begin();it!=other._field_per_mesh.end();it++,i++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=other._field_per_mesh.begin();it!=other._field_per_mesh.end();it++,i++)
{
if((const MEDFileFieldPerMesh *)*it)
- _field_per_mesh[i]=(*it)->deepCpy(this);
+ _field_per_mesh[i]=(*it)->deepCopy(this);
}
}
if(!_field_per_mesh.empty())
{
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it2=_field_per_mesh.begin();it2!=_field_per_mesh.end();it2++,i++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it2=_field_per_mesh.begin();it2!=_field_per_mesh.end();it2++,i++)
{
const MEDFileFieldPerMesh *cur=(*it2);
if(cur)
oss << startOfLine << "----------------------" << std::endl;
}
-std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > MEDFileAnyTypeField1TSWithoutSDA::splitComponents() const
+std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > MEDFileAnyTypeField1TSWithoutSDA::splitComponents() const
{
const DataArray *arr(getUndergroundDataArray());
if(!arr)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::splitComponents : no array defined !");
int nbOfCompo=arr->getNumberOfComponents();
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > ret(nbOfCompo);
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > ret(nbOfCompo);
for(int i=0;i<nbOfCompo;i++)
{
- ret[i]=deepCpy();
+ ret[i]=deepCopy();
std::vector<int> v(1,i);
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr2=arr->keepSelectedComponents(v);
+ MCAuto<DataArray> arr2=arr->keepSelectedComponents(v);
ret[i]->setArray(arr2);
}
return ret;
int MEDFileAnyTypeField1TSWithoutSDA::getDimension() const
{
int ret=-2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
(*it)->getDimension(ret);
return ret;
}
bool MEDFileAnyTypeField1TSWithoutSDA::changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
MEDFileFieldPerMesh *cur(*it);
if(cur)
void MEDFileAnyTypeField1TSWithoutSDA::fillTypesOfFieldAvailable(std::vector<TypeOfField>& types) const
{
std::set<TypeOfField> types2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
(*it)->fillTypesOfFieldAvailable(types2);
}
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsed();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsed();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
std::vector<std::string> MEDFileAnyTypeField1TSWithoutSDA::getPflsReallyUsedMulti2() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsedMulti();
ret.insert(ret.end(),tmp.begin(),tmp.end());
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsedMulti();
ret.insert(ret.end(),tmp.begin(),tmp.end());
void MEDFileAnyTypeField1TSWithoutSDA::changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
(*it)->changePflsRefsNamesGen(mapOfModif);
}
void MEDFileAnyTypeField1TSWithoutSDA::changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
(*it)->changeLocsRefsNamesGen(mapOfModif);
}
* Thus all sequences returned by this method are of the same length equal to number
* of different types of supporting entities.<br>
* A field part can include sub-parts with several different spatial discretizations,
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT"
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS" and \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT"
* for example. Hence, some of the returned sequences contains nested sequences, and an item
* of a nested sequence corresponds to a type of spatial discretization.<br>
* This method allows for iteration over MEDFile DataStructure without any overhead.
* maximal absolute dimension and values returned via the out parameter \a levs are
* dimensions relative to the maximal absolute dimension. <br>
* This method is designed for MEDFileField1TS instances that have a discretization
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS",
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT",
- * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE".
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS",
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT",
+ * \ref MEDCoupling::ON_GAUSS_NE "ON_GAUSS_NE".
* Only these 3 discretizations will be taken into account here. If \a this is
- * \ref ParaMEDMEM::ON_NODES "ON_NODES", -1 is returned and \a levs are empty.<br>
+ * \ref MEDCoupling::ON_NODES "ON_NODES", -1 is returned and \a levs are empty.<br>
* This method is useful to make the link between the dimension of the underlying mesh
* and the levels of \a this, because it is possible that the highest dimension of \a this
* field is not equal to the dimension of the underlying mesh.
std::string mName2(mName);
int ret=0;
std::vector<std::string> msg;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++,ret++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++,ret++)
if(mName2==(*it)->getMeshName())
return ret;
else
std::string tmp(mesh->getName());
if(tmp.empty())
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::addNewEntryIfNecessary : empty mesh name ! unsupported by MED file !");
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();
+ std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();
int i=0;
for(;it!=_field_per_mesh.end();it++,i++)
{
MEDFileFieldGlobsReal& glob)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
MEDFileFieldPerMesh *fpm(*it);
if(fpm)
*
* \sa splitMultiDiscrPerGeoTypes
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > MEDFileAnyTypeField1TSWithoutSDA::splitDiscretizations() const
+std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > MEDFileAnyTypeField1TSWithoutSDA::splitDiscretizations() const
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
for(std::vector< std::vector<TypeOfField> >::const_iterator it1=typesF.begin();it1!=typesF.end();it1++)
for(std::vector<TypeOfField>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
allEnt.insert(*it2);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > ret(allEnt.size());
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > ret(allEnt.size());
std::set<TypeOfField>::const_iterator it3(allEnt.begin());
for(std::size_t i=0;i<allEnt.size();i++,it3++)
{
*
* \sa splitDiscretizations
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > MEDFileAnyTypeField1TSWithoutSDA::splitMultiDiscrPerGeoTypes() const
+std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > MEDFileAnyTypeField1TSWithoutSDA::splitMultiDiscrPerGeoTypes() const
{
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector< std::vector<TypeOfField> > typesF;
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::splitMultiDiscrPerGeoTypes : empty field !");
if(nbOfMDPGT==1)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > ret0(1);
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > ret0(1);
ret0[0]=const_cast<MEDFileAnyTypeField1TSWithoutSDA *>(this); this->incrRef();
return ret0;
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > ret(nbOfMDPGT);
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > ret(nbOfMDPGT);
for(std::size_t i=0;i<nbOfMDPGT;i++)
{
std::vector< std::pair<int,int> > its;
int MEDFileAnyTypeField1TSWithoutSDA::keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair<int,int> >& its)
{
int globalCounter(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
(*it)->keepOnlySpatialDiscretization(tof,globalCounter,its);
return globalCounter;
}
int MEDFileAnyTypeField1TSWithoutSDA::keepOnlyGaussDiscretization(std::size_t idOfDisc, std::vector< std::pair<int,int> >& its)
{
int globalCounter(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
(*it)->keepOnlyGaussDiscretization(idOfDisc,globalCounter,its);
return globalCounter;
}
const DataArray *oldArr(getUndergroundDataArray());
if(oldArr)
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> newArr(createNewEmptyDataArrayInstance());
+ MCAuto<DataArray> newArr(createNewEmptyDataArrayInstance());
newArr->setInfoAndChangeNbOfCompo(oldArr->getInfoOnComponents());
setArray(newArr);
_nb_of_tuples_to_be_allocated=newLgth;//force the _nb_of_tuples_to_be_allocated because setArray has been used specialy
const DataArray *oldArr(getUndergroundDataArray());
if(!oldArr || !oldArr->isAllocated())
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::updateData : internal error 1 !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> newArr(createNewEmptyDataArrayInstance());
+ MCAuto<DataArray> newArr(createNewEmptyDataArrayInstance());
newArr->alloc(newLgth,getNumberOfComponents());
if(oldArr)
newArr->copyStringInfoFrom(*oldArr);
{
if((*it).second<(*it).first)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::updateData : the range in the leaves was invalid !");
- newArr->setContigPartOfSelectedValues2(pos,oldArr,(*it).first,(*it).second,1);
+ newArr->setContigPartOfSelectedValuesSlice(pos,oldArr,(*it).first,(*it).second,1);
pos+=(*it).second-(*it).first;
}
setArray(newArr);
void MEDFileAnyTypeField1TSWithoutSDA::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc)
{
allocIfNecessaryTheArrayToReceiveDataFromFile();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
(*it)->loadBigArraysRecursively(fid,nasc);
}
void MEDFileAnyTypeField1TSWithoutSDA::loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc)
{
if(allocIfNecessaryTheArrayToReceiveDataFromFile())
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
(*it)->loadBigArraysRecursively(fid,nasc);
}
std::size_t MEDFileAnyTypeField1TSWithoutSDA::getHeapMemorySizeWithoutChildren() const
{
- return _dt_unit.capacity()+_field_per_mesh.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh >);
+ return _dt_unit.capacity()+_field_per_mesh.capacity()*sizeof(MCAuto< MEDFileFieldPerMesh >);
}
std::vector<const BigMemoryObject *> MEDFileAnyTypeField1TSWithoutSDA::getDirectChildrenWithNull() const
std::vector<const BigMemoryObject *> ret;
if(getUndergroundDataArray())
ret.push_back(getUndergroundDataArray());
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
ret.push_back((const MEDFileFieldPerMesh *)*it);
return ret;
}
std::vector<DataArrayInt *> idsInPflPerType;
std::vector<DataArrayInt *> idsPerType;
std::vector<int> code,code2;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax));
+ MCAuto<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax));
if(type!=ON_NODES)
{
m->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > idsInPflPerType2(idsInPflPerType.size()); std::copy(idsInPflPerType.begin(),idsInPflPerType.end(),idsInPflPerType2.begin());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > idsPerType2(idsPerType.size()); std::copy(idsPerType.begin(),idsPerType.end(),idsPerType2.begin());
+ std::vector< MCAuto<DataArrayInt> > idsInPflPerType2(idsInPflPerType.size()); std::copy(idsInPflPerType.begin(),idsInPflPerType.end(),idsInPflPerType2.begin());
+ std::vector< MCAuto<DataArrayInt> > idsPerType2(idsPerType.size()); std::copy(idsPerType.begin(),idsPerType.end(),idsPerType2.begin());
std::vector<const DataArrayInt *> idsPerType3(idsPerType.size()); std::copy(idsPerType.begin(),idsPerType.end(),idsPerType3.begin());
// start of check
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field2=field->clone(false);
+ MCAuto<MEDCouplingFieldDouble> field2=field->clone(false);
int nbOfTuplesExp=field2->getNumberOfTuplesExpectedRegardingCode(code,idsPerType3);
if(nbOfTuplesExp!=arrOfVals->getNumberOfTuples())
{
bool MEDFileAnyTypeField1TSWithoutSDA::presenceOfMultiDiscPerGeoType() const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
+ for(std::vector< MCAuto< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
{
const MEDFileFieldPerMesh *fpm(*it);
if(!fpm)
* \throw If no field of \a this is lying on the mesh \a mName.
* \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
*/
-MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
+ MCAuto<MEDFileMesh> mm;
if(mName.empty())
mm=MEDFileMesh::New(glob->getFileName(),getMeshName().c_str(),getMeshIteration(),getMeshOrder());
else
* \throw If there are no mesh entities of \a meshDimRelToMax dimension in the mesh.
* \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
*/
-MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax,false));
+ MCAuto<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax,false));
const DataArrayInt *d=mesh->getNumberFieldAtLevel(meshDimRelToMax);
const DataArrayInt *e=mesh->getNumberFieldAtLevel(1);
if(meshDimRelToMax==1)
* \throw If there are no mesh entities in the mesh.
* \throw If no field values of the given \a type are available.
*/
-MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
+ MCAuto<MEDFileMesh> mm;
if(mName.empty())
mm=MEDFileMesh::New(glob->getFileName(),getMeshName().c_str(),getMeshIteration(),getMeshOrder());
else
* \throw If no field of \a this is lying on \a mesh.
* \throw If no field values of the given \a type or given \a meshDimRelToMax are available.
*/
-MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
+MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MCAuto<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
static const char msg1[]="MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel : request for a renumbered field following mesh numbering whereas it is a profile field !";
int meshId=getMeshIdFromMeshName(mesh->getName());
bool isPfl=false;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevel(type,glob,mesh,isPfl,arrOut,nasc);
+ MCAuto<MEDCouplingFieldDouble> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevel(type,glob,mesh,isPfl,arrOut,nasc);
switch(renumPol)
{
case 0:
oss << "\"" << nasc.getName() << "\" not defined on all nodes !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodeRenumSafe=nodeRenum->checkAndPreparePermutation();
+ MCAuto<DataArrayInt> nodeRenumSafe=nodeRenum->checkAndPreparePermutation();
if(!dynamic_cast<DataArrayDouble *>((DataArray *)arrOut))
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel : node renumbering not implemented for not double DataArrays !");
ret->renumberNodes(nodeRenumSafe->getConstPointer());
*/
DataArray *MEDFileAnyTypeField1TSWithoutSDA::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax));
+ MCAuto<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax));
int meshId=getMeshIdFromMeshName(mesh->getName().c_str());
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevelWithPfl(type,m,pfl,glob,nasc);
+ MCAuto<DataArray> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevelWithPfl(type,m,pfl,glob,nasc);
ret->setName(nasc.getName().c_str());
return ret.retn();
}
std::set<INTERP_KERNEL::NormalizedCellType> geoTypes=mesh->getAllGeoTypes();
int nbOfTypes=geoTypes.size();
std::vector<int> code(3*nbOfTypes);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr1=DataArrayInt::New();
+ MCAuto<DataArrayInt> arr1=DataArrayInt::New();
arr1->alloc(nbOfTypes,1);
int *arrPtr=arr1->getPointer();
std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=geoTypes.begin();
for(int i=0;i<nbOfTypes;i++,it++)
arrPtr[i]=std::distance(typmai2,std::find(typmai2,typmai2+MED_N_CELL_FIXED_GEO,*it));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr2=arr1->checkAndPreparePermutation();
+ MCAuto<DataArrayInt> arr2=arr1->checkAndPreparePermutation();
const int *arrPtr2=arr2->getConstPointer();
int i=0;
for(it=geoTypes.begin();it!=geoTypes.end();it++,i++)
* Thus all sequences returned by this method are of the same length equal to number
* of different types of supporting entities.<br>
* A field part can include sub-parts with several different spatial discretizations,
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT"
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS" and \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT"
* for example. Hence, some of the returned sequences contains nested sequences, and an item
* of a nested sequence corresponds to a type of spatial discretization.<br>
* This method allows for iteration over MEDFile DataStructure with a reduced overhead.
* a field part is returned.
* \param [in,out] typesF - a sequence of sequences of types of spatial discretizations.
* A field part can include sub-parts with several different spatial discretizations,
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT" for example.
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS" and
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT" for example.
* This sequence is of the same length as \a types.
* \param [in,out] pfls - a sequence returning a profile name per each type of spatial
* discretization. A profile name can be empty.
ret[i].resize(nbOfRet1);
for(int j=0;j<nbOfRet1;j++)
{
- DataArrayDouble *tmp=_arr->selectByTupleId2(p[j].first,p[j].second,1);
+ DataArrayDouble *tmp=_arr->selectByTupleIdSafeSlice(p[j].first,p[j].second,1);
ret[i][j]=tmp;
}
}
MEDFileIntField1TSWithoutSDA *MEDFileField1TSWithoutSDA::convertToInt() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TSWithoutSDA> ret(new MEDFileIntField1TSWithoutSDA);
+ MCAuto<MEDFileIntField1TSWithoutSDA> ret(new MEDFileIntField1TSWithoutSDA);
ret->MEDFileAnyTypeField1TSWithoutSDA::operator =(*this);
ret->deepCpyLeavesFrom(*this);
const DataArrayDouble *arr(_arr);
if(arr)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr2(arr->convertToIntArr());
+ MCAuto<DataArrayInt> arr2(arr->convertToIntArr());
ret->setArray(arr2);
}
return ret.retn();
MEDFileAnyTypeField1TSWithoutSDA *MEDFileField1TSWithoutSDA::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutSDA> ret(new MEDFileField1TSWithoutSDA(*this));
+ MCAuto<MEDFileField1TSWithoutSDA> ret(new MEDFileField1TSWithoutSDA(*this));
ret->deepCpyLeavesFrom(*this);
return ret.retn();
}
-MEDFileAnyTypeField1TSWithoutSDA *MEDFileField1TSWithoutSDA::deepCpy() const
+MEDFileAnyTypeField1TSWithoutSDA *MEDFileField1TSWithoutSDA::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutSDA> ret=static_cast<MEDFileField1TSWithoutSDA *>(shallowCpy());
+ MCAuto<MEDFileField1TSWithoutSDA> ret=static_cast<MEDFileField1TSWithoutSDA *>(shallowCpy());
if((const DataArrayDouble *)_arr)
- ret->_arr=_arr->deepCpy();
+ ret->_arr=_arr->deepCopy();
return ret.retn();
}
MEDFileField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::convertToDouble() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutSDA> ret(new MEDFileField1TSWithoutSDA);
+ MCAuto<MEDFileField1TSWithoutSDA> ret(new MEDFileField1TSWithoutSDA);
ret->MEDFileAnyTypeField1TSWithoutSDA::operator =(*this);
ret->deepCpyLeavesFrom(*this);
const DataArrayInt *arr(_arr);
if(arr)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2(arr->convertToDblArr());
+ MCAuto<DataArrayDouble> arr2(arr->convertToDblArr());
ret->setArray(arr2);
}
return ret.retn();
MEDFileAnyTypeField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TSWithoutSDA> ret(new MEDFileIntField1TSWithoutSDA(*this));
+ MCAuto<MEDFileIntField1TSWithoutSDA> ret(new MEDFileIntField1TSWithoutSDA(*this));
ret->deepCpyLeavesFrom(*this);
return ret.retn();
}
-MEDFileAnyTypeField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::deepCpy() const
+MEDFileAnyTypeField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TSWithoutSDA> ret=static_cast<MEDFileIntField1TSWithoutSDA *>(shallowCpy());
+ MCAuto<MEDFileIntField1TSWithoutSDA> ret=static_cast<MEDFileIntField1TSWithoutSDA *>(shallowCpy());
if((const DataArrayInt *)_arr)
- ret->_arr=_arr->deepCpy();
+ ret->_arr=_arr->deepCopy();
return ret.retn();
}
std::vector<std::string> infos;
std::string dtunit,fieldName;
LocateField2(fid,fileName,0,true,fieldName,typcha,infos,dtunit);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> ret;
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ret;
switch(typcha)
{
case MED_FLOAT64:
std::string dtunit;
int iii=-1;
int nbSteps=LocateField(fid,fileName,fieldName,iii,typcha,infos,dtunit);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> ret;
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ret;
switch(typcha)
{
case MED_FLOAT64:
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TS::BuildNewInstanceFromContent : empty content in input : unable to build a new instance !");
if(dynamic_cast<const MEDFileField1TSWithoutSDA *>(c))
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=MEDFileField1TS::New();
+ MCAuto<MEDFileField1TS> ret=MEDFileField1TS::New();
ret->setFileName(fileName);
ret->_content=c; c->incrRef();
return ret.retn();
}
if(dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(c))
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret=MEDFileIntField1TS::New();
+ MCAuto<MEDFileIntField1TS> ret=MEDFileIntField1TS::New();
ret->setFileName(fileName);
ret->_content=c; c->incrRef();
return ret.retn();
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,loadAll,0);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,loadAll,0);
+ MCAuto<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,fieldName,loadAll,0);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,fieldName,loadAll,0);
+ MCAuto<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,fieldName,iteration,order,loadAll,0);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> c=BuildContentFrom(fid,fileName,fieldName,iteration,order,loadAll,0);
+ MCAuto<MEDFileAnyTypeField1TS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
std::string dtunit;
int iii=-1;
int nbOfStep2=LocateField(fid,fileName,fieldName,iii,typcha,infos,dtunit);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> ret;
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ret;
switch(typcha)
{
case MED_FLOAT64:
* The returned instances are deep copy of \a this except that for globals that are share with those contained in \a this.
* ** WARNING ** do no forget to rename the ouput instances to avoid to write n-times in the same MED file field !
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > MEDFileAnyTypeField1TS::splitComponents() const
+std::vector< MCAuto< MEDFileAnyTypeField1TS > > MEDFileAnyTypeField1TS::splitComponents() const
{
const MEDFileAnyTypeField1TSWithoutSDA *content(_content);
if(!content)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TS::splitComponents : no content in this ! Unable to split components !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > contentsSplit=content->splitComponents();
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > contentsSplit=content->splitComponents();
std::size_t sz(contentsSplit.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret(sz);
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret(sz);
for(std::size_t i=0;i<sz;i++)
{
ret[i]=shallowCpy();
* This method returns as MEDFileAnyTypeField1TS new instances as number of spatial discretizations in \a this.
* The returned instances are shallowed copied of \a this except that for globals that are share with those contained in \a this.
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > MEDFileAnyTypeField1TS::splitDiscretizations() const
+std::vector< MCAuto< MEDFileAnyTypeField1TS > > MEDFileAnyTypeField1TS::splitDiscretizations() const
{
const MEDFileAnyTypeField1TSWithoutSDA *content(_content);
if(!content)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TS::splitDiscretizations : no content in this ! Unable to split discretization !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > contentsSplit(content->splitDiscretizations());
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > contentsSplit(content->splitDiscretizations());
std::size_t sz(contentsSplit.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret(sz);
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret(sz);
for(std::size_t i=0;i<sz;i++)
{
ret[i]=shallowCpy();
* This method returns as MEDFileAnyTypeField1TS new instances as number of maximal number of discretization in \a this.
* The returned instances are shallowed copied of \a this except that for globals that are share with those contained in \a this.
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > MEDFileAnyTypeField1TS::splitMultiDiscrPerGeoTypes() const
+std::vector< MCAuto< MEDFileAnyTypeField1TS > > MEDFileAnyTypeField1TS::splitMultiDiscrPerGeoTypes() const
{
const MEDFileAnyTypeField1TSWithoutSDA *content(_content);
if(!content)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TS::splitMultiDiscrPerGeoTypes : no content in this ! Unable to split discretization !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > contentsSplit(content->splitMultiDiscrPerGeoTypes());
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > contentsSplit(content->splitMultiDiscrPerGeoTypes());
std::size_t sz(contentsSplit.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret(sz);
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret(sz);
for(std::size_t i=0;i<sz;i++)
{
ret[i]=shallowCpy();
return ret;
}
-MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::deepCpy() const
+MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> ret=shallowCpy();
+ MCAuto<MEDFileAnyTypeField1TS> ret=shallowCpy();
if((const MEDFileAnyTypeField1TSWithoutSDA *)_content)
- ret->_content=_content->deepCpy();
+ ret->_content=_content->deepCopy();
ret->deepCpyGlobs(*this);
return ret.retn();
}
*/
MEDFileField1TS *MEDFileField1TS::New(const std::string& fileName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret(new MEDFileField1TS(fileName,loadAll,0));
+ MCAuto<MEDFileField1TS> ret(new MEDFileField1TS(fileName,loadAll,0));
ret->contentNotNull();
return ret.retn();
}
*/
MEDFileField1TS *MEDFileField1TS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret(new MEDFileField1TS(fileName,fieldName,loadAll,0));
+ MCAuto<MEDFileField1TS> ret(new MEDFileField1TS(fileName,fieldName,loadAll,0));
ret->contentNotNull();
return ret.retn();
}
*/
MEDFileField1TS *MEDFileField1TS::New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret(new MEDFileField1TS(fileName,fieldName,iteration,order,loadAll,0));
+ MCAuto<MEDFileField1TS> ret(new MEDFileField1TS(fileName,fieldName,iteration,order,loadAll,0));
ret->contentNotNull();
return ret.retn();
}
*/
MEDFileField1TS *MEDFileField1TS::New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=new MEDFileField1TS(other,shallowCopyOfContent);
+ MCAuto<MEDFileField1TS> ret=new MEDFileField1TS(other,shallowCopyOfContent);
ret->contentNotNull();
return ret.retn();
}
*/
MEDFileField1TS *MEDFileField1TS::New()
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=new MEDFileField1TS;
+ MCAuto<MEDFileField1TS> ret=new MEDFileField1TS;
ret->contentNotNull();
return ret.retn();
}
*/
MEDFileIntField1TS *MEDFileField1TS::convertToInt(bool isDeepCpyGlobs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret;
+ MCAuto<MEDFileIntField1TS> ret;
const MEDFileAnyTypeField1TSWithoutSDA *content(_content);
if(content)
{
const MEDFileField1TSWithoutSDA *contc=dynamic_cast<const MEDFileField1TSWithoutSDA *>(content);
if(!contc)
throw INTERP_KERNEL::Exception("MEDFileField1TS::convertToInt : the content inside this is not FLOAT64 ! This is incoherent !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TSWithoutSDA> newc(contc->convertToInt());
+ MCAuto<MEDFileIntField1TSWithoutSDA> newc(contc->convertToInt());
ret=static_cast<MEDFileIntField1TS *>(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileIntField1TSWithoutSDA *)newc,getFileName()));
}
else
return ret;
}
-void MEDFileField1TS::SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MEDCouplingAutoRefCountObjectPtr<DataArray>& arr)
+void MEDFileField1TS::SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr)
{
if(!f)
throw INTERP_KERNEL::Exception("MEDFileField1TS::SetDataArrayDoubleInField : input field is NULL !");
f->setArray(arrOutC);
}
-DataArrayDouble *MEDFileField1TS::ReturnSafelyDataArrayDouble(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr)
+DataArrayDouble *MEDFileField1TS::ReturnSafelyDataArrayDouble(MCAuto<DataArray>& arr)
{
if(!((DataArray*)arr))
throw INTERP_KERNEL::Exception("MEDFileField1TS::ReturnSafelyDataArrayDouble : no array !");
{
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNull());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNull());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
{
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtTopLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtTopLevel method instead !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNull());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNull());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
*/
MEDCouplingFieldDouble *MEDFileField1TS::getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arrOut,*contentNotNull());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arrOut,*contentNotNull());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
*/
MEDCouplingFieldDouble *MEDFileField1TS::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arrOut,*contentNotNull());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arrOut,*contentNotNull());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
{
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevelOld : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arrOut,*contentNotNull());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arrOut,*contentNotNull());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
*/
DataArrayDouble *MEDFileField1TS::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret=contentNotNull()->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNull());
+ MCAuto<DataArray> ret=contentNotNull()->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNull());
return MEDFileField1TS::ReturnSafelyDataArrayDouble(ret);
}
MEDFileIntField1TS *MEDFileIntField1TS::New()
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret=new MEDFileIntField1TS;
+ MCAuto<MEDFileIntField1TS> ret=new MEDFileIntField1TS;
ret->contentNotNull();
return ret.retn();
}
MEDFileIntField1TS *MEDFileIntField1TS::New(const std::string& fileName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret(new MEDFileIntField1TS(fileName,loadAll,0));
+ MCAuto<MEDFileIntField1TS> ret(new MEDFileIntField1TS(fileName,loadAll,0));
ret->contentNotNull();
return ret.retn();
}
MEDFileIntField1TS *MEDFileIntField1TS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret(new MEDFileIntField1TS(fileName,fieldName,loadAll,0));
+ MCAuto<MEDFileIntField1TS> ret(new MEDFileIntField1TS(fileName,fieldName,loadAll,0));
ret->contentNotNull();
return ret.retn();
}
MEDFileIntField1TS *MEDFileIntField1TS::New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret(new MEDFileIntField1TS(fileName,fieldName,iteration,order,loadAll,0));
+ MCAuto<MEDFileIntField1TS> ret(new MEDFileIntField1TS(fileName,fieldName,iteration,order,loadAll,0));
ret->contentNotNull();
return ret.retn();
}
MEDFileIntField1TS *MEDFileIntField1TS::New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret=new MEDFileIntField1TS(other,shallowCopyOfContent);
+ MCAuto<MEDFileIntField1TS> ret=new MEDFileIntField1TS(other,shallowCopyOfContent);
ret->contentNotNull();
return ret.retn();
}
*/
MEDFileField1TS *MEDFileIntField1TS::convertToDouble(bool isDeepCpyGlobs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret;
+ MCAuto<MEDFileField1TS> ret;
const MEDFileAnyTypeField1TSWithoutSDA *content(_content);
if(content)
{
const MEDFileIntField1TSWithoutSDA *contc=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(content);
if(!contc)
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::convertToInt : the content inside this is not INT32 ! This is incoherent !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutSDA> newc(contc->convertToDouble());
+ MCAuto<MEDFileField1TSWithoutSDA> newc(contc->convertToDouble());
ret=static_cast<MEDFileField1TS *>(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileField1TSWithoutSDA *)newc,getFileName()));
}
else
{
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::getFieldAtLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut2;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut2,*contentNotNull());
+ MCAuto<DataArray> arrOut2;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut2,*contentNotNull());
DataArrayInt *arrOutC=dynamic_cast<DataArrayInt *>((DataArray *)arrOut2);
if(!arrOutC)
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::getFieldAtLevelOld : mismatch between dataArrays type and MEDFileIntField1TS ! Expected int32 !");
return ret.retn();
}
-DataArrayInt *MEDFileIntField1TS::ReturnSafelyDataArrayInt(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr)
+DataArrayInt *MEDFileIntField1TS::ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr)
{
if(!((DataArray *)arr))
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::ReturnSafelyDataArrayInt : input DataArray is NULL !");
{
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtTopLevel : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtTopLevel method instead !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arr,*contentNotNull());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtTopLevel(type,std::string(),renumPol,this,arr,*contentNotNull());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
*/
MEDCouplingFieldDouble *MEDFileIntField1TS::getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt* &arrOut, int renumPol) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arr,*contentNotNull());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arr,*contentNotNull());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
*/
MEDCouplingFieldDouble *MEDFileIntField1TS::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt* &arrOut, int renumPol) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arr,*contentNotNull());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arr,*contentNotNull());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
{
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::getFieldAtLevelOld : Request for a method that can be used for instances coming from file loading ! Use getFieldOnMeshAtLevel method instead !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arr,*contentNotNull());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=contentNotNull()->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arr,*contentNotNull());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
*/
DataArrayInt *MEDFileIntField1TS::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr=contentNotNull()->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNull());
+ MCAuto<DataArray> arr=contentNotNull()->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNull());
return MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
}
std::size_t MEDFileAnyTypeFieldMultiTSWithoutSDA::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret(_name.capacity()+_infos.capacity()*sizeof(std::string)+_time_steps.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutSDA>));
+ std::size_t ret(_name.capacity()+_infos.capacity()*sizeof(std::string)+_time_steps.capacity()*sizeof(MCAuto<MEDFileField1TSWithoutSDA>));
for(std::vector<std::string>::const_iterator it=_infos.begin();it!=_infos.end();it++)
ret+=(*it).capacity();
return ret;
std::vector<const BigMemoryObject *> MEDFileAnyTypeFieldMultiTSWithoutSDA::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
ret.push_back((const MEDFileAnyTypeField1TSWithoutSDA *)*it);
return ret;
}
*/
MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTSWithoutSDA::buildFromTimeStepIds(const int *startIds, const int *endIds) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret=createNew();
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret=createNew();
ret->setInfo(_infos);
int sz=(int)_time_steps.size();
for(const int *id=startIds;id!=endIds;id++)
if(*id>=0 && *id<sz)
{
const MEDFileAnyTypeField1TSWithoutSDA *tse=_time_steps[*id];
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> tse2;
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> tse2;
if(tse)
{
tse->incrRef();
{
static const char msg[]="MEDFileAnyTypeFieldMultiTSWithoutSDA::buildFromTimeStepIds2";
int nbOfEntriesToKeep=DataArrayInt::GetNumberOfItemGivenBESRelative(bg,end,step,msg);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret=createNew();
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret=createNew();
ret->setInfo(_infos);
int sz=(int)_time_steps.size();
int j=bg;
if(j>=0 && j<sz)
{
const MEDFileAnyTypeField1TSWithoutSDA *tse=_time_steps[j];
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> tse2;
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> tse2;
if(tse)
{
tse->incrRef();
MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTSWithoutSDA::partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const
{
int id=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=DataArrayInt::New(); ids->alloc(0,1);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,id++)
+ MCAuto<DataArrayInt> ids=DataArrayInt::New(); ids->alloc(0,1);
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,id++)
{
const MEDFileAnyTypeField1TSWithoutSDA *cur(*it);
if(!cur)
MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTSWithoutSDA::partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const
{
int id=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=DataArrayInt::New(); ids->alloc(0,1);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,id++)
+ MCAuto<DataArrayInt> ids=DataArrayInt::New(); ids->alloc(0,1);
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,id++)
{
const MEDFileAnyTypeField1TSWithoutSDA *cur(*it);
if(!cur)
bool MEDFileAnyTypeFieldMultiTSWithoutSDA::presenceOfMultiDiscPerGeoType() const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
const MEDFileAnyTypeField1TSWithoutSDA *cur(*it);
if(!cur)
int MEDFileAnyTypeFieldMultiTSWithoutSDA::getTimeStepPos(int iteration, int order) const
{
int ret=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,ret++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,ret++)
{
const MEDFileAnyTypeField1TSWithoutSDA *pt(*it);
if(pt->isDealingTS(iteration,order))
bool MEDFileAnyTypeFieldMultiTSWithoutSDA::changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
MEDFileAnyTypeField1TSWithoutSDA *cur(*it);
if(cur)
MEDFileFieldGlobsReal& glob)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
MEDFileAnyTypeField1TSWithoutSDA *f1ts(*it);
if(f1ts)
oss << startLine << " - \"" << *it << "\"" << std::endl;
}
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
{
std::string chapter(17,'0'+i);
oss << startLine << chapter << std::endl;
return ret;
}
-void MEDFileAnyTypeFieldMultiTSWithoutSDA::pushBackTimeStep(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA>& tse)
+void MEDFileAnyTypeFieldMultiTSWithoutSDA::pushBackTimeStep(MCAuto<MEDFileAnyTypeField1TSWithoutSDA>& tse)
{
MEDFileAnyTypeField1TSWithoutSDA *tse2(tse);
if(!tse2)
void MEDFileAnyTypeFieldMultiTSWithoutSDA::synchronizeNameScope()
{
std::size_t nbOfCompo=_infos.size();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
MEDFileAnyTypeField1TSWithoutSDA *cur=(*it);
if(cur)
void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
MEDFileAnyTypeField1TSWithoutSDA *elt(*it);
if(elt)
void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
MEDFileAnyTypeField1TSWithoutSDA *elt(*it);
if(elt)
void MEDFileAnyTypeFieldMultiTSWithoutSDA::unloadArrays()
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
MEDFileAnyTypeField1TSWithoutSDA *elt(*it);
if(elt)
void MEDFileAnyTypeFieldMultiTSWithoutSDA::eraseEmptyTS()
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > newTS;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > newTS;
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
const MEDFileAnyTypeField1TSWithoutSDA *tmp=(*it);
if(tmp)
void MEDFileAnyTypeFieldMultiTSWithoutSDA::eraseTimeStepIds(const int *startIds, const int *endIds)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > newTS;
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > newTS;
int maxId=(int)_time_steps.size();
int ii=0;
std::set<int> idsToDel;
int j=bg;
for(int i=0;i<nbOfEntriesToKill;i++,j+=step)
b[j]=false;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > newTS;
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > newTS;
for(std::size_t i=0;i<sz;i++)
if(b[i])
newTS.push_back(_time_steps[i]);
{
int ret=0;
std::ostringstream oss; oss << "MEDFileFieldMultiTSWithoutSDA::getPosOfTimeStep : No such time step (" << iteration << "," << order << ") !\nPossibilities are : ";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,ret++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,ret++)
{
const MEDFileAnyTypeField1TSWithoutSDA *tmp(*it);
if(tmp)
int ret=0;
std::ostringstream oss; oss << "MEDFileFieldMultiTSWithoutSDA::getPosGivenTime : No such time step " << time << "! \nPossibilities are : ";
oss.precision(15);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,ret++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,ret++)
{
const MEDFileAnyTypeField1TSWithoutSDA *tmp(*it);
if(tmp)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsed2();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsed2();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
std::vector<std::string> MEDFileAnyTypeFieldMultiTSWithoutSDA::getPflsReallyUsedMulti2() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsedMulti2();
ret.insert(ret.end(),tmp.begin(),tmp.end());
std::vector<std::string> MEDFileAnyTypeFieldMultiTSWithoutSDA::getLocsReallyUsedMulti2() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeField1TSWithoutSDA > >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsedMulti2();
ret.insert(ret.end(),tmp.begin(),tmp.end());
void MEDFileAnyTypeFieldMultiTSWithoutSDA::changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TSWithoutSDA > >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeField1TSWithoutSDA > >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
(*it)->changePflsRefsNamesGen2(mapOfModif);
}
void MEDFileAnyTypeFieldMultiTSWithoutSDA::changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TSWithoutSDA > >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeField1TSWithoutSDA > >::iterator it=_time_steps.begin();it!=_time_steps.end();it++)
(*it)->changeLocsRefsNamesGen2(mapOfModif);
}
return getTimeStepEntry(iteration,order).getFieldSplitedByType(mname,types,typesF,pfls,locs);
}
-MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTSWithoutSDA::deepCpy() const
+MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTSWithoutSDA::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret=shallowCpy();
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret=shallowCpy();
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
{
if((const MEDFileAnyTypeField1TSWithoutSDA *)*it)
- ret->_time_steps[i]=(*it)->deepCpy();
+ ret->_time_steps[i]=(*it)->deepCopy();
}
return ret.retn();
}
-std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > MEDFileAnyTypeFieldMultiTSWithoutSDA::splitComponents() const
+std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > MEDFileAnyTypeFieldMultiTSWithoutSDA::splitComponents() const
{
std::size_t sz(_infos.size()),sz2(_time_steps.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > ret(sz);
- std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > > ts(sz2);
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > ret(sz);
+ std::vector< std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > > ts(sz2);
for(std::size_t i=0;i<sz;i++)
{
ret[i]=shallowCpy();
}
for(std::size_t i=0;i<sz2;i++)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > ret1=_time_steps[i]->splitComponents();
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > ret1=_time_steps[i]->splitComponents();
if(ret1.size()!=sz)
{
std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTSWithoutSDA::splitComponents : At rank #" << i << " number of components is " << ret1.size() << " whereas it should be for all time steps " << sz << " !";
* This method splits into discretization each time steps in \a this.
* ** WARNING ** the returned instances are not compulsary defined on the same time steps series !
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > MEDFileAnyTypeFieldMultiTSWithoutSDA::splitDiscretizations() const
+std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > MEDFileAnyTypeFieldMultiTSWithoutSDA::splitDiscretizations() const
{
std::size_t sz(_time_steps.size());
- std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > > items(sz);
+ std::vector< std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > > items(sz);
for(std::size_t i=0;i<sz;i++)
{
const MEDFileAnyTypeField1TSWithoutSDA *timeStep(_time_steps[i]);
items[i]=timeStep->splitDiscretizations();
}
//
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > ret;
- std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > > ret2;
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > ret;
+ std::vector< std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > > ret2;
std::vector< TypeOfField > types;
- for(std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > >::const_iterator it0=items.begin();it0!=items.end();it0++)
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
+ for(std::vector< std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > >::const_iterator it0=items.begin();it0!=items.end();it0++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
{
std::vector<TypeOfField> ts=(*it1)->getTypesOfFieldAvailable();
if(ts.size()!=1)
types.push_back(ts[0]);
}
ret.resize(types.size()); ret2.resize(types.size());
- for(std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > >::const_iterator it0=items.begin();it0!=items.end();it0++)
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
+ for(std::vector< std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > >::const_iterator it0=items.begin();it0!=items.end();it0++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
{
TypeOfField typ=(*it1)->getTypesOfFieldAvailable()[0];
std::size_t pos=std::distance(types.begin(),std::find(types.begin(),types.end(),typ));
}
for(std::size_t i=0;i<types.size();i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt(createNew());
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it1=ret2[i].begin();it1!=ret2[i].end();it1++)
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt(createNew());
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::iterator it1=ret2[i].begin();it1!=ret2[i].end();it1++)
elt->pushBackTimeStep(*it1);//also updates infos in elt
ret[i]=elt;
elt->MEDFileFieldNameScope::operator=(*this);
/*!
* Contrary to splitDiscretizations method this method makes the hypothesis that the times series are **NOT** impacted by the splitting of multi discretization.
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > MEDFileAnyTypeFieldMultiTSWithoutSDA::splitMultiDiscrPerGeoTypes() const
+std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > MEDFileAnyTypeFieldMultiTSWithoutSDA::splitMultiDiscrPerGeoTypes() const
{
std::size_t sz(_time_steps.size());
- std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > > items(sz);
+ std::vector< std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > > items(sz);
std::size_t szOut(std::numeric_limits<std::size_t>::max());
for(std::size_t i=0;i<sz;i++)
{
}
if(szOut==std::numeric_limits<std::size_t>::max())
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::splitMultiDiscrPerGeoTypes : empty field !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > ret(szOut);
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > ret(szOut);
for(std::size_t i=0;i<szOut;i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt(createNew());
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt(createNew());
for(std::size_t j=0;j<sz;j++)
elt->pushBackTimeStep(items[j][i]);
ret[i]=elt;
{
std::size_t sz=_infos.size();
int j=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,j++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,j++)
{
const MEDFileAnyTypeField1TSWithoutSDA *elt(*it);
if(elt)
if(!_time_steps.empty())
checkCoherencyOfTinyInfo(field,arr);
MEDFileAnyTypeField1TSWithoutSDA *objC=createNew1TSWithoutSDAEmptyInstance();
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> obj(objC);
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> obj(objC);
objC->setFieldNoProfileSBT(field,arr,glob,*this);
copyTinyInfoFrom(field,arr);
_time_steps.push_back(obj);
if(!_time_steps.empty())
checkCoherencyOfTinyInfo(field,arr);
MEDFileField1TSWithoutSDA *objC=new MEDFileField1TSWithoutSDA;
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> obj(objC);
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> obj(objC);
objC->setFieldProfile(field,arr,mesh,meshDimRelToMax,profile,glob,*this);
copyTinyInfoFrom(field,arr);
_time_steps.push_back(obj);
}
-void MEDFileAnyTypeFieldMultiTSWithoutSDA::setIteration(int i, MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> ts)
+void MEDFileAnyTypeFieldMultiTSWithoutSDA::setIteration(int i, MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ts)
{
int sz=(int)_time_steps.size();
if(i<0 || i>=sz)
MEDFileIntFieldMultiTSWithoutSDA *MEDFileFieldMultiTSWithoutSDA::convertToInt() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTSWithoutSDA> ret(new MEDFileIntFieldMultiTSWithoutSDA);
+ MCAuto<MEDFileIntFieldMultiTSWithoutSDA> ret(new MEDFileIntFieldMultiTSWithoutSDA);
ret->MEDFileAnyTypeFieldMultiTSWithoutSDA::operator =(*this);
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
{
const MEDFileAnyTypeField1TSWithoutSDA *eltToConv(*it);
if(eltToConv)
const MEDFileField1TSWithoutSDA *eltToConvC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(eltToConv);
if(!eltToConvC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTSWithoutSDA::convertToInt : presence of an invalid 1TS type ! Should be of type FLOAT64 !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> elt=eltToConvC->convertToInt();
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> elt=eltToConvC->convertToInt();
ret->setIteration(i,elt);
}
}
std::string dtunit;
int i=-1;
MEDFileAnyTypeField1TS::LocateField(fid,fileName,fieldName,i,typcha,infos,dtunit);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret;
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret;
switch(typcha)
{
case MED_FLOAT64:
std::vector<std::string> infos;
std::string dtunit,fieldName;
MEDFileAnyTypeField1TS::LocateField2(fid,fileName,0,true,fieldName,typcha,infos,dtunit);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret;
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> ret;
switch(typcha)
{
case MED_FLOAT64:
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent : empty content in input : unable to build a new instance !");
if(dynamic_cast<const MEDFileFieldMultiTSWithoutSDA *>(c))
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret=MEDFileFieldMultiTS::New();
+ MCAuto<MEDFileFieldMultiTS> ret=MEDFileFieldMultiTS::New();
ret->setFileName(fileName);
ret->_content=c; c->incrRef();
return ret.retn();
}
if(dynamic_cast<const MEDFileIntFieldMultiTSWithoutSDA *>(c))
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTS> ret=MEDFileIntFieldMultiTS::New();
+ MCAuto<MEDFileIntFieldMultiTS> ret=MEDFileIntFieldMultiTS::New();
ret->setFileName(fileName);
ret->_content=c; c->incrRef();
return ret.retn();
MEDFileFieldMultiTSWithoutSDA *MEDFileIntFieldMultiTSWithoutSDA::convertToDouble() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTSWithoutSDA> ret(new MEDFileFieldMultiTSWithoutSDA);
+ MCAuto<MEDFileFieldMultiTSWithoutSDA> ret(new MEDFileFieldMultiTSWithoutSDA);
ret->MEDFileAnyTypeFieldMultiTSWithoutSDA::operator =(*this);
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
{
const MEDFileAnyTypeField1TSWithoutSDA *eltToConv(*it);
if(eltToConv)
const MEDFileIntField1TSWithoutSDA *eltToConvC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(eltToConv);
if(!eltToConvC)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTSWithoutSDA::convertToInt : presence of an invalid 1TS type ! Should be of type INT32 !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> elt=eltToConvC->convertToDouble();
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> elt=eltToConvC->convertToDouble();
ret->setIteration(i,elt);
}
}
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=BuildContentFrom(fid,fileName,loadAll,0);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret=BuildNewInstanceFromContent(c,fileName);
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=BuildContentFrom(fid,fileName,loadAll,0);
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> c(BuildContentFrom(fid,fileName,fieldName,loadAll,0,0));
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret=BuildNewInstanceFromContent(c,fileName);
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> c(BuildContentFrom(fid,fileName,fieldName,loadAll,0,0));
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret=BuildNewInstanceFromContent(c,fileName);
ret->loadGlobals(fid);
return ret.retn();
}
MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::buildSubPart(const int *startIds, const int *endIds) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=contentNotNullBase()->buildFromTimeStepIds(startIds,endIds);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret=shallowCpy();
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=contentNotNullBase()->buildFromTimeStepIds(startIds,endIds);
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret=shallowCpy();
ret->_content=c;
return ret.retn();
}
MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::buildSubPartSlice(int bg, int end, int step) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=contentNotNullBase()->buildFromTimeStepIds2(bg,end,step);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret=shallowCpy();
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> c=contentNotNullBase()->buildFromTimeStepIds2(bg,end,step);
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret=shallowCpy();
ret->_content=c;
return ret.retn();
}
int nbOfTS(fmts->getNumberOfTS());
for(int i=0;i<nbOfTS;i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> elt(fmts->getTimeStepAtPos(i));
+ MCAuto<MEDFileAnyTypeField1TS> elt(fmts->getTimeStepAtPos(i));
pushBackTimeStep(elt);
}
}
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::pushBackTimeStep : input pointer is NULL !");
checkCoherencyOfType(f1ts);
f1ts->incrRef();
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> f1tsSafe(f1ts);
+ MCAuto<MEDFileAnyTypeField1TS> f1tsSafe(f1ts);
MEDFileAnyTypeField1TSWithoutSDA *c=f1ts->contentNotNullBase();
c->incrRef();
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> cSafe(c);
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> cSafe(c);
if(!((MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content))
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::pushBackTimeStep : no content in this !");
_content->pushBackTimeStep(cSafe);
* The returned instances are deep copy of \a this except that for globals that are share with those contained in \a this.
* ** WARNING ** do no forget to rename the ouput instances to avoid to write n-times in the same MED file field !
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > MEDFileAnyTypeFieldMultiTS::splitComponents() const
+std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > MEDFileAnyTypeFieldMultiTS::splitComponents() const
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(_content);
if(!content)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::splitComponents : no content in this ! Unable to split components !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > contentsSplit=content->splitComponents();
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > contentsSplit=content->splitComponents();
std::size_t sz(contentsSplit.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret(sz);
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret(sz);
for(std::size_t i=0;i<sz;i++)
{
ret[i]=shallowCpy();
* This method returns as MEDFileAnyTypeFieldMultiTS new instances as number of discretizations over time steps in \a this.
* The returned instances are shallow copied of \a this included globals that are share with those contained in \a this.
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > MEDFileAnyTypeFieldMultiTS::splitDiscretizations() const
+std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > MEDFileAnyTypeFieldMultiTS::splitDiscretizations() const
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(_content);
if(!content)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::splitDiscretizations : no content in this ! Unable to split discretizations !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > contentsSplit(content->splitDiscretizations());
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > contentsSplit(content->splitDiscretizations());
std::size_t sz(contentsSplit.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret(sz);
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret(sz);
for(std::size_t i=0;i<sz;i++)
{
ret[i]=shallowCpy();
* This method returns as MEDFileAnyTypeFieldMultiTS new instances as number of sub-discretizations over time steps in \a this.
* The returned instances are shallow copied of \a this included globals that are share with those contained in \a this.
*/
-std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > MEDFileAnyTypeFieldMultiTS::splitMultiDiscrPerGeoTypes() const
+std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > MEDFileAnyTypeFieldMultiTS::splitMultiDiscrPerGeoTypes() const
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(_content);
if(!content)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::splitMultiDiscrPerGeoTypes : no content in this ! Unable to split discretizations !");
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > contentsSplit(content->splitMultiDiscrPerGeoTypes());
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > contentsSplit(content->splitMultiDiscrPerGeoTypes());
std::size_t sz(contentsSplit.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret(sz);
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret(sz);
for(std::size_t i=0;i<sz;i++)
{
ret[i]=shallowCpy();
return ret;
}
-MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::deepCpy() const
+MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret=shallowCpy();
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret=shallowCpy();
if((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content)
- ret->_content=_content->deepCpy();
+ ret->_content=_content->deepCopy();
ret->deepCpyGlobs(*this);
return ret.retn();
}
-MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> MEDFileAnyTypeFieldMultiTS::getContent()
+MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> MEDFileAnyTypeFieldMultiTS::getContent()
{
return _content;
}
* \throw If an element in \a vectFMTS is null.
* \sa MEDFileAnyTypeFieldMultiTS::AreOnSameSupportAcrossTime
*/
-std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> >& fsc)
+std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& fsc)
{
static const char msg[]="MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport : presence of a null instance in the input vector !";
if(!mesh)
else
vectFMTSNotNodes.push_back(*it);
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > cmps;
+ std::vector< MCAuto<MEDFileFastCellSupportComparator> > cmps;
std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > retCell=SplitPerCommonSupportNotNodesAlg(vectFMTSNotNodes,mesh,cmps);
ret=retCell;
for(std::vector<MEDFileAnyTypeFieldMultiTS *>::const_iterator it2=vectFMTSNodes.begin();it2!=vectFMTSNodes.end();it2++)
if(!isFetched)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> tmp(1,*it2);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshStruct> tmp2(MEDFileMeshStruct::New(mesh));
+ MCAuto<MEDFileMeshStruct> tmp2(MEDFileMeshStruct::New(mesh));
ret.push_back(tmp); retCell.push_back(tmp); cmps.push_back(MEDFileFastCellSupportComparator::New(tmp2,*it2));
}
}
* WARNING no check here. The caller must be sure that all items in vectFMTS are coherent each other in time steps, only one same spatial discretization and not ON_NODES.
* \param [out] cmps - same size than the returned vector.
*/
-std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> >& cmps)
+std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& cmps)
{
std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret;
std::list<MEDFileAnyTypeFieldMultiTS *> lstFMTS(vectFMTS.begin(),vectFMTS.end());
MEDFileAnyTypeFieldMultiTS *ref(*it);
std::vector<MEDFileAnyTypeFieldMultiTS *> elt;
elt.push_back(ref); it=lstFMTS.erase(it);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshStruct> mst(MEDFileMeshStruct::New(mesh));
- MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> cmp(MEDFileFastCellSupportComparator::New(mst,ref));
+ MCAuto<MEDFileMeshStruct> mst(MEDFileMeshStruct::New(mesh));
+ MCAuto<MEDFileFastCellSupportComparator> cmp(MEDFileFastCellSupportComparator::New(mst,ref));
while(it!=lstFMTS.end())
{
MEDFileAnyTypeFieldMultiTS *curIt(*it);
return nts;
for(int i=0;i<nts;i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> f0cur=f0->getTimeStepAtPos(i);
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> f1cur=f1->getTimeStepAtPos(i);
+ MCAuto<MEDFileAnyTypeField1TS> f0cur=f0->getTimeStepAtPos(i);
+ MCAuto<MEDFileAnyTypeField1TS> f1cur=f1->getTimeStepAtPos(i);
std::vector<TypeOfField> tofs0(f0cur->getTypesOfFieldAvailable()),tofs1(f1cur->getTypesOfFieldAvailable());
if(tofs0.size()!=1 || tofs1.size()!=1)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::CheckSupportAcrossTime : All time steps must be defined on only one spatial discretization !");
*/
MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const std::string& fileName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret=new MEDFileFieldMultiTS(fileName,loadAll,0);
+ MCAuto<MEDFileFieldMultiTS> ret=new MEDFileFieldMultiTS(fileName,loadAll,0);
ret->contentNotNull();//to check that content type matches with \a this type.
return ret.retn();
}
*/
MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret=new MEDFileFieldMultiTS(fileName,fieldName,loadAll,0);
+ MCAuto<MEDFileFieldMultiTS> ret=new MEDFileFieldMultiTS(fileName,fieldName,loadAll,0);
ret->contentNotNull();//to check that content type matches with \a this type.
return ret.retn();
}
MEDFileFieldMultiTS *MEDFileFieldMultiTS::LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret(new MEDFileFieldMultiTS(fileName,fieldName,loadAll,0,&entities));
+ MCAuto<MEDFileFieldMultiTS> ret(new MEDFileFieldMultiTS(fileName,fieldName,loadAll,0,&entities));
ret->contentNotNull();//to check that content type matches with \a this type.
return ret.retn();
}
*/
MEDFileIntFieldMultiTS *MEDFileFieldMultiTS::convertToInt(bool isDeepCpyGlobs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTS> ret;
+ MCAuto<MEDFileIntFieldMultiTS> ret;
const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(_content);
if(content)
{
const MEDFileFieldMultiTSWithoutSDA *contc=dynamic_cast<const MEDFileFieldMultiTSWithoutSDA *>(content);
if(!contc)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::convertToInt : the content inside this is not FLOAT64 ! This is incoherent !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTSWithoutSDA> newc(contc->convertToInt());
+ MCAuto<MEDFileIntFieldMultiTSWithoutSDA> newc(contc->convertToInt());
ret=static_cast<MEDFileIntFieldMultiTS *>(MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent((MEDFileIntFieldMultiTSWithoutSDA *)newc,getFileName()));
}
else
const MEDFileField1TSWithoutSDA *itemC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(item);
if(itemC)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=MEDFileField1TS::New(*itemC,false);
+ MCAuto<MEDFileField1TS> ret=MEDFileField1TS::New(*itemC,false);
ret->shallowCpyGlobs(*this);
return ret.retn();
}
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldAtLevel : mismatch of type of field expecting FLOAT64 !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNullBase());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arrOut,*contentNotNullBase());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldAtTopLevel : mismatch of type of field !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNullBase());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,std::string(),renumPol,this,arrOut,*contentNotNullBase());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldOnMeshAtLevel : mismatch of type of field !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arrOut,*contentNotNullBase());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arrOut,*contentNotNullBase());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldOnMeshAtLevel : mismatch of type of field !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arrOut,*contentNotNullBase());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arrOut,*contentNotNullBase());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldAtLevelOld : mismatch of type of field !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arrOut;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arrOut,*contentNotNullBase());
+ MCAuto<DataArray> arrOut;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arrOut,*contentNotNullBase());
MEDFileField1TS::SetDataArrayDoubleInField(ret,arrOut);
return ret.retn();
}
const MEDFileField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldWithProfile : mismatch of type of field !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret=myF1TSC->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNullBase());
+ MCAuto<DataArray> ret=myF1TSC->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNullBase());
return MEDFileField1TS::ReturnSafelyDataArrayDouble(ret);
}
*/
MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const std::string& fileName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,loadAll,0);
+ MCAuto<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,loadAll,0);
ret->contentNotNull();//to check that content type matches with \a this type.
return ret.retn();
}
*/
MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const std::string& fileName, const std::string& fieldName, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,fieldName,loadAll,0);
+ MCAuto<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,fieldName,loadAll,0);
ret->contentNotNull();//to check that content type matches with \a this type.
return ret.retn();
}
MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,fieldName,loadAll,0,&entities);
+ MCAuto<MEDFileIntFieldMultiTS> ret=new MEDFileIntFieldMultiTS(fileName,fieldName,loadAll,0,&entities);
ret->contentNotNull();//to check that content type matches with \a this type.
return ret.retn();
}
*/
MEDFileFieldMultiTS *MEDFileIntFieldMultiTS::convertToDouble(bool isDeepCpyGlobs) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret;
+ MCAuto<MEDFileFieldMultiTS> ret;
const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(_content);
if(content)
{
const MEDFileIntFieldMultiTSWithoutSDA *contc=dynamic_cast<const MEDFileIntFieldMultiTSWithoutSDA *>(content);
if(!contc)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::convertToInt : the content inside this is not INT32 ! This is incoherent !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTSWithoutSDA> newc(contc->convertToDouble());
+ MCAuto<MEDFileFieldMultiTSWithoutSDA> newc(contc->convertToDouble());
ret=static_cast<MEDFileFieldMultiTS *>(MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent((MEDFileFieldMultiTSWithoutSDA *)newc,getFileName()));
}
else
const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::getFieldAtLevel : mismatch of type of field expecting INT32 !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arr,*contentNotNullBase());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,std::string(),renumPol,this,arr,*contentNotNullBase());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::getFieldAtTopLevel : mismatch of type of field ! INT32 expected !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,std::string(),renumPol,this,arr,*contentNotNullBase());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtTopLevel(type,std::string(),renumPol,this,arr,*contentNotNullBase());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldOnMeshAtLevel : mismatch of type of field ! INT32 expected !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arr,*contentNotNullBase());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,meshDimRelToMax,renumPol,this,mesh,arr,*contentNotNullBase());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldIntMultiTS::getFieldOnMeshAtLevel : mismatch of type of field ! INT32 expected !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arr,*contentNotNullBase());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldOnMeshAtLevel(type,renumPol,this,mesh,0,0,arr,*contentNotNullBase());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTS::getFieldOnMeshAtLevel : mismatch of type of field ! INT32 expected !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arr,*contentNotNullBase());
+ MCAuto<DataArray> arr;
+ MCAuto<MEDCouplingFieldDouble> ret=myF1TSC->getFieldAtLevel(type,meshDimRelToMax,mname,renumPol,this,arr,*contentNotNullBase());
arrOut=MEDFileIntField1TS::ReturnSafelyDataArrayInt(arr);
return ret.retn();
}
const MEDFileIntField1TSWithoutSDA *myF1TSC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(&myF1TS);
if(!myF1TSC)
throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::getFieldWithProfile : mismatch of type of field ! INT32 expected !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret=myF1TSC->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNullBase());
+ MCAuto<DataArray> ret=myF1TSC->getFieldWithProfile(type,meshDimRelToMax,mesh,pfl,this,*contentNotNullBase());
return MEDFileIntField1TS::ReturnSafelyDataArrayInt(ret);
}
const MEDFileIntField1TSWithoutSDA *itemC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(item);
if(itemC)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileIntField1TS> ret=MEDFileIntField1TS::New(*itemC,false);
+ MCAuto<MEDFileIntField1TS> ret=MEDFileIntField1TS::New(*itemC,false);
ret->shallowCpyGlobs(*this);
return ret.retn();
}
std::size_t MEDFileFields::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren());
- ret+=_fields.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA>);
+ ret+=_fields.capacity()*sizeof(MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA>);
return ret;
}
std::vector<const BigMemoryObject *> MEDFileFields::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
ret.push_back((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)*it);
return ret;
}
-MEDFileFields *MEDFileFields::deepCpy() const
+MEDFileFields *MEDFileFields::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> ret=shallowCpy();
+ MCAuto<MEDFileFields> ret=shallowCpy();
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
{
if((const MEDFileAnyTypeFieldMultiTSWithoutSDA*)*it)
- ret->_fields[i]=(*it)->deepCpy();
+ ret->_fields[i]=(*it)->deepCopy();
}
ret->deepCpyGlobs(*this);
return ret.retn();
std::set< std::pair<int,int> > s;
bool firstShot=true;
areThereSomeForgottenTS=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
if(!(const MEDFileAnyTypeFieldMultiTSWithoutSDA*)*it)
continue;
{
std::vector<std::string> ret(_fields.size());
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *f=(*it);
if(f)
std::vector<std::string> MEDFileFields::getMeshesNames() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur(*it);
if(cur)
std::string startLine(bkOffset,' ');
oss << startLine << "There are " << nbOfFields << " fields in this :" << std::endl;
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur=(*it);
if(cur)
}
}
i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur=(*it);
std::string chapter(17,'0'+i);
{
int i=0;
writeGlobals(fid,*this);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *elt=*it;
if(!elt)
if(getFileName().empty())
throw INTERP_KERNEL::Exception("MEDFileFields::loadArrays : the structure does not come from a file !");
MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *elt(*it);
if(elt)
if(!getFileName().empty())
{
MEDFileUtilities::AutoFid fid=MEDfileOpen(getFileName().c_str(),MED_ACC_RDONLY);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *elt(*it);
if(elt)
*/
void MEDFileFields::unloadArrays()
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *elt(*it);
if(elt)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsed2();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
{
std::vector<std::string> ret;
std::set<std::string> ret2;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsed2();
for(std::vector<std::string>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
std::vector<std::string> MEDFileFields::getPflsReallyUsedMulti() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
std::vector<std::string> tmp=(*it)->getPflsReallyUsedMulti2();
ret.insert(ret.end(),tmp.begin(),tmp.end());
std::vector<std::string> MEDFileFields::getLocsReallyUsedMulti() const
{
std::vector<std::string> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
std::vector<std::string> tmp=(*it)->getLocsReallyUsed2();
ret.insert(ret.end(),tmp.begin(),tmp.end());
void MEDFileFields::changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::iterator it=_fields.begin();it!=_fields.end();it++)
(*it)->changePflsRefsNamesGen2(mapOfModif);
}
void MEDFileFields::changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTSWithoutSDA > >::iterator it=_fields.begin();it!=_fields.end();it++)
(*it)->changeLocsRefsNamesGen2(mapOfModif);
}
}
b[*i]=false;
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > fields(std::count(b.begin(),b.end(),true));
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > fields(std::count(b.begin(),b.end(),true));
std::size_t j=0;
for(std::size_t i=0;i<_fields.size();i++)
if(b[i])
}
b[k]=false;
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > fields(std::count(b.begin(),b.end(),true));
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > fields(std::count(b.begin(),b.end(),true));
std::size_t j=0;
for(std::size_t i=0;i<_fields.size();i++)
if(b[i])
bool MEDFileFields::changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *cur(*it);
if(cur)
bool MEDFileFields::renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::iterator it=_fields.begin();it!=_fields.end();it++)
{
MEDFileAnyTypeFieldMultiTSWithoutSDA *fmts(*it);
if(fmts)
const MEDFileAnyTypeFieldMultiTSWithoutSDA *fmts=_fields[i];
if(!fmts)
return 0;
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ret;
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret;
const MEDFileFieldMultiTSWithoutSDA *fmtsC=dynamic_cast<const MEDFileFieldMultiTSWithoutSDA *>(fmts);
const MEDFileIntFieldMultiTSWithoutSDA *fmtsC2=dynamic_cast<const MEDFileIntFieldMultiTSWithoutSDA *>(fmts);
if(fmtsC)
*/
MEDFileFields *MEDFileFields::buildSubPart(const int *startIds, const int *endIds) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> ret=shallowCpy();
+ MCAuto<MEDFileFields> ret=shallowCpy();
std::size_t sz=std::distance(startIds,endIds);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > fields(sz);
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > fields(sz);
int j=0;
for(const int *i=startIds;i!=endIds;i++,j++)
{
*/
bool MEDFileFields::removeFieldsWithoutAnyTimeStep()
{
- std::vector<MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > newFields;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ std::vector<MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > newFields;
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *elt(*it);
if(elt)
*/
MEDFileFields *MEDFileFields::partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> ret=MEDFileFields::New();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ MCAuto<MEDFileFields> ret=MEDFileFields::New();
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur=(*it);
if(!cur)
if(cur->getMeshName()==meshName)
{
cur->incrRef();
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> cur2(const_cast<MEDFileAnyTypeFieldMultiTSWithoutSDA *>(cur));
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> cur2(const_cast<MEDFileAnyTypeFieldMultiTSWithoutSDA *>(cur));
ret->_fields.push_back(cur2);
}
}
*/
MEDFileFields *MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> ret=MEDFileFields::New();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ MCAuto<MEDFileFields> ret=MEDFileFields::New();
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur=(*it);
if(!cur)
continue;
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt=cur->partOfThisLyingOnSpecifiedTimeSteps(timeSteps);
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt=cur->partOfThisLyingOnSpecifiedTimeSteps(timeSteps);
ret->_fields.push_back(elt);
}
ret->shallowCpyOnlyUsedGlobs(*this);
*/
MEDFileFields *MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> ret=MEDFileFields::New();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
+ MCAuto<MEDFileFields> ret=MEDFileFields::New();
+ for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur=(*it);
if(!cur)
continue;
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt=cur->partOfThisNotLyingOnSpecifiedTimeSteps(timeSteps);
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> elt=cur->partOfThisNotLyingOnSpecifiedTimeSteps(timeSteps);
if(elt->getNumberOfTS()!=0)
ret->_fields.push_back(elt);
}
#include "MEDFileFieldOverView.hxx"
#include "MEDFileUtilities.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingRefCountObject.hxx"
#include "MEDCouplingMemArray.hxx"
#include "med.h"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileFieldGlobs;
class MEDCouplingMesh;
static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileFieldLoc *deepCpy() const;
+ MEDFileFieldLoc *deepCopy() const;
MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT std::string repr() const;
static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileFieldPerMeshPerTypePerDisc *deepCpy(MEDFileFieldPerMeshPerType *father) const;
+ MEDFileFieldPerMeshPerTypePerDisc *deepCopy(MEDFileFieldPerMeshPerType *father) const;
void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob);
static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries);
static bool RenumberChunks(int offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
const DataArrayInt *explicitIdsInMesh, const std::vector<int>& newCode,
- MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >& result);
+ MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> >& result);
static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt,
bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
MEDFileFieldGlobsReal& glob, bool ¬InExisting);
//! only on assignement -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT
mutable int _loc_id;
mutable int _profile_it;
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> _pd;
+ MCAuto<PartDefinition> _pd;
public:
mutable int _tmp_work1;
};
static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd);
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileFieldPerMeshPerType *deepCpy(MEDFileFieldPerMesh *father) const;
+ MEDFileFieldPerMeshPerType *deepCopy(MEDFileFieldPerMesh *father) const;
void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) const;
void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
void fillValues(int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
- void setLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
+ void setLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
bool keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
bool keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
private:
MEDFileFieldPerMesh *_father;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
+ std::vector< MCAuto<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
INTERP_KERNEL::NormalizedCellType _geo_type;
};
static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > *entities);
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
+ MEDFileFieldPerMesh *deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
void assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const std::vector<int>& code, const std::vector<int>& code2, const std::vector<DataArrayInt *>& idsInPflPerType, const std::vector<DataArrayInt *>& idsPerType, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
void keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
void changePflsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
void changeLocsRefsNamesGen(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
- MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
void getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId);
private:
int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
- const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
- const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
- const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const;
- void assignNewLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
+ void assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type,
const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes, const std::vector< std::pair<int,int> >& dads, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& locs,
std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
int _mesh_iteration;
int _mesh_order;
MEDFileAnyTypeField1TSWithoutSDA *_father;
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > > _field_pm_pt;
+ std::vector< MCAuto< MEDFileFieldPerMeshPerType > > _field_pm_pt;
};
class MEDFileFieldGlobsReal;
static MEDFileFieldGlobs *New();
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileFieldGlobs *deepCpy() const;
+ MEDFileFieldGlobs *deepCopy() const;
MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
void simpleRepr(std::ostream& oss) const;
MEDFileFieldGlobs();
~MEDFileFieldGlobs();
protected:
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _pfls;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> > _locs;
+ std::vector< MCAuto<DataArrayInt> > _pfls;
+ std::vector< MCAuto<MEDFileFieldLoc> > _locs;
std::string _file_name;
};
MEDFileFieldGlobs *contentNotNull();
const MEDFileFieldGlobs *contentNotNull() const;
protected:
- MEDCouplingAutoRefCountObjectPtr< MEDFileFieldGlobs > _globals;
+ MCAuto< MEDFileFieldGlobs > _globals;
};
class MEDFileFieldNameScope
MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
MEDLOADER_EXPORT virtual void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const;
- MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const = 0;
+ MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *deepCopy() const = 0;
MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const = 0;
- MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitComponents() const;
+ MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitComponents() const;
MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArray() const = 0;
MEDLOADER_EXPORT virtual DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const = 0;
MEDLOADER_EXPORT virtual DataArray *getOrCreateAndGetArray() = 0;
MEDLOADER_EXPORT virtual const DataArray *getOrCreateAndGetArray() const = 0;
public:
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
- MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, const std::string& mName, int renumPol, const MEDFileFieldGlobsReal *glob, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
+ MEDLOADER_EXPORT MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MCAuto<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const;
public:
MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitDiscretizations() const;
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
+ MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitDiscretizations() const;
+ MEDLOADER_EXPORT std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
MEDLOADER_EXPORT int keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair<int,int> >& its);
MEDLOADER_EXPORT int keepOnlyGaussDiscretization(std::size_t idOfDisc, std::vector< std::pair<int,int> >& its);
public:
int addNewEntryIfNecessary(const MEDCouplingMesh *mesh);
void updateData(int newLgth, const std::vector< std::pair<int,int> >& oldStartStops);
protected:
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > > _field_per_mesh;
+ std::vector< MCAuto< MEDFileFieldPerMesh > > _field_per_mesh;
int _iteration;
int _order;
double _dt;
MEDLOADER_EXPORT MEDFileField1TSWithoutSDA();
MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const;
- MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCopy() const;
MEDLOADER_EXPORT void setArray(DataArray *arr);
MEDLOADER_EXPORT DataArray *createNewEmptyDataArrayInstance() const;
MEDLOADER_EXPORT DataArray *getOrCreateAndGetArray();
MEDLOADER_EXPORT const DataArrayDouble *getOrCreateAndGetArrayDouble() const;
MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *convertToInt() const;
protected:
- MEDCouplingAutoRefCountObjectPtr< DataArrayDouble > _arr;
+ MCAuto< DataArrayDouble > _arr;
public:
static const char TYPE_STR[];
};
public:
MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
- MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *deepCopy() const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArray() const;
protected:
MEDFileIntField1TSWithoutSDA(const std::string& fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
protected:
- MEDCouplingAutoRefCountObjectPtr< DataArrayInt > _arr;
+ MCAuto< DataArrayInt > _arr;
public:
MEDLOADER_EXPORT static const char TYPE_STR[];
};
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void unloadArrays();
MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitComponents() const;
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitMultiDiscrPerGeoTypes() const;
- MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCpy() const;
+ MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitComponents() const;
+ MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
+ MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeField1TS > > splitMultiDiscrPerGeoTypes() const;
+ MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCopy() const;
MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
MEDLOADER_EXPORT virtual MEDFileAnyTypeField1TS *shallowCpy() const = 0;
public:
MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase();
MEDLOADER_EXPORT const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const;
protected:
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> _content;
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> _content;
};
class MEDFileIntField1TS;
MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
public:
- MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
- MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
+ MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MCAuto<DataArray>& arr);
+ MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MCAuto<DataArray>& arr);
private:
med_field_type getMEDFileFieldType() const { return MED_FLOAT64; }
const MEDFileField1TSWithoutSDA *contentNotNull() const;
MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile);
MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArray() const;
public:
- MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
+ MEDLOADER_EXPORT static DataArrayInt *ReturnSafelyDataArrayInt(MCAuto<DataArray>& arr);
private:
med_field_type getMEDFileFieldType() const { return MED_INT32; }
const MEDFileIntField1TSWithoutSDA *contentNotNull() const;
public:
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const;
- MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
- MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
- MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
+ MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCopy() const;
+ MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
+ MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
+ MEDLOADER_EXPORT virtual std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitMultiDiscrPerGeoTypes() const;
MEDLOADER_EXPORT virtual const char *getTypeStr() const = 0;
MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const = 0;
MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const = 0;
MEDLOADER_EXPORT int getPosGivenTime(double time, double eps=1e-8) const;
MEDLOADER_EXPORT std::vector< std::pair<int,int> > getIterations() const;
MEDLOADER_EXPORT std::vector< std::pair<int,int> > getTimeSteps(std::vector<double>& ret1) const;
- MEDLOADER_EXPORT void pushBackTimeStep(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA>& tse);
+ MEDLOADER_EXPORT void pushBackTimeStep(MCAuto<MEDFileAnyTypeField1TSWithoutSDA>& tse);
MEDLOADER_EXPORT void synchronizeNameScope();
MEDLOADER_EXPORT void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const;
MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsedMulti2() const;
MEDLOADER_EXPORT void changePflsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
- MEDLOADER_EXPORT void setIteration(int i, MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> ts);
+ MEDLOADER_EXPORT void setIteration(int i, MCAuto<MEDFileAnyTypeField1TSWithoutSDA> ts);
protected:
virtual med_field_type getMEDFileFieldType() const = 0;
void copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
void checkThatNbOfCompoOfTSMatchThis() const;
protected:
std::vector<std::string> _infos;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
+ std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> > _time_steps;
};
class MEDFileIntFieldMultiTSWithoutSDA;
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const;
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
- MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitMultiDiscrPerGeoTypes() const;
+ MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCopy() const;
+ MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
+ MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
+ MEDLOADER_EXPORT std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > splitMultiDiscrPerGeoTypes() const;
MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const = 0;
MEDLOADER_EXPORT virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const = 0;
//
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitIntoCommonTimeSeries(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS);
- MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> >& fsc);
+ MEDLOADER_EXPORT static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupport(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& fsc);
MEDLOADER_EXPORT static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1);
public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content
MEDLOADER_EXPORT std::string getName() const;
MEDLOADER_EXPORT int getNonEmptyLevels(int iteration, int order, const std::string& mname, std::vector<int>& levs) const;
MEDLOADER_EXPORT std::vector< std::vector<TypeOfField> > getTypesOfFieldAvailable() const;
MEDLOADER_EXPORT std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(int iteration, int order, const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
- MEDLOADER_EXPORT MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
+ MEDLOADER_EXPORT MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> getContent();
public:
MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase();
const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const;
private:
- static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> >& cmps);
+ static std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > SplitPerCommonSupportNotNodesAlg(const std::vector<MEDFileAnyTypeFieldMultiTS *>& vectFMTS, const MEDFileMesh *mesh, std::vector< MCAuto<MEDFileFastCellSupportComparator> >& cmps);
protected:
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
+ MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> _content;
};
class MEDFileIntFieldMultiTS;
MEDLOADER_EXPORT ~MEDFileAnyTypeFieldMultiTSIterator();
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt();
private:
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> _fmts;
+ MCAuto<MEDFileAnyTypeFieldMultiTS> _fmts;
int _iter_id;
int _nb_iter;
};
MEDLOADER_EXPORT static MEDFileFields *LoadSpecificEntities(const std::string& fileName, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> >& entities, bool loadAll=true);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT MEDFileFields *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileFields *deepCopy() const;
MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDFileFields();
MEDFileFields(const std::string& fileName, bool loadAll, const MEDFileMeshes *ms, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > *entities);
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
+ std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> > _fields;
};
class MEDFileFieldsIterator
MEDLOADER_EXPORT ~MEDFileFieldsIterator();
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt();
private:
- MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fs;
+ MCAuto<MEDFileFields> _fs;
int _iter_id;
int _nb_iter;
};
#include "MEDCouplingFieldDiscretization.hxx"
#include "CellModel.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const unsigned char MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE[MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH]=
{1,3,21,5,9,7,22,34,23,28,255,255,255,255,10,14,13,255,12,255,24,255,16,27,255,26,255,29,255,255,25,42,36,4};
MEDMeshMultiLev *MEDMeshMultiLev::NewOnlyOnNode(const MEDFileMesh *m, const DataArrayInt *pflOnNode)
{
- MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> ret(MEDMeshMultiLev::New(m,m->getNonEmptyLevels()));
+ MCAuto<MEDMeshMultiLev> ret(MEDMeshMultiLev::New(m,m->getNonEmptyLevels()));
ret->selectPartOfNodes(pflOnNode);
return ret.retn();
}
DataArray *MEDMeshMultiLev::buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret(const_cast<DataArray *>(vals)); ret->incrRef();
+ MCAuto<DataArray> ret(const_cast<DataArray *>(vals)); ret->incrRef();
if(isFastlyTheSameStruct(fst,globs))
return ret.retn();
else
{ famIds=const_cast<DataArrayInt *>(fids); famIds->incrRef(); isWithoutCopy=_mesh->isObjectInTheProgeny(famIds); return ; }
//bad luck the slowest part
isWithoutCopy=false;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > retSafe(sz);
+ std::vector< MCAuto<DataArrayInt> > retSafe(sz);
std::vector< const DataArrayInt *> ret(sz);
int start(0);
for(std::size_t i=0;i<sz;i++)
int lgth(_nb_entities[i]);
if(pfl)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(fids->selectByTupleId2(start,start+lgth,1));
+ MCAuto<DataArrayInt> tmp(fids->selectByTupleIdSafeSlice(start,start+lgth,1));
retSafe[i]=tmp->selectByTupleIdSafe(pfl->begin(),pfl->end());
}
else
{
- retSafe[i]=fids->selectByTupleId2(start,start+lgth,1);
+ retSafe[i]=fids->selectByTupleIdSafeSlice(start,start+lgth,1);
}
ret[i]=retSafe[i];
start+=lgth;
{ numIds=const_cast<DataArrayInt *>(nids); numIds->incrRef(); isWithoutCopy=_mesh->isObjectInTheProgeny(numIds); return ; }
//bad luck the slowest part
isWithoutCopy=false;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > retSafe(sz);
+ std::vector< MCAuto<DataArrayInt> > retSafe(sz);
std::vector< const DataArrayInt *> ret(sz);
int start(0);
for(std::size_t i=0;i<sz;i++)
int lgth(_nb_entities[i]);
if(pfl)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(nids->selectByTupleId2(start,start+lgth,1));
+ MCAuto<DataArrayInt> tmp(nids->selectByTupleIdSafeSlice(start,start+lgth,1));
retSafe[i]=tmp->selectByTupleIdSafe(pfl->begin(),pfl->end());
}
else
{
- retSafe[i]=nids->selectByTupleId2(start,start+lgth,1);
+ retSafe[i]=nids->selectByTupleIdSafeSlice(start,start+lgth,1);
}
ret[i]=retSafe[i];
start+=lgth;
std::string pflName(p.getPflName());
const DataArrayInt *nr(_node_reduction);
if(pflName.empty() && !nr)
- return vals->deepCpy();
+ return vals->deepCopy();
if(pflName.empty() && nr)
throw INTERP_KERNEL::Exception("MEDMeshMultiLev::constructDataArray : unexpected situation for nodes 2 !");
if(!pflName.empty() && nr)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1(globs->getProfile(pflName.c_str())->deepCpy());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p2(nr->deepCpy());
+ MCAuto<DataArrayInt> p1(globs->getProfile(pflName.c_str())->deepCopy());
+ MCAuto<DataArrayInt> p2(nr->deepCopy());
p1->sort(true); p2->sort(true);
if(!p1->isEqualWithoutConsideringStr(*p2))
throw INTERP_KERNEL::Exception("MEDMeshMultiLev::constructDataArray : it appears that a profile on nodes does not cover the cells correctly !");
p1=DataArrayInt::FindPermutationFromFirstToSecond(globs->getProfile(pflName.c_str()),nr);
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret(vals->deepCpy());
+ MCAuto<DataArray> ret(vals->deepCopy());
ret->renumberInPlace(p1->begin());
return ret.retn();
}
if(!pflName.empty() && !nr)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1(globs->getProfile(pflName.c_str())->deepCpy());
+ MCAuto<DataArrayInt> p1(globs->getProfile(pflName.c_str())->deepCopy());
p1->sort(true);
- if(!p1->isIdentity2(getNumberOfNodes()))
+ if(!p1->isIota(getNumberOfNodes()))
throw INTERP_KERNEL::Exception("MEDMeshMultiLev::constructDataArray : unexpected situation for nodes 4 !");
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret(vals->deepCpy());
+ MCAuto<DataArray> ret(vals->deepCopy());
ret->renumberInPlace(globs->getProfile(pflName.c_str())->begin());
return ret.retn();
}
if(s.size()!=_geo_types.size())
throw INTERP_KERNEL::Exception("MEDMeshMultiLev::constructDataArray : unexpected situation for cells 2 !");
std::vector< const DataArray *> arr(s.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArray> > arrSafe(s.size());
+ std::vector< MCAuto<DataArray> > arrSafe(s.size());
int iii(0);
int nc(vals->getNumberOfComponents());
std::vector<std::string> compInfo(vals->getInfoOnComponents());
int nbi(ps[0]->getNbOfIntegrationPts(globs));
const DataArrayInt *otherP(ps[0]->getPfl(globs));
const std::pair<int,int>& strtStop(ps[0]->getStartStop());
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret(vals->selectByTupleId2(strtStop.first,strtStop.second,1));
+ MCAuto<DataArray> ret(vals->selectByTupleIdSafeSlice(strtStop.first,strtStop.second,1));
if(!thisP && !otherP)
{
arrSafe[iii]=ret; arr[iii]=ret;
}
if(thisP && otherP)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1(otherP->invertArrayN2O2O2N(getNumberOfCells(ps[0]->getGeo())));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p2(thisP->deepCpy());
+ MCAuto<DataArrayInt> p1(otherP->invertArrayN2O2O2N(getNumberOfCells(ps[0]->getGeo())));
+ MCAuto<DataArrayInt> p2(thisP->deepCopy());
p2->transformWithIndArr(p1->begin(),p1->end());
- //p1=p2->getIdsNotEqual(-1);
+ //p1=p2->findIdsNotEqual(-1);
//p1=p2->selectByTupleIdSafe(p1->begin(),p1->end());
ret->rearrange(nbi*nc); ret=ret->selectByTupleIdSafe(p2->begin(),p2->end()); ret->rearrange(nc); ret->setInfoOnComponents(compInfo);
arrSafe[iii]=ret; arr[iii]=ret;
}
if(!thisP && otherP)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1(otherP->deepCpy());
+ MCAuto<DataArrayInt> p1(otherP->deepCopy());
p1->sort(true);
p1->checkAllIdsInRange(0,getNumberOfCells(ps[0]->getGeo()));
p1=DataArrayInt::FindPermutationFromFirstToSecond(otherP,p1);
{
std::vector< const DataArrayInt * >otherPS(ps.size());
std::vector< const DataArray * > arr2(ps.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArray> > arr2Safe(ps.size());
+ std::vector< MCAuto<DataArray> > arr2Safe(ps.size());
std::vector< const DataArrayInt * > nbis(ps.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > nbisSafe(ps.size());
+ std::vector< MCAuto<DataArrayInt> > nbisSafe(ps.size());
int jj(0);
for(std::vector<const MEDFileField1TSStructItem2 *>::const_iterator it2=ps.begin();it2!=ps.end();it2++,jj++)
{
int nbi((*it2)->getNbOfIntegrationPts(globs));
const DataArrayInt *otherPfl((*it2)->getPfl(globs));
const std::pair<int,int>& strtStop((*it2)->getStartStop());
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret2(vals->selectByTupleId2(strtStop.first,strtStop.second,1));
+ MCAuto<DataArray> ret2(vals->selectByTupleIdSafeSlice(strtStop.first,strtStop.second,1));
if(!otherPfl)
throw INTERP_KERNEL::Exception("MEDMeshMultiLev::constructDataArray : unexpected situation for cells 4 !");
arr2[jj]=ret2; arr2Safe[jj]=ret2; otherPS[jj]=otherPfl;
nbisSafe[jj]=DataArrayInt::New(); nbisSafe[jj]->alloc(otherPfl->getNumberOfTuples(),1); nbisSafe[jj]->fillWithValue(nbi);
nbis[jj]=nbisSafe[jj];
}
- MEDCouplingAutoRefCountObjectPtr<DataArray> arr3(DataArray::Aggregate(arr2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> otherP(DataArrayInt::Aggregate(otherPS));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> zenbis(DataArrayInt::Aggregate(nbis));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> otherPN(otherP->invertArrayN2O2O2N(getNumberOfCells(*it)));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1;
+ MCAuto<DataArray> arr3(DataArray::Aggregate(arr2));
+ MCAuto<DataArrayInt> otherP(DataArrayInt::Aggregate(otherPS));
+ MCAuto<DataArrayInt> zenbis(DataArrayInt::Aggregate(nbis));
+ MCAuto<DataArrayInt> otherPN(otherP->invertArrayN2O2O2N(getNumberOfCells(*it)));
+ MCAuto<DataArrayInt> p1;
if(thisP)
p1=DataArrayInt::FindPermutationFromFirstToSecond(otherP,thisP);
else
- p1=otherP->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> zenbisN(zenbis->renumber(p1->begin()));
- zenbisN->computeOffsets2();
+ p1=otherP->deepCopy();
+ MCAuto<DataArrayInt> zenbisN(zenbis->renumber(p1->begin()));
+ zenbisN->computeOffsetsFull();
jj=0;
for(std::vector<const MEDFileField1TSStructItem2 *>::const_iterator it2=ps.begin();it2!=ps.end();it2++,jj++)
{
//int nbi((*it2)->getNbOfIntegrationPts(globs));
const DataArrayInt *otherPfl((*it2)->getPfl(globs));
const std::pair<int,int>& strtStop((*it2)->getStartStop());
- MEDCouplingAutoRefCountObjectPtr<DataArray> ret2(vals->selectByTupleId2(strtStop.first,strtStop.second,1));
+ MCAuto<DataArray> ret2(vals->selectByTupleIdSafeSlice(strtStop.first,strtStop.second,1));
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p2(otherPfl->deepCpy());
+ MCAuto<DataArrayInt> p2(otherPfl->deepCopy());
p2->transformWithIndArr(otherPN->begin(),otherPN->end());
p2->transformWithIndArr(p1->begin(),p1->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsN(p2->buildExplicitArrByRanges(zenbisN));
+ MCAuto<DataArrayInt> idsN(p2->buildExplicitArrByRanges(zenbisN));
arr3->setPartOfValuesBase3(ret2,idsN->begin(),idsN->end(),0,nc,1);
}
arrSafe[iii]=arr3; arr[iii]=arr3;
const DataArrayInt *cf(_cell_fam_ids),*cn(_cell_num_ids),*nf(_node_fam_ids),*nn(_node_num_ids);
if(cf)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
+ MCAuto<DataArrayInt> tmp;
std::vector<const DataArrayInt *> a(2);
a[0]=cf;
if(nf)
}
if(cn)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp;
+ MCAuto<DataArrayInt> tmp;
std::vector<const DataArrayInt *> a(2);
a[0]=cn;
if(nn)
return ;
}
//
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > famIdsSafe(sz);
+ std::vector< MCAuto<DataArrayInt> > famIdsSafe(sz);
std::vector<const DataArrayInt *> famIds(sz);
bool f(true);
for(std::size_t i=0;i<sz;i++)
}
if(f)
_cell_fam_ids=DataArrayInt::Aggregate(famIds);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > numIdsSafe(sz);
+ std::vector< MCAuto<DataArrayInt> > numIdsSafe(sz);
std::vector<const DataArrayInt *> numIds(sz);
bool n(true);
for(std::size_t i=0;i<sz;i++)
if(!pflNodes || !pflNodes->isAllocated())
return ;
std::size_t sz(_parts.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a(sz);
+ std::vector< MCAuto<DataArrayInt> > a(sz);
std::vector< const DataArrayInt *> aa(sz);
for(std::size_t i=0;i<sz;i++)
{
const DataArrayInt *pfl(_pfls[i]);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> m(_parts[i]);
+ MCAuto<MEDCoupling1GTUMesh> m(_parts[i]);
if(pfl)
m=dynamic_cast<MEDCoupling1GTUMesh *>(_parts[i]->buildPartOfMySelfKeepCoords(pfl->begin(),pfl->end()));
DataArrayInt *cellIds=0;
m->fillCellIdsToKeepFromNodeIds(pflNodes->begin(),pflNodes->end(),true,cellIds);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsSafe(cellIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> m2(m->buildPartOfMySelfKeepCoords(cellIds->begin(),cellIds->end()));
+ MCAuto<DataArrayInt> cellIdsSafe(cellIds);
+ MCAuto<MEDCouplingPointSet> m2(m->buildPartOfMySelfKeepCoords(cellIds->begin(),cellIds->end()));
int tmp=-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n(m2->getNodeIdsInUse(tmp));
+ MCAuto<DataArrayInt> o2n(m2->getNodeIdsInUse(tmp));
a[i]=o2n->invertArrayO2N2N2O(tmp); aa[i]=a[i];
if(pfl)
_pfls[i]=pfl->selectByTupleIdSafe(cellIds->begin(),cellIds->end());
if(!aa.empty())
_node_reduction=DataArrayInt::Aggregate(aa);//general case
else
- _node_reduction=pflNodes->deepCpy();//case where no cells in read mesh.
+ _node_reduction=pflNodes->deepCopy();//case where no cells in read mesh.
_node_reduction->sort(true);
_node_reduction=_node_reduction->buildUnique();
if(_node_reduction->getNumberOfTuples()==pflNodes->getNumberOfTuples())
if(_node_reduction->getNumberOfTuples()>pflNodes->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDUMeshMultiLev::selectPartOfNodes : internal error in MEDCoupling during cell select from a list of nodes !");
// Here the cells available in _parts is not enough to cover all the nodes in pflNodes. So adding vertices cells in _parts...
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> pflNodes2(pflNodes->deepCpy());
+ MCAuto<DataArrayInt> pflNodes2(pflNodes->deepCopy());
pflNodes2->sort(true);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diff(pflNodes2->buildSubstractionOptimized(_node_reduction));
+ MCAuto<DataArrayInt> diff(pflNodes2->buildSubstractionOptimized(_node_reduction));
appendVertices(diff,pflNodes2);
}
{
}
-MEDUMeshMultiLev::MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh>& part):MEDMeshMultiLev(other)
+MEDUMeshMultiLev::MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MCAuto<MEDCoupling1GTUMesh>& part):MEDMeshMultiLev(other)
{
_parts.resize(1);
_parts[0]=part;
tmp=_parts[0]->getCoords();
if(!tmp)
throw INTERP_KERNEL::Exception("MEDUMeshMultiLev::getVTUArrays : the coordinates are null !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a(const_cast<DataArrayDouble *>(tmp)); tmp->incrRef();
+ MCAuto<DataArrayDouble> a(const_cast<DataArrayDouble *>(tmp)); tmp->incrRef();
int szBCE(0),szD(0),szF(0);
bool isPolyh(false);
int iii(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_parts.begin();it!=_parts.end();it++,iii++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_parts.begin();it!=_parts.end();it++,iii++)
{
const MEDCoupling1GTUMesh *cur(*it);
if(!cur)
throw INTERP_KERNEL::Exception("MEDUMeshMultiLev::getVTUArrays : a part is null !");
//
const DataArrayInt *pfl(_pfls[iii]);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> cur2;
+ MCAuto<MEDCoupling1GTUMesh> cur2;
if(!pfl)
{ cur2=const_cast<MEDCoupling1GTUMesh *>(cur); cur2->incrRef(); }
else
else
{
isPolyh=true;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp2(cur->computeEffectiveNbOfNodesPerCell());
+ MCAuto<DataArrayInt> tmp2(cur->computeEffectiveNbOfNodesPerCell());
szD+=tmp2->accumulate(0)+curNbCells;
szF+=2*curNbCells+cur->getNodalConnectivity()->getNumberOfTuples();
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayByte> b(DataArrayByte::New()); b->alloc(szBCE,1); char *bPtr(b->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c(DataArrayInt::New()); c->alloc(szBCE,1); int *cPtr(c->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> d(DataArrayInt::New()); d->alloc(szD,1); int *dPtr(d->getPointer());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> e(DataArrayInt::New()),f(DataArrayInt::New()); int *ePtr(0),*fPtr(0);
+ MCAuto<DataArrayByte> b(DataArrayByte::New()); b->alloc(szBCE,1); char *bPtr(b->getPointer());
+ MCAuto<DataArrayInt> c(DataArrayInt::New()); c->alloc(szBCE,1); int *cPtr(c->getPointer());
+ MCAuto<DataArrayInt> d(DataArrayInt::New()); d->alloc(szD,1); int *dPtr(d->getPointer());
+ MCAuto<DataArrayInt> e(DataArrayInt::New()),f(DataArrayInt::New()); int *ePtr(0),*fPtr(0);
if(isPolyh)
{ e->alloc(szBCE,1); ePtr=e->getPointer(); f->alloc(szF,1); fPtr=f->getPointer(); }
int k(0);
iii=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_parts.begin();it!=_parts.end();it++,iii++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_parts.begin();it!=_parts.end();it++,iii++)
{
const MEDCoupling1GTUMesh *cur(*it);
//
const DataArrayInt *pfl(_pfls[iii]);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> cur2;
+ MCAuto<MEDCoupling1GTUMesh> cur2;
if(!pfl)
{ cur2=const_cast<MEDCoupling1GTUMesh *>(cur); cur2->incrRef(); }
else
return _mesh->isObjectInTheProgeny(coords);
}
-void MEDUMeshMultiLev::reorderNodesIfNecessary(MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& coords, DataArrayInt *nodalConnVTK, DataArrayInt *polyhedNodalConnVTK) const
+void MEDUMeshMultiLev::reorderNodesIfNecessary(MCAuto<DataArrayDouble>& coords, DataArrayInt *nodalConnVTK, DataArrayInt *polyhedNodalConnVTK) const
{
const DataArrayInt *nr(_node_reduction);
if(!nr)
if(szExp!=nr->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDUMeshMultiLev::reorderNodesIfNecessary : internal error #3 !");
// Go renumbering !
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n(DataArrayInt::New()); o2n->alloc(sz,1);
+ MCAuto<DataArrayInt> o2n(DataArrayInt::New()); o2n->alloc(sz,1);
int *o2nPtr(o2n->getPointer());
int newId(0);
for(int i=0;i<sz;i++,o2nPtr++)
if(b[i]) *o2nPtr=newId++; else *o2nPtr=-1;
const int *o2nPtrc(o2n->begin());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o(o2n->invertArrayO2N2N2O(nr->getNumberOfTuples()));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> perm(DataArrayInt::FindPermutationFromFirstToSecond(n2o,nr));
+ MCAuto<DataArrayInt> n2o(o2n->invertArrayO2N2N2O(nr->getNumberOfTuples()));
+ MCAuto<DataArrayInt> perm(DataArrayInt::FindPermutationFromFirstToSecond(n2o,nr));
const int *permPtr(perm->begin());
int *work2(nodalConnVTK->getPointer()),*endW2(nodalConnVTK->getPointer()+nodalConnVTK->getNumberOfTuples());
while(work2!=endW2)
{
int nbOfCells(verticesToAdd->getNumberOfTuples());//it is not a bug cells are NORM_POINT1
MEDMeshMultiLev::appendVertices(verticesToAdd,nr);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> elt(MEDCoupling1SGTUMesh::New("",INTERP_KERNEL::NORM_POINT1));
+ MCAuto<MEDCoupling1SGTUMesh> elt(MEDCoupling1SGTUMesh::New("",INTERP_KERNEL::NORM_POINT1));
elt->allocateCells(nbOfCells);
for(int i=0;i<nbOfCells;i++)
{
if(_parts.empty())
throw INTERP_KERNEL::Exception("MEDUMeshMultiLev::appendVertices : parts are empty !");
elt->setCoords(_parts[0]->getCoords());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> elt2((MEDCoupling1SGTUMesh *)elt); elt2->incrRef();
+ MCAuto<MEDCoupling1GTUMesh> elt2((MEDCoupling1SGTUMesh *)elt); elt2->incrRef();
_parts.push_back(elt2);
}
const DataArrayInt *pfl(0),*nr(_node_reduction);
if(!_pfls.empty())
pfl=_pfls[0];
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> facesIfPresent2(facesIfPresent); facesIfPresent->incrRef();
+ MCAuto<MEDCoupling1GTUMesh> facesIfPresent2(facesIfPresent); facesIfPresent->incrRef();
moveFaceToCell();
- MEDCouplingAutoRefCountObjectPtr<MEDUMeshMultiLev> ret2(new MEDUMeshMultiLev(*this,facesIfPresent2));
+ MCAuto<MEDUMeshMultiLev> ret2(new MEDUMeshMultiLev(*this,facesIfPresent2));
if(pfl)
ret2->setCellReduction(pfl);
if(nr)
if(!pflNodes || !pflNodes->isAllocated())
return ;
std::vector<int> ngs(getNodeGridStructure());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(MEDCouplingStructuredMesh::Build1GTNodalConnectivity(&ngs[0],&ngs[0]+ngs.size()));
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> m(MEDCoupling1SGTUMesh::New("",MEDCouplingStructuredMesh::GetGeoTypeGivenMeshDimension(ngs.size())));
+ MCAuto<DataArrayInt> conn(MEDCouplingStructuredMesh::Build1GTNodalConnectivity(&ngs[0],&ngs[0]+ngs.size()));
+ MCAuto<MEDCoupling1SGTUMesh> m(MEDCoupling1SGTUMesh::New("",MEDCouplingStructuredMesh::GetGeoTypeGivenMeshDimension(ngs.size())));
m->setNodalConnectivity(conn);
const DataArrayInt *pfl(_pfls[0]);
if(pfl)
}
DataArrayInt *cellIds=0;
m->fillCellIdsToKeepFromNodeIds(pflNodes->begin(),pflNodes->end(),true,cellIds);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsSafe(cellIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> m2(m->buildPartOfMySelfKeepCoords(cellIds->begin(),cellIds->end()));
+ MCAuto<DataArrayInt> cellIdsSafe(cellIds);
+ MCAuto<MEDCouplingPointSet> m2(m->buildPartOfMySelfKeepCoords(cellIds->begin(),cellIds->end()));
int tmp=-1;
_node_reduction=m2->getNodeIdsInUse(tmp);
if(pfl)
const DataArrayInt *pfl(0),*nr(_node_reduction);
if(!_pfls.empty())
pfl=_pfls[0];
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nnr;
+ MCAuto<DataArrayInt> nnr;
std::vector<int> cgs,ngs(getNodeGridStructure());
cgs.resize(ngs.size());
std::transform(ngs.begin(),ngs.end(),cgs.begin(),std::bind2nd(std::plus<int>(),-1));
if(pfl)
{
std::vector< std::pair<int,int> > cellParts;
- MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> ret2;
+ MCAuto<MEDMeshMultiLev> ret2;
if(MEDCouplingStructuredMesh::IsPartStructured(pfl->begin(),pfl->end(),cgs,cellParts))
{
- MEDCouplingAutoRefCountObjectPtr<MEDCMeshMultiLev> ret(new MEDCMeshMultiLev(*this));
+ MCAuto<MEDCMeshMultiLev> ret(new MEDCMeshMultiLev(*this));
ret->_is_internal=false;
if(nr)
- { nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
+ { nnr=nr->deepCopy(); nnr->sort(true); ret->setNodeReduction(nnr); }
ret->_nb_entities[0]=pfl->getNumberOfTuples();
ret->_pfls[0]=0;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > coords(_coords.size());
+ std::vector< MCAuto<DataArrayDouble> > coords(_coords.size());
for(std::size_t i=0;i<_coords.size();i++)
- coords[i]=_coords[i]->selectByTupleId2(cellParts[i].first,cellParts[i].second+1,1);
+ coords[i]=_coords[i]->selectByTupleIdSafeSlice(cellParts[i].first,cellParts[i].second+1,1);
ret->_coords=coords;
ret2=(MEDCMeshMultiLev *)ret; ret2->incrRef();
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> m(MEDCouplingCMesh::New());
+ MCAuto<MEDCouplingCMesh> m(MEDCouplingCMesh::New());
for(std::size_t i=0;i<ngs.size();i++)
m->setCoordsAt(i,_coords[i]);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> m2(m->build1SGTUnstructured());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> m3=dynamic_cast<MEDCoupling1GTUMesh *>(m2->buildPartOfMySelfKeepCoords(pfl->begin(),pfl->end()));
- MEDCouplingAutoRefCountObjectPtr<MEDUMeshMultiLev> ret(new MEDUMeshMultiLev(*this,m3));
+ MCAuto<MEDCoupling1SGTUMesh> m2(m->build1SGTUnstructured());
+ MCAuto<MEDCoupling1GTUMesh> m3=dynamic_cast<MEDCoupling1GTUMesh *>(m2->buildPartOfMySelfKeepCoords(pfl->begin(),pfl->end()));
+ MCAuto<MEDUMeshMultiLev> ret(new MEDUMeshMultiLev(*this,m3));
if(nr)
- { m3->zipCoords(); nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
+ { m3->zipCoords(); nnr=nr->deepCopy(); nnr->sort(true); ret->setNodeReduction(nnr); }
ret2=(MEDUMeshMultiLev *)ret; ret2->incrRef();
}
const DataArrayInt *famIds(_cell_fam_ids),*numIds(_cell_num_ids);
if(famIds)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(famIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+ MCAuto<DataArrayInt> tmp(famIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
ret2->setFamilyIdsOnCells(tmp);
}
if(numIds)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(numIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+ MCAuto<DataArrayInt> tmp(numIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
ret2->setNumberIdsOnCells(tmp);
}
return ret2.retn();
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDCMeshMultiLev> ret(new MEDCMeshMultiLev(*this));
+ MCAuto<MEDCMeshMultiLev> ret(new MEDCMeshMultiLev(*this));
if(nr)
- { nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
+ { nnr=nr->deepCopy(); nnr->sort(true); ret->setNodeReduction(nnr); }
return ret.retn();
}
}
const DataArrayInt *pfl(0),*nr(_node_reduction);
if(!_pfls.empty())
pfl=_pfls[0];
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nnr;
+ MCAuto<DataArrayInt> nnr;
std::vector<int> cgs,ngs(getNodeGridStructure());
cgs.resize(ngs.size());
std::transform(ngs.begin(),ngs.end(),cgs.begin(),std::bind2nd(std::plus<int>(),-1));
if(pfl)
{
std::vector< std::pair<int,int> > cellParts,nodeParts;
- MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> ret2;
+ MCAuto<MEDMeshMultiLev> ret2;
if(MEDCouplingStructuredMesh::IsPartStructured(pfl->begin(),pfl->end(),cgs,cellParts))
{
nodeParts=cellParts;
nodeParts[i].second++;
st[i]=nodeParts[i].second-nodeParts[i].first;
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p(MEDCouplingStructuredMesh::BuildExplicitIdsFrom(ngs,nodeParts));
- MEDCouplingAutoRefCountObjectPtr<MEDCurveLinearMeshMultiLev> ret(new MEDCurveLinearMeshMultiLev(*this));
+ MCAuto<DataArrayInt> p(MEDCouplingStructuredMesh::BuildExplicitIdsFrom(ngs,nodeParts));
+ MCAuto<MEDCurveLinearMeshMultiLev> ret(new MEDCurveLinearMeshMultiLev(*this));
ret->_is_internal=false;
if(nr)
- { nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
+ { nnr=nr->deepCopy(); nnr->sort(true); ret->setNodeReduction(nnr); }
ret->_nb_entities[0]=pfl->getNumberOfTuples();
ret->_pfls[0]=0;
ret->_coords=_coords->selectByTupleIdSafe(p->begin(),p->end());
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> m(MEDCouplingCurveLinearMesh::New());
+ MCAuto<MEDCouplingCurveLinearMesh> m(MEDCouplingCurveLinearMesh::New());
m->setCoords(_coords); m->setNodeGridStructure(&_structure[0],&_structure[0]+_structure.size());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> m2(m->build1SGTUnstructured());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> m3=dynamic_cast<MEDCoupling1GTUMesh *>(m2->buildPartOfMySelfKeepCoords(pfl->begin(),pfl->end()));
- MEDCouplingAutoRefCountObjectPtr<MEDUMeshMultiLev> ret(new MEDUMeshMultiLev(*this,m3));
+ MCAuto<MEDCoupling1SGTUMesh> m2(m->build1SGTUnstructured());
+ MCAuto<MEDCoupling1GTUMesh> m3=dynamic_cast<MEDCoupling1GTUMesh *>(m2->buildPartOfMySelfKeepCoords(pfl->begin(),pfl->end()));
+ MCAuto<MEDUMeshMultiLev> ret(new MEDUMeshMultiLev(*this,m3));
if(nr)
- { m3->zipCoords(); nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
+ { m3->zipCoords(); nnr=nr->deepCopy(); nnr->sort(true); ret->setNodeReduction(nnr); }
ret2=(MEDUMeshMultiLev *)ret; ret2->incrRef();
}
const DataArrayInt *famIds(_cell_fam_ids),*numIds(_cell_num_ids);
if(famIds)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(famIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+ MCAuto<DataArrayInt> tmp(famIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
ret2->setFamilyIdsOnCells(tmp);
}
if(numIds)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(numIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+ MCAuto<DataArrayInt> tmp(numIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
ret2->setNumberIdsOnCells(tmp);
}
return ret2.retn();
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDCurveLinearMeshMultiLev> ret(new MEDCurveLinearMeshMultiLev(*this));
+ MCAuto<MEDCurveLinearMeshMultiLev> ret(new MEDCurveLinearMeshMultiLev(*this));
if(nr)
- { nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
+ { nnr=nr->deepCopy(); nnr->sort(true); ret->setNodeReduction(nnr); }
return ret.retn();
}
}
throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem2::BuildAggregationOf : invalid situation ! Several same geo type chunk must all lie on profiles !");
arrs[i]=globs->getProfile(obj->_pfl->getName().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(DataArrayInt::Aggregate(arrs));
+ MCAuto<DataArrayInt> arr(DataArrayInt::Aggregate(arrs));
arr->sort();
int oldNbTuples(arr->getNumberOfTuples());
arr=arr->buildUnique();
if(oldNbTuples!=arr->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem2::BuildAggregationOf : some entities are present several times !");
- if(arr->isIdentity2(nbEntityRef))
+ if(arr->isIota(nbEntityRef))
{
std::pair<int,int> p(0,nbEntityRef);
std::string a,b;
else
{
const DataArrayInt *pfl=globs->getProfile(otherNodeIt.getPflName().c_str());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cpyPfl(pfl->deepCpy());
+ MCAuto<DataArrayInt> cpyPfl(pfl->deepCopy());
cpyPfl->sort();
- if(cpyPfl->isIdentity2(nbOfNodes))
+ if(cpyPfl->isIota(nbOfNodes))
{//on all nodes also !
if(!ret0)
return false;
int pos0(-1),pos1(-1);
if(presenceOfCellDiscr(pos0))
{
- MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> ret(_already_checked[pos0].buildFromScratchDataSetSupportOnCells(mst,globs));
+ MCAuto<MEDMeshMultiLev> ret(_already_checked[pos0].buildFromScratchDataSetSupportOnCells(mst,globs));
if(presenceOfPartialNodeDiscr(pos1))
ret->setNodeReduction(_already_checked[pos1][0].getPfl(globs));
return ret.retn();
_f1ts_cmps.resize(nbPts);
for(int i=0;i<nbPts;i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> elt=ref->getTimeStepAtPos(i);
+ MCAuto<MEDFileAnyTypeField1TS> elt=ref->getTimeStepAtPos(i);
try
{
_f1ts_cmps[i]=MEDFileField1TSStruct::New(elt,_mesh_comp);
std::size_t MEDFileFastCellSupportComparator::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret(_f1ts_cmps.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct>));
+ std::size_t ret(_f1ts_cmps.capacity()*sizeof(MCAuto<MEDFileField1TSStruct>));
return ret;
}
const MEDFileMeshStruct *mst(_mesh_comp);
if(mst)
ret.push_back(mst);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct> >::const_iterator it=_f1ts_cmps.begin();it!=_f1ts_cmps.end();it++)
+ for(std::vector< MCAuto<MEDFileField1TSStruct> >::const_iterator it=_f1ts_cmps.begin();it!=_f1ts_cmps.end();it++)
ret.push_back((const MEDFileField1TSStruct *)*it);
return ret;
}
}
for(int i=0;i<nbPts;i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> elt=other->getTimeStepAtPos(i);
+ MCAuto<MEDFileAnyTypeField1TS> elt=other->getTimeStepAtPos(i);
if(!_f1ts_cmps[i]->isEqualConsideringThePast(elt,_mesh_comp))
if(!_f1ts_cmps[i]->isSupportSameAs(elt,_mesh_comp))
return false;
}
for(int i=0;i<nbPts;i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> elt=other->getTimeStepAtPos(i);
+ MCAuto<MEDFileAnyTypeField1TS> elt=other->getTimeStepAtPos(i);
if(!_f1ts_cmps[i]->isCompatibleWithNodesDiscr(elt,_mesh_comp))
return false;
}
#include "MEDLoaderDefines.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingRefCountObject.hxx"
#include "MEDCoupling1GTUMesh.hxx"
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayInt;
class MEDCouplingMesh;
MEDMeshMultiLev(const MEDFileMesh *mesh, int nbNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
protected:
const MEDFileMesh *_mesh;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _pfls;
+ std::vector< MCAuto<DataArrayInt> > _pfls;
std::vector< INTERP_KERNEL::NormalizedCellType > _geo_types;
std::vector<int> _nb_entities;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_reduction;
+ MCAuto<DataArrayInt> _node_reduction;
int _nb_nodes;
//
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _cell_fam_ids;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _cell_num_ids;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_fam_ids;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_num_ids;
+ MCAuto<DataArrayInt> _cell_fam_ids;
+ MCAuto<DataArrayInt> _cell_num_ids;
+ MCAuto<DataArrayInt> _node_fam_ids;
+ MCAuto<DataArrayInt> _node_num_ids;
public:
MEDLOADER_EXPORT static const int PARAMEDMEM_2_VTKTYPE_LGTH=34;
MEDLOADER_EXPORT static const unsigned char PARAMEDMEM_2_VTKTYPE[PARAMEDMEM_2_VTKTYPE_LGTH];
static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
void selectPartOfNodes(const DataArrayInt *pflNodes);
MEDMeshMultiLev *prepare() const;
- MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh>& part);
+ MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MCAuto<MEDCoupling1GTUMesh>& part);
MEDLOADER_EXPORT bool buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *&types, DataArrayInt *&cellLocations, DataArrayInt *& cells, DataArrayInt *&faceLocations, DataArrayInt *&faces) const;
protected:
void appendVertices(const DataArrayInt *verticesToAdd, DataArrayInt *nr);
private:
- void reorderNodesIfNecessary(MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& coords, DataArrayInt *nodalConnVTK, DataArrayInt *polyhedNodalConnVTK) const;
+ void reorderNodesIfNecessary(MCAuto<DataArrayDouble>& coords, DataArrayInt *nodalConnVTK, DataArrayInt *polyhedNodalConnVTK) const;
private:
MEDUMeshMultiLev(const MEDUMeshMultiLev& other);
MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<int>& levs);
MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> > _parts;
+ std::vector< MCAuto<MEDCoupling1GTUMesh> > _parts;
//! this attribute is used only for mesh with no cells but having coordinates. For classical umeshes those pointer is equal to pointer of coordinates of instances in this->_parts.
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
+ MCAuto<DataArrayDouble> _coords;
};
class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
void initStdFieldOfIntegers(const MEDFileStructuredMesh *m);
protected:
bool _is_internal;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _face_fam_ids;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _face_num_ids;
+ MCAuto<DataArrayInt> _face_fam_ids;
+ MCAuto<DataArrayInt> _face_num_ids;
};
class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<int>& levs);
MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > _coords;
+ std::vector< MCAuto<DataArrayDouble> > _coords;
};
class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<int>& levs);
MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
private:
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
+ MCAuto<DataArrayDouble> _coords;
std::vector<int> _structure;
};
private:
INTERP_KERNEL::NormalizedCellType _geo_type;
std::pair<int,int> _start_end;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _pfl;
+ MCAuto<DataArrayInt> _pfl;
std::string _loc;
int _nb_of_entity;
};
private:
MEDFileFastCellSupportComparator(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
private:
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshStruct> _mesh_comp;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct> > _f1ts_cmps;
+ MCAuto<MEDFileMeshStruct> _mesh_comp;
+ std::vector< MCAuto<MEDFileField1TSStruct> > _f1ts_cmps;
};
}
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
extern med_geometry_type typmai3[34];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
std::size_t MEDFileJointCorrespondence::getHeapMemorySizeWithoutChildren() const
{
- return sizeof(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>);
+ return sizeof(MCAuto<DataArrayInt>);
}
std::vector<const BigMemoryObject *> MEDFileJointCorrespondence::getDirectChildrenWithNull() const
return true;
}
-MEDFileJointCorrespondence *MEDFileJointCorrespondence::deepCpy() const
+MEDFileJointCorrespondence *MEDFileJointCorrespondence::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileJointCorrespondence> ret=new MEDFileJointCorrespondence(*this);
+ MCAuto<MEDFileJointCorrespondence> ret=new MEDFileJointCorrespondence(*this);
return ret.retn();
}
MEDFileJointCorrespondence *MEDFileJointCorrespondence::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileJointCorrespondence> ret=new MEDFileJointCorrespondence(*this);
+ MCAuto<MEDFileJointCorrespondence> ret=new MEDFileJointCorrespondence(*this);
return ret.retn();
}
std::size_t MEDFileJointOneStep::getHeapMemorySizeWithoutChildren() const
{
- return _correspondences.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>);
+ return _correspondences.capacity()*sizeof(MCAuto<DataArrayInt>);
}
std::vector<const BigMemoryObject *> MEDFileJointOneStep::getDirectChildrenWithNull() const
&loc_ent_type, &loc_geo_type, &rem_ent_type, &rem_geo_type, &num_entity));
if ( num_entity > 0 )
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> correspondence=DataArrayInt::New();
+ MCAuto<DataArrayInt> correspondence=DataArrayInt::New();
correspondence->alloc(num_entity*2, 1);
MEDFILESAFECALLERRD0(MEDsubdomainCorrespondenceRd,(fid, mName.c_str(), jointName.c_str(), order, iteration, loc_ent_type,
loc_geo_type, rem_ent_type, rem_geo_type, correspondence->getPointer()));
void MEDFileJointOneStep::writeLL(med_idt fid, const std::string& localMeshName, const std::string& jointName) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointCorrespondence> >::const_iterator it=_correspondences.begin();it!=_correspondences.end();it++)
+ for(std::vector< MCAuto<MEDFileJointCorrespondence> >::const_iterator it=_correspondences.begin();it!=_correspondences.end();it++)
{
(*it)->writeLL(fid, localMeshName, jointName, getOrder(), getIteration());
}
return true;
}
-MEDFileJointOneStep *MEDFileJointOneStep::deepCpy() const
+MEDFileJointOneStep *MEDFileJointOneStep::deepCopy() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointCorrespondence> > correspondences(_correspondences.size());
+ std::vector< MCAuto<MEDFileJointCorrespondence> > correspondences(_correspondences.size());
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointCorrespondence> >::const_iterator it=_correspondences.begin();it!=_correspondences.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileJointCorrespondence> >::const_iterator it=_correspondences.begin();it!=_correspondences.end();it++,i++)
if((const MEDFileJointCorrespondence *)*it)
- correspondences[i]=(*it)->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep> ret= new MEDFileJointOneStep;
+ correspondences[i]=(*it)->deepCopy();
+ MCAuto<MEDFileJointOneStep> ret= new MEDFileJointOneStep;
ret->_correspondences=correspondences;
return ret.retn();
}
MEDFileJointOneStep *MEDFileJointOneStep::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep> ret=new MEDFileJointOneStep(*this);
+ MCAuto<MEDFileJointOneStep> ret=new MEDFileJointOneStep(*this);
return ret.retn();
}
std::ostringstream oss;
oss << "(*************************************)\n(* JOINT_ONE_STEP INFORMATION: *)\n(*************************************)\n";
oss << "- Number of the correspondences : <<" << _correspondences.size() << ">>\n";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointCorrespondence> >::const_iterator it=_correspondences.begin();it!=_correspondences.end();it++)
+ for(std::vector< MCAuto<MEDFileJointCorrespondence> >::const_iterator it=_correspondences.begin();it!=_correspondences.end();it++)
{
oss << (*it)->simpleRepr();
}
}
std::size_t MEDFileJoint::getHeapMemorySizeWithoutChildren() const
{
- return _joint.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep>);
+ return _joint.capacity()*sizeof(MCAuto<MEDFileJointOneStep>);
}
std::vector<const BigMemoryObject *> MEDFileJoint::getDirectChildrenWithNull() const
// if ( _loc_mesh_name.empty() )
// throw INTERP_KERNEL::Exception("MEDFileJoint::write : name of a local mesh not defined!");
MEDFILESAFECALLERWR0(MEDsubdomainJointCr,(fid,getLocalMeshName().c_str(),getJointName().c_str(),getDescription().c_str(),getDomainNumber(),getRemoteMeshName().c_str()));
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep> >::const_iterator it=_joint.begin();it!=_joint.end();it++) {
+ for(std::vector< MCAuto<MEDFileJointOneStep> >::const_iterator it=_joint.begin();it!=_joint.end();it++) {
(*it)->writeLL(fid, getLocalMeshName(),getJointName());
}
}
return true;
}
-MEDFileJoint *MEDFileJoint::deepCpy() const
+MEDFileJoint *MEDFileJoint::deepCopy() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep> > joint(_joint.size());
+ std::vector< MCAuto<MEDFileJointOneStep> > joint(_joint.size());
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep> >::const_iterator it=_joint.begin();it!=_joint.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileJointOneStep> >::const_iterator it=_joint.begin();it!=_joint.end();it++,i++)
if((const MEDFileJointOneStep *)*it)
- joint[i]=(*it)->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> ret=MEDFileJoint::New();
+ joint[i]=(*it)->deepCopy();
+ MCAuto<MEDFileJoint> ret=MEDFileJoint::New();
ret->_joint=joint;
return ret.retn();
}
MEDFileJoint *MEDFileJoint::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> ret=new MEDFileJoint(*this);
+ MCAuto<MEDFileJoint> ret=new MEDFileJoint(*this);
return ret.retn();
}
oss << "- Description : <<" << getDescription() << ">>\n";
oss << "- Joint name : <<" << getJointName() << ">>\n";
oss << "- Domain number : " << getDomainNumber() << "\n";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep> >::const_iterator it=_joint.begin();it!=_joint.end();it++)
+ for(std::vector< MCAuto<MEDFileJointOneStep> >::const_iterator it=_joint.begin();it!=_joint.end();it++)
{
oss << (*it)->simpleRepr();
}
void MEDFileJoints::write(med_idt fid) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++)
+ for(std::vector< MCAuto<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++)
{
(*it)->write(fid);
}
{
std::vector<std::string> ret(_joints.size());
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++,i++)
{
const MEDFileJoint *f=(*it);
if(f)
bool MEDFileJoints::changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> >::iterator it=_joints.begin();it!=_joints.end();it++)
+ for(std::vector< MCAuto<MEDFileJoint> >::iterator it=_joints.begin();it!=_joints.end();it++)
{
MEDFileJoint *cur(*it);
if(cur)
_joints.push_back(MEDFileJoint::New(fid,meshName,i));
}
-MEDFileJoints *MEDFileJoints::deepCpy() const
+MEDFileJoints *MEDFileJoints::deepCopy() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> > joints(_joints.size());
+ std::vector< MCAuto<MEDFileJoint> > joints(_joints.size());
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++,i++)
if((const MEDFileJoint *)*it)
- joints[i]=(*it)->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileJoints> ret=MEDFileJoints::New();
+ joints[i]=(*it)->deepCopy();
+ MCAuto<MEDFileJoints> ret=MEDFileJoints::New();
ret->_joints=joints;
return ret.retn();
}
std::size_t MEDFileJoints::getHeapMemorySizeWithoutChildren() const
{
- return _joints.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileJoint>));
+ return _joints.capacity()*(sizeof(MCAuto<MEDFileJoint>));
}
std::vector<const BigMemoryObject *> MEDFileJoints::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++)
+ for(std::vector< MCAuto<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++)
ret.push_back((const MEDFileJoint *)*it);
return ret;
}
std::vector<std::string> jns=getJointsNames();
for(int i=0;i<nbOfJoints;i++)
oss << " - #" << i << " \"" << jns[i] << "\"\n";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++)
+ for(std::vector< MCAuto<MEDFileJoint> >::const_iterator it=_joints.begin();it!=_joints.end();it++)
{
oss << (*it)->simpleRepr();
}
#include "MEDLoaderDefines.hxx"
#include "MEDFileUtilities.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* \brief Joint Correspondence enumerates pairs of corresponding entities of a
INTERP_KERNEL::NormalizedCellType rem_geo_type);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT MEDFileJointCorrespondence *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileJointCorrespondence *deepCopy() const;
MEDLOADER_EXPORT MEDFileJointCorrespondence *shallowCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileJointCorrespondence *other) const;
MEDLOADER_EXPORT void setIsNodal(bool isNodal) { _is_nodal = isNodal; }
bool _is_nodal;
INTERP_KERNEL::NormalizedCellType _loc_geo_type;
INTERP_KERNEL::NormalizedCellType _rem_geo_type;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _correspondence;
+ MCAuto<DataArrayInt> _correspondence;
};
/*!
MEDLOADER_EXPORT static MEDFileJointOneStep *New(med_idt fid, const std::string& mName, const std::string& jointName, int number=1);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT MEDFileJointOneStep *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileJointOneStep *deepCopy() const;
MEDLOADER_EXPORT MEDFileJointOneStep *shallowCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileJointOneStep *other) const;
MEDLOADER_EXPORT void setOrder(int order) { _order=order; }
int _order;
int _iteration;
private:
- std::vector<MEDCouplingAutoRefCountObjectPtr<MEDFileJointCorrespondence> > _correspondences;
+ std::vector<MCAuto<MEDFileJointCorrespondence> > _correspondences;
};
/*!
MEDLOADER_EXPORT static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum );
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT MEDFileJoint *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileJoint *deepCopy() const;
MEDLOADER_EXPORT MEDFileJoint *shallowCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileJoint *other) const;
MEDLOADER_EXPORT void setLocalMeshName(const std::string& name) { _loc_mesh_name=name; }
std::string _desc_name;
int _domain_number;
std::string _rem_mesh_name;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJointOneStep> > _joint;
+ std::vector< MCAuto<MEDFileJointOneStep> > _joint;
};
/*!
MEDLOADER_EXPORT static MEDFileJoints *New();
MEDLOADER_EXPORT static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
MEDLOADER_EXPORT static MEDFileJoints *New(med_idt fid, const std::string& meshName);
- MEDLOADER_EXPORT MEDFileJoints *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileJoints *deepCopy() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT std::string simpleRepr() const;
MEDFileJoints();
MEDFileJoints(med_idt fid, const std::string& meshName);
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileJoint> > _joints;
+ std::vector< MCAuto<MEDFileJoint> > _joints;
};
}
extern med_geometry_type typmai3[34];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const char MEDFileMesh::DFT_FAM_NAME[]="FAMILLE_ZERO";
*/
MEDFileMesh *MEDFileMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
- std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
+ std::vector<std::string> ms=MEDCoupling::GetMeshNames(fileName);
if(ms.empty())
{
std::ostringstream oss; oss << "MEDFileMesh::New : no meshes in file \"" << fileName << "\" !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
MEDFileUtilities::CheckFileForRead(fileName);
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> ret;
+ MCAuto<MEDFileMesh> ret;
switch(meshType)
{
case UNSTRUCTURED:
MEDFileMesh *MEDFileMesh::New(const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs, MEDFileJoints* joints)
{
MEDFileUtilities::CheckFileForRead(fileName);
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,dummy3,dummy0,dummy1,dummy2);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> ret;
+ MCAuto<MEDFileMesh> ret;
switch(meshType)
{
case UNSTRUCTURED:
*/
std::vector<std::string> MEDFileMesh::removeOrphanFamilies()
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> allFamIdsInUse=computeAllFamilyIdsInUse();
+ MCAuto<DataArrayInt> allFamIdsInUse=computeAllFamilyIdsInUse();
std::vector<std::string> ret;
if(!((DataArrayInt*)allFamIdsInUse))
{
std::vector<bool> v(fams->getNumberOfTuples(),false);
for(std::set<int>::const_iterator pt=idsRefed.begin();pt!=idsRefed.end();pt++)
fams->switchOnTupleEqualTo(*pt,v);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> unfetchedIds(DataArrayInt::BuildListOfSwitchedOff(v));
+ MCAuto<DataArrayInt> unfetchedIds(DataArrayInt::BuildListOfSwitchedOff(v));
if(!unfetchedIds->empty())
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newFams(fams->deepCpy());
+ MCAuto<DataArrayInt> newFams(fams->deepCopy());
newFams->setPartOfValuesSimple3(0,unfetchedIds->begin(),unfetchedIds->end(),0,1,1);
setFamilyFieldArr(*it,newFams);
}
const DataArrayInt *fieldFamIds=getFamilyFieldAtLevel(meshDimRelToMaxExt);
if(fieldFamIds==0)
throw INTERP_KERNEL::Exception("MEDFileMesh::createGroupOnAll : Family field arr ids is not defined for this level !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famIds=fieldFamIds->getDifferentValues();
+ MCAuto<DataArrayInt> famIds=fieldFamIds->getDifferentValues();
std::vector<std::string> familiesOnWholeGroup;
for(const int *it=famIds->begin();it!=famIds->end();it++)
{
const DataArrayInt *fieldFamIds=getFamilyFieldAtLevel(*it);
if(fieldFamIds)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famIds3=fieldFamIds->getDifferentValues();
+ MCAuto<DataArrayInt> famIds3=fieldFamIds->getDifferentValues();
std::vector<int> tmp;
std::set_intersection(famIds3->begin(),famIds3->end(),famIds2.begin(),famIds2.end(),std::back_insert_iterator< std::vector<int> >(tmp));
for(std::vector<int>::const_iterator it2=tmp.begin();it2!=tmp.end();it2++)
if(grpName.empty())
throw INTERP_KERNEL::Exception("MEDFileUMesh::addGroup : empty group name ! MED file format do not accept empty group name !");
ids->checkStrictlyMonotonic(true);
- famArr->incrRef(); MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famArrTmp(famArr);
+ famArr->incrRef(); MCAuto<DataArrayInt> famArrTmp(famArr);
std::vector<std::string> grpsNames=getGroupsNames();
if(std::find(grpsNames.begin(),grpsNames.end(),grpName)!=grpsNames.end())
{
std::ostringstream oss; oss << "MEDFileUMesh::addGroup : Group with name \"" << grpName << "\" already exists ! Destroy it before calling this method !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > allFamIds(getAllNonNullFamilyIds());
+ std::list< MCAuto<DataArrayInt> > allFamIds(getAllNonNullFamilyIds());
allFamIds.erase(std::find(allFamIds.begin(),allFamIds.end(),famArrTmp));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famIds=famArr->selectByTupleIdSafe(ids->begin(),ids->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> diffFamIds=famIds->getDifferentValues();
+ MCAuto<DataArrayInt> famIds=famArr->selectByTupleIdSafe(ids->begin(),ids->end());
+ MCAuto<DataArrayInt> diffFamIds=famIds->getDifferentValues();
std::vector<int> familyIds;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > idsPerfamiliyIds;
+ std::vector< MCAuto<DataArrayInt> > idsPerfamiliyIds;
int maxVal=getTheMaxAbsFamilyId()+1;
std::map<std::string,int> families(_families);
std::map<std::string, std::vector<std::string> > groups(_groups);
bool created(false);
for(const int *famId=diffFamIds->begin();famId!=diffFamIds->end();famId++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids2Tmp=famIds->getIdsEqual(*famId);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids2=ids->selectByTupleId(ids2Tmp->begin(),ids2Tmp->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids1=famArr->getIdsEqual(*famId);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret0(ids1->buildSubstractionOptimized(ids2));
+ MCAuto<DataArrayInt> ids2Tmp=famIds->findIdsEqual(*famId);
+ MCAuto<DataArrayInt> ids2=ids->selectByTupleId(ids2Tmp->begin(),ids2Tmp->end());
+ MCAuto<DataArrayInt> ids1=famArr->findIdsEqual(*famId);
+ MCAuto<DataArrayInt> ret0(ids1->buildSubstractionOptimized(ids2));
if(ret0->empty())
{
bool isFamPresent=false;
- for(std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator itl=allFamIds.begin();itl!=allFamIds.end() && !isFamPresent;itl++)
+ for(std::list< MCAuto<DataArrayInt> >::const_iterator itl=allFamIds.begin();itl!=allFamIds.end() && !isFamPresent;itl++)
isFamPresent=(*itl)->presenceOfValue(*famId);
if(!isFamPresent)
{ familyIds.push_back(*famId); idsPerfamiliyIds.push_back(ret0); fams.push_back(FindOrCreateAndGiveFamilyWithId(families,*famId,created)); } // adding *famId in grp
*/
DataArrayInt *MEDFileMesh::getAllFamiliesIdsReferenced() const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
+ MCAuto<DataArrayInt> ret=DataArrayInt::New();
std::set<int> v;
for(std::map<std::string,int>::const_iterator it=_families.begin();it!=_families.end();it++)
v.insert((*it).second);
DataArrayInt *MEDFileMesh::computeAllFamilyIdsInUse() const
{
std::vector<int> famLevs=getFamArrNonEmptyLevelsExt();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret;
+ MCAuto<DataArrayInt> ret;
for(std::vector<int>::const_iterator it=famLevs.begin();it!=famLevs.end();it++)
{
const DataArrayInt *arr=getFamilyFieldAtLevel(*it);//arr not null due to spec of getFamArrNonEmptyLevelsExt
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> dv=arr->getDifferentValues();
+ MCAuto<DataArrayInt> dv=arr->getDifferentValues();
if((DataArrayInt *) ret)
ret=dv->buildUnion(ret);
else
const DataArrayInt *fam=getFamilyFieldAtLevel(*it);
if(fam)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=fam->getDifferentValues();
+ MCAuto<DataArrayInt> tmp=fam->getDifferentValues();
std::set<int> r2;
std::set_intersection(tmp->begin(),tmp->end(),allFamIds.begin(),allFamIds.end(),std::inserter(r2,r2.end()));
if(!r2.empty())
}
if(famIdsToRenum.empty())
return true;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> allIds=getAllFamiliesIdsReferenced();
+ MCAuto<DataArrayInt> allIds=getAllFamiliesIdsReferenced();
for(std::map<int,std::vector<int> >::const_iterator it2=famIdsToRenum.begin();it2!=famIdsToRenum.end();it2++)
{
DataArrayInt *fam=const_cast<DataArrayInt *>(getFamilyFieldAtLevel((*it2).first));
addFamilyOnGrp((*it4),newFam);
}
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=fam->getIdsEqualList(&(*it2).second[0],&(*it2).second[0]+(*it2).second.size());
+ MCAuto<DataArrayInt> ids=fam->findIdsEqualList(&(*it2).second[0],&(*it2).second[0]+(*it2).second.size());
for(const int *id=ids->begin();id!=ids->end();id++)
famIdsToChange[*id]=ren[famIdsToChange[*id]];
}
void MEDFileMesh::normalizeFamIdsTrio()
{
ensureDifferentFamIdsPerLevel();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> allIds=getAllFamiliesIdsReferenced();
+ MCAuto<DataArrayInt> allIds=getAllFamiliesIdsReferenced();
std::vector<int> levs=getNonEmptyLevelsExt();
std::set<int> levsS(levs.begin(),levs.end());
std::set<std::string> famsFetched;
if(fam)
{
int refId=1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=fam->getDifferentValues();
+ MCAuto<DataArrayInt> tmp=fam->getDifferentValues();
std::map<int,int> ren;
for(const int *it=tmp->begin();it!=tmp->end();it++,refId++)
ren[*it]=refId;
if(fam)
{
int refId=-1;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=fam->getDifferentValues();
+ MCAuto<DataArrayInt> tmp=fam->getDifferentValues();
std::map<int,int> ren;
for(const int *it=tmp->begin();it!=tmp->end();it++,refId--)
ren[*it]=refId;
DataArrayInt *fam=const_cast<DataArrayInt*>(getFamilyFieldAtLevel(*it2));
if(fam)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=fam->getDifferentValues();
+ MCAuto<DataArrayInt> tmp=fam->getDifferentValues();
fam->fillWithZero();
for(const int *it3=tmp->begin();it3!=tmp->end();it3++)
if(allIds->presenceOfValue(*it3))
void MEDFileMesh::normalizeFamIdsMEDFile()
{
ensureDifferentFamIdsPerLevel();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> allIds=getAllFamiliesIdsReferenced();
+ MCAuto<DataArrayInt> allIds=getAllFamiliesIdsReferenced();
std::vector<int> levs=getNonEmptyLevelsExt();
std::set<int> levsS(levs.begin(),levs.end());
std::set<std::string> famsFetched;
const DataArrayInt *fam=getFamilyFieldAtLevel(1);
if(fam)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=fam->getDifferentValues();
+ MCAuto<DataArrayInt> tmp=fam->getDifferentValues();
std::map<int,int> ren;
for(const int *it=tmp->begin();it!=tmp->end();it++,refId++)
ren[*it]=refId;
const DataArrayInt *fam=getFamilyFieldAtLevel(*it2);
if(fam)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp=fam->getDifferentValues();
+ MCAuto<DataArrayInt> tmp=fam->getDifferentValues();
std::map<int,int> ren;
for(const int *it=tmp->begin();it!=tmp->end();it++,refId--)
ren[*it]=refId;
DataArrayInt *ret(getFamilyFieldAtLevel(meshDimRelToMaxExt));
if(ret)
return ret;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(DataArrayInt::New());
+ MCAuto<DataArrayInt> arr(DataArrayInt::New());
arr->alloc(getSizeAtLevel(meshDimRelToMaxExt),1);
arr->fillWithZero();
setFamilyFieldArr(meshDimRelToMaxExt,arr);
if(grpsName.find(std::string(""))!=grpsName.end())
throw INTERP_KERNEL::Exception("MEDFileUMesh::setGroupsAtLevel : groups name must be different empty string !");
int sz=getSizeAtLevel(meshDimRelToMaxExt);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fam;
+ MCAuto<DataArrayInt> fam;
std::vector< std::vector<int> > fidsOfGroups;
if(!renum)
{
}
else
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > grps2(grps.size());
+ std::vector< MCAuto<DataArrayInt> > grps2(grps.size());
for(unsigned int ii=0;ii<grps.size();ii++)
{
grps2[ii]=MEDFileUMeshSplitL1::Renumber(getRevNumberFieldAtLevel(meshDimRelToMaxExt),grps[ii]);
if(!_families.empty())
offset=getMaxAbsFamilyId()+1;
TranslateFamilyIds(meshDimRelToMaxExt==1?offset:-offset,fam,fidsOfGroups);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=fam->getDifferentValues();
+ MCAuto<DataArrayInt> ids=fam->getDifferentValues();
appendFamilyEntries(ids,fidsOfGroups,grpsName2);
setFamilyFieldArr(meshDimRelToMaxExt,fam);
}
std::vector<int> MEDFileMesh::getDistributionOfTypes(int meshDimRelToMax) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> mLev(getMeshAtLevel(meshDimRelToMax));
+ MCAuto<MEDCouplingMesh> mLev(getMeshAtLevel(meshDimRelToMax));
return mLev->getDistributionOfTypes();
}
*/
MEDFileUMesh *MEDFileUMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
- std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
+ std::vector<std::string> ms(MEDCoupling::GetMeshNames(fileName));
if(ms.empty())
{
std::ostringstream oss; oss << "MEDFileUMesh::New : no meshes in file \"" << fileName << "\" !";
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
return new MEDFileUMesh(fid,ms.front(),dt,it,mrs);
}
*/
MEDFileUMesh *MEDFileUMesh::LoadPartOf(med_idt fid, const std::string& mName, const std::vector<INTERP_KERNEL::NormalizedCellType>& types, const std::vector<int>& slicPerTyp, int dt, int it, MEDFileMeshReadSelector *mrs)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
+ MCAuto<MEDFileUMesh> ret(MEDFileUMesh::New());
ret->loadPartUMeshFromFile(fid,mName,types,slicPerTyp,dt,it,mrs);
return ret.retn();
}
std::size_t MEDFileUMesh::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(MEDFileMesh::getHeapMemorySizeWithoutChildren());
- ret+=_ms.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1>));
+ ret+=_ms.capacity()*(sizeof(MCAuto<MEDFileUMeshSplitL1>));
return ret;
}
ret.push_back((const DataArrayInt *)_rev_num_coords);
ret.push_back((const DataArrayAsciiChar *)_name_coords);
ret.push_back((const PartDefinition *)_part_coords);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
ret.push_back((const MEDFileUMeshSplitL1*) *it);
return ret;
}
MEDFileMesh *MEDFileUMesh::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(new MEDFileUMesh(*this));
+ MCAuto<MEDFileUMesh> ret(new MEDFileUMesh(*this));
return ret.retn();
}
return new MEDFileUMesh;
}
-MEDFileMesh *MEDFileUMesh::deepCpy() const
+MEDFileMesh *MEDFileUMesh::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(new MEDFileUMesh(*this));
+ MCAuto<MEDFileUMesh> ret(new MEDFileUMesh(*this));
ret->deepCpyEquivalences(*this);
if((const DataArrayDouble*)_coords)
- ret->_coords=_coords->deepCpy();
+ ret->_coords=_coords->deepCopy();
if((const DataArrayInt*)_fam_coords)
- ret->_fam_coords=_fam_coords->deepCpy();
+ ret->_fam_coords=_fam_coords->deepCopy();
if((const DataArrayInt*)_num_coords)
- ret->_num_coords=_num_coords->deepCpy();
+ ret->_num_coords=_num_coords->deepCopy();
if((const DataArrayInt*)_rev_num_coords)
- ret->_rev_num_coords=_rev_num_coords->deepCpy();
+ ret->_rev_num_coords=_rev_num_coords->deepCopy();
if((const DataArrayAsciiChar*)_name_coords)
- ret->_name_coords=_name_coords->deepCpy();
+ ret->_name_coords=_name_coords->deepCopy();
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,i++)
{
if((const MEDFileUMeshSplitL1 *)(*it))
- ret->_ms[i]=(*it)->deepCpy(ret->_coords);
+ ret->_ms[i]=(*it)->deepCopy(ret->_coords);
}
if((const PartDefinition*)_part_coords)
- ret->_part_coords=_part_coords->deepCpy();
+ ret->_part_coords=_part_coords->deepCopy();
return ret.retn();
}
const DataArrayAsciiChar *namc1=_name_coords;
if(namc1)
(const_cast<DataArrayAsciiChar *>(namc1))->setName("");//This parameter is not discriminant for comparison
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
{
const MEDFileUMeshSplitL1 *tmp=(*it);
if(tmp)
void MEDFileUMesh::setName(const std::string& name)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
if((MEDFileUMeshSplitL1 *)(*it)!=0)
(*it)->setName(name);
MEDFileMesh::setName(name);
void MEDFileUMesh::loadPartUMeshFromFile(med_idt fid, const std::string& mName, const std::vector<INTERP_KERNEL::NormalizedCellType>& types, const std::vector<int>& slicPerTyp, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUMeshL2 loaderl2;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
int mid(MEDFileUMeshL2::GetMeshIdFromName(fid,mName,meshType,dummy3,dummy0,dummy1,dummy2));
if(meshType!=UNSTRUCTURED)
{
{
const MEDFileEquivalences *equiv(other._equiv);
if(equiv)
- _equiv=equiv->deepCpy(this);
+ _equiv=equiv->deepCopy(this);
}
bool MEDFileMesh::areEquivalencesEqual(const MEDFileMesh *other, std::string& what) const
void MEDFileMesh::checkCartesian() const
{
- if(getAxType()!=AX_CART)
+ if(getAxisType()!=AX_CART)
{
- std::ostringstream oss; oss << "MEDFileMesh::checkCartesian : request for method that is dedicated to a cartesian convention ! But you are not in cartesian convention (" << DataArray::GetAxTypeRepr(getAxType()) << ").";
+ std::ostringstream oss; oss << "MEDFileMesh::checkCartesian : request for method that is dedicated to a cartesian convention ! But you are not in cartesian convention (" << DataArray::GetAxisTypeRepr(getAxisType()) << ").";
oss << std::endl << "To perform operation you have two possiblities :" << std::endl;
- oss << " - call setAxType(AX_CART)" << std::endl;
+ oss << " - call setAxisType(AX_CART)" << std::endl;
oss << " - call cartesianize()";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
void MEDFileUMesh::loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUMeshL2 loaderl2;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType axType;
+ MEDCoupling::MEDCouplingAxisType axType;
int mid(MEDFileUMeshL2::GetMeshIdFromName(fid,mName,meshType,axType,dummy0,dummy1,dummy2));
- setAxType(axType);
+ setAxisType(axType);
if(meshType!=UNSTRUCTURED)
{
std::ostringstream oss; oss << "Trying to load as unstructured an existing mesh with name '" << mName << "' !";
MEDLoaderBase::safeStrCpy2(c.c_str(),MED_SNAME_SIZE-1,comp+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
- MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,mdim,MED_UNSTRUCTURED_MESH,desc,"",MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxType()),comp,unit));
+ MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,mdim,MED_UNSTRUCTURED_MESH,desc,"",MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxisType()),comp,unit));
if(_univ_wr_status)
MEDFILESAFECALLERWR0(MEDmeshUniversalNameWr,(fid,maa));
std::string meshName(MEDLoaderBase::buildStringFromFortran(maa,MED_NAME_SIZE));
MEDFileUMeshL2::WriteCoords(fid,meshName,_iteration,_order,_time,_coords,_fam_coords,_num_coords,_name_coords);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
if((const MEDFileUMeshSplitL1 *)(*it)!=0)
(*it)->write(fid,meshName,mdim);
MEDFileUMeshL2::WriteFamiliesAndGrps(fid,meshName,_families,_groups,_too_long_str);
{
std::vector<int> ret;
int lev=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
if((const MEDFileUMeshSplitL1 *)(*it)!=0)
if(!(*it)->empty())
ret.push_back(lev);
if(famCoo)
ret.push_back(1);
int lev=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
{
const MEDFileUMeshSplitL1 *cur(*it);
if(cur)
if(numCoo)
ret.push_back(1);
int lev=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
{
const MEDFileUMeshSplitL1 *cur(*it);
if(cur)
if(nameCoo)
ret.push_back(1);
int lev=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev--)
{
const MEDFileUMeshSplitL1 *cur(*it);
if(cur)
int val=_fam_coords->getMaxValue(tmp);
ret=std::max(ret,std::abs(val));
}
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
{
if((const MEDFileUMeshSplitL1 *)(*it))
{
int val=_fam_coords->getMaxValue(tmp);
ret=std::max(ret,val);
}
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
{
if((const MEDFileUMeshSplitL1 *)(*it))
{
int val=_fam_coords->getMinValue(tmp);
ret=std::min(ret,val);
}
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
{
if((const MEDFileUMeshSplitL1 *)(*it))
{
int MEDFileUMesh::getMeshDimension() const
{
int lev=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,lev++)
if((const MEDFileUMeshSplitL1 *)(*it)!=0)
return (*it)->getMeshDimension()+lev;
throw INTERP_KERNEL::Exception("MEDFileUMesh::getMeshDimension : impossible to find a mesh dimension !");
else
{
const DataArrayInt *arr(globs->getProfile(st[i].getPflName()));
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> m2(dynamic_cast<MEDCoupling1GTUMesh *>(m->buildPartOfMySelf(arr->begin(),arr->end(),true)));
+ MCAuto<MEDCoupling1GTUMesh> m2(dynamic_cast<MEDCoupling1GTUMesh *>(m->buildPartOfMySelf(arr->begin(),arr->end(),true)));
m2->computeNodeIdsAlg(nodesFetched);
}
}
MEDFileMesh *MEDFileUMesh::cartesianize() const
{
- if(getAxType()==AX_CART)
+ if(getAxisType()==AX_CART)
{
incrRef();
return const_cast<MEDFileUMesh *>(this);
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(new MEDFileUMesh(*this));
+ MCAuto<MEDFileUMesh> ret(new MEDFileUMesh(*this));
const DataArrayDouble *coords(_coords);
if(!coords)
throw INTERP_KERNEL::Exception("MEDFileUMesh::cartesianize : coordinates are null !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsCart(_coords->cartesianize(getAxType()));
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::iterator it=ret->_ms.begin();it!=ret->_ms.end();it++)
+ MCAuto<DataArrayDouble> coordsCart(_coords->cartesianize(getAxisType()));
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::iterator it=ret->_ms.begin();it!=ret->_ms.end();it++)
if((const MEDFileUMeshSplitL1 *)(*it))
*it=(*it)->shallowCpyUsingCoords(coordsCart);
ret->_coords=coordsCart;
- ret->setAxType(AX_CART);
+ ret->setAxisType(AX_CART);
return ret.retn();
}
}
DataArrayDouble *MEDFileUMesh::getCoords() const
{
checkCartesian();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp(_coords);
+ MCAuto<DataArrayDouble> tmp(_coords);
if((DataArrayDouble *)tmp)
{
return tmp;
checkCartesian();
synchronizeTinyInfoOnLeaves();
std::vector<std::string> fams2=getFamiliesOnGroups(grps);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> zeRet=getFamilies(meshDimRelToMaxExt,fams2,renum);
+ MCAuto<MEDCouplingUMesh> zeRet=getFamilies(meshDimRelToMaxExt,fams2,renum);
if(grps.size()==1 && ((MEDCouplingUMesh *)zeRet))
zeRet->setName(grps[0]);
return zeRet.retn();
synchronizeTinyInfoOnLeaves();
if(meshDimRelToMaxExt==1)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr=getFamiliesArr(1,fams,renum);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> c=_coords->selectByTupleId(arr->getConstPointer(),arr->getConstPointer()+arr->getNbOfElems());
+ MCAuto<DataArrayInt> arr=getFamiliesArr(1,fams,renum);
+ MCAuto<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
+ MCAuto<DataArrayDouble> c=_coords->selectByTupleId(arr->getConstPointer(),arr->getConstPointer()+arr->getNbOfElems());
ret->setCoords(c);
return ret.retn();
}
std::vector<int> famIds=getFamiliesIds(fams);
const MEDFileUMeshSplitL1 *l1=getMeshAtLevSafe(meshDimRelToMaxExt);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> zeRet;
+ MCAuto<MEDCouplingUMesh> zeRet;
if(!famIds.empty())
zeRet=l1->getFamilyPart(&famIds[0],&famIds[0]+famIds.size(),renum);
else
{
if((const DataArrayInt *)_fam_coords)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da;
+ MCAuto<DataArrayInt> da;
if(!famIds.empty())
- da=_fam_coords->getIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
+ da=_fam_coords->findIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
else
- da=_fam_coords->getIdsEqualList(0,0);
+ da=_fam_coords->findIdsEqualList(0,0);
if(renum)
return MEDFileUMeshSplitL1::Renumber(_num_coords,da);
else
if(!renum)
{
MEDCouplingUMesh *umesh=MEDCouplingUMesh::New();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> cc=_coords->deepCpy();
+ MCAuto<DataArrayDouble> cc=_coords->deepCopy();
umesh->setCoords(cc);
MEDFileUMeshSplitL1::ClearNonDiscrAttributes(umesh);
umesh->setName(getName());
*/
void MEDFileUMesh::forceComputationOfParts() const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
{
const MEDFileUMeshSplitL1 *elt(*it);
if(elt)
if(-meshDimRelToMax>=(int)_ms.size())
throw INTERP_KERNEL::Exception("MEDFileUMesh::checkMeshDimCoherency : The meshdim of mesh is not managed by 'this' !");
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++,i++)
{
if(((const MEDFileUMeshSplitL1*) (*it))!=0)
{
_fam_coords=DataArrayInt::New();
_fam_coords->alloc(nbOfTuples,1);
_fam_coords->fillWithZero();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
if((MEDFileUMeshSplitL1 *)(*it))
(*it)->setCoords(coords);
}
for(std::vector<int>::const_iterator it=levs.begin();it!=levs.end();it++)
{
const DataArrayInt *ffield=getFamilyFieldAtLevel(*it);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids=ffield->getDifferentValues();
+ MCAuto<DataArrayInt> ids=ffield->getDifferentValues();
std::set<int> res;
std::set_union(ids->begin(),ids->end(),allFamsIds.begin(),allFamsIds.end(),std::inserter(res,res.begin()));
allFamsIds=res;
std::vector<int> levs=getNonEmptyLevels();
if(std::find(levs.begin(),levs.end(),0)==levs.end() || std::find(levs.begin(),levs.end(),-1)==levs.end())
throw INTERP_KERNEL::Exception("MEDFileUMesh::buildInnerBoundaryAlongM1Group : This method works only for mesh definied on level 0 and -1 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0=getMeshAtLevel(0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1=getMeshAtLevel(-1);
+ MCAuto<MEDCouplingUMesh> m0=getMeshAtLevel(0);
+ MCAuto<MEDCouplingUMesh> m1=getMeshAtLevel(-1);
int nbNodes=m0->getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m11=getGroup(-1,grpNameM1);
+ MCAuto<MEDCouplingUMesh> m11=getGroup(-1,grpNameM1);
DataArrayInt *tmp00=0,*tmp11=0,*tmp22=0;
m0->findNodesToDuplicate(*m11,tmp00,tmp11,tmp22);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodeIdsToDuplicate(tmp00);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellsToModifyConn0(tmp11);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellsToModifyConn1(tmp22);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp0=static_cast<MEDCouplingUMesh *>(m0->buildPartOfMySelf(cellsToModifyConn0->begin(),cellsToModifyConn0->end(),true));
+ MCAuto<DataArrayInt> nodeIdsToDuplicate(tmp00);
+ MCAuto<DataArrayInt> cellsToModifyConn0(tmp11);
+ MCAuto<DataArrayInt> cellsToModifyConn1(tmp22);
+ MCAuto<MEDCouplingUMesh> tmp0=static_cast<MEDCouplingUMesh *>(m0->buildPartOfMySelf(cellsToModifyConn0->begin(),cellsToModifyConn0->end(),true));
// node renumbering of cells in m1 impacted by duplication of node but not in group 'grpNameM1' on level -1
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descTmp0=DataArrayInt::New(),descITmp0=DataArrayInt::New(),revDescTmp0=DataArrayInt::New(),revDescITmp0=DataArrayInt::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp0Desc=tmp0->buildDescendingConnectivity(descTmp0,descITmp0,revDescTmp0,revDescITmp0);
+ MCAuto<DataArrayInt> descTmp0=DataArrayInt::New(),descITmp0=DataArrayInt::New(),revDescTmp0=DataArrayInt::New(),revDescITmp0=DataArrayInt::New();
+ MCAuto<MEDCouplingUMesh> tmp0Desc=tmp0->buildDescendingConnectivity(descTmp0,descITmp0,revDescTmp0,revDescITmp0);
descTmp0=0; descITmp0=0; revDescTmp0=0; revDescITmp0=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellsInM1ToRenumW2=tmp0Desc->getCellIdsLyingOnNodes(nodeIdsToDuplicate->begin(),nodeIdsToDuplicate->end(),false);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> cellsInM1ToRenumW3=static_cast<MEDCouplingUMesh *>(tmp0Desc->buildPartOfMySelf(cellsInM1ToRenumW2->begin(),cellsInM1ToRenumW2->end(),true));
+ MCAuto<DataArrayInt> cellsInM1ToRenumW2=tmp0Desc->getCellIdsLyingOnNodes(nodeIdsToDuplicate->begin(),nodeIdsToDuplicate->end(),false);
+ MCAuto<MEDCouplingUMesh> cellsInM1ToRenumW3=static_cast<MEDCouplingUMesh *>(tmp0Desc->buildPartOfMySelf(cellsInM1ToRenumW2->begin(),cellsInM1ToRenumW2->end(),true));
DataArrayInt *cellsInM1ToRenumW4Tmp=0;
m1->areCellsIncludedIn(cellsInM1ToRenumW3,2,cellsInM1ToRenumW4Tmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellsInM1ToRenumW4(cellsInM1ToRenumW4Tmp);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellsInM1ToRenumW5=cellsInM1ToRenumW4->getIdsInRange(0,m1->getNumberOfCells());
+ MCAuto<DataArrayInt> cellsInM1ToRenumW4(cellsInM1ToRenumW4Tmp);
+ MCAuto<DataArrayInt> cellsInM1ToRenumW5=cellsInM1ToRenumW4->findIdsInRange(0,m1->getNumberOfCells());
cellsInM1ToRenumW5->transformWithIndArr(cellsInM1ToRenumW4->begin(),cellsInM1ToRenumW4->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> grpIds=getGroupArr(-1,grpNameM1);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellsInM1ToRenum=cellsInM1ToRenumW5->buildSubstraction(grpIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1Part=static_cast<MEDCouplingUMesh *>(m1->buildPartOfMySelf(cellsInM1ToRenum->begin(),cellsInM1ToRenum->end(),true));
+ MCAuto<DataArrayInt> grpIds=getGroupArr(-1,grpNameM1);
+ MCAuto<DataArrayInt> cellsInM1ToRenum=cellsInM1ToRenumW5->buildSubstraction(grpIds);
+ MCAuto<MEDCouplingUMesh> m1Part=static_cast<MEDCouplingUMesh *>(m1->buildPartOfMySelf(cellsInM1ToRenum->begin(),cellsInM1ToRenum->end(),true));
m1Part->duplicateNodesInConn(nodeIdsToDuplicate->begin(),nodeIdsToDuplicate->end(),nbNodes);
m1->setPartOfMySelf(cellsInM1ToRenum->begin(),cellsInM1ToRenum->end(),*m1Part);
// end of node renumbering of cells in m1 impacted by duplication of node but not in group of level -1 'grpNameM1'
// duplication of cells in group 'grpNameM1' on level -1
m11->duplicateNodesInConn(nodeIdsToDuplicate->begin(),nodeIdsToDuplicate->end(),nbNodes); m11->setCoords(m0->getCoords());
std::vector<const MEDCouplingUMesh *> v(2); v[0]=m1; v[1]=m11;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> newm1=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(v,tmp00,tmp11);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> szOfCellGrpOfSameType(tmp00);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idInMsOfCellGrpOfSameType(tmp11);
+ MCAuto<MEDCouplingUMesh> newm1=MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords(v,tmp00,tmp11);
+ MCAuto<DataArrayInt> szOfCellGrpOfSameType(tmp00);
+ MCAuto<DataArrayInt> idInMsOfCellGrpOfSameType(tmp11);
//
newm1->setName(getName());
const DataArrayInt *fam=getFamilyFieldAtLevel(-1);
if(!fam)
throw INTERP_KERNEL::Exception("MEDFileUMesh::buildInnerBoundaryAlongM1Group : internal problem !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newFam=DataArrayInt::New();
+ MCAuto<DataArrayInt> newFam=DataArrayInt::New();
newFam->alloc(newm1->getNumberOfCells(),1);
// Get a new family ID: care must be taken if we need a positive ID or a negative one:
// Positive ID for family of nodes, negative for all the rest.
if(idInMsOfCellGrpOfSameType->getIJ(i,0)==0)
{
end=start+szOfCellGrpOfSameType->getIJ(i,0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> part=fam->selectByTupleId2(start,end,1);
+ MCAuto<DataArrayInt> part=fam->selectByTupleIdSafeSlice(start,end,1);
newFam->setPartOfValues1(part,globStart,globEnd,1,0,1,1,true);
start=end;
}
std::vector<int> levs=getNonEmptyLevels();
bool ret=false;
std::vector< const DataArrayInt* > renumCellsSplited;//same than memorySaverIfThrow
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > memorySaverIfThrow;//same than renumCellsSplited only in case of throw
+ std::vector< MCAuto<DataArrayInt> > memorySaverIfThrow;//same than renumCellsSplited only in case of throw
int start=0;
int end=0;
for(std::vector<int>::reverse_iterator it=levs.rbegin();it!=levs.rend();it++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=getMeshAtLevel(*it);
+ MCAuto<MEDCouplingUMesh> m=getMeshAtLevel(*it);
std::vector<int> code1=m->getDistributionOfTypes();
end=PutInThirdComponentOfCodeOffset(code1,start);
oldCode.insert(oldCode.end(),code1.begin(),code1.end());
bool hasChanged=m->unPolyze();
DataArrayInt *fake=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2nCellsPart=m->getLevArrPerCellTypes(MEDCouplingUMesh::MEDMEM_ORDER,
+ MCAuto<DataArrayInt> o2nCellsPart=m->getLevArrPerCellTypes(MEDCouplingUMesh::MEDMEM_ORDER,
MEDCouplingUMesh::MEDMEM_ORDER+MEDCouplingUMesh::N_MEDMEM_ORDER,fake);
fake->decrRef();
renumCellsSplited.push_back(o2nCellsPart); memorySaverIfThrow.push_back(o2nCellsPart);
if(hasChanged)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2nCellsPart2=o2nCellsPart->buildPermArrPerLevel();
+ MCAuto<DataArrayInt> o2nCellsPart2=o2nCellsPart->buildPermArrPerLevel();
m->renumberCells(o2nCellsPart2->getConstPointer(),false);
ret=true;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famField2,numField2;
+ MCAuto<DataArrayInt> famField2,numField2;
const DataArrayInt *famField=getFamilyFieldAtLevel(*it); if(famField) { famField->incrRef(); famField2=const_cast<DataArrayInt *>(famField); }
const DataArrayInt *numField=getNumberFieldAtLevel(*it); if(numField) { numField->incrRef(); numField2=const_cast<DataArrayInt *>(numField); }
setMeshAtLevel(*it,m);
end=PutInThirdComponentOfCodeOffset(code2,start);
newCode.insert(newCode.end(),code2.begin(),code2.end());
//
- if(o2nCellsPart2->isIdentity2(o2nCellsPart2->getNumberOfTuples()))
+ if(o2nCellsPart2->isIota(o2nCellsPart2->getNumberOfTuples()))
continue;
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newFamField=famField->renumber(o2nCellsPart2->getConstPointer());
+ MCAuto<DataArrayInt> newFamField=famField->renumber(o2nCellsPart2->getConstPointer());
setFamilyFieldArr(*it,newFamField);
}
if(numField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newNumField=numField->renumber(o2nCellsPart2->getConstPointer());
+ MCAuto<DataArrayInt> newNumField=numField->renumber(o2nCellsPart2->getConstPointer());
setRenumFieldArr(*it,newNumField);
}
}
}
if(ret)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renumCells=DataArrayInt::Aggregate(renumCellsSplited);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2nRenumCellRet=renumCells->buildPermArrPerLevel();
+ MCAuto<DataArrayInt> renumCells=DataArrayInt::Aggregate(renumCellsSplited);
+ MCAuto<DataArrayInt> o2nRenumCellRet=renumCells->buildPermArrPerLevel();
o2nRenumCell=o2nRenumCellRet.retn();
}
return ret;
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh(zeLev->getWholeMesh(false));
+ MCAuto<MEDCouplingUMesh> mesh(zeLev->getWholeMesh(false));
mesh->computeNodeIdsAlg(nodeIdsInUse);
}
}
int nbrOfNodesInUse((int)std::count(nodeIdsInUse.begin(),nodeIdsInUse.end(),true));
if(nbrOfNodesInUse==nbOfNodes)
return 0;//no need to update _part_coords
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodes,1);
+ MCAuto<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(nbOfNodes,1);
std::transform(nodeIdsInUse.begin(),nodeIdsInUse.end(),ret->getPointer(),MEDLoaderAccVisit1());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret2(ret->invertArrayO2N2N2OBis(nbrOfNodesInUse));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords(coo->selectByTupleIdSafe(ret2->begin(),ret2->end()));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newFamCoords;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> newNameCoords;
+ MCAuto<DataArrayInt> ret2(ret->invertArrayO2N2N2OBis(nbrOfNodesInUse));
+ MCAuto<DataArrayDouble> newCoords(coo->selectByTupleIdSafe(ret2->begin(),ret2->end()));
+ MCAuto<DataArrayInt> newFamCoords;
+ MCAuto<DataArrayAsciiChar> newNameCoords;
if((const DataArrayInt *)_fam_coords)
newFamCoords=_fam_coords->selectByTupleIdSafe(ret2->begin(),ret2->end());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newNumCoords;
+ MCAuto<DataArrayInt> newNumCoords;
if((const DataArrayInt *)_num_coords)
newNumCoords=_num_coords->selectByTupleIdSafe(ret2->begin(),ret2->end());
if((const DataArrayAsciiChar *)_name_coords)
newNameCoords=static_cast<DataArrayAsciiChar *>(_name_coords->selectByTupleIdSafe(ret2->begin(),ret2->end()));
_coords=newCoords; _fam_coords=newFamCoords; _num_coords=newNumCoords; _name_coords=newNameCoords; _rev_num_coords=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
{
if((MEDFileUMeshSplitL1*)*it)
{
const PartDefinition *pc(_part_coords);
if(pc)
{
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> tmpPD(DataArrayPartDefinition::New(ret2));
+ MCAuto<PartDefinition> tmpPD(DataArrayPartDefinition::New(ret2));
_part_coords=tmpPD->composeWith(pc);
}
return ret.retn();
checkCartesian();
if(getMeshDimension()!=2)
throw INTERP_KERNEL::Exception("MEDFileUMesh::buildExtrudedMesh : this is expected to be with mesh dimension equal to 2 !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
- m1D->checkCoherency();
+ MCAuto<MEDFileUMesh> ret(MEDFileUMesh::New());
+ m1D->checkConsistencyLight();
if(m1D->getMeshDimension()!=1)
throw INTERP_KERNEL::Exception("MEDFileUMesh::buildExtrudedMesh : input mesh must have a mesh dimension equal to one !");
int nbRep(m1D->getNumberOfCells());
std::vector<int> levs(getNonEmptyLevels());
std::vector<std::string> grps(getGroupsNames());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > zeList;
+ std::vector< MCAuto<MEDCouplingUMesh> > zeList;
DataArrayDouble *coords(0);
std::size_t nbOfLevsOut(levs.size()+1);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > o2ns(nbOfLevsOut);
+ std::vector< MCAuto<DataArrayInt> > o2ns(nbOfLevsOut);
for(std::vector<int>::const_iterator lev=levs.begin();lev!=levs.end();lev++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> item(getMeshAtLevel(*lev));
+ MCAuto<MEDCouplingUMesh> item(getMeshAtLevel(*lev));
item=item->clone(false);
item->changeSpaceDimension(3+(*lev),0.);//no problem non const but change DataArrayDouble for coordinates do not alter data
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp(static_cast<MEDCouplingUMesh *>(m1D->deepCpy()));
+ MCAuto<MEDCouplingUMesh> tmp(static_cast<MEDCouplingUMesh *>(m1D->deepCopy()));
tmp->changeSpaceDimension(3+(*lev),0.);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> elt(item->buildExtrudedMesh(tmp,policy));
+ MCAuto<MEDCouplingUMesh> elt(item->buildExtrudedMesh(tmp,policy));
zeList.push_back(elt);
if(*lev==0)
coords=elt->getCoords();
}
if(!coords)
throw INTERP_KERNEL::Exception("MEDFileUMesh::buildExtrudedMesh : internal error !");
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> >::iterator it=zeList.begin();it!=zeList.end();it++)
+ for(std::vector< MCAuto<MEDCouplingUMesh> >::iterator it=zeList.begin();it!=zeList.end();it++)
{
(*it)->setName(getName());
(*it)->setCoords(coords);
for(std::size_t ii=0;ii!=zeList.size();ii++)
{
int lev(levs[ii]);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> elt(zeList[ii]);
+ MCAuto<MEDCouplingUMesh> elt(zeList[ii]);
if(lev<=-1)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> elt1(getMeshAtLevel(lev+1));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> elt2(elt1->clone(false));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(elt2->getNodalConnectivity()->deepCpy());
+ MCAuto<MEDCouplingUMesh> elt1(getMeshAtLevel(lev+1));
+ MCAuto<MEDCouplingUMesh> elt2(elt1->clone(false));
+ MCAuto<DataArrayInt> tmp(elt2->getNodalConnectivity()->deepCopy());
elt2->setConnectivity(tmp,elt2->getNodalConnectivityIndex());
elt2->shiftNodeNumbersInConn(nbRep*elt1->getNumberOfNodes());
elt1->setCoords(elt->getCoords()); elt2->setCoords(elt->getCoords());
o2ns[ii]=elt->sortCellsInMEDFileFrmt();
ret->setMeshAtLevel(lev,elt);
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> endLev(getMeshAtLevel(levs.back())),endLev2;
+ MCAuto<MEDCouplingUMesh> endLev(getMeshAtLevel(levs.back())),endLev2;
endLev=endLev->clone(false); endLev->setCoords(coords);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(endLev->getNodalConnectivity()->deepCpy());
+ MCAuto<DataArrayInt> tmp(endLev->getNodalConnectivity()->deepCopy());
endLev2=endLev->clone(false); endLev2->setConnectivity(tmp,endLev->getNodalConnectivityIndex());
endLev2->shiftNodeNumbersInConn(nbRep*getNumberOfNodes());
endLev=MEDCouplingUMesh::MergeUMeshesOnSameCoords(endLev,endLev2);
for(std::size_t ii=0;ii!=zeList.size();ii++)
{
int lev(levs[ii]);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > outGrps;
+ std::vector< MCAuto<DataArrayInt> > outGrps;
std::vector< const DataArrayInt * > outGrps2;
if(lev<=-1)
{
for(std::vector<std::string>::const_iterator grp=grps.begin();grp!=grps.end();grp++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> grpArr(getGroupArr(lev+1,*grp));
+ MCAuto<DataArrayInt> grpArr(getGroupArr(lev+1,*grp));
if(!grpArr->empty())
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> grpArr1(grpArr->deepCpy()),grpArr2(grpArr->deepCpy());
+ MCAuto<DataArrayInt> grpArr1(grpArr->deepCopy()),grpArr2(grpArr->deepCopy());
int offset0(zeList[ii]->getNumberOfCells());
int offset1(offset0+getNumberOfCellsAtLevel(lev+1));
grpArr1->applyLin(1,offset0); grpArr2->applyLin(1,offset1);
//
for(std::vector<std::string>::const_iterator grp=grps.begin();grp!=grps.end();grp++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> grpArr(getGroupArr(lev,*grp));
+ MCAuto<DataArrayInt> grpArr(getGroupArr(lev,*grp));
if(!grpArr->empty())
{
int nbCellsB4Extrusion(getNumberOfCellsAtLevel(lev));
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > grpArrs(nbRep);
+ std::vector< MCAuto<DataArrayInt> > grpArrs(nbRep);
std::vector< const DataArrayInt *> grpArrs2(nbRep);
for(int iii=0;iii<nbRep;iii++)
{
- grpArrs[iii]=grpArr->deepCpy(); grpArrs[iii]->applyLin(1,iii*nbCellsB4Extrusion);
+ grpArrs[iii]=grpArr->deepCopy(); grpArrs[iii]->applyLin(1,iii*nbCellsB4Extrusion);
grpArrs2[iii]=grpArrs[iii];
}
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> grpArrExt(DataArrayInt::Aggregate(grpArrs2));
+ MCAuto<DataArrayInt> grpArrExt(DataArrayInt::Aggregate(grpArrs2));
grpArrExt->transformWithIndArr(o2ns[ii]->begin(),o2ns[ii]->end());
std::ostringstream grpName; grpName << *grp << "_extruded";
grpArrExt->setName(grpName.str());
}
ret->setGroupsAtLevel(lev,outGrps2);
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > outGrps;
+ std::vector< MCAuto<DataArrayInt> > outGrps;
std::vector< const DataArrayInt * > outGrps2;
for(std::vector<std::string>::const_iterator grp=grps.begin();grp!=grps.end();grp++)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> grpArr1(getGroupArr(levs.back(),*grp));
+ MCAuto<DataArrayInt> grpArr1(getGroupArr(levs.back(),*grp));
if(grpArr1->empty())
continue;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> grpArr2(grpArr1->deepCpy());
+ MCAuto<DataArrayInt> grpArr2(grpArr1->deepCopy());
std::ostringstream grpName; grpName << *grp << "_top";
grpArr2->setName(grpName.str());
grpArr2->applyLin(1,getNumberOfCellsAtLevel(levs.back()));
MEDFileUMesh *MEDFileUMesh::linearToQuadratic(int conversionType, double eps) const
{
checkCartesian();
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
+ MCAuto<MEDFileUMesh> ret(MEDFileUMesh::New());
int initialNbNodes(getNumberOfNodes());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0Tmp(getMeshAtLevel(0));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0(dynamic_cast<MEDCouplingUMesh *>(m0Tmp->deepCpy()));
+ MCAuto<MEDCouplingUMesh> m0Tmp(getMeshAtLevel(0));
+ MCAuto<MEDCouplingUMesh> m0(dynamic_cast<MEDCouplingUMesh *>(m0Tmp->deepCopy()));
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> notUsed(m0->convertLinearCellsToQuadratic(conversionType));
+ MCAuto<DataArrayInt> notUsed(m0->convertLinearCellsToQuadratic(conversionType));
}
DataArrayDouble *zeCoords(m0->getCoords());
ret->setMeshAtLevel(0,m0);
const DataArrayInt *famField(getFamilyFieldAtLevel(0));
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famFieldCpy(famField->deepCpy());
+ MCAuto<DataArrayInt> famFieldCpy(famField->deepCopy());
ret->setFamilyFieldArr(0,famFieldCpy);
}
famField=getFamilyFieldAtLevel(1);
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fam(DataArrayInt::New()); fam->alloc(zeCoords->getNumberOfTuples(),1);
+ MCAuto<DataArrayInt> fam(DataArrayInt::New()); fam->alloc(zeCoords->getNumberOfTuples(),1);
fam->fillWithZero();
fam->setPartOfValues1(famField,0,initialNbNodes,1,0,1,1);
ret->setFamilyFieldArr(1,fam);
}
ret->copyFamGrpMapsFrom(*this);
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> partZeCoords(zeCoords->selectByTupleId2(initialNbNodes,zeCoords->getNumberOfTuples(),1));
+ MCAuto<DataArrayDouble> partZeCoords(zeCoords->selectByTupleIdSafeSlice(initialNbNodes,zeCoords->getNumberOfTuples(),1));
for(std::vector<int>::const_iterator lev=levs.begin();lev!=levs.end();lev++)
{
if(*lev==0)
continue;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1Tmp(getMeshAtLevel(*lev));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1(dynamic_cast<MEDCouplingUMesh *>(m1Tmp->deepCpy()));
+ MCAuto<MEDCouplingUMesh> m1Tmp(getMeshAtLevel(*lev));
+ MCAuto<MEDCouplingUMesh> m1(dynamic_cast<MEDCouplingUMesh *>(m1Tmp->deepCopy()));
if(m1->getMeshDimension()!=0)
{
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> notUsed(m1->convertLinearCellsToQuadratic(conversionType));
+ MCAuto<DataArrayInt> notUsed(m1->convertLinearCellsToQuadratic(conversionType));
}//kill unused notUsed var
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> m1Coords(m1->getCoords()->selectByTupleId2(initialNbNodes,m1->getNumberOfNodes(),1));
+ MCAuto<DataArrayDouble> m1Coords(m1->getCoords()->selectByTupleIdSafeSlice(initialNbNodes,m1->getNumberOfNodes(),1));
DataArrayInt *b(0);
bool a(partZeCoords->areIncludedInMe(m1Coords,eps,b));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bSafe(b);
+ MCAuto<DataArrayInt> bSafe(b);
if(!a)
{
std::ostringstream oss; oss << "MEDFileUMesh::linearCellsToQuadratic : for level " << *lev << " problem to identify nodes generated !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
b->applyLin(1,initialNbNodes);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> l0(DataArrayInt::New()); l0->alloc(initialNbNodes,1); l0->iota();
+ MCAuto<DataArrayInt> l0(DataArrayInt::New()); l0->alloc(initialNbNodes,1); l0->iota();
std::vector<const DataArrayInt *> v(2); v[0]=l0; v[1]=b;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renum(DataArrayInt::Aggregate(v));
+ MCAuto<DataArrayInt> renum(DataArrayInt::Aggregate(v));
m1->renumberNodesInConn(renum->begin());
}
m1->setCoords(zeCoords);
famField=getFamilyFieldAtLevel(*lev);
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famFieldCpy(famField->deepCpy());
+ MCAuto<DataArrayInt> famFieldCpy(famField->deepCopy());
ret->setFamilyFieldArr(*lev,famFieldCpy);
}
}
MEDFileUMesh *MEDFileUMesh::quadraticToLinear(double eps) const
{
checkCartesian();
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0Tmp(getMeshAtLevel(0));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m0(dynamic_cast<MEDCouplingUMesh *>(m0Tmp->deepCpy()));
+ MCAuto<MEDFileUMesh> ret(MEDFileUMesh::New());
+ MCAuto<MEDCouplingUMesh> m0Tmp(getMeshAtLevel(0));
+ MCAuto<MEDCouplingUMesh> m0(dynamic_cast<MEDCouplingUMesh *>(m0Tmp->deepCopy()));
m0->convertQuadraticCellsToLinear();
m0->zipCoords();
DataArrayDouble *zeCoords(m0->getCoords());
const DataArrayInt *famField(getFamilyFieldAtLevel(0));
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famFieldCpy(famField->deepCpy());
+ MCAuto<DataArrayInt> famFieldCpy(famField->deepCopy());
ret->setFamilyFieldArr(0,famFieldCpy);
}
famField=getFamilyFieldAtLevel(1);
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fam(famField->selectByTupleId2(0,zeCoords->getNumberOfTuples(),1));
+ MCAuto<DataArrayInt> fam(famField->selectByTupleIdSafeSlice(0,zeCoords->getNumberOfTuples(),1));
ret->setFamilyFieldArr(1,fam);
}
ret->copyFamGrpMapsFrom(*this);
{
if(*lev==0)
continue;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1Tmp(getMeshAtLevel(*lev));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m1(dynamic_cast<MEDCouplingUMesh *>(m1Tmp->deepCpy()));
+ MCAuto<MEDCouplingUMesh> m1Tmp(getMeshAtLevel(*lev));
+ MCAuto<MEDCouplingUMesh> m1(dynamic_cast<MEDCouplingUMesh *>(m1Tmp->deepCopy()));
m1->convertQuadraticCellsToLinear();
m1->zipCoords();
DataArrayInt *b(0);
bool a(zeCoords->areIncludedInMe(m1->getCoords(),eps,b));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> bSafe(b);
+ MCAuto<DataArrayInt> bSafe(b);
if(!a)
{
std::ostringstream oss; oss << "MEDFileUMesh::quadraticToLinear : for level " << *lev << " problem to identify nodes generated !";
famField=getFamilyFieldAtLevel(*lev);
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famFieldCpy(famField->deepCpy());
+ MCAuto<DataArrayInt> famFieldCpy(famField->deepCopy());
ret->setFamilyFieldArr(*lev,famFieldCpy);
}
}
return ret.retn();
}
-void MEDFileUMesh::serialize(std::vector<double>& tinyDouble, std::vector<int>& tinyInt, std::vector<std::string>& tinyStr, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI, MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& bigArrayD)
+void MEDFileUMesh::serialize(std::vector<double>& tinyDouble, std::vector<int>& tinyInt, std::vector<std::string>& tinyStr, std::vector< MCAuto<DataArrayInt> >& bigArraysI, MCAuto<DataArrayDouble>& bigArrayD)
{
clearNonDiscrAttributes();
forceComputationOfParts();
tinyDouble.clear(); tinyInt.clear(); tinyStr.clear(); bigArraysI.clear(); bigArrayD=0;
std::vector<int> layer0;
- layer0.push_back(getAxType());//0 i
+ layer0.push_back(getAxisType());//0 i
layer0.push_back(_order); //1 i
layer0.push_back(_iteration);//2 i
layer0.push_back(getSpaceDimension());//3 i
}
void MEDFileUMesh::unserialize(std::vector<double>& tinyDouble, std::vector<int>& tinyInt, std::vector<std::string>& tinyStr,
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI, MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& bigArrayD)
+ std::vector< MCAuto<DataArrayInt> >& bigArraysI, MCAuto<DataArrayDouble>& bigArrayD)
{
int sz0(tinyInt[0]);
std::vector<int> layer0(tinyInt.begin()+1,tinyInt.begin()+1+sz0);
std::reverse(tinyStr.begin(),tinyStr.end());
std::reverse(bigArraysI.begin(),bigArraysI.end());
//
- setAxType((MEDCouplingAxisType)layer0.back()); layer0.pop_back();
+ setAxisType((MEDCouplingAxisType)layer0.back()); layer0.pop_back();
_order=layer0.back(); layer0.pop_back();
_iteration=layer0.back(); layer0.pop_back();
int spaceDim(layer0.back()); layer0.pop_back();
*/
void MEDFileUMesh::setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> elt(new MEDFileUMeshSplitL1(m));
+ MCAuto<MEDFileUMeshSplitL1> elt(new MEDFileUMeshSplitL1(m));
checkAndGiveEntryInSplitL1(meshDimRelToMax,m)=elt;
}
*/
void MEDFileUMesh::setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> elt(new MEDFileUMeshSplitL1(m,newOrOld));
+ MCAuto<MEDFileUMeshSplitL1> elt(new MEDFileUMeshSplitL1(m,newOrOld));
checkAndGiveEntryInSplitL1(meshDimRelToMax,m)=elt;
}
-MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1>& MEDFileUMesh::checkAndGiveEntryInSplitL1(int meshDimRelToMax, MEDCouplingPointSet *m)
+MCAuto<MEDFileUMeshSplitL1>& MEDFileUMesh::checkAndGiveEntryInSplitL1(int meshDimRelToMax, MEDCouplingPointSet *m)
{
dealWithTinyInfo(m);
std::vector<int> levSet=getNonEmptyLevels();
* \throw If the meshes in \a ms do not share the same node coordinates array.
* \throw If the node coordinates array of \a this mesh (if any) is not the same as that
* of the given meshes.
- * \throw If \a ms[ i ] is not well defined (MEDCouplingUMesh::checkCoherency()).
+ * \throw If \a ms[ i ] is not well defined (MEDCouplingUMesh::checkConsistencyLight()).
* \throw If names of some meshes in \a ms are equal.
* \throw If \a ms includes a mesh with an empty name.
*/
if((DataArrayDouble *)_coords!=coo)
throw INTERP_KERNEL::Exception("MEDFileUMesh::setGroupsFromScratch : coordinates mismatches !");
std::vector<DataArrayInt *> corr;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MEDCouplingUMesh::FuseUMeshesOnSameCoords(ms,_zipconn_pol,corr);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > corr3(corr.begin(),corr.end());
+ MCAuto<MEDCouplingUMesh> m=MEDCouplingUMesh::FuseUMeshesOnSameCoords(ms,_zipconn_pol,corr);
+ std::vector< MCAuto<DataArrayInt> > corr3(corr.begin(),corr.end());
setMeshAtLevel(meshDimRelToMax,m,renum);
std::vector<const DataArrayInt *> corr2(corr.begin(),corr.end());
setGroupsAtLevel(meshDimRelToMax,corr2,true);
* \throw If the meshes in \a ms do not share the same node coordinates array.
* \throw If the node coordinates array of \a this mesh (if any) is not the same as that
* of the given meshes.
- * \throw If \a ms[ i ] is not well defined (MEDCouplingUMesh::checkCoherency()).
+ * \throw If \a ms[ i ] is not well defined (MEDCouplingUMesh::checkConsistencyLight()).
* \throw If names of some meshes in \a ms are equal.
* \throw If \a ms includes a mesh with an empty name.
*/
if((DataArrayDouble *)_coords!=coo)
throw INTERP_KERNEL::Exception("MEDFileUMesh::setGroupsOnSetMesh : coordinates mismatches !");
MEDCouplingUMesh *m=getMeshAtLevel(meshDimRelToMax,renum);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > corr(ms.size());
+ std::vector< MCAuto<DataArrayInt> > corr(ms.size());
int i=0;
for(std::vector<const MEDCouplingUMesh *>::const_iterator it=ms.begin();it!=ms.end();it++,i++)
{
int mdim=ms[0]->getMeshDimension();
for(unsigned int i=1;i<ms.size();i++)
{
- ms[i]->checkCoherency();
+ ms[i]->checkConsistencyLight();
if(ms[i]->getCoords()!=ret)
throw INTERP_KERNEL::Exception("MEDFileUMesh::checkMultiMesh : meshes must share the same coords !");
if(ms[i]->getMeshDimension()!=mdim)
void MEDFileUMesh::synchronizeTinyInfoOnLeaves() const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
if((const MEDFileUMeshSplitL1 *)(*it))
(*it)->synchronizeTinyInfo(*this);
}
DataArrayInt *arr=_fam_coords;
if(arr)
arr->changeValue(oldId,newId);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::iterator it=_ms.begin();it!=_ms.end();it++)
{
MEDFileUMeshSplitL1 *sp=(*it);
if(sp)
}
}
-std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > MEDFileUMesh::getAllNonNullFamilyIds() const
+std::list< MCAuto<DataArrayInt> > MEDFileUMesh::getAllNonNullFamilyIds() const
{
- std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > ret;
+ std::list< MCAuto<DataArrayInt> > ret;
const DataArrayInt *da(_fam_coords);
if(da)
- { da->incrRef(); ret.push_back(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+ { da->incrRef(); ret.push_back(MCAuto<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
+ for(std::vector< MCAuto<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
{
const MEDFileUMeshSplitL1 *elt(*it);
if(elt)
{
da=elt->getFamilyField();
if(da)
- { da->incrRef(); ret.push_back(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
+ { da->incrRef(); ret.push_back(MCAuto<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
}
}
return ret;
{
if((const DataArrayInt *)_fam_nodes)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da;
+ MCAuto<DataArrayInt> da;
if(!famIds.empty())
- da=_fam_nodes->getIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
+ da=_fam_nodes->findIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
else
- da=_fam_nodes->getIdsEqualList(0,0);
+ da=_fam_nodes->findIdsEqualList(0,0);
if(renum)
return MEDFileUMeshSplitL1::Renumber(_num_nodes,da);
else
{
if((const DataArrayInt *)_fam_cells)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da;
+ MCAuto<DataArrayInt> da;
if(!famIds.empty())
- da=_fam_cells->getIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
+ da=_fam_cells->findIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
else
- da=_fam_cells->getIdsEqualList(0,0);
+ da=_fam_cells->findIdsEqualList(0,0);
if(renum)
return MEDFileUMeshSplitL1::Renumber(_num_cells,da);
else
{
if((const DataArrayInt *)_fam_faces)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da;
+ MCAuto<DataArrayInt> da;
if(!famIds.empty())
- da=_fam_faces->getIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
+ da=_fam_faces->findIdsEqualList(&famIds[0],&famIds[0]+famIds.size());
else
- da=_fam_faces->getIdsEqualList(0,0);
+ da=_fam_faces->findIdsEqualList(0,0);
if(renum)
return MEDFileUMeshSplitL1::Renumber(_num_faces,da);
else
arr->changeValue(oldId,newId);
}
-std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > MEDFileStructuredMesh::getAllNonNullFamilyIds() const
+std::list< MCAuto<DataArrayInt> > MEDFileStructuredMesh::getAllNonNullFamilyIds() const
{
- std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > ret;
+ std::list< MCAuto<DataArrayInt> > ret;
const DataArrayInt *da(_fam_nodes);
if(da)
- { da->incrRef(); ret.push_back(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
+ { da->incrRef(); ret.push_back(MCAuto<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
da=_fam_cells;
if(da)
- { da->incrRef(); ret.push_back(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
+ { da->incrRef(); ret.push_back(MCAuto<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
da=_fam_faces;
if(da)
- { da->incrRef(); ret.push_back(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
+ { da->incrRef(); ret.push_back(MCAuto<DataArrayInt>(const_cast<DataArrayInt *>(da))); }
return ret;
}
void MEDFileStructuredMesh::deepCpyAttributes()
{
if((const DataArrayInt*)_fam_nodes)
- _fam_nodes=_fam_nodes->deepCpy();
+ _fam_nodes=_fam_nodes->deepCopy();
if((const DataArrayInt*)_num_nodes)
- _num_nodes=_num_nodes->deepCpy();
+ _num_nodes=_num_nodes->deepCopy();
if((const DataArrayAsciiChar*)_names_nodes)
- _names_nodes=_names_nodes->deepCpy();
+ _names_nodes=_names_nodes->deepCopy();
if((const DataArrayInt*)_fam_cells)
- _fam_cells=_fam_cells->deepCpy();
+ _fam_cells=_fam_cells->deepCopy();
if((const DataArrayInt*)_num_cells)
- _num_cells=_num_cells->deepCpy();
+ _num_cells=_num_cells->deepCopy();
if((const DataArrayAsciiChar*)_names_cells)
- _names_cells=_names_cells->deepCpy();
+ _names_cells=_names_cells->deepCopy();
if((const DataArrayInt*)_fam_faces)
- _fam_faces=_fam_faces->deepCpy();
+ _fam_faces=_fam_faces->deepCopy();
if((const DataArrayInt*)_num_faces)
- _num_faces=_num_faces->deepCpy();
+ _num_faces=_num_faces->deepCopy();
if((const DataArrayAsciiChar*)_names_faces)
- _names_faces=_names_faces->deepCpy();
+ _names_faces=_names_faces->deepCopy();
if((const DataArrayInt*)_rev_num_nodes)
- _rev_num_nodes=_rev_num_nodes->deepCpy();
+ _rev_num_nodes=_rev_num_nodes->deepCopy();
if((const DataArrayInt*)_rev_num_cells)
- _rev_num_cells=_rev_num_cells->deepCpy();
+ _rev_num_cells=_rev_num_cells->deepCopy();
}
/*!
}
void MEDFileStructuredMesh::LoadStrMeshDAFromFile(med_idt fid, int meshDim, int dt, int it, const std::string& mName, MEDFileMeshReadSelector *mrs,
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& famCells, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& numCells, MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar>& namesCells)
+ MCAuto<DataArrayInt>& famCells, MCAuto<DataArrayInt>& numCells, MCAuto<DataArrayAsciiChar>& namesCells)
{
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
med_geometry_type geoTypeReq=MEDFileStructuredMesh::GetGeoTypeFromMeshDim(meshDim);
*/
MEDFileCMesh *MEDFileCMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
- std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
+ std::vector<std::string> ms(MEDCoupling::GetMeshNames(fileName));
if(ms.empty())
{
std::ostringstream oss; oss << "MEDFileUMesh::New : no meshes in file \"" << fileName << "\" !";
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
return new MEDFileCMesh(fid,ms.front(),dt,it,mrs);
}
MEDFileMesh *MEDFileCMesh::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> ret(new MEDFileCMesh(*this));
+ MCAuto<MEDFileCMesh> ret(new MEDFileCMesh(*this));
return ret.retn();
}
return new MEDFileCMesh;
}
-MEDFileMesh *MEDFileCMesh::deepCpy() const
+MEDFileMesh *MEDFileCMesh::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> ret(new MEDFileCMesh(*this));
+ MCAuto<MEDFileCMesh> ret(new MEDFileCMesh(*this));
ret->deepCpyEquivalences(*this);
if((const MEDCouplingCMesh*)_cmesh)
- ret->_cmesh=static_cast<MEDCouplingCMesh*>(_cmesh->deepCpy());
+ ret->_cmesh=static_cast<MEDCouplingCMesh*>(_cmesh->deepCopy());
ret->deepCpyAttributes();
return ret.retn();
}
void MEDFileCMesh::loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dtunit;
- ParaMEDMEM::MEDCouplingAxisType axType;
+ MEDCoupling::MEDCouplingAxisType axType;
int mid=MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,axType,dummy0,dummy1,dtunit);
if(meshType!=CARTESIAN)
{
}
MEDFileCMeshL2 loaderl2;
loaderl2.loadAll(fid,mid,mName,dt,it);
- setAxType(axType);
+ setAxisType(axType);
MEDCouplingCMesh *mesh=loaderl2.getMesh();
mesh->incrRef();
_cmesh=mesh;
MEDFileMesh *MEDFileCMesh::cartesianize() const
{
- if(getAxType()==AX_CART)
+ if(getAxisType()==AX_CART)
{
incrRef();
return const_cast<MEDFileCMesh *>(this);
const MEDCouplingCMesh *cmesh(getMesh());
if(!cmesh)
throw INTERP_KERNEL::Exception("MEDFileCMesh::cartesianize : impossible to turn into cartesian because the mesh is null !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> clmesh(cmesh->buildCurveLinear());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords(clmesh->getCoords()->cartesianize(getAxType()));
+ MCAuto<MEDCouplingCurveLinearMesh> clmesh(cmesh->buildCurveLinear());
+ MCAuto<DataArrayDouble> coords(clmesh->getCoords()->cartesianize(getAxisType()));
clmesh->setCoords(coords);
- MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret(MEDFileCurveLinearMesh::New());
+ MCAuto<MEDFileCurveLinearMesh> ret(MEDFileCurveLinearMesh::New());
ret->MEDFileStructuredMesh::operator=(*this);
ret->setMesh(clmesh);
- ret->setAxType(AX_CART);
+ ret->setAxisType(AX_CART);
return ret.retn();
}
}
MEDLoaderBase::safeStrCpy2(c.c_str(),MED_SNAME_SIZE-1,comp+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
- MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,spaceDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxType()),comp,unit));
+ MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,spaceDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxisType()),comp,unit));
if(_univ_wr_status)
MEDFILESAFECALLERWR0(MEDmeshUniversalNameWr,(fid,maa));
- MEDFILESAFECALLERWR0(MEDmeshGridTypeWr,(fid,maa,MEDFileMeshL2::TraduceAxisTypeRevStruct(getAxType())));
+ MEDFILESAFECALLERWR0(MEDmeshGridTypeWr,(fid,maa,MEDFileMeshL2::TraduceAxisTypeRevStruct(getAxisType())));
for(int i=0;i<spaceDim;i++)
{
const DataArrayDouble *da=_cmesh->getCoordsAt(i);
MEDFileCurveLinearMesh *MEDFileCurveLinearMesh::New(const std::string& fileName, MEDFileMeshReadSelector *mrs)
{
- std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
+ std::vector<std::string> ms(MEDCoupling::GetMeshNames(fileName));
if(ms.empty())
{
std::ostringstream oss; oss << "MEDFileUMesh::New : no meshes in file \"" << fileName << "\" !";
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingAxisType dummy3;
std::string dummy2;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
return new MEDFileCurveLinearMesh(fid,ms.front(),dt,it,mrs);
MEDFileMesh *MEDFileCurveLinearMesh::shallowCpy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret(new MEDFileCurveLinearMesh(*this));
+ MCAuto<MEDFileCurveLinearMesh> ret(new MEDFileCurveLinearMesh(*this));
return ret.retn();
}
return new MEDFileCurveLinearMesh;
}
-MEDFileMesh *MEDFileCurveLinearMesh::deepCpy() const
+MEDFileMesh *MEDFileCurveLinearMesh::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret(new MEDFileCurveLinearMesh(*this));
+ MCAuto<MEDFileCurveLinearMesh> ret(new MEDFileCurveLinearMesh(*this));
ret->deepCpyEquivalences(*this);
if((const MEDCouplingCurveLinearMesh*)_clmesh)
- ret->_clmesh=static_cast<MEDCouplingCurveLinearMesh*>(_clmesh->deepCpy());
+ ret->_clmesh=static_cast<MEDCouplingCurveLinearMesh*>(_clmesh->deepCopy());
ret->deepCpyAttributes();
return ret.retn();
}
MEDFileMesh *MEDFileCurveLinearMesh::cartesianize() const
{
- if(getAxType()==AX_CART)
+ if(getAxisType()==AX_CART)
{
incrRef();
return const_cast<MEDFileCurveLinearMesh *>(this);
const DataArrayDouble *coords(mesh->getCoords());
if(!coords)
throw INTERP_KERNEL::Exception("MEDFileCurveLinearMesh::cartesianize : coordinate pointer in mesh is null !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> ret(new MEDFileCurveLinearMesh(*this));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> mesh2(mesh->clone(false));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coordsCart(coords->cartesianize(getAxType()));
+ MCAuto<MEDFileCurveLinearMesh> ret(new MEDFileCurveLinearMesh(*this));
+ MCAuto<MEDCouplingCurveLinearMesh> mesh2(mesh->clone(false));
+ MCAuto<DataArrayDouble> coordsCart(coords->cartesianize(getAxisType()));
mesh2->setCoords(coordsCart);
ret->setMesh(mesh2);
- ret->setAxType(AX_CART);
+ ret->setAxisType(AX_CART);
return ret.retn();
}
}
MEDLoaderBase::safeStrCpy2(c.c_str(),MED_SNAME_SIZE-1,comp+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
MEDLoaderBase::safeStrCpy2(u.c_str(),MED_SNAME_SIZE-1,unit+i*MED_SNAME_SIZE,_too_long_str);//MED_TAILLE_PNOM-1 to avoid to write '\0' on next compo
}
- MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,meshDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxType()),comp,unit));
+ MEDFILESAFECALLERWR0(MEDmeshCr,(fid,maa,spaceDim,meshDim,MED_STRUCTURED_MESH,desc,dtunit,MED_SORT_DTIT,MEDFileMeshL2::TraduceAxisTypeRev(getAxisType()),comp,unit));
if(_univ_wr_status)
MEDFILESAFECALLERWR0(MEDmeshUniversalNameWr,(fid,maa));
MEDFILESAFECALLERWR0(MEDmeshGridTypeWr,(fid,maa,MED_CURVILINEAR_GRID));
void MEDFileCurveLinearMesh::loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
int dummy0,dummy1;
std::string dtunit;
- ParaMEDMEM::MEDCouplingAxisType axType;
+ MEDCoupling::MEDCouplingAxisType axType;
int mid=MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,axType,dummy0,dummy1,dtunit);
- setAxType(axType);
+ setAxisType(axType);
if(meshType!=CURVE_LINEAR)
{
std::ostringstream oss; oss << "Trying to load as curve linear an existing mesh with name '" << mName << "' that is NOT curve linear !";
return new MEDFileMeshMultiTS(fileName,mName);
}
-MEDFileMeshMultiTS *MEDFileMeshMultiTS::deepCpy() const
+MEDFileMeshMultiTS *MEDFileMeshMultiTS::deepCopy() const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> ret=MEDFileMeshMultiTS::New();
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> > meshOneTs(_mesh_one_ts.size());
+ MCAuto<MEDFileMeshMultiTS> ret=MEDFileMeshMultiTS::New();
+ std::vector< MCAuto<MEDFileMesh> > meshOneTs(_mesh_one_ts.size());
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++,i++)
if((const MEDFileMesh *)*it)
- meshOneTs[i]=(*it)->deepCpy();
+ meshOneTs[i]=(*it)->deepCopy();
ret->_mesh_one_ts=meshOneTs;
return ret.retn();
}
std::size_t MEDFileMeshMultiTS::getHeapMemorySizeWithoutChildren() const
{
- return _mesh_one_ts.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMesh>);
+ return _mesh_one_ts.capacity()*sizeof(MCAuto<MEDFileMesh>);
}
std::vector<const BigMemoryObject *> MEDFileMeshMultiTS::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
ret.push_back((const MEDFileMesh *)*it);
return ret;
}
bool MEDFileMeshMultiTS::changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileMesh> >::iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
{
MEDFileMesh *cur(*it);
if(cur)
void MEDFileMeshMultiTS::cartesianizeMe()
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileMesh> >::iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
{
MEDFileMesh *cur(*it);
if(cur)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> ccur(cur->cartesianize());// Attention ! Do not wrap these two lines because memory leak !
+ MCAuto<MEDFileMesh> ccur(cur->cartesianize());// Attention ! Do not wrap these two lines because memory leak !
*it=ccur;
}
}
throw INTERP_KERNEL::Exception("MEDFileMeshMultiTS::setOneTimeStep : input pointer should be different from 0 !");
_mesh_one_ts.resize(1);
mesh1TimeStep->incrRef();
- //MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> toto=mesh1TimeStep;
+ //MCAuto<MEDFileMesh> toto=mesh1TimeStep;
_mesh_one_ts[0]=mesh1TimeStep;
}
*/
void MEDFileMeshMultiTS::setJoints( MEDFileJoints* joints )
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileMesh> >::iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
{
(*it)->setJoints( joints );
}
MEDFileJoints *joints(getJoints());
bool jointsWritten(false);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
{
if ( jointsWritten )
const_cast<MEDFileMesh&>(**it).setJoints( 0 );
MEDFileMeshMultiTS::MEDFileMeshMultiTS(const std::string& fileName)
try
{
- std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
+ std::vector<std::string> ms(MEDCoupling::GetMeshNames(fileName));
if(ms.empty())
{
std::ostringstream oss; oss << "MEDFileUMesh::New : no meshes in file \"" << fileName << "\" !";
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
int dt,it;
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,ms.front(),meshType,dummy3,dt,it,dummy2);
loadFromFile(fileName,ms.front());
}
void MEDFileMeshes::write(med_idt fid) const
{
- checkCoherency();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++)
+ checkConsistencyLight();
+ for(std::vector< MCAuto<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++)
{
(*it)->copyOptionsFrom(*this);
(*it)->write(fid);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),medmod);
std::ostringstream oss; oss << "MEDFileMesh : error on attempt to write in file : \"" << fileName << "\"";
MEDFileUtilities::CheckMEDCode(fid,fid,oss.str());
- checkCoherency();
+ checkConsistencyLight();
write(fid);
}
{
std::vector<std::string> ret(_meshes.size());
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++,i++)
{
const MEDFileMeshMultiTS *f=(*it);
if(f)
bool MEDFileMeshes::changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab)
{
bool ret=false;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::iterator it=_meshes.begin();it!=_meshes.end();it++)
+ for(std::vector< MCAuto<MEDFileMeshMultiTS> >::iterator it=_meshes.begin();it!=_meshes.end();it++)
{
MEDFileMeshMultiTS *cur(*it);
if(cur)
void MEDFileMeshes::cartesianizeMe()
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::iterator it=_meshes.begin();it!=_meshes.end();it++)
+ for(std::vector< MCAuto<MEDFileMeshMultiTS> >::iterator it=_meshes.begin();it!=_meshes.end();it++)
{
MEDFileMeshMultiTS *cur(*it);
if(cur)
void MEDFileMeshes::loadFromFile(const std::string& fileName)
{
- std::vector<std::string> ms=MEDLoader::GetMeshNames(fileName);
+ std::vector<std::string> ms(MEDCoupling::GetMeshNames(fileName));
int i=0;
_meshes.resize(ms.size());
for(std::vector<std::string>::const_iterator it=ms.begin();it!=ms.end();it++,i++)
{
}
-MEDFileMeshes *MEDFileMeshes::deepCpy() const
+MEDFileMeshes *MEDFileMeshes::deepCopy() const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> > meshes(_meshes.size());
+ std::vector< MCAuto<MEDFileMeshMultiTS> > meshes(_meshes.size());
std::size_t i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++,i++)
if((const MEDFileMeshMultiTS *)*it)
- meshes[i]=(*it)->deepCpy();
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> ret=MEDFileMeshes::New();
+ meshes[i]=(*it)->deepCopy();
+ MCAuto<MEDFileMeshes> ret=MEDFileMeshes::New();
ret->_meshes=meshes;
return ret.retn();
}
std::size_t MEDFileMeshes::getHeapMemorySizeWithoutChildren() const
{
- return _meshes.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS>));
+ return _meshes.capacity()*(sizeof(MCAuto<MEDFileMeshMultiTS>));
}
std::vector<const BigMemoryObject *> MEDFileMeshes::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++)
+ for(std::vector< MCAuto<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++)
ret.push_back((const MEDFileMeshMultiTS *)*it);
return ret;
}
oss << " - #" << i << " \"" << mns[i] << "\"\n";
}
-void MEDFileMeshes::checkCoherency() const
+void MEDFileMeshes::checkConsistencyLight() const
{
- static const char MSG[]="MEDFileMeshes::checkCoherency : mesh at rank ";
+ static const char MSG[]="MEDFileMeshes::checkConsistencyLight : mesh at rank ";
int i=0;
std::set<std::string> s;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++,i++)
{
const MEDFileMeshMultiTS *elt=(*it);
if(!elt)
#include <map>
#include <list>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileFieldGlobsReal;
class MEDFileField1TSStructItem;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT virtual MEDFileMesh *createNewEmpty() const = 0;
- MEDLOADER_EXPORT virtual MEDFileMesh *deepCpy() const = 0;
+ MEDLOADER_EXPORT virtual MEDFileMesh *deepCopy() const = 0;
MEDLOADER_EXPORT virtual MEDFileMesh *shallowCpy() const = 0;
MEDLOADER_EXPORT virtual bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
MEDLOADER_EXPORT virtual void clearNonDiscrAttributes() const;
MEDLOADER_EXPORT double getTimeValue() const { return _time; }
MEDLOADER_EXPORT void setTimeUnit(const std::string& unit) { _dt_unit=unit; }
MEDLOADER_EXPORT std::string getTimeUnit() const { return _dt_unit; }
- MEDLOADER_EXPORT void setAxType(MEDCouplingAxisType at) { _axis_type=at; }
- MEDLOADER_EXPORT MEDCouplingAxisType getAxType() const { return _axis_type; }
+ MEDLOADER_EXPORT void setAxisType(MEDCouplingAxisType at) { _axis_type=at; }
+ MEDLOADER_EXPORT MEDCouplingAxisType getAxisType() const { return _axis_type; }
MEDLOADER_EXPORT std::vector<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
MEDLOADER_EXPORT virtual int getNumberOfNodes() const = 0;
MEDLOADER_EXPORT virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const = 0;
void getFamilyRepr(std::ostream& oss) const;
virtual void appendFamilyEntries(const DataArrayInt *famIds, const std::vector< std::vector<int> >& fidsOfGrps, const std::vector<std::string>& grpNames);
virtual void changeFamilyIdArr(int oldId, int newId) = 0;
- virtual std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > getAllNonNullFamilyIds() const = 0;
+ virtual std::list< MCAuto<DataArrayInt> > getAllNonNullFamilyIds() const = 0;
virtual void loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs) = 0;
void loadLLWithAdditionalItems(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
void addGroupUnderground(bool isNodeGroup, const DataArrayInt *ids, DataArrayInt *famArr);
bool _univ_wr_status;
std::string _desc_name;
MEDCouplingAxisType _axis_type;
- MEDCouplingAutoRefCountObjectPtr<MEDFileJoints> _joints;
- MEDCouplingAutoRefCountObjectPtr<MEDFileEquivalences> _equiv;
+ MCAuto<MEDFileJoints> _joints;
+ MCAuto<MEDFileEquivalences> _equiv;
protected:
std::map<std::string, std::vector<std::string> > _groups;
std::map<std::string,int> _families;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
- MEDLOADER_EXPORT MEDFileMesh *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileMesh *deepCopy() const;
MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
MEDLOADER_EXPORT void clearNonDiscrAttributes() const;
MEDLOADER_EXPORT MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
// serialization
MEDLOADER_EXPORT void serialize(std::vector<double>& tinyDouble, std::vector<int>& tinyInt, std::vector<std::string>& tinyStr,
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI, MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& bigArrayD);
+ std::vector< MCAuto<DataArrayInt> >& bigArraysI, MCAuto<DataArrayDouble>& bigArrayD);
MEDLOADER_EXPORT void unserialize(std::vector<double>& tinyDouble, std::vector<int>& tinyInt, std::vector<std::string>& tinyStr,
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI, MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& bigArrayD);
+ std::vector< MCAuto<DataArrayInt> >& bigArraysI, MCAuto<DataArrayDouble>& bigArrayD);
private:
MEDLOADER_EXPORT ~MEDFileUMesh();
void writeLL(med_idt fid) const;
void computeRevNum() const;
void synchronizeTinyInfoOnLeaves() const;
void changeFamilyIdArr(int oldId, int newId);
- std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > getAllNonNullFamilyIds() const;
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1>& checkAndGiveEntryInSplitL1(int meshDimRelToMax, MEDCouplingPointSet *m);
+ std::list< MCAuto<DataArrayInt> > getAllNonNullFamilyIds() const;
+ MCAuto<MEDFileUMeshSplitL1>& checkAndGiveEntryInSplitL1(int meshDimRelToMax, MEDCouplingPointSet *m);
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> > _ms;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_coords;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_coords;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _name_coords;
- mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num_coords;
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> _part_coords;
+ std::vector< MCAuto<MEDFileUMeshSplitL1> > _ms;
+ MCAuto<DataArrayDouble> _coords;
+ MCAuto<DataArrayInt> _fam_coords;
+ MCAuto<DataArrayInt> _num_coords;
+ MCAuto<DataArrayAsciiChar> _name_coords;
+ mutable MCAuto<DataArrayInt> _rev_num_coords;
+ MCAuto<PartDefinition> _part_coords;
};
class MEDFileStructuredMesh : public MEDFileMesh
protected:
~MEDFileStructuredMesh() { }
void changeFamilyIdArr(int oldId, int newId);
- std::list< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > getAllNonNullFamilyIds() const;
+ std::list< MCAuto<DataArrayInt> > getAllNonNullFamilyIds() const;
void deepCpyAttributes();
void loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
void writeStructuredLL(med_idt fid, const std::string& maa) const;
static med_geometry_type GetGeoTypeFromMeshDim(int meshDim);
private:
static void LoadStrMeshDAFromFile(med_idt fid, int meshDim, int dt, int it, const std::string& mName, MEDFileMeshReadSelector *mrs,
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& famCells, MEDCouplingAutoRefCountObjectPtr<DataArrayInt>& numCells, MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar>& namesCells);
+ MCAuto<DataArrayInt>& famCells, MCAuto<DataArrayInt>& numCells, MCAuto<DataArrayAsciiChar>& namesCells);
private:
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_nodes;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_nodes;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _names_nodes;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_cells;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_cells;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _names_cells;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_faces;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_faces;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _names_faces;
- mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num_nodes;
- mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num_cells;
- mutable MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> _faces_if_necessary;
+ MCAuto<DataArrayInt> _fam_nodes;
+ MCAuto<DataArrayInt> _num_nodes;
+ MCAuto<DataArrayAsciiChar> _names_nodes;
+ MCAuto<DataArrayInt> _fam_cells;
+ MCAuto<DataArrayInt> _num_cells;
+ MCAuto<DataArrayAsciiChar> _names_cells;
+ MCAuto<DataArrayInt> _fam_faces;
+ MCAuto<DataArrayInt> _num_faces;
+ MCAuto<DataArrayAsciiChar> _names_faces;
+ mutable MCAuto<DataArrayInt> _rev_num_nodes;
+ mutable MCAuto<DataArrayInt> _rev_num_cells;
+ mutable MCAuto<MEDCoupling1SGTUMesh> _faces_if_necessary;
};
class MEDFileCMesh : public MEDFileStructuredMesh
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
- MEDLOADER_EXPORT MEDFileMesh *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileMesh *deepCopy() const;
MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
MEDLOADER_EXPORT int getMeshDimension() const;
MEDFileCMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
void loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
private:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> _cmesh;
+ MCAuto<MEDCouplingCMesh> _cmesh;
};
class MEDFileCurveLinearMesh : public MEDFileStructuredMesh
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
- MEDLOADER_EXPORT MEDFileMesh *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileMesh *deepCopy() const;
MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
MEDLOADER_EXPORT int getMeshDimension() const;
void writeLL(med_idt fid) const;
void loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);//to imp
private:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> _clmesh;
+ MCAuto<MEDCouplingCurveLinearMesh> _clmesh;
};
class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable
MEDLOADER_EXPORT static MEDFileMeshMultiTS *New();
MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName);
MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
- MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCopy() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT std::string getName() const;
MEDFileMeshMultiTS(const std::string& fileName);
MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName);
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> > _mesh_one_ts;
+ std::vector< MCAuto<MEDFileMesh> > _mesh_one_ts;
};
class MEDFileMeshesIterator;
public:
MEDLOADER_EXPORT static MEDFileMeshes *New();
MEDLOADER_EXPORT static MEDFileMeshes *New(const std::string& fileName);
- MEDLOADER_EXPORT MEDFileMeshes *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileMeshes *deepCopy() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT std::string simpleRepr() const;
MEDLOADER_EXPORT void destroyMeshAtPos(int i);
private:
~MEDFileMeshes() { }
- void checkCoherency() const;
+ void checkConsistencyLight() const;
void loadFromFile(const std::string& fileName);
MEDFileMeshes();
MEDFileMeshes(const std::string& fileName);
private:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> > _meshes;
+ std::vector< MCAuto<MEDFileMeshMultiTS> > _meshes;
};
class MEDFileMeshesIterator
MEDLOADER_EXPORT ~MEDFileMeshesIterator();
MEDLOADER_EXPORT MEDFileMesh *nextt();
private:
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> _ms;
+ MCAuto<MEDFileMeshes> _ms;
int _iter_id;
int _nb_iter;
};
extern med_geometry_type typmai3[34];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDFileUMeshPerType *MEDFileUMeshPerType::New(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType geoElt2, MEDFileMeshReadSelector *mrs)
{
med_entity_type whichEntity;
if(!isExisting(fid,mName,dt,it,geoElt,whichEntity))
throw INTERP_KERNEL::Exception("MEDFileUMeshPerType::NewPart : The specified geo type is not present in the specified mesh !");
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> ret(new MEDFileUMeshPerType);
+ MCAuto<MEDFileUMeshPerType> ret(new MEDFileUMeshPerType);
ret->loadPart(fid,mName,dt,it,mdim,geoElt,geoElt2,whichEntity,strt,stp,step,mrs);
return ret.retn();
}
{
_m=MEDCoupling1SGTUMesh::New(mName,type);
MEDCoupling1SGTUMesh *mc(dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh *)_m));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
int nbOfNodesPerCell(mc->getNumberOfNodesPerCell());
conn->alloc(nbOfNodesPerCell*curNbOfElem,1);
MEDFILESAFECALLERRD0(MEDmeshElementConnectivityRd,(fid,mName,dt,it,entity,geoElt,MED_NODAL,MED_FULL_INTERLACE,conn->getPointer()));
int nbOfEltsToLoad(DataArray::GetNumberOfItemGivenBES(strt,end,step,"MEDFileUMeshPerType::loadPartStaticType"));
_m=MEDCoupling1SGTUMesh::New(mName,type);
MEDCoupling1SGTUMesh *mc(dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh *)_m));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
int nbOfNodesPerCell(mc->getNumberOfNodesPerCell());
conn->alloc(nbOfNodesPerCell*nbOfEltsToLoad,1);
med_filter filter=MED_FILTER_INIT;
med_bool changement,transformation;
med_int curNbOfElem(MEDmeshnEntity(fid,mName,dt,it,entity,geoElt,MED_INDEX_NODE,MED_NODAL,&changement,&transformation)-1);
_m=MEDCoupling1DGTUMesh::New(mName,geoElt==MED_POLYGON?INTERP_KERNEL::NORM_POLYGON:INTERP_KERNEL::NORM_QPOLYG);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> mc(DynamicCast<MEDCoupling1GTUMesh,MEDCoupling1DGTUMesh>(_m));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
+ MCAuto<MEDCoupling1DGTUMesh> mc(DynamicCast<MEDCoupling1GTUMesh,MEDCoupling1DGTUMesh>(_m));
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
conn->alloc(arraySize,1); connI->alloc(curNbOfElem+1,1);
MEDFILESAFECALLERRD0(MEDmeshPolygon2Rd,(fid,mName,dt,it,MED_CELL,geoElt,MED_NODAL,connI->getPointer(),conn->getPointer()));
std::transform(conn->begin(),conn->end(),conn->getPointer(),std::bind2nd(std::plus<int>(),-1));
med_int indexFaceLgth(MEDmeshnEntity(fid,mName,dt,it,MED_CELL,MED_POLYHEDRON,MED_INDEX_NODE,MED_NODAL,&changement,&transformation));
int curNbOfElem(MEDmeshnEntity(fid,mName,dt,it,MED_CELL,MED_POLYHEDRON,MED_INDEX_FACE,MED_NODAL,&changement,&transformation)-1);
_m=MEDCoupling1DGTUMesh::New(mName,INTERP_KERNEL::NORM_POLYHED);
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> mc(DynamicCastSafe<MEDCoupling1GTUMesh,MEDCoupling1DGTUMesh>(_m));
+ MCAuto<MEDCoupling1DGTUMesh> mc(DynamicCastSafe<MEDCoupling1GTUMesh,MEDCoupling1DGTUMesh>(_m));
INTERP_KERNEL::AutoPtr<int> index=new int[curNbOfElem+1];
INTERP_KERNEL::AutoPtr<int> indexFace=new int[indexFaceLgth];
INTERP_KERNEL::AutoPtr<int> locConn=new int[connFaceLgth];
MEDFILESAFECALLERRD0(MEDmeshPolyhedronRd,(fid,mName,dt,it,MED_CELL,MED_NODAL,index,indexFace,locConn));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
+ MCAuto<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
int arraySize=connFaceLgth;
for(int i=0;i<curNbOfElem;i++)
arraySize+=index[i+1]-index[i]-1;
const MEDCoupling1SGTUMesh *m0(dynamic_cast<const MEDCoupling1SGTUMesh *>(m));
if(!m0)
throw INTERP_KERNEL::Exception("MEDFileUMeshPerType::Write : internal error #1 !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(m0->getNodalConnectivity()->deepCpy());
+ MCAuto<DataArrayInt> arr(m0->getNodalConnectivity()->deepCopy());
std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind2nd(std::plus<int>(),1));
MEDFILESAFECALLERWR0(MEDmeshElementConnectivityWr,(fid,mname.c_str(),dt,it,timm,MED_CELL,curMedType,MED_NODAL,MED_FULL_INTERLACE,nbOfCells,arr->begin()));
}
throw INTERP_KERNEL::Exception("MEDFileUMeshPerType::Write : internal error #2 !");
if(ikt==INTERP_KERNEL::NORM_POLYGON || ikt==INTERP_KERNEL::NORM_QPOLYG)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr(m0->getNodalConnectivity()->deepCpy()),arrI(m0->getNodalConnectivityIndex()->deepCpy());
+ MCAuto<DataArrayInt> arr(m0->getNodalConnectivity()->deepCopy()),arrI(m0->getNodalConnectivityIndex()->deepCopy());
std::transform(arr->begin(),arr->end(),arr->getPointer(),std::bind2nd(std::plus<int>(),1));
std::transform(arrI->begin(),arrI->end(),arrI->getPointer(),std::bind2nd(std::plus<int>(),1));
MEDFILESAFECALLERWR0(MEDmeshPolygon2Wr,(fid,mname.c_str(),dt,it,timm,MED_CELL,ikt==INTERP_KERNEL::NORM_POLYGON?MED_POLYGON:MED_POLYGON2,MED_NODAL,nbOfCells+1,arrI->begin(),arr->begin()));
#include "MEDCouplingMemArray.hxx"
#include "MEDCoupling1GTUMesh.hxx"
#include "MEDCouplingPartDefinition.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "NormalizedUnstructuredMesh.hxx"
#include "med.h"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
class MEDFileMeshReadSelector;
void loadCommonPart(med_idt fid, const char *mName, int dt, int it, int mdim, int curNbOfElem, med_geometry_type geoElt, med_entity_type entity, MEDFileMeshReadSelector *mrs);
void loadPartOfCellCommonPart(med_idt fid, const char *mName, int strt, int stp, int step, int dt, int it, int mdim, int curNbOfElem, med_geometry_type geoElt, med_entity_type entity, MEDFileMeshReadSelector *mrs);
private:
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> _m;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _names;
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> _pd;
+ MCAuto<MEDCoupling1GTUMesh> _m;
+ MCAuto<DataArrayInt> _num;
+ MCAuto<DataArrayInt> _fam;
+ MCAuto<DataArrayAsciiChar> _names;
+ MCAuto<PartDefinition> _pd;
med_entity_type _entity;
};
}
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
extern med_geometry_type typmainoeud[1];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const char MEDFileMeshL2::ZE_SEP_FOR_FAMILY_KILLERS[]="!/__\\!";//important start by - because ord('!')==33 the smallest (!=' ') to preserve orders at most.
return std::vector<const BigMemoryObject *>();
}
-int MEDFileMeshL2::GetMeshIdFromName(med_idt fid, const std::string& mname, ParaMEDMEM::MEDCouplingMeshType& meshType, ParaMEDMEM::MEDCouplingAxisType& axType, int& dt, int& it, std::string& dtunit1)
+int MEDFileMeshL2::GetMeshIdFromName(med_idt fid, const std::string& mname, MEDCoupling::MEDCouplingMeshType& meshType, MEDCoupling::MEDCouplingAxisType& axType, int& dt, int& it, std::string& dtunit1)
{
med_mesh_type type_maillage;
char maillage_description[MED_COMMENT_SIZE+1];
/*!
* non static and non const method because _description, _dt_unit... are set in this method.
*/
-std::vector<std::string> MEDFileMeshL2::getAxisInfoOnMesh(med_idt fid, int mId, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, ParaMEDMEM::MEDCouplingAxisType& axType, int& nstep, int& Mdim)
+std::vector<std::string> MEDFileMeshL2::getAxisInfoOnMesh(med_idt fid, int mId, const std::string& mName, MEDCoupling::MEDCouplingMeshType& meshType, MEDCoupling::MEDCouplingAxisType& axType, int& nstep, int& Mdim)
{
med_mesh_type type_maillage;
med_int spaceDim;
return true;
}
-ParaMEDMEM::MEDCouplingAxisType MEDFileMeshL2::TraduceAxisType(med_axis_type at)
+MEDCoupling::MEDCouplingAxisType MEDFileMeshL2::TraduceAxisType(med_axis_type at)
{
switch(at)
{
}
}
-ParaMEDMEM::MEDCouplingAxisType MEDFileMeshL2::TraduceAxisTypeStruct(med_grid_type gt)
+MEDCoupling::MEDCouplingAxisType MEDFileMeshL2::TraduceAxisTypeStruct(med_grid_type gt)
{
switch(gt)
{
}
}
-med_axis_type MEDFileMeshL2::TraduceAxisTypeRev(ParaMEDMEM::MEDCouplingAxisType at)
+med_axis_type MEDFileMeshL2::TraduceAxisTypeRev(MEDCoupling::MEDCouplingAxisType at)
{
switch(at)
{
}
}
-med_grid_type MEDFileMeshL2::TraduceAxisTypeRevStruct(ParaMEDMEM::MEDCouplingAxisType at)
+med_grid_type MEDFileMeshL2::TraduceAxisTypeRevStruct(MEDCoupling::MEDCouplingAxisType at)
{
switch(at)
{
Mdim=-3;
_name.set(mName.c_str());
int nstep;
- ParaMEDMEM::MEDCouplingMeshType meshType;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingAxisType dummy3;
std::vector<std::string> ret(getAxisInfoOnMesh(fid,mId,mName.c_str(),meshType,dummy3,nstep,Mdim));
if(nstep==0)
{
med_bool changement,transformation;
int nCoords(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation));
std::vector<bool> fetchedNodeIds(nCoords,false);
- 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++)
+ for(std::vector< std::vector< MCAuto<MEDFileUMeshPerType> > >::const_iterator it0=_per_type_mesh.begin();it0!=_per_type_mesh.end();it0++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
(*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;
- 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++)
+ for(std::vector< std::vector< MCAuto<MEDFileUMeshPerType> > >::const_iterator it0=_per_type_mesh.begin();it0!=_per_type_mesh.end();it0++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
(*it1)->getMesh()->renumberNodesWithOffsetInConn(-nMin);
loadPartCoords(fid,mId,infosOnComp,mName,dt,it,nMin,nMax);
}
for(std::size_t ii=0;ii<nbOfTypes;ii++)
{
int strt(slicPerTyp[3*ii+0]),stp(slicPerTyp[3*ii+1]),step(slicPerTyp[3*ii+2]);
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> tmp(MEDFileUMeshPerType::NewPart(fid,mName.c_str(),dt,it,mdim,types[ii],strt,stp,step,mrs));
+ MCAuto<MEDFileUMeshPerType> tmp(MEDFileUMeshPerType::NewPart(fid,mName.c_str(),dt,it,mdim,types[ii],strt,stp,step,mrs));
_per_type_mesh[0].push_back(tmp);
}
sortTypes();
void MEDFileUMeshL2::sortTypes()
{
std::set<int> mdims;
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> > tmp(_per_type_mesh[0]);
+ std::vector< MCAuto<MEDFileUMeshPerType> > tmp(_per_type_mesh[0]);
_per_type_mesh.clear();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >::const_iterator it=tmp.begin();it!=tmp.end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it=tmp.begin();it!=tmp.end();it++)
mdims.insert((*it)->getDim());
if(mdims.empty())
return;
_per_type_mesh.resize(mdim+1);
for(int dim=mdim+1;dim!=0;dim--)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >& elt=_per_type_mesh[mdim+1-dim];
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >::const_iterator it=tmp.begin();it!=tmp.end();it++)
+ std::vector< MCAuto<MEDFileUMeshPerType> >& elt=_per_type_mesh[mdim+1-dim];
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it=tmp.begin();it!=tmp.end();it++)
if((*it)->getDim()==dim-1)
elt.push_back(*it);
}
// suppression of contiguous empty levels at the end of _per_type_mesh.
int nbOfUselessLev=0;
bool isFirst=true;
- for(std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> > >::reverse_iterator it2=_per_type_mesh.rbegin();it2!=_per_type_mesh.rend();it2++)
+ for(std::vector< std::vector< MCAuto<MEDFileUMeshPerType> > >::reverse_iterator it2=_per_type_mesh.rbegin();it2!=_per_type_mesh.rend();it2++)
{
if((*it2).empty() && isFirst)
{
bool MEDFileUMeshL2::isFamDefinedOnLev(int levId) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >::const_iterator it=_per_type_mesh[levId].begin();it!=_per_type_mesh[levId].end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it=_per_type_mesh[levId].begin();it!=_per_type_mesh[levId].end();it++)
if((*it)->getFam()==0)
return false;
return true;
bool MEDFileUMeshL2::isNumDefinedOnLev(int levId) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >::const_iterator it=_per_type_mesh[levId].begin();it!=_per_type_mesh[levId].end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it=_per_type_mesh[levId].begin();it!=_per_type_mesh[levId].end();it++)
if((*it)->getNum()==0)
return false;
return true;
bool MEDFileUMeshL2::isNamesDefinedOnLev(int levId) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >::const_iterator it=_per_type_mesh[levId].begin();it!=_per_type_mesh[levId].end();it++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it=_per_type_mesh[levId].begin();it!=_per_type_mesh[levId].end();it++)
if((*it)->getNames()==0)
return false;
return true;
_name.set(mName.c_str());
int nstep;
int Mdim;
- ParaMEDMEM::MEDCouplingMeshType meshType;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingAxisType dummy3;
std::vector<std::string> infosOnComp=getAxisInfoOnMesh(fid,mId,mName.c_str(),meshType,dummy3,nstep,Mdim);
if(meshType!=CARTESIAN)
throw INTERP_KERNEL::Exception("Invalid mesh type ! You are expected a structured one whereas in file it is not a structured !");
med_data_type dataTypeReq=GetDataTypeCorrespondingToSpaceId(i);
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
int nbOfElt(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,dataTypeReq,MED_NO_CMODE,&chgt,&trsf));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> da=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> da=DataArrayDouble::New();
da->alloc(nbOfElt,1);
da->setInfoOnComponent(0,infosOnComp[i]);
MEDFILESAFECALLERRD0(MEDmeshGridIndexCoordinateRd,(fid,mName.c_str(),dt,it,i+1,da->getPointer()));
_name.set(mName.c_str());
int nstep;
int Mdim;
- ParaMEDMEM::MEDCouplingMeshType meshType;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingAxisType dummy3;
std::vector<std::string> infosOnComp=getAxisInfoOnMesh(fid,mId,mName,meshType,dummy3,nstep,Mdim);
if(meshType!=CURVE_LINEAR)
throw INTERP_KERNEL::Exception("Invalid mesh type ! You are expected a structured one whereas in file it is not a structured !");
_clmesh->setNodeGridStructure(stGrid,((int *)stGrid)+Mdim);
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
int nbNodes(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&chgt,&trsf));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> da=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> da=DataArrayDouble::New();
da->alloc(nbNodes,infosOnComp.size());
da->setInfoOnComponents(infosOnComp);
MEDFILESAFECALLERRD0(MEDmeshNodeCoordinateRd,(fid,mName.c_str(),dt,it,MED_FULL_INTERLACE,da->getPointer()));
if((MEDCouplingUMesh *)_m==0)
{
updateTime();
- _m=static_cast<MEDCouplingUMesh *>(_st->_m_by_types.getUmesh()->deepCpy());
+ _m=static_cast<MEDCouplingUMesh *>(_st->_m_by_types.getUmesh()->deepCopy());
_m->renumberCells(_st->_num->getConstPointer(),true);
return _m.retn();
}
else
{
updateTime();
- _m=static_cast<MEDCouplingUMesh *>(_st->_m_by_types.getUmesh()->deepCpy());
+ _m=static_cast<MEDCouplingUMesh *>(_st->_m_by_types.getUmesh()->deepCopy());
_m->renumberCells(_st->_num->getConstPointer(),true);
return _m.retn();
}
MEDFileUMeshSplitL1::MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const std::string& mName, int id):_m(this)
{
- const std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >& v=l2.getLev(id);
+ const std::vector< MCAuto<MEDFileUMeshPerType> >& v=l2.getLev(id);
if(v.empty())
return;
int sz=v.size();
for(int i=0;i<sz;i++)
{
MEDCoupling1GTUMesh *elt(v[i]->getMesh());
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> tmp2=l2.getCoords();
+ MCAuto<DataArrayDouble> tmp2=l2.getCoords();
elt->setCoords(tmp2);
ms[i]=elt;
pds[i]=v[i]->getPartDef();
MEDFileUMeshSplitL1 *MEDFileUMeshSplitL1::shallowCpyUsingCoords(DataArrayDouble *coords) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> ret(new MEDFileUMeshSplitL1(*this));
+ MCAuto<MEDFileUMeshSplitL1> ret(new MEDFileUMeshSplitL1(*this));
ret->_m_by_types.shallowCpyMeshes();
ret->_m_by_types.setCoords(coords);
return ret.retn();
}
-MEDFileUMeshSplitL1 *MEDFileUMeshSplitL1::deepCpy(DataArrayDouble *coords) const
+MEDFileUMeshSplitL1 *MEDFileUMeshSplitL1::deepCopy(DataArrayDouble *coords) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> ret(new MEDFileUMeshSplitL1(*this));
- ret->_m_by_types=_m_by_types.deepCpy(coords);
+ MCAuto<MEDFileUMeshSplitL1> ret(new MEDFileUMeshSplitL1(*this));
+ ret->_m_by_types=_m_by_types.deepCopy(coords);
if((const DataArrayInt *)_fam)
- ret->_fam=_fam->deepCpy();
+ ret->_fam=_fam->deepCopy();
if((const DataArrayInt *)_num)
- ret->_num=_num->deepCpy();
+ ret->_num=_num->deepCopy();
if((const DataArrayInt *)_rev_num)
- ret->_rev_num=_rev_num->deepCpy();
+ ret->_rev_num=_rev_num->deepCopy();
if((const DataArrayAsciiChar *)_names)
- ret->_names=_names->deepCpy();
+ ret->_names=_names->deepCopy();
return ret.retn();
}
{
m->incrRef();
_m=m;
- _m_by_types.assignUMesh(dynamic_cast<MEDCouplingUMesh *>(m->deepCpy()));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=_m_by_types.getUmesh()->getRenumArrForConsecutiveCellTypesSpec(typmai2,typmai2+MED_N_CELL_FIXED_GEO);
- if(!da->isIdentity2(m->getNumberOfCells()))
+ _m_by_types.assignUMesh(dynamic_cast<MEDCouplingUMesh *>(m->deepCopy()));
+ MCAuto<DataArrayInt> da=_m_by_types.getUmesh()->getRenumArrForConsecutiveCellTypesSpec(typmai2,typmai2+MED_N_CELL_FIXED_GEO);
+ if(!da->isIota(m->getNumberOfCells()))
{
_num=da->invertArrayO2N2N2O(m->getNumberOfCells());
_m.updateTime();
MEDCouplingUMesh *MEDFileUMeshSplitL1::getFamilyPart(const int *idsBg, const int *idsEnd, bool renum) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> eltsToKeep=_fam->getIdsEqualList(idsBg,idsEnd);
+ MCAuto<DataArrayInt> eltsToKeep=_fam->findIdsEqualList(idsBg,idsEnd);
MEDCouplingUMesh *m=(MEDCouplingUMesh *)_m_by_types.getUmesh()->buildPartOfMySelf(eltsToKeep->getConstPointer(),eltsToKeep->getConstPointer()+eltsToKeep->getNumberOfTuples(),true);
if(renum)
return renumIfNeeded(m,eltsToKeep->getConstPointer());
DataArrayInt *MEDFileUMeshSplitL1::getFamilyPartArr(const int *idsBg, const int *idsEnd, bool renum) const
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=_fam->getIdsEqualList(idsBg,idsEnd);
+ MCAuto<DataArrayInt> da=_fam->findIdsEqualList(idsBg,idsEnd);
if(renum)
return renumIfNeededArr(da);
return da.retn();
MEDCouplingUMesh *MEDFileUMeshSplitL1::getWholeMesh(bool renum) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp;
+ MCAuto<MEDCouplingUMesh> tmp;
if(renum && ((const DataArrayInt *)_num))
tmp=_m;
else
return 0;
int start(0),stop(0);
_m_by_types.getStartStopOfGeoTypeWithoutComputation(gt,start,stop);
- return fam->selectByTupleId2(start,stop,1);
+ return fam->selectByTupleIdSafeSlice(start,stop,1);
}
DataArrayInt *MEDFileUMeshSplitL1::extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const
return 0;
int start(0),stop(0);
_m_by_types.getStartStopOfGeoTypeWithoutComputation(gt,start,stop);
- return num->selectByTupleId2(start,stop,1);
+ return num->selectByTupleIdSafeSlice(start,stop,1);
}
DataArrayInt *MEDFileUMeshSplitL1::getOrCreateAndGetFamilyField()
{
std::vector< DataArrayInt * > corr;
_m=MEDCouplingUMesh::FuseUMeshesOnSameCoords(ms,0,corr);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > corrMSafe(corr.begin(),corr.end());
+ std::vector< MCAuto<DataArrayInt> > corrMSafe(corr.begin(),corr.end());
std::vector< std::vector<int> > fidsOfGroups;
std::vector< const DataArrayInt * > corr2(corr.begin(),corr.end());
_fam=DataArrayInt::MakePartition(corr2,((MEDCouplingUMesh *)_m)->getNumberOfCells(),fidsOfGroups);
{
int nbCells=(*it)->getNumberOfCells();
int end=start+nbCells;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fam,num;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> names;
+ MCAuto<DataArrayInt> fam,num;
+ MCAuto<DataArrayAsciiChar> names;
if((const DataArrayInt *)_fam)
- fam=_fam->substr(start,end);
+ fam=_fam->subArray(start,end);
if((const DataArrayInt *)_num)
- num=_num->substr(start,end);
+ num=_num->subArray(start,end);
if((const DataArrayAsciiChar *)_names)
- names=static_cast<DataArrayAsciiChar *>(_names->substr(start,end));
+ names=static_cast<DataArrayAsciiChar *>(_names->subArray(start,end));
MEDFileUMeshPerType::Write(fid,mName,mdim,(*it),fam,num,names);
start=end;
}
_m_by_types.renumberNodesInConnWithoutComputation(newNodeNumbersO2N);
}
-void MEDFileUMeshSplitL1::serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const
+void MEDFileUMeshSplitL1::serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const
{
bigArraysI.push_back(_fam);
bigArraysI.push_back(_num);
_m_by_types.serialize(tinyInt,bigArraysI);
}
-void MEDFileUMeshSplitL1::unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI)
+void MEDFileUMeshSplitL1::unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI)
{
_fam=bigArraysI.back(); bigArraysI.pop_back();
_num=bigArraysI.back(); bigArraysI.pop_back();
m->renumberCells(renum->getConstPointer(),true);
else
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> locnum=renum->selectByTupleId(cellIds,cellIds+m->getNumberOfCells());
+ MCAuto<DataArrayInt> locnum=renum->selectByTupleId(cellIds,cellIds+m->getNumberOfCells());
m->renumberCells(locnum->getConstPointer(),true);
}
return m;
}
-MEDFileUMeshSplitL1 *MEDFileUMeshSplitL1::Unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI)
+MEDFileUMeshSplitL1 *MEDFileUMeshSplitL1::Unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> ret(new MEDFileUMeshSplitL1);
+ MCAuto<MEDFileUMeshSplitL1> ret(new MEDFileUMeshSplitL1);
ret->unserialize(name,coo,tinyInt,bigArraysI);
return ret.retn();
}
}
if(_mp_time>=_m_time)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
MEDCoupling1GTUMesh *tmp(*it);
if(tmp)
void MEDFileUMeshAggregateCompute::assignParts(const std::vector< const MEDCoupling1GTUMesh * >& mParts)
{
std::size_t sz(mParts.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> > ret(sz);
+ std::vector< MCAuto<MEDCoupling1GTUMesh> > ret(sz);
for(std::size_t i=0;i<sz;i++)
{
const MEDCoupling1GTUMesh *elt(mParts[i]);
if(_mp_time<=_m_time)
return _m->getNumberOfCells();
int ret(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
ret+=(*it)->getNumberOfCells();
return ret;
}
{
if(_mp_time>=_m_time)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
const MEDCoupling1GTUMesh *elt(*it);
if(elt && elt->getCellModelEnum()==ct)
//
std::vector<MEDCoupling1GTUMesh *> ret(_m_parts.size());
std::size_t i(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++,i++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++,i++)
{
const MEDCoupling1GTUMesh *elt(*it);
ret[i]=const_cast<MEDCoupling1GTUMesh *>(elt);
{
if(_mp_time>_m_time)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
MEDCoupling1GTUMesh *m(*it);
if(m)
return ;// no needs to compte parts they are already here !
}
std::vector<MEDCouplingUMesh *> ms(m->splitByType());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> > msMSafe(ms.begin(),ms.end());
+ std::vector< MCAuto<MEDCouplingUMesh> > msMSafe(ms.begin(),ms.end());
std::size_t sz(msMSafe.size());
_m_parts.resize(sz);
for(std::size_t i=0;i<sz;i++)
throw INTERP_KERNEL::Exception("MEDFileUMeshAggregateCompute::getPartDefOfWithoutComputation : The input geo type is not existing in this !");
}
-void MEDFileUMeshAggregateCompute::serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const
+void MEDFileUMeshAggregateCompute::serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const
{
if(_mp_time<_m_time)
throw INTERP_KERNEL::Exception("MEDFileUMeshAggregateCompute::serialize : the parts require a computation !");
DataArrayInt *elt(mesh1->getNodalConnectivity());
if(elt)
elt->incrRef();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elt1(elt);
+ MCAuto<DataArrayInt> elt1(elt);
bigArraysI.push_back(elt1);
}
else if(mesh2)
elt1->incrRef();
if(elt2)
elt2->incrRef();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elt11(elt1),elt22(elt2);
+ MCAuto<DataArrayInt> elt11(elt1),elt22(elt2);
bigArraysI.push_back(elt11); bigArraysI.push_back(elt22);
}
else
}
}
-void MEDFileUMeshAggregateCompute::unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI)
+void MEDFileUMeshAggregateCompute::unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI)
{
int nbParts(tinyInt.back()); tinyInt.pop_back();
_part_def.clear(); _part_def.resize(nbParts);
for(int i=0;i<nbParts;i++)
{
INTERP_KERNEL::NormalizedCellType tp((INTERP_KERNEL::NormalizedCellType) tinyInt.back()); tinyInt.pop_back();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> mesh(MEDCoupling1GTUMesh::New(name,tp));
+ MCAuto<MEDCoupling1GTUMesh> mesh(MEDCoupling1GTUMesh::New(name,tp));
mesh->setCoords(coo);
MEDCoupling1SGTUMesh *mesh1(dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh *) mesh));
MEDCoupling1DGTUMesh *mesh2(dynamic_cast<MEDCoupling1DGTUMesh *>((MEDCoupling1GTUMesh *) mesh));
}
else if(mesh2)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elt0,elt1;
+ MCAuto<DataArrayInt> elt0,elt1;
elt0=bigArraysI.back(); bigArraysI.pop_back();
elt1=bigArraysI.back(); bigArraysI.pop_back();
mesh2->setNodalConnectivity(elt0,elt1);
std::size_t MEDFileUMeshAggregateCompute::getTimeOfParts() const
{
std::size_t ret(0);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
const MEDCoupling1GTUMesh *elt(*it);
if(!elt)
std::size_t MEDFileUMeshAggregateCompute::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret(_m_parts.size()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh>));
+ std::size_t ret(_m_parts.size()*sizeof(MCAuto<MEDCoupling1GTUMesh>));
return ret;
}
std::vector<const BigMemoryObject *> MEDFileUMeshAggregateCompute::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
ret.push_back((const MEDCoupling1GTUMesh *)*it);
ret.push_back((const MEDCouplingUMesh *)_m);
return ret;
}
-MEDFileUMeshAggregateCompute MEDFileUMeshAggregateCompute::deepCpy(DataArrayDouble *coords) const
+MEDFileUMeshAggregateCompute MEDFileUMeshAggregateCompute::deepCopy(DataArrayDouble *coords) const
{
MEDFileUMeshAggregateCompute ret;
ret._m_parts.resize(_m_parts.size());
const MEDCoupling1GTUMesh *elt(_m_parts[i]);
if(elt)
{
- ret._m_parts[i]=static_cast<ParaMEDMEM::MEDCoupling1GTUMesh*>(elt->deepCpy());
+ ret._m_parts[i]=static_cast<MEDCoupling::MEDCoupling1GTUMesh*>(elt->deepCopy());
ret._m_parts[i]->setCoords(coords);
}
}
ret._mp_time=_mp_time; ret._m_time=_m_time;
if((const MEDCouplingUMesh *)_m)
{
- ret._m=static_cast<ParaMEDMEM::MEDCouplingUMesh*>(_m->deepCpy());
+ ret._m=static_cast<MEDCoupling::MEDCouplingUMesh*>(_m->deepCopy());
ret._m->setCoords(coords);
}
std::size_t sz(_part_def.size());
{
const PartDefinition *elt(_part_def[i]);
if(elt)
- ret._part_def[i]=elt->deepCpy();
+ ret._part_def[i]=elt->deepCopy();
}
return ret;
}
void MEDFileUMeshAggregateCompute::shallowCpyMeshes()
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
const MEDCoupling1GTUMesh *elt(*it);
if(elt)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> elt2(elt->clone(false));
+ MCAuto<MEDCouplingMesh> elt2(elt->clone(false));
*it=DynamicCastSafe<MEDCouplingMesh,MEDCoupling1GTUMesh>(elt2);
}
}
void MEDFileUMeshAggregateCompute::clearNonDiscrAttributes() const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
MEDFileUMeshSplitL1::ClearNonDiscrAttributes(*it);
MEDFileUMeshSplitL1::ClearNonDiscrAttributes(_m);
}
void MEDFileUMeshAggregateCompute::synchronizeTinyInfo(const MEDFileMesh& master) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
const MEDCoupling1GTUMesh *tmp(*it);
if(tmp)
else
{
std::vector<int> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
const MEDCoupling1GTUMesh *tmp(*it);
if(!tmp)
else
{
int ret=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
const MEDCoupling1GTUMesh *m(*it);
if(!m)
void MEDFileUMeshAggregateCompute::setCoords(DataArrayDouble *coords)
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ for(std::vector< MCAuto<MEDCoupling1GTUMesh> >::iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
MEDCoupling1GTUMesh *tmp(*it);
if(tmp)
#include "MEDCoupling1GTUMesh.hxx"
#include "MEDCouplingPartDefinition.hxx"
#include "MEDCouplingCurveLinearMesh.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "med.h"
#include <map>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileMeshReadSelector;
int getIteration() const { return _iteration; }
int getOrder() const { return _order; }
double getTime() const { return _time; }
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> getPartDefOfCoo() const { return _part_coords; }
- std::vector<std::string> getAxisInfoOnMesh(med_idt fid, int mId, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, ParaMEDMEM::MEDCouplingAxisType& axType, int& nstep, int& Mdim);
- static int GetMeshIdFromName(med_idt fid, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, ParaMEDMEM::MEDCouplingAxisType& axType, int& dt, int& it, std::string& dtunit1);
+ MCAuto<PartDefinition> getPartDefOfCoo() const { return _part_coords; }
+ std::vector<std::string> getAxisInfoOnMesh(med_idt fid, int mId, const std::string& mName, MEDCoupling::MEDCouplingMeshType& meshType, MEDCoupling::MEDCouplingAxisType& axType, int& nstep, int& Mdim);
+ static int GetMeshIdFromName(med_idt fid, const std::string& mName, MEDCoupling::MEDCouplingMeshType& meshType, MEDCoupling::MEDCouplingAxisType& axType, int& dt, int& it, std::string& dtunit1);
static double CheckMeshTimeStep(med_idt fid, const std::string& mname, int nstep, int dt, int it);
static void ReadFamiliesAndGrps(med_idt fid, const std::string& mname, std::map<std::string,int>& fams, std::map<std::string, std::vector<std::string> >& grps, MEDFileMeshReadSelector *mrs);
static void WriteFamiliesAndGrps(med_idt fid, const std::string& mname, const std::map<std::string,int>& fams, const std::map<std::string, std::vector<std::string> >& grps, int tooLongStrPol);
static bool RenameFamiliesFromFileToMem(std::vector< std::string >& famNames);
static bool RenameFamiliesFromMemToFile(std::vector< std::string >& famNames);
- static ParaMEDMEM::MEDCouplingAxisType TraduceAxisType(med_axis_type at);
- static ParaMEDMEM::MEDCouplingAxisType TraduceAxisTypeStruct(med_grid_type gt);
- static med_axis_type TraduceAxisTypeRev(ParaMEDMEM::MEDCouplingAxisType at);
- static med_grid_type TraduceAxisTypeRevStruct(ParaMEDMEM::MEDCouplingAxisType at);
+ static MEDCoupling::MEDCouplingAxisType TraduceAxisType(med_axis_type at);
+ static MEDCoupling::MEDCouplingAxisType TraduceAxisTypeStruct(med_grid_type gt);
+ static med_axis_type TraduceAxisTypeRev(MEDCoupling::MEDCouplingAxisType at);
+ static med_grid_type TraduceAxisTypeRevStruct(MEDCoupling::MEDCouplingAxisType at);
private:
typedef bool (*RenameFamiliesPatternFunc)(std::vector< std::string >&);
static void RenameFamiliesPatternInternal(std::vector< std::pair<std::string,std::pair<int,std::vector<std::string> > > >& crudeFams, RenameFamiliesPatternFunc func);
int _iteration;
int _order;
double _time;
- MEDCouplingAutoRefCountObjectPtr<PartDefinition> _part_coords;
+ MCAuto<PartDefinition> _part_coords;
};
class MEDFileUMeshL2 : public MEDFileMeshL2
void loadPartCoords(med_idt fid, int mId, const std::vector<std::string>& infosOnComp, const std::string& mName, int dt, int it, int nMin, int nMax);
int getNumberOfLevels() const { return _per_type_mesh.size(); }
bool emptyLev(int levId) const { return _per_type_mesh[levId].empty(); }
- const std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> >& getLev(int levId) const { return _per_type_mesh[levId]; }
+ const std::vector< MCAuto<MEDFileUMeshPerType> >& getLev(int levId) const { return _per_type_mesh[levId]; }
bool isFamDefinedOnLev(int levId) const;
bool isNumDefinedOnLev(int levId) const;
bool isNamesDefinedOnLev(int levId) const;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> getCoords() const { return _coords; }
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> getCoordsFamily() const { return _fam_coords; }
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> getCoordsNum() const { return _num_coords; }
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> getCoordsName() const { return _name_coords; }
+ MCAuto<DataArrayDouble> getCoords() const { return _coords; }
+ MCAuto<DataArrayInt> getCoordsFamily() const { return _fam_coords; }
+ MCAuto<DataArrayInt> getCoordsNum() const { return _num_coords; }
+ MCAuto<DataArrayAsciiChar> getCoordsName() const { return _name_coords; }
static void WriteCoords(med_idt fid, const std::string& mname, int dt, int it, double time, const DataArrayDouble *coords, const DataArrayInt *famCoords, const DataArrayInt *numCoords, const DataArrayAsciiChar *nameCoords);
private:
void sortTypes();
private:
- std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshPerType> > > _per_type_mesh;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam_coords;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_coords;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _name_coords;
+ std::vector< std::vector< MCAuto<MEDFileUMeshPerType> > > _per_type_mesh;
+ MCAuto<DataArrayDouble> _coords;
+ MCAuto<DataArrayInt> _fam_coords;
+ MCAuto<DataArrayInt> _num_coords;
+ MCAuto<DataArrayAsciiChar> _name_coords;
};
class MEDFileStrMeshL2 : public MEDFileMeshL2
MEDFileCMeshL2();
void loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it);
MEDCouplingCMesh *getMesh() { return _cmesh; }
- ParaMEDMEM::MEDCouplingAxisType getAxType() const { return _ax_type; }
+ MEDCoupling::MEDCouplingAxisType getAxisType() const { return _ax_type; }
private:
static med_data_type GetDataTypeCorrespondingToSpaceId(int id);
private:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCMesh> _cmesh;
- ParaMEDMEM::MEDCouplingAxisType _ax_type;
+ MCAuto<MEDCouplingCMesh> _cmesh;
+ MEDCoupling::MEDCouplingAxisType _ax_type;
};
class MEDFileCLMeshL2 : public MEDFileStrMeshL2
void loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it);
MEDCouplingCurveLinearMesh *getMesh() { return _clmesh; }
private:
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingCurveLinearMesh> _clmesh;
+ MCAuto<MEDCouplingCurveLinearMesh> _clmesh;
};
class MEDFileMesh;
const MEDFileUMeshSplitL1 *_st;
mutable std::size_t _mpt_time;
mutable std::size_t _num_time;
- mutable MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> _m;
+ mutable MCAuto<MEDCouplingUMesh> _m;
};
class MEDFileUMeshAggregateCompute : public BigMemoryObject
std::size_t getTimeOfThis() const;
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileUMeshAggregateCompute deepCpy(DataArrayDouble *coords) const;
+ MEDFileUMeshAggregateCompute deepCopy(DataArrayDouble *coords) const;
void shallowCpyMeshes();
bool isEqual(const MEDFileUMeshAggregateCompute& other, double eps, std::string& what) const;
void clearNonDiscrAttributes() const;
void setCoords(DataArrayDouble *coords);
void forceComputationOfPartsFromUMesh() const;
const PartDefinition *getPartDefOfWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const;
- void serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const;
- void unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI);
+ void serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const;
+ void unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI);
private:
std::size_t getTimeOfParts() const;
std::size_t getTimeOfUMesh() const;
private:
- mutable std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> > _m_parts;
+ mutable std::vector< MCAuto<MEDCoupling1GTUMesh> > _m_parts;
mutable std::size_t _mp_time;
mutable std::size_t _m_time;
- mutable MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> _m;
- mutable std::vector< MEDCouplingAutoRefCountObjectPtr<PartDefinition> > _part_def;
+ mutable MCAuto<MEDCouplingUMesh> _m;
+ mutable std::vector< MCAuto<PartDefinition> > _part_def;
};
class MEDFileUMeshSplitL1 : public RefCountObject
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileUMeshSplitL1 *shallowCpyUsingCoords(DataArrayDouble *coords) const;
- MEDFileUMeshSplitL1 *deepCpy(DataArrayDouble *coords) const;
+ MEDFileUMeshSplitL1 *deepCopy(DataArrayDouble *coords) const;
void setCoords(DataArrayDouble *coords);
bool isEqual(const MEDFileUMeshSplitL1 *other, double eps, std::string& what) const;
void clearNonDiscrAttributes() const;
//
void renumberNodesInConn(const int *newNodeNumbersO2N);
//
- void serialize(std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI) const;
- void unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI);
+ void serialize(std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI) const;
+ void unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI);
//
static void ClearNonDiscrAttributes(const MEDCouplingMesh *tmp);
static std::vector<int> GetNewFamiliesNumber(int nb, const std::map<std::string,int>& families);
std::map<int,int>& famIdTrad, std::map<int,std::string>& newfams);
static DataArrayInt *Renumber(const DataArrayInt *renum, const DataArrayInt *da);
static MEDCouplingUMesh *Renumber2(const DataArrayInt *renum, MEDCouplingUMesh *m, const int *cellIds);
- static MEDFileUMeshSplitL1 *Unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI);
+ static MEDFileUMeshSplitL1 *Unserialize(const std::string& name, DataArrayDouble *coo, std::vector<int>& tinyInt, std::vector< MCAuto<DataArrayInt> >& bigArraysI);
private:
MEDFileUMeshSplitL1();
void assignCommonPart();
void computeRevNum() const;
private:
MEDFileUMeshAggregateCompute _m_by_types;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _fam;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num;
- MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _names;
- mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num;
+ MCAuto<DataArrayInt> _fam;
+ MCAuto<DataArrayInt> _num;
+ MCAuto<DataArrayAsciiChar> _names;
+ mutable MCAuto<DataArrayInt> _rev_num;
MEDFileUMeshPermCompute _m;
};
}
#include "MEDFileMeshReadSelector.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDFileMeshReadSelector::MEDFileMeshReadSelector():_code(0xFFFFFFFF)
{
#include <sstream>
#include <string>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDLOADER_EXPORT MEDFileMeshReadSelector
{
#include <set>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDFileParameter1TS::MEDFileParameter1TS(int iteration, int order, double time):_iteration(iteration),_order(order),_time(time)
{
return true;
}
-MEDFileParameter1TS *MEDFileParameterDouble1TSWTI::deepCpy() const
+MEDFileParameter1TS *MEDFileParameterDouble1TSWTI::deepCopy() const
{
return new MEDFileParameterDouble1TSWTI(*this);
}
return true;
}
-MEDFileParameter1TS *MEDFileParameterDouble1TS::deepCpy() const
+MEDFileParameter1TS *MEDFileParameterDouble1TS::deepCopy() const
{
return new MEDFileParameterDouble1TS(*this);
}
{
const MEDFileParameter1TS *elt=_param_per_ts[i];
if(elt)
- _param_per_ts[i]=elt->deepCpy();
+ _param_per_ts[i]=elt->deepCopy();
}
}
std::size_t MEDFileParameterMultiTS::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDFileParameterMultiTS));
- ret+=sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS>)*_param_per_ts.capacity();
+ ret+=sizeof(MCAuto<MEDFileParameter1TS>)*_param_per_ts.capacity();
return ret;
}
std::vector<const BigMemoryObject *> MEDFileParameterMultiTS::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
ret.push_back((const MEDFileParameter1TS *)*it);
return ret;
}
-MEDFileParameterMultiTS *MEDFileParameterMultiTS::deepCpy() const
+MEDFileParameterMultiTS *MEDFileParameterMultiTS::deepCopy() const
{
return new MEDFileParameterMultiTS(*this,true);
}
void MEDFileParameterMultiTS::writeLL(med_idt fid, const MEDFileWritable& mw) const
{
std::set<med_parameter_type> diffType;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
{
const MEDFileParameter1TS *elt(*it);
if(dynamic_cast<const MEDFileParameterDouble1TSWTI *>(elt))
return;
med_parameter_type typ=*diffType.begin();
MEDFileParameterTinyInfo::writeLLHeader(fid,typ);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
{
const MEDFileParameter1TS *elt(*it);
if(elt)
void MEDFileParameterMultiTS::simpleRepr2(int bkOffset, std::ostream& oss) const
{
MEDFileParameterTinyInfo::mainRepr(bkOffset,oss);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
{
const MEDFileParameter1TS *elt(*it);
if(elt)
void MEDFileParameterMultiTS::appendValue(int dt, int it, double time, double val)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileParameterDouble1TSWTI> elt=MEDFileParameterDouble1TSWTI::New(dt,it,time);
+ MCAuto<MEDFileParameterDouble1TSWTI> elt=MEDFileParameterDouble1TSWTI::New(dt,it,time);
elt->setValue(val);
- MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> elt2((MEDFileParameterDouble1TSWTI*)elt); elt2->incrRef();
+ MCAuto<MEDFileParameter1TS> elt2((MEDFileParameterDouble1TSWTI*)elt); elt2->incrRef();
_param_per_ts.push_back(elt2);
}
{
int ret=0;
std::ostringstream oss; oss << "MEDFileParameterMultiTS::getPosOfTimeStep : no such iteration=" << iteration << " order=" << order << " ! Possibilities are :";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++,ret++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++,ret++)
{
const MEDFileParameter1TS *elt(*it);
if(elt)
{
int ret=0;
std::ostringstream oss; oss << "MEDFileParameterMultiTS::getPosGivenTime : no such time=" << time << " ! Possibilities are :";
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++,ret++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++,ret++)
{
const MEDFileParameter1TS *elt(*it);
if(elt)
std::ostringstream oss; oss << "MEDFileParameterMultiTS::eraseTimeStepIds : At pos #" << std::distance(startIds,w) << " value is " << *w << " should be in [0," << len << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str());
}
std::size_t newNb=std::count(b.begin(),b.end(),true);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> > paramPerTs(newNb);
+ std::vector< MCAuto<MEDFileParameter1TS> > paramPerTs(newNb);
std::size_t j=0;
for(std::size_t i=0;i<_param_per_ts.size();i++)
if(b[i])
std::vector< std::pair<int,int> > MEDFileParameterMultiTS::getIterations() const
{
std::vector< std::pair<int,int> > ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
{
const MEDFileParameter1TS *elt(*it);
if(elt)
{
std::vector< std::pair<int,int> > ret0;
ret1.clear();
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
+ for(std::vector< MCAuto<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
{
const MEDFileParameter1TS *elt(*it);
if(elt)
std::size_t MEDFileParameters::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(sizeof(MEDFileParameters));
- ret+=sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS>)*_params.capacity();
+ ret+=sizeof(MCAuto<MEDFileParameterMultiTS>)*_params.capacity();
return ret;
}
std::vector<const BigMemoryObject *> MEDFileParameters::getDirectChildrenWithNull() const
{
std::vector<const BigMemoryObject *> ret;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
+ for(std::vector< MCAuto<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
ret.push_back((const MEDFileParameterMultiTS *)*it);
return ret;
}
-MEDFileParameters *MEDFileParameters::deepCpy() const
+MEDFileParameters *MEDFileParameters::deepCopy() const
{
return new MEDFileParameters(*this,true);
}
{
const MEDFileParameterMultiTS *elt=_params[i];
if(elt)
- _params[i]=elt->deepCpy();
+ _params[i]=elt->deepCopy();
}
}
void MEDFileParameters::writeLL(med_idt fid) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
+ for(std::vector< MCAuto<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
{
const MEDFileParameterMultiTS *elt(*it);
if(elt)
{
std::vector<std::string> ret(_params.size());
int i=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++,i++)
+ for(std::vector< MCAuto<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++,i++)
{
const MEDFileParameterMultiTS *p=(*it);
if(p)
void MEDFileParameters::simpleReprWithoutHeader(std::ostream& oss) const
{
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
+ for(std::vector< MCAuto<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
{
const MEDFileParameterMultiTS *elt(*it);
if(elt)
{
if(param)
param->incrRef();
- MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> elt(param);
+ MCAuto<MEDFileParameterMultiTS> elt(param);
_params.push_back(elt);
}
_params.resize(i+1);
if(param)
param->incrRef();
- MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> elt(param);
+ MCAuto<MEDFileParameterMultiTS> elt(param);
_params[i]=elt;
}
std::ostringstream oss; oss << "MEDFileParameters::destroyParamAtPos : should be in [0," << _params.size() << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- _params[i]=MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS>(0);
+ _params[i]=MCAuto<MEDFileParameterMultiTS>(0);
}
int MEDFileParameters::getPosFromParamName(const std::string& paramName) const
{
std::ostringstream oss; oss << "MEDFileParameters::getPosFromParamName : no such name=" << paramName << " ! Possibilities are :";
int ret=0;
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++,ret++)
+ for(std::vector< MCAuto<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++,ret++)
{
const MEDFileParameterMultiTS *elt(*it);
if(elt)
#include "MEDLoaderDefines.hxx"
#include "MEDFileUtilities.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileParameter1TS : public RefCountObject
{
public:
- MEDLOADER_EXPORT virtual MEDFileParameter1TS *deepCpy() const = 0;
+ MEDLOADER_EXPORT virtual MEDFileParameter1TS *deepCopy() const = 0;
MEDLOADER_EXPORT virtual bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
MEDLOADER_EXPORT virtual void simpleRepr2(int bkOffset, std::ostream& oss) const = 0;
MEDLOADER_EXPORT virtual void readValue(med_idt fid, const std::string& name) = 0;
{
public:
MEDLOADER_EXPORT static MEDFileParameterDouble1TSWTI *New(int iteration, int order, double time);
- MEDLOADER_EXPORT MEDFileParameter1TS *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileParameter1TS *deepCopy() const;
MEDLOADER_EXPORT void setValue(double val) { _arr=val; }
MEDLOADER_EXPORT double getValue() const { return _arr; }
MEDLOADER_EXPORT bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName);
MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName);
MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it);
- MEDLOADER_EXPORT virtual MEDFileParameter1TS *deepCpy() const;
+ MEDLOADER_EXPORT virtual MEDFileParameter1TS *deepCopy() const;
MEDLOADER_EXPORT virtual bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
MEDLOADER_EXPORT virtual std::string simpleRepr() const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT void setName(const std::string& name) { _name=name; }
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT MEDFileParameterMultiTS *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileParameterMultiTS *deepCopy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileParameterMultiTS *other, double eps, std::string& what) const;
MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& mw) const;
MEDFileParameterMultiTS(const std::string& fileName, const std::string& paramName);
void finishLoading(med_idt fid, med_parameter_type typ, int nbOfSteps);
protected:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> > _param_per_ts;
+ std::vector< MCAuto<MEDFileParameter1TS> > _param_per_ts;
};
class MEDFileParameters : public RefCountObject, public MEDFileWritable
MEDLOADER_EXPORT static MEDFileParameters *New(const std::string& fileName);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDLOADER_EXPORT MEDFileParameters *deepCpy() const;
+ MEDLOADER_EXPORT MEDFileParameters *deepCopy() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileParameters *other, double eps, std::string& what) const;
MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDFileParameters(const MEDFileParameters& other, bool deepCopy);
MEDFileParameters();
protected:
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> > _params;
+ std::vector< MCAuto<MEDFileParameterMultiTS> > _params;
};
}
MEDfileClose(_fid);
}
-ParaMEDMEM::MEDFileWritable::MEDFileWritable():_too_long_str(0),_zipconn_pol(2)
+MEDCoupling::MEDFileWritable::MEDFileWritable():_too_long_str(0),_zipconn_pol(2)
{
}
-void ParaMEDMEM::MEDFileWritable::copyOptionsFrom(const MEDFileWritable& other) const
+void MEDCoupling::MEDFileWritable::copyOptionsFrom(const MEDFileWritable& other) const
{
_too_long_str=other._too_long_str;
_zipconn_pol=other._zipconn_pol;
}
-int ParaMEDMEM::MEDFileWritable::getTooLongStrPolicy() const
+int MEDCoupling::MEDFileWritable::getTooLongStrPolicy() const
{
return _too_long_str;
}
-void ParaMEDMEM::MEDFileWritable::setTooLongStrPolicy(int newVal)
+void MEDCoupling::MEDFileWritable::setTooLongStrPolicy(int newVal)
{
if(newVal!=2 && newVal!=1 && newVal!=0)
throw INTERP_KERNEL::Exception("MEDFileWritable::setTooLongStrPolicy : invalid policy should be in 0,1 or 2 !");
_too_long_str=newVal;
}
-int ParaMEDMEM::MEDFileWritable::getZipConnPolicy()
+int MEDCoupling::MEDFileWritable::getZipConnPolicy()
{
return _zipconn_pol;
}
-void ParaMEDMEM::MEDFileWritable::setZipConnPolicy(int newVal)
+void MEDCoupling::MEDFileWritable::setZipConnPolicy(int newVal)
{
_zipconn_pol=newVal;
}
};
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDLOADER_EXPORT MEDFileWritable
{
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingGaussLocalization.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelAutoPtr.hxx"
#include <iterator>
#include <algorithm>
-/*! \class MEDLoader
- *
- * \brief Static class offering the "basic" API to read and write MED files/
- *
- * This class implements only static methods and offers the high level API to access MED files.
- * Take a look at \ref medloader for more details.
- *
- */
med_geometry_type typmai[MED_N_CELL_FIXED_GEO] = { MED_POINT1,
MED_SEG2,
MED_NONE//33
};
-double MEDLoader::_EPS_FOR_NODE_COMP=1.e-12;
+double _EPS_FOR_NODE_COMP=1.e-12;
-int MEDLoader::_COMP_FOR_CELL=0;
+int _COMP_FOR_CELL=0;
-int MEDLoader::_TOO_LONG_STR=0;
+int _TOO_LONG_STR=0;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/// @cond INTERNAL
{
int readUMeshDimFromFile(const std::string& fileName, const std::string& meshName, std::vector<int>& possibilities);
void dispatchElems(int nbOfElemCell, int nbOfElemFace, int& nbOfElem, med_entity_type& whichEntity);
- void writeFieldWithoutReadingAndMappingOfMeshInFile(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
+ void writeFieldWithoutReadingAndMappingOfMeshInFile(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch);
med_int getIdFromMeshName(med_idt fid, const std::string& meshName, std::string& trueMeshName);
std::vector<std::string> getMeshNamesFid(med_idt fid);
}
/// @endcond
-void MEDLoader::AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj)
+void MEDCoupling::AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj)
{
obj.setTooLongStrPolicy(_TOO_LONG_STR);
}
-bool MEDLoader::HasXDR()
+bool MEDCoupling::HasXDR()
{
#ifdef HAS_XDR
return true;
#endif
}
-std::string MEDLoader::MEDFileVersionStr()
+std::string MEDCoupling::MEDFileVersionStr()
{
return std::string(MED_VERSION_STR);
}
-void MEDLoader::MEDFileVersion(int& major, int& minor, int& release)
+void MEDCoupling::MEDFileVersion(int& major, int& minor, int& release)
{
major=MED_NUM_MAJEUR;
minor=MED_NUM_MINEUR;
/*!
* This method sets the epsilon value used for node comparison when trying to buid a profile for a field on node/cell on an already written mesh.
*/
-void MEDLoader::SetEpsilonForNodeComp(double val)
+void MEDCoupling::SetEpsilonForNodeComp(double val)
{
_EPS_FOR_NODE_COMP=val;
}
/*!
* This method sets the policy comparison when trying to fit the already written mesh on a field. The semantic of the policy is specified in MEDCouplingUMesh::zipConnectivityTraducer.
*/
-void MEDLoader::SetCompPolicyForCell(int val)
+void MEDCoupling::SetCompPolicyForCell(int val)
{
_COMP_FOR_CELL=val;
}
* This method set the behaviour of MEDLoader when a too long string is seen in datastructure before copy it in MED file.
* By default (0) an exception is thrown. If equal to 1 a warning is emitted in std_err but no exception is thrown.
*/
-void MEDLoader::SetTooLongStrPolicy(int val)
+void MEDCoupling::SetTooLongStrPolicy(int val)
{
_TOO_LONG_STR=val;
}
* - the space dimension
* - the number of nodes
*/
-std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > MEDLoader::GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes)
+std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > MEDCoupling::GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes)
{
CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,meshId,nommaa,&spaceDim,&meshDim,&type_maillage,maillage_description,dt_unit,&sortingType,&nstep,&axisType,axisname,axisunit));
if(type_maillage!=MED_UNSTRUCTURED_MESH)
{
- std::ostringstream oss; oss << "MEDLoader::GetUMeshGlobalInfo : Mesh \""<< meshName << "\" in file \"" << fileName;
+ std::ostringstream oss; oss << "GetUMeshGlobalInfo : Mesh \""<< meshName << "\" in file \"" << fileName;
oss << "\" exists but it is not an unstructured mesh ! This method is not relevant for mesh types that are not unstructured !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
// limitation
if(nstep!=1)
- throw INTERP_KERNEL::Exception("MEDLoader::GetUMeshGlobalInfo : multisteps on mesh not managed !");
+ throw INTERP_KERNEL::Exception("GetUMeshGlobalInfo : multisteps on mesh not managed !");
med_int numdt,numit;
med_float dt;
MEDFILESAFECALLERRD0(MEDmeshComputationStepInfo,(fid,nommaa,1,&numdt,&numit,&dt));
return ret;
}
-void MEDLoader::CheckFileForRead(const std::string& fileName)
+void MEDCoupling::CheckFileForRead(const std::string& fileName)
{
MEDFileUtilities::CheckFileForRead(fileName);
}
-std::vector<std::string> MEDLoader::GetMeshNames(const std::string& fileName)
+std::vector<std::string> MEDCoupling::GetMeshNames(const std::string& fileName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
std::vector<std::string> ret=MEDLoaderNS::getMeshNamesFid(fid);
return ret;
}
-std::vector< std::pair<std::string,std::string> > MEDLoader::GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName)
+std::vector< std::pair<std::string,std::string> > MEDCoupling::GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields(MEDnField(fid));
std::vector<std::string> fields(nbFields);
}
fields[i]=curFieldName;
}
- std::ostringstream oss; oss << "MEDLoader::GetComponentsNamesOfField : no such field \"" << fieldName << "\" in file \"" << fileName << "\" !" << std::endl;
+ std::ostringstream oss; oss << "GetComponentsNamesOfField : no such field \"" << fieldName << "\" in file \"" << fileName << "\" !" << std::endl;
oss << "Possible field names are : " << std::endl;
std::copy(fields.begin(),fields.end(),std::ostream_iterator<std::string>(oss," "));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-std::vector<std::string> MEDLoader::GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName)
+std::vector<std::string> MEDCoupling::GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::vector<std::string> ret;
//
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
return ret;
}
-std::vector<std::string> MEDLoader::GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName)
+std::vector<std::string> MEDCoupling::GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret(nfam);
}
-std::vector<std::string> MEDLoader::GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName)
+std::vector<std::string> MEDCoupling::GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret;
return ret;
}
-std::vector<std::string> MEDLoader::GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName)
+std::vector<std::string> MEDCoupling::GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret;
if(!found)
{
std::ostringstream oss;
- oss << "MEDLoader::GetMeshGroupsNamesOnFamily : no such family \"" << famName << "\" in file \"" << fileName << "\" in mesh \"" << meshName << "\" !";
+ oss << "GetMeshGroupsNamesOnFamily : no such family \"" << famName << "\" in file \"" << fileName << "\" in mesh \"" << meshName << "\" !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
return ret;
}
-std::vector<std::string> MEDLoader::GetMeshGroupsNames(const std::string& fileName, const std::string& meshName)
+std::vector<std::string> MEDCoupling::GetMeshGroupsNames(const std::string& fileName, const std::string& meshName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector<std::string> ret;
return ret;
}
-std::vector<ParaMEDMEM::TypeOfField> MEDLoader::GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
+std::vector<MEDCoupling::TypeOfField> MEDCoupling::GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
- std::vector<ParaMEDMEM::TypeOfField> ret;
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> fs(MEDFileAnyTypeFieldMultiTS::New(fileName,fieldName,false));
+ std::vector<MEDCoupling::TypeOfField> ret;
+ MCAuto<MEDFileAnyTypeFieldMultiTS> fs(MEDFileAnyTypeFieldMultiTS::New(fileName,fieldName,false));
if(fs->getMeshName()!=meshName)
{
- std::ostringstream oss; oss << "MEDLoader::GetTypesOfField : The field \"" << fieldName << "\" in file \"" << fileName << "\" is not lying on mesh \"" << meshName << "\"";
+ std::ostringstream oss; oss << "GetTypesOfField : The field \"" << fieldName << "\" in file \"" << fileName << "\" is not lying on mesh \"" << meshName << "\"";
oss << " The name of the mesh in file is \"" << fs->getMeshName() << "\"!";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
return ret;
for(int i=0;i<nbTS;i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> f1ts(fs->getTimeStepAtPos(i));
- std::vector<ParaMEDMEM::TypeOfField> tof(f1ts->getTypesOfFieldAvailable());
- for(std::vector<ParaMEDMEM::TypeOfField>::const_iterator it=tof.begin();it!=tof.end();it++)
+ MCAuto<MEDFileAnyTypeField1TS> f1ts(fs->getTimeStepAtPos(i));
+ std::vector<MEDCoupling::TypeOfField> tof(f1ts->getTypesOfFieldAvailable());
+ for(std::vector<MEDCoupling::TypeOfField>::const_iterator it=tof.begin();it!=tof.end();it++)
if(std::find(ret.begin(),ret.end(),*it)==ret.end())
ret.push_back(*it);
}
// sort ret to put before ON_NODES then ON_CELLS then the remaining.
- std::vector<ParaMEDMEM::TypeOfField> ret2;
+ std::vector<MEDCoupling::TypeOfField> ret2;
if(std::find(ret.begin(),ret.end(),ON_NODES)!=ret.end())
ret2.push_back(ON_NODES);
if(std::find(ret.begin(),ret.end(),ON_CELLS)!=ret.end())
ret2.push_back(ON_CELLS);
- for(std::vector<ParaMEDMEM::TypeOfField>::const_iterator it=ret.begin();it!=ret.end();it++)
+ for(std::vector<MEDCoupling::TypeOfField>::const_iterator it=ret.begin();it!=ret.end();it++)
if(*it!=ON_NODES && *it!=ON_CELLS)
ret2.push_back(*it);
return ret2;
}
-std::vector<std::string> MEDLoader::GetAllFieldNames(const std::string& fileName)
+std::vector<std::string> MEDCoupling::GetAllFieldNames(const std::string& fileName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::vector<std::string> ret;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
return ret;
}
-std::vector<std::string> MEDLoader::GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
+std::vector<std::string> MEDCoupling::GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::vector<std::string> ret;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
return ret;
}
-std::vector<std::string> MEDLoader::GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName)
+std::vector<std::string> MEDCoupling::GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
switch(type)
{
case ON_CELLS:
}
}
-std::vector<std::string> MEDLoader::GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
+std::vector<std::string> MEDCoupling::GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::vector<std::string> ret;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
return ret;
}
-std::vector<std::string> MEDLoader::GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
+std::vector<std::string> MEDCoupling::GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::vector<std::string> ret;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
return ret;
}
-std::vector< std::pair< std::pair<int,int>, double> > MEDLoader::GetAllFieldIterations(const std::string& fileName, const std::string& fieldName)
+std::vector< std::pair< std::pair<int,int>, double> > MEDCoupling::GetAllFieldIterations(const std::string& fileName, const std::string& fieldName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::vector< std::pair< std::pair<int,int>, double > > ret;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
INTERP_KERNEL::AutoPtr<char> nomcha=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
med_bool localmesh;
//
- std::ostringstream oss; oss << "MEDLoader::GetAllFieldIterations : No field with name \"" << fieldName<< "\" in file \"" << fileName << "\" ! Possible fields are : ";
+ std::ostringstream oss; oss << "GetAllFieldIterations : No field with name \"" << fieldName<< "\" in file \"" << fileName << "\" ! Possible fields are : ";
for(int i=0;i<nbFields;i++)
{
med_int ncomp(MEDfieldnComponent(fid,i+1));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-double MEDLoader::GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order)
+double MEDCoupling::GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
med_int nbFields=MEDnField(fid);
//
return ret;
}
-std::vector< std::pair<int,int> > MEDLoader::GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
+std::vector< std::pair<int,int> > MEDCoupling::GetFieldIterations(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
switch(type)
{
case ON_CELLS:
}
}
-std::vector< std::pair<int,int> > MEDLoader::GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
+std::vector< std::pair<int,int> > MEDCoupling::GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::string meshNameCpp(meshName);
std::vector< std::pair<int,int> > ret;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
INTERP_KERNEL::AutoPtr<char> nomcha=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
med_bool localmesh;
//
- std::ostringstream oss; oss << "MEDLoader::GetCellFieldIterations : No cell Field field with name \"" << fieldName<< "\" in file \"" << fileName << "\" ! Possible fields are : ";
+ std::ostringstream oss; oss << "GetCellFieldIterations : No cell Field field with name \"" << fieldName<< "\" in file \"" << fileName << "\" ! Possible fields are : ";
std::set<std::string> s2;
for(int i=0;i<nbFields;i++)
{
return ret;
}
-std::vector< std::pair<int,int> > MEDLoader::GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
+std::vector< std::pair<int,int> > MEDCoupling::GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::string meshNameCpp(meshName);
std::vector< std::pair<int,int> > ret;
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
INTERP_KERNEL::AutoPtr<char> nomcha=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
med_bool localmesh;
//
- std::ostringstream oss; oss << "MEDLoader::GetNodeFieldIterations : No node Field field with name \"" << fieldName<< "\" in file \"" << fileName << "\" ! Possible fields are : ";
+ std::ostringstream oss; oss << "GetNodeFieldIterations : No node Field field with name \"" << fieldName<< "\" in file \"" << fileName << "\" ! Possible fields are : ";
std::set<std::string> s2;
for(int i=0;i<nbFields;i++)
{
return ret;
}
-ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax)
+MEDCoupling::MEDCouplingMesh *MEDCoupling::ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax)
{
- CheckFileForRead(fileName);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
+ MEDCoupling::CheckFileForRead(fileName);
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
MEDFileMesh *mmPtr(mm);
MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
if(mmuPtr)
const MEDCouplingCurveLinearMesh *ret(mmc2Ptr->getMesh()); ret->incrRef();
return const_cast<MEDCouplingCurveLinearMesh *>(ret);
}
- std::ostringstream oss; oss << "MEDLoader::ReadMeshFromFile : The mesh \"" << meshName << "\" in file \"" << fileName << "\" has not a recognized type !";
+ std::ostringstream oss; oss << "ReadMeshFromFile : The mesh \"" << meshName << "\" in file \"" << fileName << "\" has not a recognized type !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax)
+MEDCoupling::MEDCouplingMesh *MEDCoupling::ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax)
{
- CheckFileForRead(fileName);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName));
+ MEDCoupling::CheckFileForRead(fileName);
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName));
MEDFileMesh *mmPtr(mm);
MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
if(mmuPtr)
const MEDCouplingCurveLinearMesh *ret(mmc2Ptr->getMesh()); ret->incrRef();
return const_cast<MEDCouplingCurveLinearMesh *>(ret);
}
- std::ostringstream oss; oss << "MEDLoader::ReadMeshFromFile (2) : The first mesh \"" << mm->getName() << "\" in file \"" << fileName << "\" has not a recognized type !";
+ std::ostringstream oss; oss << "ReadMeshFromFile (2) : The first mesh \"" << mm->getName() << "\" in file \"" << fileName << "\" has not a recognized type !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax)
+MEDCoupling::MEDCouplingUMesh *MEDCoupling::ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax)
{
- CheckFileForRead(fileName);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
+ MEDCoupling::CheckFileForRead(fileName);
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
MEDFileMesh *mmPtr(mm);
MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
if(!mmuPtr)
{
- std::ostringstream oss; oss << "MEDLoader::ReadUMeshFromFile : With fileName=\""<< fileName << "\", meshName=\""<< meshName << "\" exists but it is not an unstructured mesh !";
+ std::ostringstream oss; oss << "ReadUMeshFromFile : With fileName=\""<< fileName << "\", meshName=\""<< meshName << "\" exists but it is not an unstructured mesh !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
return mmuPtr->getMeshAtLevel(meshDimRelToMax,true);
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax)
+MEDCoupling::MEDCouplingUMesh *MEDCoupling::ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax)
{
- CheckFileForRead(fileName);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName));
+ MEDCoupling::CheckFileForRead(fileName);
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName));
MEDFileMesh *mmPtr(mm);
MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
if(!mmuPtr)
{
- std::ostringstream oss; oss << "MEDLoader::ReadUMeshFromFile : With fileName=\""<< fileName << "\", meshName (the first) =\""<< mm->getName() << "\" exists but it is not an unstructured mesh !";
+ std::ostringstream oss; oss << "ReadUMeshFromFile : With fileName=\""<< fileName << "\", meshName (the first) =\""<< mm->getName() << "\" exists but it is not an unstructured mesh !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
return mmuPtr->getMeshAtLevel(meshDimRelToMax,true);
}
-int MEDLoader::ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName)
+int MEDCoupling::ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
std::vector<int> poss;
return MEDLoaderNS::readUMeshDimFromFile(fileName,meshName,poss);
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& fams)
+MEDCoupling::MEDCouplingUMesh *MEDCoupling::ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& fams)
{
- CheckFileForRead(fileName);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
+ MEDCoupling::CheckFileForRead(fileName);
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
MEDFileMesh *mmPtr(mm);
MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
if(!mmuPtr)
{
- std::ostringstream oss; oss << "MEDLoader::ReadUMeshFromFamilies : With fileName=\""<< fileName << "\", meshName (the first) =\""<< mm->getName() << "\" exists but it is not an unstructured mesh !";
+ std::ostringstream oss; oss << "ReadUMeshFromFamilies : With fileName=\""<< fileName << "\", meshName (the first) =\""<< mm->getName() << "\" exists but it is not an unstructured mesh !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
return mmuPtr->getFamilies(meshDimRelToMax,fams,true);
}
-ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& grps)
+MEDCoupling::MEDCouplingUMesh *MEDCoupling::ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& grps)
{
- CheckFileForRead(fileName);
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
+ MEDCoupling::CheckFileForRead(fileName);
+ MCAuto<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
MEDFileMesh *mmPtr(mm);
MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
if(!mmuPtr)
{
- std::ostringstream oss; oss << "MEDLoader::ReadUMeshFromGroups : With fileName=\""<< fileName << "\", meshName (the first) =\""<< mm->getName() << "\" exists but it is not an unstructured mesh !";
+ std::ostringstream oss; oss << "ReadUMeshFromGroups : With fileName=\""<< fileName << "\", meshName (the first) =\""<< mm->getName() << "\" exists but it is not an unstructured mesh !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
return mmuPtr->getGroups(meshDimRelToMax,grps,true);
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling::ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
- CheckFileForRead(fileName);
+ MEDCoupling::CheckFileForRead(fileName);
switch(type)
{
case ON_CELLS:
}
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
- const std::vector<std::pair<int,int> >& its)
+std::vector<MEDCoupling::MEDCouplingFieldDouble *> MEDCoupling::ReadFieldsOnSameMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+ const std::vector<std::pair<int,int> >& its)
{
if(its.empty())
- return std::vector<ParaMEDMEM::MEDCouplingFieldDouble *>();
- CheckFileForRead(fileName);
- std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ret(its.size());
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> > retSafe(its.size());
+ return std::vector<MEDCoupling::MEDCouplingFieldDouble *>();
+ MEDCoupling::CheckFileForRead(fileName);
+ std::vector<MEDCoupling::MEDCouplingFieldDouble *> ret(its.size());
+ std::vector< MCAuto<MEDCouplingFieldDouble> > retSafe(its.size());
if(its.empty())
return ret;
//Retrieving mesh of rank 0 and field on rank 0 too.
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
+ MCAuto<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
MEDFileMesh *mmPtr(mm);
MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
if(!mmuPtr)
- throw INTERP_KERNEL::Exception("MEDLoader::ReadFieldsOnSameMesh : only unstructured mesh is managed !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=mmuPtr->getMeshAtLevel(meshDimRelToMax);
+ throw INTERP_KERNEL::Exception("ReadFieldsOnSameMesh : only unstructured mesh is managed !");
+ MCAuto<MEDCouplingUMesh> m=mmuPtr->getMeshAtLevel(meshDimRelToMax);
const DataArrayInt *o2n=mmuPtr->getNumberFieldAtLevel(meshDimRelToMax);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m2(m->clone(true));
+ MCAuto<MEDCouplingUMesh> m2(m->clone(true));
if(o2n)
m2->renumberCells(o2n->begin(),true);
int i=0;
for(std::vector<std::pair<int,int> >::const_iterator it=its.begin();it!=its.end();it++,i++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff=MEDFileField1TS::New(fileName,fieldName,(*it).first,(*it).second);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> retElt=ff->getFieldOnMeshAtLevel(type,m);
+ MCAuto<MEDFileField1TS> ff=MEDFileField1TS::New(fileName,fieldName,(*it).first,(*it).second);
+ MCAuto<MEDCouplingFieldDouble> retElt=ff->getFieldOnMeshAtLevel(type,m);
if(o2n)
retElt->renumberCells(o2n->begin(),true);
retElt->setMesh(m2);
return ret;
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+std::vector<MEDCoupling::MEDCouplingFieldDouble *> MEDCoupling::ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its)
{
return ReadFieldsOnSameMesh(ON_CELLS,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+std::vector<MEDCoupling::MEDCouplingFieldDouble *> MEDCoupling::ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its)
{
return ReadFieldsOnSameMesh(ON_NODES,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+std::vector<MEDCoupling::MEDCouplingFieldDouble *> MEDCoupling::ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its)
{
return ReadFieldsOnSameMesh(ON_GAUSS_PT,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> MEDLoader::ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+std::vector<MEDCoupling::MEDCouplingFieldDouble *> MEDCoupling::ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
const std::vector<std::pair<int,int> >& its)
{
return ReadFieldsOnSameMesh(ON_GAUSS_NE,fileName,meshName,meshDimRelToMax,fieldName,its);
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling::ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
+ MCAuto<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
+ MCAuto<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
MEDFileMesh *mPtr(mm);
MEDFileUMesh *muPtr=dynamic_cast<MEDFileUMesh *>(mPtr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_CELLS,m));
+ MCAuto<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_CELLS,m));
if(muPtr)
{
const DataArrayInt *num(muPtr->getNumberFieldAtLevel(meshDimRelToMax));
return ret.retn();
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling::ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
+ MCAuto<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
+ MCAuto<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
MEDFileMesh *mPtr(mm);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_NODES,m));
+ MCAuto<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_NODES,m));
MEDFileUMesh *muPtr=dynamic_cast<MEDFileUMesh *>(mPtr);
if(ff->getPflsReallyUsed().empty())
{
else
{
DataArrayInt *pfl=0,*arr2=0;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(ff->getFieldWithProfile(ON_NODES,meshDimRelToMax,mm,pfl));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> pflSafe(pfl);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> mp(m->getCellIdsFullyIncludedInNodeIds(pfl->begin(),pfl->end()));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mzip(static_cast<MEDCouplingUMesh *>(m->buildPartAndReduceNodes(mp->begin(),mp->end(),arr2)));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr2Safe(arr2);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arr3(arr2->invertArrayO2N2N2O(mzip->getNumberOfNodes()));
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> pflSorted(pflSafe->deepCpy()); pflSorted->sort(true);
+ MCAuto<DataArrayDouble> arr(ff->getFieldWithProfile(ON_NODES,meshDimRelToMax,mm,pfl));
+ MCAuto<DataArrayInt> pflSafe(pfl);
+ MCAuto<DataArrayInt> mp(m->getCellIdsFullyIncludedInNodeIds(pfl->begin(),pfl->end()));
+ MCAuto<MEDCouplingUMesh> mzip(static_cast<MEDCouplingUMesh *>(m->buildPartAndReduceNodes(mp->begin(),mp->end(),arr2)));
+ MCAuto<DataArrayInt> arr2Safe(arr2);
+ MCAuto<DataArrayInt> arr3(arr2->invertArrayO2N2N2O(mzip->getNumberOfNodes()));
+ MCAuto<DataArrayInt> pflSorted(pflSafe->deepCopy()); pflSorted->sort(true);
if(!arr3->isEqualWithoutConsideringStr(*pflSorted))
- throw INTERP_KERNEL::Exception("MEDLoader::ReadFieldNode : not implemented yet !");
+ throw INTERP_KERNEL::Exception("ReadFieldNode : not implemented yet !");
if(!arr3->isEqualWithoutConsideringStr(*pflSafe))
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n2(pflSafe->checkAndPreparePermutation());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o2(o2n2->invertArrayO2N2N2O(o2n2->getNumberOfTuples()));
+ MCAuto<DataArrayInt> o2n2(pflSafe->checkAndPreparePermutation());
+ MCAuto<DataArrayInt> n2o2(o2n2->invertArrayO2N2N2O(o2n2->getNumberOfTuples()));
mzip->renumberNodes(n2o2->begin(),n2o2->getNumberOfTuples());
arr->setName("");
ret->setArray(arr);
return ret.retn();
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling::ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
+ MCAuto<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
+ MCAuto<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
MEDFileMesh *mPtr(mm);
MEDFileUMesh *muPtr=dynamic_cast<MEDFileUMesh *>(mPtr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_GAUSS_PT,m));
+ MCAuto<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_GAUSS_PT,m));
if(muPtr)
{
const DataArrayInt *num(muPtr->getNumberFieldAtLevel(meshDimRelToMax));
return ret.retn();
}
-ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
+MEDCoupling::MEDCouplingFieldDouble *MEDCoupling::ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
+ MCAuto<MEDFileField1TS> ff(MEDFileField1TS::New(fileName,fieldName,iteration,order));
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
+ MCAuto<MEDCouplingMesh> m(mm->getMeshAtLevel(meshDimRelToMax,false));
MEDFileMesh *mPtr(mm);
MEDFileUMesh *muPtr=dynamic_cast<MEDFileUMesh *>(mPtr);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_GAUSS_NE,m));
+ MCAuto<MEDCouplingFieldDouble> ret(ff->getFieldOnMeshAtLevel(ON_GAUSS_NE,m));
if(muPtr)
{
const DataArrayInt *num(muPtr->getNumberFieldAtLevel(meshDimRelToMax));
return ret.retn();
}
-void MEDLoader::WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch)
+void MEDCoupling::WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch)
{
if(!mesh)
- throw INTERP_KERNEL::Exception("MEDLoader::WriteMesh : input mesh is null !");
+ throw INTERP_KERNEL::Exception("WriteMesh : input mesh is null !");
const MEDCouplingUMesh *um(dynamic_cast<const MEDCouplingUMesh *>(mesh));
if(um)
{
const MEDCoupling1GTUMesh *um2(dynamic_cast<const MEDCoupling1GTUMesh *>(mesh));
if(um2)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu(MEDFileUMesh::New());
+ MCAuto<MEDFileUMesh> mmu(MEDFileUMesh::New());
AssignStaticWritePropertiesTo(*mmu);
mmu->setMeshAtLevel(0,const_cast<MEDCoupling1GTUMesh *>(um2));
mmu->write(fileName,mod);
const MEDCouplingCMesh *um3(dynamic_cast<const MEDCouplingCMesh *>(mesh));
if(um3)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> mmc(MEDFileCMesh::New());
+ MCAuto<MEDFileCMesh> mmc(MEDFileCMesh::New());
AssignStaticWritePropertiesTo(*mmc);
mmc->setMesh(const_cast<MEDCouplingCMesh *>(um3));
mmc->write(fileName,mod);
const MEDCouplingCurveLinearMesh *um4(dynamic_cast<const MEDCouplingCurveLinearMesh *>(mesh));
if(um4)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> mmc(MEDFileCurveLinearMesh::New());
+ MCAuto<MEDFileCurveLinearMesh> mmc(MEDFileCurveLinearMesh::New());
AssignStaticWritePropertiesTo(*mmc);
mmc->setMesh(const_cast<MEDCouplingCurveLinearMesh *>(um4));
mmc->write(fileName,mod);
return ;
}
- throw INTERP_KERNEL::Exception("MEDLoader::WriteMesh : only MEDCouplingUMesh, MEDCoupling1GTUMesh, MEDCouplingCMesh, MEDCouplingCurveLinear are dealed in this API for the moment !");
+ throw INTERP_KERNEL::Exception("WriteMesh : only MEDCouplingUMesh, MEDCoupling1GTUMesh, MEDCouplingCMesh, MEDCouplingCurveLinear are dealed in this API for the moment !");
}
-void MEDLoader::WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch)
+void MEDCoupling::WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch)
{
if(!mesh)
- throw INTERP_KERNEL::Exception("MEDLoader::WriteUMesh : input mesh is null !");
+ throw INTERP_KERNEL::Exception("WriteUMesh : input mesh is null !");
int mod=writeFromScratch?2:0;
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m(MEDFileUMesh::New());
+ MCAuto<MEDFileUMesh> m(MEDFileUMesh::New());
AssignStaticWritePropertiesTo(*m);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mcpy(static_cast<MEDCouplingUMesh *>(mesh->deepCpy()));
+ MCAuto<MEDCouplingUMesh> mcpy(static_cast<MEDCouplingUMesh *>(mesh->deepCopy()));
m->setMeshAtLevel(0,mcpy,true);
m->write(fileName,mod);
}
-void MEDLoader::WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch)
+void MEDCoupling::WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch)
{
- MEDLoader::WriteUMesh(fileName,mesh,writeFromScratch);
+ WriteUMesh(fileName,mesh,writeFromScratch);
}
-void MEDLoader::WriteUMeshesPartition(const std::string& fileName, const std::string& meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
+void MEDCoupling::WriteUMeshesPartition(const std::string& fileName, const std::string& meshNameC, const std::vector<const MEDCoupling::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
{
std::string meshName(meshNameC);
if(meshName.empty())
std::ostringstream oss; oss << "File with name \'" << fileName << "\' has not valid permissions !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m(MEDFileUMesh::New());
+ MCAuto<MEDFileUMesh> m(MEDFileUMesh::New());
AssignStaticWritePropertiesTo(*m);
m->setGroupsFromScratch(0,meshes,true);
m->setName(meshNameC);
m->write(fileName,mod);
}
-void MEDLoader::WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
+void MEDCoupling::WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshNameC, const std::vector<const MEDCoupling::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
{
WriteUMeshesPartition(fileName,meshNameC,meshes,writeFromScratch);
}
-void MEDLoader::WriteUMeshes(const std::string& fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
+void MEDCoupling::WriteUMeshes(const std::string& fileName, const std::vector<const MEDCoupling::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
{
int mod=writeFromScratch?2:0;
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m(MEDFileUMesh::New());
+ MCAuto<MEDFileUMesh> m(MEDFileUMesh::New());
AssignStaticWritePropertiesTo(*m);
m->setMeshes(meshes,true);
m->write(fileName,mod);
}
-void MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
+void MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff(MEDFileField1TS::New());
- MEDLoader::AssignStaticWritePropertiesTo(*ff);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2(f->deepCpy());
+ MCAuto<MEDFileField1TS> ff(MEDFileField1TS::New());
+ AssignStaticWritePropertiesTo(*ff);
+ MCAuto<MEDCouplingFieldDouble> f2(f->deepCopy());
const MEDCouplingMesh *m(f2->getMesh());
const MEDCouplingUMesh *um(dynamic_cast<const MEDCouplingUMesh *>(m));
const MEDCoupling1GTUMesh *um2(dynamic_cast<const MEDCoupling1GTUMesh *>(m));
const MEDCouplingCMesh *um3(dynamic_cast<const MEDCouplingCMesh *>(m));
const MEDCouplingCurveLinearMesh *um4(dynamic_cast<const MEDCouplingCurveLinearMesh *>(m));
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm;
+ MCAuto<MEDFileMesh> mm;
int mod=writeFromScratch?2:0;
if(um)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu(MEDFileUMesh::New());
- MEDLoader::AssignStaticWritePropertiesTo(*mmu);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n(um->getRenumArrForMEDFileFrmt());
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o(o2n->invertArrayO2N2N2O(o2n->getNumberOfTuples()));
+ MCAuto<MEDFileUMesh> mmu(MEDFileUMesh::New());
+ AssignStaticWritePropertiesTo(*mmu);
+ MCAuto<DataArrayInt> o2n(um->getRenumArrForMEDFileFrmt());
+ MCAuto<DataArrayInt> n2o(o2n->invertArrayO2N2N2O(o2n->getNumberOfTuples()));
f2->renumberCells(o2n->begin(),false);
mmu->setMeshAtLevel(0,const_cast<MEDCouplingUMesh *>(static_cast<const MEDCouplingUMesh *>(f2->getMesh())));
mmu->setRenumFieldArr(0,n2o);
}
else if(um2)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu(MEDFileUMesh::New());
- MEDLoader::AssignStaticWritePropertiesTo(*mmu);
+ MCAuto<MEDFileUMesh> mmu(MEDFileUMesh::New());
+ AssignStaticWritePropertiesTo(*mmu);
mmu->setMeshAtLevel(0,const_cast<MEDCoupling1GTUMesh *>(um2));
ff->setFieldNoProfileSBT(f2);
mmu->write(fileName,mod);
}
else if(um3)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> mmc(MEDFileCMesh::New());
- MEDLoader::AssignStaticWritePropertiesTo(*mmc);
+ MCAuto<MEDFileCMesh> mmc(MEDFileCMesh::New());
+ AssignStaticWritePropertiesTo(*mmc);
mmc->setMesh(const_cast<MEDCouplingCMesh *>(um3));
ff->setFieldNoProfileSBT(f2);
mmc->write(fileName,mod);
}
else if(um4)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> mmc(MEDFileCurveLinearMesh::New());
- MEDLoader::AssignStaticWritePropertiesTo(*mmc);
+ MCAuto<MEDFileCurveLinearMesh> mmc(MEDFileCurveLinearMesh::New());
+ AssignStaticWritePropertiesTo(*mmc);
mmc->setMesh(const_cast<MEDCouplingCurveLinearMesh *>(um4));
ff->setFieldNoProfileSBT(f2);
mmc->write(fileName,mod);
ff->write(fileName,0);
}
-void MEDLoader::WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
+void MEDCoupling::WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch)
{
if(!f)
- throw INTERP_KERNEL::Exception("MEDLoader::WriteField : input field is NULL !");
- f->checkCoherency();
+ throw INTERP_KERNEL::Exception("WriteField : input field is NULL !");
+ f->checkConsistencyLight();
int status=MEDLoaderBase::getStatusOfFile(fileName);
if(status!=MEDLoaderBase::EXIST_RW && status!=MEDLoaderBase::NOT_EXIST)
{
{
std::vector<std::string> meshNames=GetMeshNames(fileName);
if(!f->getMesh())
- throw INTERP_KERNEL::Exception("MEDLoader::WriteField : trying to write a field with no mesh !");
+ throw INTERP_KERNEL::Exception("WriteField : trying to write a field with no mesh !");
std::string fileNameCpp(f->getMesh()->getName());
if(std::find(meshNames.begin(),meshNames.end(),fileNameCpp)==meshNames.end())
MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(fileName,f,false);
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,f->getMesh()->getName().c_str()));
+ MCAuto<MEDFileMesh> mm(MEDFileMesh::New(fileName,f->getMesh()->getName().c_str()));
AssignStaticWritePropertiesTo(*mm);
const MEDFileMesh *mmPtr(mm);
const MEDFileUMesh *mmuPtr=dynamic_cast<const MEDFileUMesh *>(mmPtr);
if(!mmuPtr)
- throw INTERP_KERNEL::Exception("MEDLoader::WriteField : only umeshes are supported now !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2(f->deepCpy());
+ throw INTERP_KERNEL::Exception("WriteField : only umeshes are supported now !");
+ MCAuto<MEDCouplingFieldDouble> f2(f->deepCopy());
MEDCouplingUMesh *m=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
if(!m)
- throw INTERP_KERNEL::Exception("MEDLoader::WriteField : only umesh in input field supported !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=m->getRenumArrForMEDFileFrmt();
+ throw INTERP_KERNEL::Exception("WriteField : only umesh in input field supported !");
+ MCAuto<DataArrayInt> o2n=m->getRenumArrForMEDFileFrmt();
f2->renumberCells(o2n->begin(),false);
m=static_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mread=mmuPtr->getMeshAtLevel(m->getMeshDimension()-mm->getMeshDimension());
+ MCAuto<MEDCouplingUMesh> mread=mmuPtr->getMeshAtLevel(m->getMeshDimension()-mm->getMeshDimension());
if(f2->getTypeOfField()!=ON_NODES)
{
m->tryToShareSameCoordsPermute(*mread,_EPS_FOR_NODE_COMP);
DataArrayInt *part=0;
bool b=mread->areCellsIncludedIn(m,_COMP_FOR_CELL,part);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> partSafe(part);
+ MCAuto<DataArrayInt> partSafe(part);
if(!b)
{
- std::ostringstream oss; oss << "MEDLoader::WriteField : The file \""<< fileName << "\" already contains a mesh named \""<< f->getMesh()->getName() << "\" and this mesh in the file is not compatible (a subpart) with the mesh you intend to write ! This is maybe due to a too strict policy ! Try with to lease it by calling SetCompPolicyForCell !";
+ std::ostringstream oss; oss << "WriteField : The file \""<< fileName << "\" already contains a mesh named \""<< f->getMesh()->getName() << "\" and this mesh in the file is not compatible (a subpart) with the mesh you intend to write ! This is maybe due to a too strict policy ! Try with to lease it by calling SetCompPolicyForCell !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts(MEDFileField1TS::New());
+ MCAuto<MEDFileField1TS> f1ts(MEDFileField1TS::New());
AssignStaticWritePropertiesTo(*f1ts);
- if(part->isIdentity2(mread->getNumberOfCells()))
+ if(part->isIota(mread->getNumberOfCells()))
f1ts->setFieldNoProfileSBT(f2);
else
{
{
DataArrayInt *part=0;
bool b=mread->getCoords()->areIncludedInMe(m->getCoords(),_EPS_FOR_NODE_COMP,part);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> partSafe(part);
+ MCAuto<DataArrayInt> partSafe(part);
if(!b)
{
- std::ostringstream oss; oss << "MEDLoader::WriteField : The file \""<< fileName << "\" already contains a mesh named \""<< f->getMesh()->getName() << "\" and this mesh in the file is not compatible (a subpart regarding nodes) with the mesh you intend to write ! This is maybe due to a too strict epsilon ! Try with to lease it by calling SetEpsilonForNodeComp !";
+ std::ostringstream oss; oss << "WriteField : The file \""<< fileName << "\" already contains a mesh named \""<< f->getMesh()->getName() << "\" and this mesh in the file is not compatible (a subpart regarding nodes) with the mesh you intend to write ! This is maybe due to a too strict epsilon ! Try with to lease it by calling SetEpsilonForNodeComp !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts(MEDFileField1TS::New());
+ MCAuto<MEDFileField1TS> f1ts(MEDFileField1TS::New());
AssignStaticWritePropertiesTo(*f1ts);
- if(part->isIdentity2(mread->getNumberOfNodes()))
+ if(part->isIota(mread->getNumberOfNodes()))
f1ts->setFieldNoProfileSBT(f2);
else
{
}
}
-void MEDLoader::WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
+void MEDCoupling::WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch)
{
WriteField(fileName,f,writeFromScratch);
}
-void MEDLoader::WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f)
+void MEDCoupling::WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f)
{
if(!f)
- throw INTERP_KERNEL::Exception("MEDLoader::WriteFieldUsingAlreadyWrittenMesh : input field is null !");
- f->checkCoherency();
+ throw INTERP_KERNEL::Exception("WriteFieldUsingAlreadyWrittenMesh : input field is null !");
+ f->checkConsistencyLight();
int status=MEDLoaderBase::getStatusOfFile(fileName);
if(status!=MEDLoaderBase::EXIST_RW)
{
std::ostringstream oss; oss << "File with name \'" << fileName << "\' has not valid permissions or not exists !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts(MEDFileField1TS::New());
+ MCAuto<MEDFileField1TS> f1ts(MEDFileField1TS::New());
AssignStaticWritePropertiesTo(*f1ts);
MEDCouplingUMesh *m(dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f->getMesh())));
if(m)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n(m->getRenumArrForMEDFileFrmt());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2(f->deepCpy());
+ MCAuto<DataArrayInt> o2n(m->getRenumArrForMEDFileFrmt());
+ MCAuto<MEDCouplingFieldDouble> f2(f->deepCopy());
f2->renumberCells(o2n->begin(),false);
f1ts->setFieldNoProfileSBT(f2);
}
#include <list>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayInt;
class MEDCouplingMesh;
class MEDCouplingUMesh;
class MEDCouplingFieldDouble;
class MEDFileWritable;
-}
-class MEDLOADER_EXPORT MEDLoader
-{
-public:
- static void SetEpsilonForNodeComp(double val);
- static void SetCompPolicyForCell(int val);
- static void SetTooLongStrPolicy(int val);
- static bool HasXDR();
- static std::string MEDFileVersionStr();
- static void MEDFileVersion(int& major, int& minor, int& release);
- static void CheckFileForRead(const std::string& fileName);
- static std::vector<std::string> GetMeshNames(const std::string& fileName);
- static std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes);
- static std::vector< std::pair<std::string,std::string> > GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName);
- static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
- static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
- static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
- static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
- static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
- static std::vector<std::string> GetAllFieldNames(const std::string& fileName);
- static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
- static std::vector<ParaMEDMEM::TypeOfField> GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
- static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName);
- static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
- static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
- static std::vector< std::pair<int,int> > GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName);
- static std::vector< std::pair<int,int> > GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
- static std::vector< std::pair<int,int> > GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
- static std::vector< std::pair< std::pair<int,int>, double> > GetAllFieldIterations(const std::string& fileName, const std::string& fieldName);
- static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& fams);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& grps);
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
- static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
- const std::vector<std::pair<int,int> >& its);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
- const std::vector<std::pair<int,int> >& its);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
- const std::vector<std::pair<int,int> >& its);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
- const std::vector<std::pair<int,int> >& its);
- static std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
- const std::vector<std::pair<int,int> >& its);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
- static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch);
- static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch);
- static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch);
- static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
- static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
- static void WriteUMeshes(const std::string& fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
- static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
- static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
- static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f);
-public:
- static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj);
-private:
- MEDLoader();
-public:
- static double _EPS_FOR_NODE_COMP;
- static int _COMP_FOR_CELL;
- static int _TOO_LONG_STR;
+ MEDLOADER_EXPORT void SetEpsilonForNodeComp(double val);
+ MEDLOADER_EXPORT void SetCompPolicyForCell(int val);
+ MEDLOADER_EXPORT void SetTooLongStrPolicy(int val);
+ MEDLOADER_EXPORT bool HasXDR();
+ MEDLOADER_EXPORT std::string MEDFileVersionStr();
+ MEDLOADER_EXPORT void MEDFileVersion(int& major, int& minor, int& release);
+ MEDLOADER_EXPORT void CheckFileForRead(const std::string& fileName);
+ MEDLOADER_EXPORT std::vector<std::string> GetMeshNames(const std::string& fileName);
+ MEDLOADER_EXPORT std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes);
+ MEDLOADER_EXPORT std::vector< std::pair<std::string,std::string> > GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName);
+ MEDLOADER_EXPORT std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
+ MEDLOADER_EXPORT std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
+ MEDLOADER_EXPORT std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName);
+ MEDLOADER_EXPORT std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName);
+ MEDLOADER_EXPORT std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName);
+ MEDLOADER_EXPORT std::vector<std::string> GetAllFieldNames(const std::string& fileName);
+ MEDLOADER_EXPORT std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ MEDLOADER_EXPORT std::vector<MEDCoupling::TypeOfField> GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ MEDLOADER_EXPORT std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName);
+ MEDLOADER_EXPORT std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ MEDLOADER_EXPORT std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName);
+ MEDLOADER_EXPORT std::vector< std::pair<int,int> > GetFieldIterations(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ MEDLOADER_EXPORT std::vector< std::pair<int,int> > GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ MEDLOADER_EXPORT std::vector< std::pair<int,int> > GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName);
+ MEDLOADER_EXPORT std::vector< std::pair< std::pair<int,int>, double> > GetAllFieldIterations(const std::string& fileName, const std::string& fieldName);
+ MEDLOADER_EXPORT double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& fams);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector<std::string>& grps);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0);
+ MEDLOADER_EXPORT int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingFieldDouble *ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDLOADER_EXPORT std::vector<MEDCoupling::MEDCouplingFieldDouble *> ReadFieldsOnSameMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+ const std::vector<std::pair<int,int> >& its);
+ MEDLOADER_EXPORT std::vector<MEDCoupling::MEDCouplingFieldDouble *> ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+ const std::vector<std::pair<int,int> >& its);
+ MEDLOADER_EXPORT std::vector<MEDCoupling::MEDCouplingFieldDouble *> ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+ const std::vector<std::pair<int,int> >& its);
+ MEDLOADER_EXPORT std::vector<MEDCoupling::MEDCouplingFieldDouble *> ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+ const std::vector<std::pair<int,int> >& its);
+ MEDLOADER_EXPORT std::vector<MEDCoupling::MEDCouplingFieldDouble *> ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName,
+ const std::vector<std::pair<int,int> >& its);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDLOADER_EXPORT MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order);
+ MEDLOADER_EXPORT void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, const std::vector<const MEDCoupling::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, const std::vector<const MEDCoupling::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteUMeshes(const std::string& fileName, const std::vector<const MEDCoupling::MEDCouplingUMesh *>& meshes, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch);
+ MEDLOADER_EXPORT void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f);
+
+ MEDLOADER_EXPORT void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj);
};
#endif
#endif
using namespace SauvUtilities;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
namespace
{
//================================================================================
/*!
- * \brief Makes ParaMEDMEM::MEDFileData from self
+ * \brief Makes MEDCoupling::MEDFileData from self
*/
//================================================================================
-ParaMEDMEM::MEDFileData* IntermediateMED::convertInMEDFileDS()
+MEDCoupling::MEDFileData* IntermediateMED::convertInMEDFileDS()
{
- MEDCouplingAutoRefCountObjectPtr< MEDFileUMesh > mesh = makeMEDFileMesh();
- MEDCouplingAutoRefCountObjectPtr< MEDFileFields > fields = makeMEDFileFields(mesh);
+ MCAuto< MEDFileUMesh > mesh = makeMEDFileMesh();
+ MCAuto< MEDFileFields > fields = makeMEDFileFields(mesh);
- MEDCouplingAutoRefCountObjectPtr< MEDFileMeshes > meshes = MEDFileMeshes::New();
- MEDCouplingAutoRefCountObjectPtr< MEDFileData > medData = MEDFileData::New();
+ MCAuto< MEDFileMeshes > meshes = MEDFileMeshes::New();
+ MCAuto< MEDFileData > medData = MEDFileData::New();
meshes->pushMesh( mesh );
medData->setMeshes( meshes );
if ( fields ) medData->setFields( fields );
//================================================================================
/*!
- * \brief Creates ParaMEDMEM::MEDFileUMesh from its data
+ * \brief Creates MEDCoupling::MEDFileUMesh from its data
*/
//================================================================================
-ParaMEDMEM::MEDFileUMesh* IntermediateMED::makeMEDFileMesh()
+MEDCoupling::MEDFileUMesh* IntermediateMED::makeMEDFileMesh()
{
// check if all needed piles are present
checkDataAvailability();
*/
//================================================================================
-ParaMEDMEM::DataArrayDouble * IntermediateMED::getCoords()
+MEDCoupling::DataArrayDouble * IntermediateMED::getCoords()
{
DataArrayDouble* coordArray = DataArrayDouble::New();
coordArray->alloc( _nbNodes, _spaceDim );
*/
//================================================================================
-void IntermediateMED::setConnectivity( ParaMEDMEM::MEDFileUMesh* mesh,
- ParaMEDMEM::DataArrayDouble* coords )
+void IntermediateMED::setConnectivity( MEDCoupling::MEDFileUMesh* mesh,
+ MEDCoupling::DataArrayDouble* coords )
{
int meshDim = 0;
*/
//================================================================================
-void IntermediateMED::setGroups( ParaMEDMEM::MEDFileUMesh* mesh )
+void IntermediateMED::setGroups( MEDCoupling::MEDFileUMesh* mesh )
{
bool isMeshNameSet = false;
const int meshDim = mesh->getMeshDimension();
const int meshDimRelToMaxExt = ( dim == 0 ? 1 : dim - meshDim );
std::vector<const DataArrayInt *> medGroups;
- std::vector<MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > refGroups;
+ std::vector<MCAuto<DataArrayInt> > refGroups;
for ( size_t i = 0; i < _groups.size(); ++i )
{
Group& grp = _groups[i];
if ( !grp._refNames[ iRef ].empty() &&
uniqueNames.insert( grp._refNames[ iRef ]).second ) // for name uniqueness (23155)
{
- refGroups.push_back( grp._medGroup->deepCpy() );
+ refGroups.push_back( grp._medGroup->deepCopy() );
refGroups.back()->setName( grp._refNames[ iRef ].c_str() );
medGroups.push_back( refGroups.back() );
}
*/
//================================================================================
-ParaMEDMEM::MEDFileFields * IntermediateMED::makeMEDFileFields(ParaMEDMEM::MEDFileUMesh* mesh)
+MEDCoupling::MEDFileFields * IntermediateMED::makeMEDFileFields(MEDCoupling::MEDFileUMesh* mesh)
{
if ( _nodeFields.empty() && _cellFields.empty() ) return 0;
//================================================================================
void IntermediateMED::setFields( SauvUtilities::DoubleField* fld,
- ParaMEDMEM::MEDFileFields* medFields,
- ParaMEDMEM::MEDFileUMesh* mesh,
+ MEDCoupling::MEDFileFields* medFields,
+ MEDCoupling::MEDFileUMesh* mesh,
const TID castemID,
std::set< std::string >& usedFieldNames)
{
//================================================================================
void IntermediateMED::setTS( SauvUtilities::DoubleField* fld,
- ParaMEDMEM::DataArrayDouble* values,
- ParaMEDMEM::MEDFileFields* medFields,
- ParaMEDMEM::MEDFileUMesh* mesh,
+ MEDCoupling::DataArrayDouble* values,
+ MEDCoupling::MEDFileFields* medFields,
+ MEDCoupling::MEDFileUMesh* mesh,
const int iSub)
{
// treat a field support
// set the mesh
if ( onAll )
{
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
< MEDCouplingUMesh > dimMesh = mesh->getMeshAtLevel( dimRel );
timeStamp->setMesh( dimMesh );
}
- else if ( timeStamp->getTypeOfField() == ParaMEDMEM::ON_NODES )
+ else if ( timeStamp->getTypeOfField() == MEDCoupling::ON_NODES )
{
DataArrayDouble * coo = mesh->getCoords();
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
<DataArrayDouble> subCoo = coo->selectByTupleId(support->_medGroup->begin(),
support->_medGroup->end());
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh > nodeSubMesh =
+ MCAuto< MEDCouplingUMesh > nodeSubMesh =
MEDCouplingUMesh::Build0DMeshFromCoords( subCoo );
timeStamp->setMesh( nodeSubMesh );
}
else
{
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
< MEDCouplingUMesh > dimMesh = mesh->getMeshAtLevel( dimRel );
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
<MEDCouplingMesh> subMesh = dimMesh->buildPart(support->_medGroup->begin(),
support->_medGroup->end());
timeStamp->setMesh( subMesh);
timeStamp->setArray( values );
values->decrRef();
// set gauss points
- if ( timeStamp->getTypeOfField() == ParaMEDMEM::ON_GAUSS_PT )
+ if ( timeStamp->getTypeOfField() == MEDCoupling::ON_GAUSS_PT )
{
TGaussDef gaussDef( fld->_sub[iSub]._support->_cellType,
fld->_sub[iSub].nbGauss() );
timeStamp->setOrder( nbTS );
// add the time-stamp
- timeStamp->checkCoherency();
+ timeStamp->checkConsistencyLight();
if ( onAll )
fld->_curMedField->appendFieldNoProfileSBT( timeStamp );
else
*/
//================================================================================
-ParaMEDMEM::TypeOfField DoubleField::getMedType( const int iSub ) const
+MEDCoupling::TypeOfField DoubleField::getMedType( const int iSub ) const
{
using namespace INTERP_KERNEL;
*/
//================================================================================
-ParaMEDMEM::TypeOfTimeDiscretization DoubleField::getMedTimeDisc() const
+MEDCoupling::TypeOfTimeDiscretization DoubleField::getMedTimeDisc() const
{
return ONE_TIME;
// NO_TIME = 4,
#include <list>
#include <algorithm>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class DataArrayInt;
reference is converted into a copy of the medGroup
(issue 0021311)
*/
- ParaMEDMEM::DataArrayInt* _medGroup; // result of conversion
+ MEDCoupling::DataArrayInt* _medGroup; // result of conversion
std::vector< unsigned > _relocTable; // for _cells[i] gives its index in _medGroup
bool empty() const { return _cells.empty() && _groups.empty(); }
is the same and supports of subcomponents do not overlap
*/
std::vector< std::vector< double > > _comp_values;
- ParaMEDMEM::MEDFileFieldMultiTS* _curMedField;
+ MEDCoupling::MEDFileFieldMultiTS* _curMedField;
DoubleField( int nb_sub, int total_nb_comp )
: _sub(nb_sub), _group(NULL), _curMedField(NULL) { _comp_values.reserve( total_nb_comp ); }
bool isMultiTimeStamps() const;
bool isMedCompatible(bool& sameNbGauss) const;
- ParaMEDMEM::TypeOfField getMedType( const int iSub=0 ) const;
- ParaMEDMEM::TypeOfTimeDiscretization getMedTimeDisc() const;
+ MEDCoupling::TypeOfField getMedType( const int iSub=0 ) const;
+ MEDCoupling::TypeOfTimeDiscretization getMedTimeDisc() const;
int getNbTuples( const int iSub=0 ) const;
int getNbValuesPerElement( const int iSub=0 ) const;
int getNbGauss( const int iSub=0 ) const;
int getNbCellsOfType( TCellType type ) const { return _cellsByType[type].size(); }
const Cell* insert(TCellType type, const Cell& ma) { return &( *_cellsByType[type].insert( ma ).first ); }
Group* addNewGroup(std::vector<SauvUtilities::Group*>* groupsToFix=0);
- ParaMEDMEM::MEDFileData* convertInMEDFileDS();
+ MEDCoupling::MEDFileData* convertInMEDFileDS();
private:
- ParaMEDMEM::MEDFileUMesh* makeMEDFileMesh();
- ParaMEDMEM::DataArrayDouble * getCoords();
- void setConnectivity( ParaMEDMEM::MEDFileUMesh* mesh, ParaMEDMEM::DataArrayDouble* coords );
- void setGroups( ParaMEDMEM::MEDFileUMesh* mesh );
- ParaMEDMEM::MEDFileFields * makeMEDFileFields(ParaMEDMEM::MEDFileUMesh* mesh);
+ MEDCoupling::MEDFileUMesh* makeMEDFileMesh();
+ MEDCoupling::DataArrayDouble * getCoords();
+ void setConnectivity( MEDCoupling::MEDFileUMesh* mesh, MEDCoupling::DataArrayDouble* coords );
+ void setGroups( MEDCoupling::MEDFileUMesh* mesh );
+ MEDCoupling::MEDFileFields * makeMEDFileFields(MEDCoupling::MEDFileUMesh* mesh);
void setFields( SauvUtilities::DoubleField* fld,
- ParaMEDMEM::MEDFileFields* medFields,
- ParaMEDMEM::MEDFileUMesh* mesh,
+ MEDCoupling::MEDFileFields* medFields,
+ MEDCoupling::MEDFileUMesh* mesh,
const TID castemID,
std::set< std::string >& usedNames);
void setTS( SauvUtilities::DoubleField* fld,
- ParaMEDMEM::DataArrayDouble* values,
- ParaMEDMEM::MEDFileFields* medFields,
- ParaMEDMEM::MEDFileUMesh* mesh,
+ MEDCoupling::DataArrayDouble* values,
+ MEDCoupling::MEDFileFields* medFields,
+ MEDCoupling::MEDFileUMesh* mesh,
const int iSub=0);
void checkDataAvailability() const;
void setGroupLongNames();
#include "SauvReader.hxx"
#include "SauvMedConvertor.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "NormalizedUnstructuredMesh.hxx"
#include "MEDCouplingRefCountObject.hxx"
#include <sstream>
#include <iostream>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace SauvUtilities;
using namespace std;
{
if ( fileName.empty() ) THROW_IK_EXCEPTION("Invalid file name");
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr< SauvUtilities::FileReader> parser;
+ MEDCoupling::MCAuto< SauvUtilities::FileReader> parser;
// try to open as XRD
parser = new XDRReader( fileName.c_str() );
*/
//================================================================================
-ParaMEDMEM::MEDFileData * SauvReader::loadInMEDFileDS()
+MEDCoupling::MEDFileData * SauvReader::loadInMEDFileDS()
{
SauvUtilities::IntermediateMED iMed; // intermadiate DS
_iMed = &iMed;
THROW_IK_EXCEPTION("XDR : ENREGISTREMENT DE TYPE " << recordNumber << " not implemented!!!");
}
- ParaMEDMEM::MEDFileData* medFileData = iMed.convertInMEDFileDS();
+ MEDCoupling::MEDFileData* medFileData = iMed.convertInMEDFileDS();
return medFileData;
}
struct Group;
struct DoubleField;
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileData;
-class SauvReader : public ParaMEDMEM::RefCountObject
+class SauvReader : public MEDCoupling::RefCountObject
{
public:
MEDLOADER_EXPORT static SauvReader* New(const std::string& fileName);
- MEDLOADER_EXPORT ParaMEDMEM::MEDFileData * loadInMEDFileDS();
+ MEDLOADER_EXPORT MEDCoupling::MEDFileData * loadInMEDFileDS();
MEDLOADER_EXPORT ~SauvReader();
private:
/*!
* \brief Base class for ASCII and XDR file readers
*/
- class FileReader : public ParaMEDMEM::RefCountObject
+ class FileReader : public MEDCoupling::RefCountObject
{
public:
FileReader(const char* fileName);
#include <cstdlib>
#include <iomanip>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace SauvUtilities;
using namespace std;
for ( size_t iDim = 0; iDim < dims.size(); ++iDim )
{
int dimRelExt = dims[ iDim ];
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel(dimRelExt);
+ MCAuto< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel(dimRelExt);
const DataArrayInt * famIds = _fileMesh->getFamilyFieldAtLevel(dimRelExt);
if ( !famIds ) continue;
SubMesh* nilSm = (SubMesh*) 0;
for ( int isOnNodes = 0; isOnNodes < 2; ++isOnNodes )
{
- vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldMultiTS > >
+ vector< MCAuto< MEDFileFieldMultiTS > >
fields = isOnNodes ? _nodeFields : _cellFields;
for ( size_t i = 0; i < fields.size(); ++i )
{
INTERP_KERNEL::NormalizedCellType type,
const DataArrayInt* profile )
{
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh >
+ MCAuto< MEDCouplingMesh >
mesh = _fileMesh->getMeshAtLevel(sm->_dimRelExt);
const MEDCouplingUMesh* uMesh = dynamic_cast< const MEDCouplingUMesh* > ((const MEDCouplingMesh*) mesh );
code[2] = -1;
}
vector<const DataArrayInt *> idsPerType( 1, profile );
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt>
+ MCAuto<DataArrayInt>
resIDs = uMesh->checkTypeConsistencyAndContig( code, idsPerType );
if (( const DataArrayInt *) resIDs )
{
void SauvWriter::writeFileHead()
{
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel(0);
+ MCAuto< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel(0);
*_sauvFile
<< " ENREGISTREMENT DE TYPE 4" << endl
else
{
// write each sub-type as a SAUV sub-mesh
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh >
+ MCAuto< MEDCouplingMesh >
mesh = _fileMesh->getMeshAtLevel( sm._dimRelExt );
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh>
+ MCAuto< MEDCouplingUMesh>
umesh = mesh->buildUnstructured();
for ( int iType=0; iType < sm.cellIDsByTypeSize(); ++iType )
void SauvWriter::writeNodes()
{
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel( 1 );
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh > umesh = mesh->buildUnstructured();
+ MCAuto< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel( 1 );
+ MCAuto< MEDCouplingUMesh > umesh = mesh->buildUnstructured();
// write the index connecting nodes with their coodrinates
_sauvFile->precision(14);
_sauvFile->setf( ios_base::scientific, ios_base::floatfield );
_sauvFile->setf( ios_base::uppercase );
- MEDCouplingAutoRefCountObjectPtr< DataArrayDouble> coordArray = umesh->getCoordinatesAndOwner();
+ MCAuto< DataArrayDouble> coordArray = umesh->getCoordinatesAndOwner();
const double precision = 1.e-99; // PAL12077
for ( int i = 0; i < nbNodes; ++i)
{
void SauvWriter::writeFieldNames( const bool isNodal,
std::map<std::string,int>& fldNamePrefixMap)
{
- vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldMultiTS > >&
+ vector< MCAuto< MEDFileFieldMultiTS > >&
flds = isNodal ? _nodeFields : _cellFields;
map<string,int> nameNbMap;
#include "MEDCouplingRefCountObject.hxx"
#include "NormalizedUnstructuredMesh.hxx"
#include "SauvUtilities.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <vector>
#include <string>
#include <map>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileData;
class MEDFileMesh;
/*!
* \brief Class to write a MEDFileData into a SAUVE format file
*/
- class SauvWriter : public ParaMEDMEM::RefCountObject
+ class SauvWriter : public MEDCoupling::RefCountObject
{
public:
MEDLOADER_EXPORT static SauvWriter *New();
private:
- MEDCouplingAutoRefCountObjectPtr< MEDFileMesh > _fileMesh;
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldMultiTS > > _nodeFields;
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldMultiTS > > _cellFields;
+ MCAuto< MEDFileMesh > _fileMesh;
+ std::vector< MCAuto< MEDFileFieldMultiTS > > _nodeFields;
+ std::vector< MCAuto< MEDFileFieldMultiTS > > _cellFields;
std::vector<SubMesh> _subs;
std::map< int, SubMesh* > _famIDs2Sub;
SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py ${MEDCOUPLING_INSTALL_PYTHON})
-INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest1.py MEDLoaderTest2.py MEDLoaderTest3.py MEDLoaderTest4.py SauvLoaderTest.py MEDLoaderExamplesTest.py MEDLoaderCouplingTrainingSession.py CaseIO.py CaseReader.py CaseWriter.py VTKReader.py MEDLoaderSplitter.py medutilities.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS})
+INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest1.py MEDLoaderTest2.py MEDLoaderTest3.py MEDLoaderTest123.py MEDLoaderTest4.py SauvLoaderTest.py MEDLoaderExamplesTest.py MEDLoaderCouplingTrainingSession.py CaseIO.py CaseReader.py CaseWriter.py VTKReader.py MEDLoaderSplitter.py medutilities.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS})
INSTALL(FILES med2sauv PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
INSTALL(FILES sauv2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
INSTALL(FILES case2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
-ADD_TEST(MEDLoaderTest1_2_3 ${PYTHON_EXECUTABLE} -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR} -p MEDLoaderTest[123].py)
+ADD_TEST(MEDLoaderTest1_2_3 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest123.py)
SET_TESTS_PROPERTIES(MEDLoaderTest1_2_3 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDLoaderTest4 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest4.py)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-ADD_TEST(MEDLoaderTest1_2_3 python -m unittest discover -p MEDLoaderTest[123].py)
+ADD_TEST(MEDLoaderTest1_2_3 python MEDLoaderTest123.py)
SET_TESTS_PROPERTIES(MEDLoaderTest1_2_3 PROPERTIES LABELS "${COMPONENT_NAME}")
ADD_TEST(MEDLoaderTest4 python MEDLoaderTest4.py)
pass
c=DataArrayInt(len(cells),nbNodesPerCell+1) ; c[:,0]=ct ; c[:,1:]=c2-1 ; c.rearrange(1)
m.setConnectivity(c,cI,True)
- m.checkCoherency1()
+ m.checkConsistency()
return m
def __traduceMeshForPolyhed(self,name,coords,arr0,arr1,arr2):
m.setCoords(coo)
#
arr2=arr2[:]-1
- arr0mc0=DataArrayInt(arr0) ; arr0mc0.computeOffsets2()
- arr0mc1=DataArrayInt(arr0).deepCpy()
- arr0mc2=DataArrayInt(len(arr0),2) ; arr0mc2[:,0]=DataArrayInt(arr0)-1 ; arr0mc2[:,1]=1 ; arr0mc2.rearrange(1) ; arr0mc2.computeOffsets2()
+ arr0mc0=DataArrayInt(arr0) ; arr0mc0.computeOffsetsFull()
+ arr0mc1=DataArrayInt(arr0).deepCopy()
+ arr0mc2=DataArrayInt(len(arr0),2) ; arr0mc2[:,0]=DataArrayInt(arr0)-1 ; arr0mc2[:,1]=1 ; arr0mc2.rearrange(1) ; arr0mc2.computeOffsetsFull()
arr0mc3=DataArrayInt.Range(0,2*len(arr0),2).buildExplicitArrByRanges(arr0mc2)
- arr1mc0=DataArrayInt(arr1) ; arr1mc0.computeOffsets2()
+ arr1mc0=DataArrayInt(arr1) ; arr1mc0.computeOffsetsFull()
arr1mc1=arr1mc0[arr0mc0] ; arr1mc1[1:]+=arr0mc0[1:]
- arr1mc2=DataArrayInt(arr1).deepCpy() ; arr1mc2+=1 ; arr1mc2.computeOffsets2()
+ arr1mc2=DataArrayInt(arr1).deepCopy() ; arr1mc2+=1 ; arr1mc2.computeOffsetsFull()
arr2mc0=(arr1mc2[1:])[arr0mc3]
#
c=DataArrayInt(arr1.size+arr2.size)
c[a]=DataArrayInt(arr2)
#
m.setConnectivity(c,arr1mc1,True)
- m.checkCoherency1()
+ m.checkConsistency()
return m
def __traduceMeshForPolygon(self,name,coords,arr0,arr1):
m=MEDCouplingUMesh(name,2)
m.setCoords(coo)
#
- arr0_0=DataArrayInt(arr0+1) ; arr0_0.computeOffsets2()
- arr0_1=DataArrayInt(len(arr0),2) ; arr0_1[:,1]=DataArrayInt(arr0) ; arr0_1[:,0]=1 ; arr0_1.rearrange(1) ; arr0_1.computeOffsets2()
+ arr0_0=DataArrayInt(arr0+1) ; arr0_0.computeOffsetsFull()
+ arr0_1=DataArrayInt(len(arr0),2) ; arr0_1[:,1]=DataArrayInt(arr0) ; arr0_1[:,0]=1 ; arr0_1.rearrange(1) ; arr0_1.computeOffsetsFull()
arr0_2=DataArrayInt.Range(1,2*len(arr0),2).buildExplicitArrByRanges(arr0_1)
c=DataArrayInt(len(arr0)+len(arr1)) ; c[:]=0 ; c[arr0_0[:-1]]=NORM_POLYGON
c[arr0_2]=DataArrayInt(arr1-1)
#
m.setConnectivity(c,arr0_0,True)
- m.checkCoherency1()
+ m.checkConsistency()
return m
def __convertGeo2MED(self,geoFileName):
pass
f=MEDCouplingFieldDouble(self.discSpatial2[discr],ONE_TIME) ; f.setName("%s_%s"%(fieldName,mcmeshes[meshId].getName()))
f.setMesh(mcmeshes[meshId]) ; f.setArray(vals2) ; f.setTime(float(it),it,-1)
- f.checkCoherency()
+ f.checkConsistencyLight()
mlfields[locId+meshId].appendFieldNoProfileSBT(f)
pass
pass
f=MEDCouplingFieldDouble(self.discSpatial2[discr],ONE_TIME) ; f.setName("%s_%s"%(fieldName,mcmeshes[nbTurn].getName()))
f.setMesh(mcmeshes[nbTurn]) ; f.setArray(vals2) ; f.setTime(float(it),it,-1)
- f.checkCoherency()
+ f.checkConsistencyLight()
mlfields[locId+nbTurn].appendFieldNoProfileSBT(f)
nbTurn+=1
pass
c=mp.computeNbOfFacesPerCell()
a=np.memmap(f,dtype='int32',mode='w+',offset=mm.tell(),shape=(nbelem,))
a[:]=c.toNumPyArray(); a.flush() ; mm.seek(mm.tell()+nbelem*4)
- c=mp.getNodalConnectivity()[:] ; c.pushBackSilent(-1) ; c[mp.getNodalConnectivityIndex()[:-1]]=-1 ; ids=c.getIdsEqual(-1) ; nbOfNodesPerFace=ids.deltaShiftIndex()-1
+ c=mp.getNodalConnectivity()[:] ; c.pushBackSilent(-1) ; c[mp.getNodalConnectivityIndex()[:-1]]=-1 ; ids=c.findIdsEqual(-1) ; nbOfNodesPerFace=ids.deltaShiftIndex()-1
a=np.memmap(f,dtype='int32',mode='w+',offset=mm.tell(),shape=(len(nbOfNodesPerFace),))
a[:]=nbOfNodesPerFace.toNumPyArray() ; a.flush() ; mm.seek(mm.tell()+len(nbOfNodesPerFace)*4)
ids2=ids.buildComplement(ids.back()+1)
%include "MEDLoaderCommon.i"
%pythoncode %{
-def ParaMEDMEMDataArrayDoublenew(cls,*args):
+def MEDCouplingDataArrayDoublenew(cls,*args):
import _MEDLoader
return _MEDLoader.DataArrayDouble____new___(cls,args)
-def ParaMEDMEMDataArrayDoubleIadd(self,*args):
+def MEDCouplingDataArrayDoubleIadd(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDouble____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIsub(self,*args):
+def MEDCouplingDataArrayDoubleIsub(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDouble____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleImul(self,*args):
+def MEDCouplingDataArrayDoubleImul(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDouble____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleIdiv(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDouble____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIpow(self,*args):
+def MEDCouplingDataArrayDoubleIpow(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDouble____ipow___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoublenew(cls,*args):
+def MEDCouplingFieldDoublenew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingFieldDouble____new___(cls,args)
-def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args):
+def MEDCouplingFieldDoubleIadd(self,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingFieldDouble____iadd___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args):
+def MEDCouplingFieldDoubleIsub(self,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingFieldDouble____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args):
+def MEDCouplingFieldDoubleImul(self,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingFieldDouble____imul___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args):
+def MEDCouplingFieldDoubleIdiv(self,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingFieldDouble____idiv___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args):
+def MEDCouplingFieldDoubleIpow(self,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingFieldDouble____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayIntnew(cls,*args):
+def MEDCouplingDataArrayIntnew(cls,*args):
import _MEDLoader
return _MEDLoader.DataArrayInt____new___(cls,args)
-def ParaMEDMEMDataArrayIntIadd(self,*args):
+def MEDCouplingDataArrayIntIadd(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayInt____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntIsub(self,*args):
+def MEDCouplingDataArrayIntIsub(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayInt____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntImul(self,*args):
+def MEDCouplingDataArrayIntImul(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayInt____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntIdiv(self,*args):
+def MEDCouplingDataArrayIntIdiv(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayInt____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntImod(self,*args):
+def MEDCouplingDataArrayIntImod(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayInt____imod___(self, self, *args)
-def ParaMEDMEMDataArrayIntIpow(self,*args):
+def MEDCouplingDataArrayIntIpow(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayInt____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
+def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDoubleTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
+def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDoubleTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
+def MEDCouplingDataArrayDoubleTupleImul(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDoubleTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayDoubleTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayIntTupleIadd(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayIntTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
+def MEDCouplingDataArrayIntTupleIsub(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayIntTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImul(self,*args):
+def MEDCouplingDataArrayIntTupleImul(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayIntTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
+def MEDCouplingDataArrayIntTupleIdiv(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayIntTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImod(self,*args):
+def MEDCouplingDataArrayIntTupleImod(self,*args):
import _MEDLoader
return _MEDLoader.DataArrayIntTuple____imod___(self, self, *args)
def ParaMEDMEMDenseMatrixIadd(self,*args):
def ParaMEDMEMDenseMatrixIsub(self,*args):
import _MEDLoader
return _MEDLoader.DenseMatrix____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingUMeshnew(cls,*args):
+def MEDCouplingUMeshnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingUMesh____new___(cls,args)
-def ParaMEDMEMMEDCoupling1DGTUMeshnew(cls,*args):
+def MEDCoupling1DGTUMeshnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDCoupling1DGTUMesh____new___(cls,args)
-def ParaMEDMEMMEDCoupling1SGTUMeshnew(cls,*args):
+def MEDCoupling1SGTUMeshnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDCoupling1SGTUMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingCurveLinearMeshnew(cls,*args):
+def MEDCouplingCurveLinearMeshnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingCurveLinearMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingCMeshnew(cls,*args):
+def MEDCouplingCMeshnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingCMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingIMeshnew(cls,*args):
+def MEDCouplingIMeshnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDCouplingIMesh____new___(cls,args)
-def ParaMEDMEMMEDCouplingExtrudedMeshnew(cls,*args):
+def MEDCouplingExtrudedMeshnew(cls,*args):
import _MEDLoader
- return _MEDLoader.MEDCouplingExtrudedMesh____new___(cls,args)
+ return _MEDLoader.MEDCouplingMappedExtrudedMesh____new___(cls,args)
%}
%pythoncode %{
#include "SauvReader.hxx"
#include "SauvWriter.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
%}
#if SWIG_VERSION >= 0x010329
%template() std::vector<std::string>;
#endif
-%typemap(out) ParaMEDMEM::MEDFileMesh*
+%typemap(out) MEDCoupling::MEDFileMesh*
{
$result=convertMEDFileMesh($1,$owner);
}
-%typemap(out) ParaMEDMEM::MEDFileParameter1TS*
+%typemap(out) MEDCoupling::MEDFileParameter1TS*
{
$result=convertMEDFileParameter1TS($1,$owner);
}
-%typemap(out) ParaMEDMEM::MEDFileAnyTypeFieldMultiTS*
+%typemap(out) MEDCoupling::MEDFileAnyTypeFieldMultiTS*
{
$result=convertMEDFileFieldMultiTS($1,$owner);
}
-%typemap(out) ParaMEDMEM::MEDFileAnyTypeField1TS*
+%typemap(out) MEDCoupling::MEDFileAnyTypeField1TS*
{
$result=convertMEDFileField1TS($1,$owner);
}
-%typemap(out) ParaMEDMEM::MEDMeshMultiLev*
+%typemap(out) MEDCoupling::MEDMeshMultiLev*
{
$result=convertMEDMeshMultiLev($1,$owner);
}
-%newobject MEDLoader::ReadUMeshFromFamilies;
-%newobject MEDLoader::ReadUMeshFromGroups;
-%newobject MEDLoader::ReadUMeshFromFile;
-%newobject MEDLoader::ReadMeshFromFile;
-%newobject MEDLoader::ReadField;
-%newobject MEDLoader::ReadFieldCell;
-%newobject MEDLoader::ReadFieldNode;
-%newobject MEDLoader::ReadFieldGauss;
-%newobject MEDLoader::ReadFieldGaussNE;
-%newobject ParaMEDMEM::MEDFileMesh::New;
-%newobject ParaMEDMEM::MEDFileMesh::createNewEmpty;
-%newobject ParaMEDMEM::MEDFileMesh::deepCpy;
-%newobject ParaMEDMEM::MEDFileMesh::shallowCpy;
-%newobject ParaMEDMEM::MEDFileMesh::getMeshAtLevel;
-%newobject ParaMEDMEM::MEDFileMesh::__getitem__;
-%newobject ParaMEDMEM::MEDFileMesh::getGroupArr;
-%newobject ParaMEDMEM::MEDFileMesh::getGroupsArr;
-%newobject ParaMEDMEM::MEDFileMesh::getFamilyArr;
-%newobject ParaMEDMEM::MEDFileMesh::getFamiliesArr;
-%newobject ParaMEDMEM::MEDFileMesh::getNodeGroupArr;
-%newobject ParaMEDMEM::MEDFileMesh::getNodeGroupsArr;
-%newobject ParaMEDMEM::MEDFileMesh::getNodeFamilyArr;
-%newobject ParaMEDMEM::MEDFileMesh::getNodeFamiliesArr;
-%newobject ParaMEDMEM::MEDFileMesh::getAllFamiliesIdsReferenced;
-%newobject ParaMEDMEM::MEDFileMesh::computeAllFamilyIdsInUse;
-%newobject ParaMEDMEM::MEDFileMesh::getEquivalences;
-%newobject ParaMEDMEM::MEDFileMesh::cartesianize;
-%newobject ParaMEDMEM::MEDFileData::getJoints;
-%newobject ParaMEDMEM::MEDFileStructuredMesh::getImplicitFaceMesh;
-%newobject ParaMEDMEM::MEDFileUMesh::New;
-%newobject ParaMEDMEM::MEDFileUMesh::LoadPartOf;
-%newobject ParaMEDMEM::MEDFileUMesh::getCoords;
-%newobject ParaMEDMEM::MEDFileUMesh::getPartDefAtLevel;
-%newobject ParaMEDMEM::MEDFileUMesh::getGroup;
-%newobject ParaMEDMEM::MEDFileUMesh::getGroups;
-%newobject ParaMEDMEM::MEDFileUMesh::getFamily;
-%newobject ParaMEDMEM::MEDFileUMesh::getFamilies;
-%newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh;
-%newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh;
-%newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
-%newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
-%newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
-%newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
-%newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
-%newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
-%newobject ParaMEDMEM::MEDFileUMesh::buildExtrudedMesh;
-%newobject ParaMEDMEM::MEDFileUMesh::linearToQuadratic;
-%newobject ParaMEDMEM::MEDFileUMesh::quadraticToLinear;
-%newobject ParaMEDMEM::MEDFileCMesh::New;
-%newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
-%newobject ParaMEDMEM::MEDFileMeshMultiTS::New;
-%newobject ParaMEDMEM::MEDFileMeshMultiTS::deepCpy;
-%newobject ParaMEDMEM::MEDFileMeshMultiTS::getOneTimeStep;
-%newobject ParaMEDMEM::MEDFileMeshes::New;
-%newobject ParaMEDMEM::MEDFileMeshes::deepCpy;
-%newobject ParaMEDMEM::MEDFileMeshes::getMeshAtPos;
-%newobject ParaMEDMEM::MEDFileMeshes::getMeshWithName;
-%newobject ParaMEDMEM::MEDFileMeshes::__getitem__;
-%newobject ParaMEDMEM::MEDFileMeshes::__iter__;
-
-%newobject ParaMEDMEM::MEDFileFields::New;
-%newobject ParaMEDMEM::MEDFileFields::LoadPartOf;
-%newobject ParaMEDMEM::MEDFileFields::LoadSpecificEntities;
-%newobject ParaMEDMEM::MEDFileFields::deepCpy;
-%newobject ParaMEDMEM::MEDFileFields::shallowCpy;
-%newobject ParaMEDMEM::MEDFileFields::getFieldWithName;
-%newobject ParaMEDMEM::MEDFileFields::getFieldAtPos;
-%newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
-%newobject ParaMEDMEM::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
-%newobject ParaMEDMEM::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
-%newobject ParaMEDMEM::MEDFileFields::__iter__;
-
-%newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::New;
-%newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::deepCpy;
-%newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::shallowCpy;
-%newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
-%newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStep;
-%newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
-%newobject ParaMEDMEM::MEDFileAnyTypeFieldMultiTS::__iter__;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::New;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::LoadSpecificEntities;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevel;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtTopLevel;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::getFieldAtLevelOld;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::getUndergroundDataArray;
-%newobject ParaMEDMEM::MEDFileFieldMultiTS::convertToInt;
-%newobject ParaMEDMEM::MEDFileIntFieldMultiTS::New;
-%newobject ParaMEDMEM::MEDFileIntFieldMultiTS::LoadSpecificEntities;
-%newobject ParaMEDMEM::MEDFileIntFieldMultiTS::getUndergroundDataArray;
-%newobject ParaMEDMEM::MEDFileIntFieldMultiTS::convertToDouble;
-
-%newobject ParaMEDMEM::MEDFileAnyTypeField1TS::New;
-%newobject ParaMEDMEM::MEDFileAnyTypeField1TS::shallowCpy;
-%newobject ParaMEDMEM::MEDFileAnyTypeField1TS::deepCpy;
-%newobject ParaMEDMEM::MEDFileField1TS::New;
-%newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevel;
-%newobject ParaMEDMEM::MEDFileField1TS::getFieldAtTopLevel;
-%newobject ParaMEDMEM::MEDFileField1TS::getFieldOnMeshAtLevel;
-%newobject ParaMEDMEM::MEDFileField1TS::getFieldAtLevelOld;
-%newobject ParaMEDMEM::MEDFileField1TS::getUndergroundDataArray;
-%newobject ParaMEDMEM::MEDFileField1TS::convertToInt;
-%newobject ParaMEDMEM::MEDFileIntField1TS::New;
-%newobject ParaMEDMEM::MEDFileIntField1TS::getUndergroundDataArray;
-%newobject ParaMEDMEM::MEDFileIntField1TS::convertToDouble;
-
-%newobject ParaMEDMEM::MEDFileData::New;
-%newobject ParaMEDMEM::MEDFileData::deepCpy;
-%newobject ParaMEDMEM::MEDFileData::getMeshes;
-%newobject ParaMEDMEM::MEDFileData::getFields;
-%newobject ParaMEDMEM::MEDFileData::getParams;
-
-%newobject ParaMEDMEM::MEDFileParameterDouble1TS::New;
-%newobject ParaMEDMEM::MEDFileParameterDouble1TS::deepCpy;
-%newobject ParaMEDMEM::MEDFileParameterMultiTS::New;
-%newobject ParaMEDMEM::MEDFileParameterMultiTS::deepCpy;
-%newobject ParaMEDMEM::MEDFileParameterMultiTS::getTimeStepAtPos;
-%newobject ParaMEDMEM::MEDFileParameterMultiTS::__getitem__;
-%newobject ParaMEDMEM::MEDFileParameters::New;
-%newobject ParaMEDMEM::MEDFileParameters::deepCpy;
-%newobject ParaMEDMEM::MEDFileParameters::getParamAtPos;
-%newobject ParaMEDMEM::MEDFileParameters::getParamWithName;
-%newobject ParaMEDMEM::MEDFileParameters::__getitem__;
-
-%newobject ParaMEDMEM::MEDFileJointCorrespondence::New;
-%newobject ParaMEDMEM::MEDFileJointCorrespondence::deepCpy;
-%newobject ParaMEDMEM::MEDFileJointCorrespondence::shallowCpy;
-%newobject ParaMEDMEM::MEDFileJointOneStep::New;
-%newobject ParaMEDMEM::MEDFileJointOneStep::deepCpy;
-%newobject ParaMEDMEM::MEDFileJointOneStep::shallowCpy;
-%newobject ParaMEDMEM::MEDFileJoint::New;
-%newobject ParaMEDMEM::MEDFileJoint::deepCpy;
-%newobject ParaMEDMEM::MEDFileJoint::shallowCpy;
-%newobject ParaMEDMEM::MEDFileJoints::New;
-%newobject ParaMEDMEM::MEDFileJoints::deepCpy;
-%newobject ParaMEDMEM::MEDFileJoints::getJointAtPos;
-%newobject ParaMEDMEM::MEDFileJoints::getJointWithName;
-%newobject ParaMEDMEM::MEDFileJoints::__getitem__;
-%newobject ParaMEDMEM::MEDFileEquivalences::getEquivalence;
-%newobject ParaMEDMEM::MEDFileEquivalences::getEquivalenceWithName;
-%newobject ParaMEDMEM::MEDFileEquivalences::appendEmptyEquivalenceWithName;
-%newobject ParaMEDMEM::MEDFileEquivalencePair::initCell;
-%newobject ParaMEDMEM::MEDFileEquivalencePair::initNode;
-%newobject ParaMEDMEM::MEDFileEquivalencePair::getCell;
-%newobject ParaMEDMEM::MEDFileEquivalencePair::getNode;
-%newobject ParaMEDMEM::MEDFileEquivalenceData::getArray;
-%newobject ParaMEDMEM::MEDFileEquivalenceCell::getArray;
-
-%newobject ParaMEDMEM::SauvWriter::New;
-%newobject ParaMEDMEM::SauvReader::New;
-%newobject ParaMEDMEM::SauvReader::loadInMEDFileDS;
-
-%newobject ParaMEDMEM::MEDFileMeshStruct::New;
-%newobject ParaMEDMEM::MEDMeshMultiLev::prepare;
-%newobject ParaMEDMEM::MEDMeshMultiLev::buildDataArray;
-%newobject ParaMEDMEM::MEDFileFastCellSupportComparator::New;
-%newobject ParaMEDMEM::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
+%newobject ReadUMeshFromFamiliesSwig;
+%newobject ReadUMeshFromGroupsSwig;
+%newobject MEDCoupling::ReadUMeshFromFile;
+%newobject MEDCoupling::ReadMeshFromFile;
+%newobject MEDCoupling::ReadField;
+%newobject MEDCoupling::ReadFieldCell;
+%newobject MEDCoupling::ReadFieldNode;
+%newobject MEDCoupling::ReadFieldGauss;
+%newobject MEDCoupling::ReadFieldGaussNE;
+%newobject MEDCoupling::MEDFileMesh::New;
+%newobject MEDCoupling::MEDFileMesh::createNewEmpty;
+%newobject MEDCoupling::MEDFileMesh::deepCopy;
+%newobject MEDCoupling::MEDFileMesh::shallowCpy;
+%newobject MEDCoupling::MEDFileMesh::getMeshAtLevel;
+%newobject MEDCoupling::MEDFileMesh::__getitem__;
+%newobject MEDCoupling::MEDFileMesh::getGroupArr;
+%newobject MEDCoupling::MEDFileMesh::getGroupsArr;
+%newobject MEDCoupling::MEDFileMesh::getFamilyArr;
+%newobject MEDCoupling::MEDFileMesh::getFamiliesArr;
+%newobject MEDCoupling::MEDFileMesh::getNodeGroupArr;
+%newobject MEDCoupling::MEDFileMesh::getNodeGroupsArr;
+%newobject MEDCoupling::MEDFileMesh::getNodeFamilyArr;
+%newobject MEDCoupling::MEDFileMesh::getNodeFamiliesArr;
+%newobject MEDCoupling::MEDFileMesh::getAllFamiliesIdsReferenced;
+%newobject MEDCoupling::MEDFileMesh::computeAllFamilyIdsInUse;
+%newobject MEDCoupling::MEDFileMesh::getEquivalences;
+%newobject MEDCoupling::MEDFileMesh::cartesianize;
+%newobject MEDCoupling::MEDFileData::getJoints;
+%newobject MEDCoupling::MEDFileStructuredMesh::getImplicitFaceMesh;
+%newobject MEDCoupling::MEDFileUMesh::New;
+%newobject MEDCoupling::MEDFileUMesh::LoadPartOf;
+%newobject MEDCoupling::MEDFileUMesh::getCoords;
+%newobject MEDCoupling::MEDFileUMesh::getPartDefAtLevel;
+%newobject MEDCoupling::MEDFileUMesh::getGroup;
+%newobject MEDCoupling::MEDFileUMesh::getGroups;
+%newobject MEDCoupling::MEDFileUMesh::getFamily;
+%newobject MEDCoupling::MEDFileUMesh::getFamilies;
+%newobject MEDCoupling::MEDFileUMesh::getLevel0Mesh;
+%newobject MEDCoupling::MEDFileUMesh::getLevelM1Mesh;
+%newobject MEDCoupling::MEDFileUMesh::getLevelM2Mesh;
+%newobject MEDCoupling::MEDFileUMesh::getLevelM3Mesh;
+%newobject MEDCoupling::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
+%newobject MEDCoupling::MEDFileUMesh::extractFamilyFieldOnGeoType;
+%newobject MEDCoupling::MEDFileUMesh::extractNumberFieldOnGeoType;
+%newobject MEDCoupling::MEDFileUMesh::zipCoords;
+%newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh;
+%newobject MEDCoupling::MEDFileUMesh::linearToQuadratic;
+%newobject MEDCoupling::MEDFileUMesh::quadraticToLinear;
+%newobject MEDCoupling::MEDFileCMesh::New;
+%newobject MEDCoupling::MEDFileCurveLinearMesh::New;
+%newobject MEDCoupling::MEDFileMeshMultiTS::New;
+%newobject MEDCoupling::MEDFileMeshMultiTS::deepCopy;
+%newobject MEDCoupling::MEDFileMeshMultiTS::getOneTimeStep;
+%newobject MEDCoupling::MEDFileMeshes::New;
+%newobject MEDCoupling::MEDFileMeshes::deepCopy;
+%newobject MEDCoupling::MEDFileMeshes::getMeshAtPos;
+%newobject MEDCoupling::MEDFileMeshes::getMeshWithName;
+%newobject MEDCoupling::MEDFileMeshes::__getitem__;
+%newobject MEDCoupling::MEDFileMeshes::__iter__;
+
+%newobject MEDCoupling::MEDFileFields::New;
+%newobject MEDCoupling::MEDFileFields::LoadPartOf;
+%newobject MEDCoupling::MEDFileFields::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileFields::deepCopy;
+%newobject MEDCoupling::MEDFileFields::shallowCpy;
+%newobject MEDCoupling::MEDFileFields::getFieldWithName;
+%newobject MEDCoupling::MEDFileFields::getFieldAtPos;
+%newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedMeshName;
+%newobject MEDCoupling::MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps;
+%newobject MEDCoupling::MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps;
+%newobject MEDCoupling::MEDFileFields::__iter__;
+
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::New;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::deepCopy;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::shallowCpy;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepAtPos;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStep;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::getTimeStepGivenTime;
+%newobject MEDCoupling::MEDFileAnyTypeFieldMultiTS::__iter__;
+%newobject MEDCoupling::MEDFileFieldMultiTS::New;
+%newobject MEDCoupling::MEDFileFieldMultiTS::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
+%newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
+%newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
+%newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileIntFieldMultiTS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileIntFieldMultiTS::convertToDouble;
+
+%newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
+%newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
+%newobject MEDCoupling::MEDFileAnyTypeField1TS::deepCopy;
+%newobject MEDCoupling::MEDFileField1TS::New;
+%newobject MEDCoupling::MEDFileField1TS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileField1TS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileField1TS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileField1TS::getFieldAtLevelOld;
+%newobject MEDCoupling::MEDFileField1TS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileField1TS::convertToInt;
+%newobject MEDCoupling::MEDFileIntField1TS::New;
+%newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
+
+%newobject MEDCoupling::MEDFileData::New;
+%newobject MEDCoupling::MEDFileData::deepCopy;
+%newobject MEDCoupling::MEDFileData::getMeshes;
+%newobject MEDCoupling::MEDFileData::getFields;
+%newobject MEDCoupling::MEDFileData::getParams;
+
+%newobject MEDCoupling::MEDFileParameterDouble1TS::New;
+%newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy;
+%newobject MEDCoupling::MEDFileParameterMultiTS::New;
+%newobject MEDCoupling::MEDFileParameterMultiTS::deepCopy;
+%newobject MEDCoupling::MEDFileParameterMultiTS::getTimeStepAtPos;
+%newobject MEDCoupling::MEDFileParameterMultiTS::__getitem__;
+%newobject MEDCoupling::MEDFileParameters::New;
+%newobject MEDCoupling::MEDFileParameters::deepCopy;
+%newobject MEDCoupling::MEDFileParameters::getParamAtPos;
+%newobject MEDCoupling::MEDFileParameters::getParamWithName;
+%newobject MEDCoupling::MEDFileParameters::__getitem__;
+
+%newobject MEDCoupling::MEDFileJointCorrespondence::New;
+%newobject MEDCoupling::MEDFileJointCorrespondence::deepCopy;
+%newobject MEDCoupling::MEDFileJointCorrespondence::shallowCpy;
+%newobject MEDCoupling::MEDFileJointOneStep::New;
+%newobject MEDCoupling::MEDFileJointOneStep::deepCopy;
+%newobject MEDCoupling::MEDFileJointOneStep::shallowCpy;
+%newobject MEDCoupling::MEDFileJoint::New;
+%newobject MEDCoupling::MEDFileJoint::deepCopy;
+%newobject MEDCoupling::MEDFileJoint::shallowCpy;
+%newobject MEDCoupling::MEDFileJoints::New;
+%newobject MEDCoupling::MEDFileJoints::deepCopy;
+%newobject MEDCoupling::MEDFileJoints::getJointAtPos;
+%newobject MEDCoupling::MEDFileJoints::getJointWithName;
+%newobject MEDCoupling::MEDFileJoints::__getitem__;
+%newobject MEDCoupling::MEDFileEquivalences::getEquivalence;
+%newobject MEDCoupling::MEDFileEquivalences::getEquivalenceWithName;
+%newobject MEDCoupling::MEDFileEquivalences::appendEmptyEquivalenceWithName;
+%newobject MEDCoupling::MEDFileEquivalencePair::initCell;
+%newobject MEDCoupling::MEDFileEquivalencePair::initNode;
+%newobject MEDCoupling::MEDFileEquivalencePair::getCell;
+%newobject MEDCoupling::MEDFileEquivalencePair::getNode;
+%newobject MEDCoupling::MEDFileEquivalenceData::getArray;
+%newobject MEDCoupling::MEDFileEquivalenceCell::getArray;
+
+%newobject MEDCoupling::SauvWriter::New;
+%newobject MEDCoupling::SauvReader::New;
+%newobject MEDCoupling::SauvReader::loadInMEDFileDS;
+
+%newobject MEDCoupling::MEDFileMeshStruct::New;
+%newobject MEDCoupling::MEDMeshMultiLev::prepare;
+%newobject MEDCoupling::MEDMeshMultiLev::buildDataArray;
+%newobject MEDCoupling::MEDFileFastCellSupportComparator::New;
+%newobject MEDCoupling::MEDFileFastCellSupportComparator::buildFromScratchDataSetSupport;
%feature("unref") MEDFileMesh "$this->decrRef();"
%feature("unref") MEDFileUMesh "$this->decrRef();"
%feature("unref") MEDCurveLinearMeshMultiLev "$this->decrRef();"
%feature("unref") MEDFileMeshStruct "$this->decrRef();"
-class MEDLoader
+namespace MEDCoupling
{
-public:
- static bool HasXDR();
- static std::string MEDFileVersionStr();
- static void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
- static void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
- static void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
- static void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- static std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
- %extend
- {
- static PyObject *MEDFileVersion()
- {
- int major,minor,release;
- MEDLoader::MEDFileVersion(major,minor,release);
- PyObject *ret(PyTuple_New(3));
- PyTuple_SetItem(ret,0,SWIG_From_int(major));
- PyTuple_SetItem(ret,1,SWIG_From_int(minor));
- PyTuple_SetItem(ret,2,SWIG_From_int(release));
- return ret;
- }
+ bool HasXDR();
+ std::string MEDFileVersionStr();
+ void SetEpsilonForNodeComp(double val) throw(INTERP_KERNEL::Exception);
+ void SetCompPolicyForCell(int val) throw(INTERP_KERNEL::Exception);
+ void SetTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
+ void CheckFileForRead(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetMeshNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetAllFieldNames(const std::string& fileName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
+ int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingFieldDouble *ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+ void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
+}
- static PyObject *GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
- {
- std::vector< std::pair<int,int> > res=MEDLoader::GetFieldIterations(type,fileName,meshName,fieldName);
- PyObject *ret=PyList_New(res.size());
- int rk=0;
- for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
- {
- PyObject *elt=PyTuple_New(2);
- PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
- PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
- PyList_SetItem(ret,rk,elt);
- }
- return ret;
- }
+%rename (MEDFileVersion) MEDFileVersionSwig;
+%rename (GetFieldIterations) GetFieldIterationsSwig;
+%rename (GetAllFieldIterations) GetAllFieldIterationsSwig;
+%rename (GetCellFieldIterations) GetCellFieldIterationsSwig;
+%rename (GetNodeFieldIterations) GetNodeFieldIterationsSwig;
+%rename (GetComponentsNamesOfField) GetComponentsNamesOfFieldSwig;
+%rename (GetUMeshGlobalInfo) GetUMeshGlobalInfoSwig;
+%rename (ReadFieldsOnSameMesh) ReadFieldsOnSameMeshSwig;
+%rename (WriteUMeshesPartition) WriteUMeshesPartitionSwig;
+%rename (WriteUMeshesPartitionDep) WriteUMeshesPartitionDepSwig;
+%rename (WriteUMeshes) WriteUMeshesSwig;
+%rename (GetTypesOfField) GetTypesOfFieldSwig;
+%rename (ReadUMeshFromGroups) ReadUMeshFromGroupsSwig;
+%rename (ReadUMeshFromFamilies) ReadUMeshFromFamiliesSwig;
+
+%inline
+{
+ PyObject *MEDFileVersionSwig()
+ {
+ int major,minor,release;
+ MEDCoupling::MEDFileVersion(major,minor,release);
+ PyObject *ret(PyTuple_New(3));
+ PyTuple_SetItem(ret,0,SWIG_From_int(major));
+ PyTuple_SetItem(ret,1,SWIG_From_int(minor));
+ PyTuple_SetItem(ret,2,SWIG_From_int(release));
+ return ret;
+ }
+
+ PyObject *GetFieldIterationsSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName)
+ {
+ std::vector< std::pair<int,int> > res=MEDCoupling::GetFieldIterations(type,fileName,meshName,fieldName);
+ PyObject *ret=PyList_New(res.size());
+ int rk=0;
+ for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
+ {
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
+ PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
+ PyList_SetItem(ret,rk,elt);
+ }
+ return ret;
+ }
+
+ PyObject *GetAllFieldIterationsSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair< std::pair<int,int>, double> > res=MEDCoupling::GetAllFieldIterations(fileName,fieldName);
+ PyObject *ret=PyList_New(res.size());
+ int rk=0;
+ for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
+ {
+ PyObject *elt=PyTuple_New(3);
+ PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
+ PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
+ PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
+ PyList_SetItem(ret,rk,elt);
+ }
+ return ret;
+ }
+
+ PyObject *GetCellFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<int,int> > res=MEDCoupling::GetCellFieldIterations(fileName,meshName,fieldName);
+ PyObject *ret=PyList_New(res.size());
+ int rk=0;
+ for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
+ {
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
+ PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
+ PyList_SetItem(ret,rk,elt);
+ }
+ return ret;
+ }
- static PyObject *GetAllFieldIterations(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
- {
- std::vector< std::pair< std::pair<int,int>, double> > res=MEDLoader::GetAllFieldIterations(fileName,fieldName);
- PyObject *ret=PyList_New(res.size());
- int rk=0;
- for(std::vector< std::pair< std::pair<int,int>, double> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
- {
- PyObject *elt=PyTuple_New(3);
- PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first.first));
- PyTuple_SetItem(elt,1,SWIG_From_int((*iter).first.second));
- PyTuple_SetItem(elt,2,SWIG_From_double((*iter).second));
- PyList_SetItem(ret,rk,elt);
- }
- return ret;
- }
+ PyObject *GetNodeFieldIterationsSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<int,int> > res=MEDCoupling::GetNodeFieldIterations(fileName,meshName,fieldName);
+ PyObject *ret=PyList_New(res.size());
+ int rk=0;
+ for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
+ {
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
+ PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
+ PyList_SetItem(ret,rk,elt);
+ }
+ return ret;
+ }
- static PyObject *GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
- {
- std::vector< std::pair<int,int> > res=MEDLoader::GetCellFieldIterations(fileName,meshName,fieldName);
- PyObject *ret=PyList_New(res.size());
- int rk=0;
- for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
- {
- PyObject *elt=PyTuple_New(2);
- PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
- PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
- PyList_SetItem(ret,rk,elt);
- }
- return ret;
- }
- static PyObject *GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
- {
- std::vector< std::pair<int,int> > res=MEDLoader::GetNodeFieldIterations(fileName,meshName,fieldName);
- PyObject *ret=PyList_New(res.size());
- int rk=0;
- for(std::vector< std::pair<int,int> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
- {
- PyObject *elt=PyTuple_New(2);
- PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first));
- PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second));
- PyList_SetItem(ret,rk,elt);
- }
- return ret;
- }
- static PyObject *GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
- {
- std::vector< std::pair<std::string,std::string> > res=MEDLoader::GetComponentsNamesOfField(fileName,fieldName);
- PyObject *ret=PyList_New(res.size());
- int rk=0;
- for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
- {
- PyObject *elt=PyTuple_New(2);
- PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
- PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
- PyList_SetItem(ret,rk,elt);
- }
- return ret;
- }
- static PyObject *GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
- {
- int meshDim,spaceDim,numberOfNodes;
- std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
- PyObject *ret=PyTuple_New(4);
- PyObject *elt0=PyList_New(res.size());
- int i=0;
- for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
- {
- const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
- int j=0;
- PyObject *elt1=PyList_New(obj2.size());
- for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
- {
- PyObject *elt2=PyTuple_New(2);
- PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
- PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
- PyList_SetItem(elt1,j,elt2);
- }
- PyList_SetItem(elt0,i,elt1);
- }
- PyTuple_SetItem(ret,0,elt0);
- PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
- PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
- PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
- return ret;
- }
- static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
- const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
- {
- std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
- std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
- return convertFieldDoubleVecToPy(res);
- }
- static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
- {
- std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
- MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
- }
- static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
- {
- std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
- MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
- }
- static void WriteUMeshes(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
- {
- std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",v);
- MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
- }
- static PyObject *GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
- {
- std::vector< ParaMEDMEM::TypeOfField > v=MEDLoader::GetTypesOfField(fileName,meshName,fieldName);
- int size=v.size();
- PyObject *ret=PyList_New(size);
- for(int i=0;i<size;i++)
- PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
- return ret;
- }
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
- {
- std::vector<std::string> grps;
- converPyListToVecString(li,grps);
- return MEDLoader::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
- }
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
- {
- std::vector<std::string> fams;
- converPyListToVecString(li,fams);
- return MEDLoader::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
- }
- }
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
- static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
- static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f) throw(INTERP_KERNEL::Exception);
-};
-
-namespace ParaMEDMEM
+ PyObject *GetComponentsNamesOfFieldSwig(const std::string& fileName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::string,std::string> > res=MEDCoupling::GetComponentsNamesOfField(fileName,fieldName);
+ PyObject *ret=PyList_New(res.size());
+ int rk=0;
+ for(std::vector< std::pair<std::string,std::string> >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++)
+ {
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,PyString_FromString((*iter).first.c_str()));
+ PyTuple_SetItem(elt,1,PyString_FromString((*iter).second.c_str()));
+ PyList_SetItem(ret,rk,elt);
+ }
+ return ret;
+ }
+
+ PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception)
+ {
+ int meshDim,spaceDim,numberOfNodes;
+ std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
+ PyObject *ret=PyTuple_New(4);
+ PyObject *elt0=PyList_New(res.size());
+ int i=0;
+ for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
+ {
+ const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
+ int j=0;
+ PyObject *elt1=PyList_New(obj2.size());
+ for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
+ {
+ PyObject *elt2=PyTuple_New(2);
+ PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
+ PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
+ PyList_SetItem(elt1,j,elt2);
+ }
+ PyList_SetItem(elt0,i,elt1);
+ }
+ PyTuple_SetItem(ret,0,elt0);
+ PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
+ PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
+ PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
+ return ret;
+ }
+
+ PyObject *ReadFieldsOnSameMeshSwig(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax,
+ const std::string& fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<std::pair<int,int> > its=convertTimePairIdsFromPy(liIts);
+ std::vector<MEDCoupling::MEDCouplingFieldDouble *> res=MEDCoupling::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its);
+ return convertFieldDoubleVecToPy(res);
+ }
+
+ void WriteUMeshesPartitionSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
+ MEDCoupling::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
+ }
+
+ void WriteUMeshesPartitionDepSwig(const std::string& fileName, const std::string& meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
+ MEDCoupling::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
+ }
+
+ void WriteUMeshesSwig(const std::string& fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const MEDCoupling::MEDCouplingUMesh *> v;
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",v);
+ MEDCoupling::WriteUMeshes(fileName,v,writeFromScratch);
+ }
+
+ PyObject *GetTypesOfFieldSwig(const std::string& fileName, const std::string& meshName, const std::string& fieldName) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< MEDCoupling::TypeOfField > v=MEDCoupling::GetTypesOfField(fileName,meshName,fieldName);
+ int size=v.size();
+ PyObject *ret=PyList_New(size);
+ for(int i=0;i<size;i++)
+ PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
+ return ret;
+ }
+
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroupsSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<std::string> grps;
+ converPyListToVecString(li,grps);
+ return MEDCoupling::ReadUMeshFromGroups(fileName,meshName,meshDimRelToMax,grps);
+ }
+
+ MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamiliesSwig(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<std::string> fams;
+ converPyListToVecString(li,fams);
+ return MEDCoupling::ReadUMeshFromFamilies(fileName,meshName,meshDimRelToMax,fams);
+ }
+}
+
+namespace MEDCoupling
{
class MEDFileWritable
{
INTERP_KERNEL::NormalizedCellType rem_geo_type)
throw(INTERP_KERNEL::Exception);
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
- MEDFileJointCorrespondence *deepCpy() const;
+ MEDFileJointCorrespondence *deepCopy() const;
MEDFileJointCorrespondence *shallowCpy() const;
void setIsNodal(bool isNodal);
bool getIsNodal() const;
public:
static MEDFileJointOneStep *New(int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception);
static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1) throw(INTERP_KERNEL::Exception);
- MEDFileJointOneStep *deepCpy() const;
+ MEDFileJointOneStep *deepCopy() const;
MEDFileJointOneStep *shallowCpy() const;
bool isEqual(const MEDFileJointOneStep *other) const;
void setOrder(int order);
static MEDFileJoint *New() throw(INTERP_KERNEL::Exception);
static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num) throw(INTERP_KERNEL::Exception);
static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ) throw(INTERP_KERNEL::Exception);
- MEDFileJoint *deepCpy() const;
+ MEDFileJoint *deepCopy() const;
MEDFileJoint *shallowCpy() const;
bool isEqual(const MEDFileJoint *other) const;
void setLocalMeshName(const std::string& name);
public:
static MEDFileJoints *New() throw(INTERP_KERNEL::Exception);
static MEDFileJoints *New(const std::string& fileName, const std::string& meshName) throw(INTERP_KERNEL::Exception);
- MEDFileJoints *deepCpy() const;
+ MEDFileJoints *deepCopy() const;
std::string simpleRepr() const;
void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::string getMeshName() const;
static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
- virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
+ virtual MEDFileMesh *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
void setName(const std::string& name);
double getTimeValue() const;
void setTimeUnit(const std::string& unit);
std::string getTimeUnit() const;
- void setAxType(MEDCouplingAxisType at);
- MEDCouplingAxisType getAxType() const;
+ void setAxisType(MEDCouplingAxisType at);
+ MEDCouplingAxisType getAxisType() const;
virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception);
virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
{
std::vector<const DataArrayInt *> grps;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",grps);
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
}
const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
tmp->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception)
const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
tmp->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
tmp->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
tmp->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
if(tmp)
tmp->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
}
PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created) throw(INTERP_KERNEL::Exception)
}
PyTuple_SetItem(ret,2,retLev1_1);
//
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
std::vector<double> a0;
std::vector<int> a1;
std::vector<std::string> a2;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
+ std::vector< MCAuto<DataArrayInt> > a3;
+ MCAuto<DataArrayDouble> a4;
self->serialize(a0,a1,a2,a3,a4);
PyObject *ret(PyTuple_New(5));
PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
DataArrayInt *elt(a3[i]);
if(elt)
elt->incrRef();
- PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret3,i,SWIG_NewPointerObj(SWIG_as_voidptr(elt),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
}
PyTuple_SetItem(ret,3,ret3);
DataArrayDouble *ret4(a4);
if(ret4)
ret4->incrRef();
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(ret4),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
return ret;
}
std::vector<double> a0;
std::vector<int> a1;
std::vector<std::string> a2;
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > a3;
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> a4;
+ std::vector< MCAuto<DataArrayInt> > a3;
+ MCAuto<DataArrayDouble> a4;
//
PyObject *a0py(PyTuple_GetItem(inp,0)),*a1py(PyTuple_GetItem(inp,1)),*a2py(PyTuple_GetItem(inp,2));
int tmp(-1);
//
PyObject *b0py(PyTuple_GetItem(inp,3)),*b1py(PyTuple_GetItem(inp,4));
void *argp(0);
- int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,0|0));
+ int status(SWIG_ConvertPtr(b1py,&argp,SWIGTYPE_p_MEDCoupling__DataArrayDouble,0|0));
if(!SWIG_IsOK(status))
throw INTERP_KERNEL::Exception(MSG);
a4=reinterpret_cast<DataArrayDouble *>(argp);
a4->incrRef();
{
std::vector< DataArrayInt * > a3Tmp;
- convertFromPyObjVectorOfObj<ParaMEDMEM::DataArrayInt *>(b0py,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",a3Tmp);
+ convertFromPyObjVectorOfObj<MEDCoupling::DataArrayInt *>(b0py,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",a3Tmp);
std::size_t sz(a3Tmp.size());
a3.resize(sz);
for(std::size_t i=0;i<sz;i++)
void setMeshes(PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
{
std::vector<const MEDCouplingUMesh *> ms;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
self->setMeshes(ms,renum);
}
void setGroupsFromScratch(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
{
std::vector<const MEDCouplingUMesh *> ms;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
self->setGroupsFromScratch(meshDimRelToMax,ms,renum);
}
void setGroupsOnSetMesh(int meshDimRelToMax, PyObject *li, bool renum=false) throw(INTERP_KERNEL::Exception)
{
std::vector<const MEDCouplingUMesh *> ms;
- convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCouplingUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
+ convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",ms);
self->setGroupsOnSetMesh(meshDimRelToMax,ms,renum);
}
DataArrayInt *ret0=0,*ret1=0,*ret2=0;
self->buildInnerBoundaryAlongM1Group(grpNameM1,ret0,ret1,ret2);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(ret2),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
const MEDCouplingCMesh *tmp=self->getMesh();
if(tmp)
tmp->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCMesh, SWIG_POINTER_OWN | 0 );
}
}
};
const MEDCouplingCurveLinearMesh *tmp=self->getMesh();
if(tmp)
tmp->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__MEDCouplingCurveLinearMesh, SWIG_POINTER_OWN | 0 );
}
}
};
static MEDFileMeshMultiTS *New();
static MEDFileMeshMultiTS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName) throw(INTERP_KERNEL::Exception);
- MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileMeshMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
public:
static MEDFileMeshes *New();
static MEDFileMeshes *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileMeshes *deepCopy() const throw(INTERP_KERNEL::Exception);
void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
int getNumberOfMeshes() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getMeshesNames() const throw(INTERP_KERNEL::Exception);
const DataArrayInt *ret=self->getProfile(pflName);
if(ret)
ret->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getProfileFromId(int pflId) const throw(INTERP_KERNEL::Exception)
const DataArrayInt *ret=self->getProfileFromId(pflId);
if(ret)
ret->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
PyObject *getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception)
const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
if(loc)
loc->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
}
PyObject *getLocalization(const std::string& locName) const throw(INTERP_KERNEL::Exception)
const MEDFileFieldLoc *loc=&self->getLocalization(locName);
if(loc)
loc->incrRef();
- return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_ParaMEDMEM__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
}
PyObject *zipPflsNames() throw(INTERP_KERNEL::Exception)
bool presenceOfMultiDiscPerGeoType() const throw(INTERP_KERNEL::Exception);
void setTime(int iteration, int order, double val) throw(INTERP_KERNEL::Exception);
virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileAnyTypeField1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
void setDtUnit(const std::string& dtUnit) throw(INTERP_KERNEL::Exception);
%extend
PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileField1TS *New();
- ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
DataArrayInt *ret1=0;
DataArrayDouble *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
{
PyObject *elt3=PyTuple_New(4);
PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
- PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
PyList_SetItem(elt2,j,elt3);
if(elt0)
elt0->incrRef();
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
std::size_t sz=elt1Cpp.size();
PyObject *elt=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
static MEDFileIntField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileIntField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- ParaMEDMEM::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
//
void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,meshDimRelToMax,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,meshDimRelToMax,mesh,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,mesh,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,mname,meshDimRelToMax,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
DataArrayInt *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
public:
static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileAnyTypeFieldMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
for(int i=0;i<sz;i++)
{
PyObject *elt=PyList_GetItem(elts,i);
- ret[i]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
+ ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
}
return ret;
}
else
{
std::vector<int> ret(1);
- ret[0]=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
+ ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
return ret;
}
}
}
else
{
- std::vector<int> idsToRemove=ParaMEDMEM_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
+ std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
if(!idsToRemove.empty())
self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
if(elt0 && PyList_Check(elt0))
{
int sz=PyList_Size(elt0);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
+ MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
int *pt=da->getPointer();
for(int i=0;i<sz;i++,pt++)
{
PyObject *splitComponents() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitDiscretizations() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyObject *splitMultiDiscrPerGeoTypes() const throw(INTERP_KERNEL::Exception)
{
- std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
void pushBackTimeSteps(PyObject *li) throw(INTERP_KERNEL::Exception)
{
void *argp(0);
- int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,0|0));
+ int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
if(SWIG_IsOK(status))
{
self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
else
{
std::vector<MEDFileAnyTypeField1TS *> tmp;
- convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
self->pushBackTimeSteps(tmp);
}
}
static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li) throw(INTERP_KERNEL::Exception)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
- convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
std::size_t sz=ret.size();
PyObject *retPy=PyList_New(sz);
static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
- convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFastCellSupportComparator> > ret2;
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
+ std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
if(ret2.size()!=ret.size())
{
PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
}
PyTuple_SetItem(ret0Py,0,ret1Py);
- PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_ParaMEDMEM__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
PyList_SetItem(retPy,i,ret0Py);
}
return retPy;
//
void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- ParaMEDMEM::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileFieldMultiTS()
DataArrayInt *ret1=0;
DataArrayDouble *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
{
PyObject *elt3=PyTuple_New(4);
PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
- PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
PyList_SetItem(elt2,j,elt3);
if(elt0)
elt0->incrRef();
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
std::size_t sz=elt1Cpp.size();
PyObject *elt=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
//
void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception);
void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- ParaMEDMEM::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileIntFieldMultiTS()
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtLevel(type,iteration,order,meshDimRelToMax,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtTopLevel(type,iteration,order,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,meshDimRelToMax,mesh,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldOnMeshAtLevel(type,iteration,order,mesh,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
MEDCouplingFieldDouble *ret0=self->getFieldAtLevelOld(type,iteration,order,mname,meshDimRelToMax,ret1,renumPol);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
DataArrayInt *ret1=0;
DataArrayInt *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
static MEDFileFields *New() throw(INTERP_KERNEL::Exception);
static MEDFileFields *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0) throw(INTERP_KERNEL::Exception);
- MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileFields *deepCopy() const throw(INTERP_KERNEL::Exception);
MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
void loadArrays() throw(INTERP_KERNEL::Exception);
void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception);
if(obj && PyList_Check(obj))
{
int sz=PyList_Size(obj);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
+ MCAuto<DataArrayInt> da=DataArrayInt::New(); da->alloc(sz,1);
int *pt=da->getPointer();
for(int i=0;i<sz;i++,pt++)
{
PyObject *elt1=PyList_GetItem(obj,i);
*pt=MEDFileFieldsgetitemSingleTS__(self,elt1);
}
- return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_ParaMEDMEM__MEDFileFields, SWIG_POINTER_OWN | 0 );
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->buildSubPart(da->begin(),da->end())),SWIGTYPE_p_MEDCoupling__MEDFileFields, SWIG_POINTER_OWN | 0 );
}
else
return convertMEDFileFieldMultiTS(self->getFieldAtPos(MEDFileFieldsgetitemSingleTS__(self,obj)), SWIG_POINTER_OWN | 0 );
for(int i=0;i<sz;i++)
{
PyObject *elt=PyList_GetItem(elts,i);
- ret[i]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elt);
+ ret[i]=MEDCoupling_MEDFileFields_getPosOfField(self,elt);
}
return ret;
}
else
{
std::vector<int> ret(1);
- ret[0]=ParaMEDMEM_MEDFileFields_getPosOfField(self,elts);
+ ret[0]=MEDCoupling_MEDFileFields_getPosOfField(self,elts);
return ret;
}
}
void pushFields(PyObject *fields) throw(INTERP_KERNEL::Exception)
{
std::vector<MEDFileAnyTypeFieldMultiTS *> tmp;
- convertFromPyObjVectorOfObj<ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_ParaMEDMEM__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(fields,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",tmp);
self->pushFields(tmp);
}
}
else
{
- std::vector<int> idsToRemove=ParaMEDMEM_MEDFileFields_getPosOfFields(self,elts);
+ std::vector<int> idsToRemove=MEDCoupling_MEDFileFields_getPosOfFields(self,elts);
if(!idsToRemove.empty())
self->destroyFieldsAtPos(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
static MEDFileParameterDouble1TS *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it) throw(INTERP_KERNEL::Exception);
- virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ virtual MEDFileParameter1TS *deepCopy() const throw(INTERP_KERNEL::Exception);
virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void setName(const std::string& name) throw(INTERP_KERNEL::Exception);
std::string getName() const throw(INTERP_KERNEL::Exception);
static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName) throw(INTERP_KERNEL::Exception);
std::string getName() const;
void setName(const std::string& name);
- MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileParameterMultiTS *deepCopy() const throw(INTERP_KERNEL::Exception);
void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void appendValue(int dt, int it, double time, double val) throw(INTERP_KERNEL::Exception);
MEDFileParameter1TS *__getitem__(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
{
- MEDFileParameter1TS *ret=self->getTimeStepAtPos(ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
+ MEDFileParameter1TS *ret=self->getTimeStepAtPos(MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt0));
if(ret)
ret->incrRef();
return ret;
for(int i=0;i<sz;i++)
{
PyObject *elt=PyList_GetItem(elts,i);
- ret[i]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elt);
+ ret[i]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elt);
}
return ret;
}
else
{
std::vector<int> ret(1);
- ret[0]=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepId(self,elts);
+ ret[0]=MEDCoupling_MEDFileParameterMultiTS_getTimeStepId(self,elts);
return ret;
}
}
void __delitem__(PyObject *elts) throw(INTERP_KERNEL::Exception)
{
- std::vector<int> idsToRemove=ParaMEDMEM_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
+ std::vector<int> idsToRemove=MEDCoupling_MEDFileParameterMultiTS_getTimeStepIds(self,elts);
if(!idsToRemove.empty())
self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
}
public:
static MEDFileParameters *New();
static MEDFileParameters *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
- MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileParameters *deepCopy() const throw(INTERP_KERNEL::Exception);
void write(const std::string& fileName, int mode) const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getParamsNames() const throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
public:
static MEDFileData *New(const std::string& fileName) throw(INTERP_KERNEL::Exception);
static MEDFileData *New();
- MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
+ MEDFileData *deepCopy() const throw(INTERP_KERNEL::Exception);
void setFields(MEDFileFields *fields) throw(INTERP_KERNEL::Exception);
void setMeshes(MEDFileMeshes *meshes) throw(INTERP_KERNEL::Exception);
void setParams(MEDFileParameters *params) throw(INTERP_KERNEL::Exception);
PyObject *ret=PyTuple_New(2);
PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
Py_XINCREF(ret1Py);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1Py);
return ret;
}
PyObject *ret=PyTuple_New(2);
PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
Py_XINCREF(ret1Py);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1Py);
return ret;
}
PyObject *ret=PyTuple_New(2);
PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
Py_XINCREF(ret1Py);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1Py);
return ret;
}
PyObject *ret=PyTuple_New(2);
PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
Py_XINCREF(ret1Py);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,1,ret1Py);
return ret;
}
Py_XINCREF(ret0Py);
PyObject *ret=PyTuple_New(7);
PyTuple_SetItem(ret,0,ret0Py);
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
}
PyObject *ret(PyTuple_New(2));
PyObject *ret0=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
- PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(ret0,i,SWIG_NewPointerObj(SWIG_as_voidptr(objs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyTuple_SetItem(ret,0,ret0);
PyObject *ret1Py(isInternal?Py_True:Py_False);
Py_XINCREF(ret1Py);
self->buildVTUArrays(ret0,ret1,ret2);
std::size_t sz(ret1.size());
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
PyObject *ret1Py=PyList_New(sz);
for(std::size_t i=0;i<sz;i++)
PyList_SetItem(ret1Py,i,SWIG_From_int(ret1[i]));
a=cI.deltaShiftIndex()
b=a-1
myNewNbOfTuples=oldNbOfTuples-sum(b.getValues())
-o2n,newNbOfTuples=DataArrayInt.BuildOld2NewArrayFromSurjectiveFormat2(oldNbOfTuples,c,cI)
+o2n,newNbOfTuples=DataArrayInt.ConvertIndexArrayToO2N(oldNbOfTuples,c,cI)
print "Ai je trouve le bon resultat ? %s"%(str(myNewNbOfTuples==newNbOfTuples)) ; assert myNewNbOfTuples==newNbOfTuples
#
d3=d2.renumberAndReduce(o2n,newNbOfTuples)
m.insertNextCell(NORM_POLYGON,o2n[6*i:6*(i+1)].getValues())
pass
m.finishInsertingCells()
-m.checkCoherency()
+m.checkConsistencyLight()
#
m.writeVTK("My7hexagons.vtu")
mesh3D.setCoords(myCoords);
mesh3D.orientCorrectlyPolyhedrons()
mesh3D.sortCellsInMEDFileFrmt()
-mesh3D.checkCoherency()
+mesh3D.checkConsistencyLight()
renum=DataArrayInt.New(60) ; renum[:15]=range(15,30) ; renum[15:30]=range(15) ; renum[30:45]=range(45,60) ; renum[45:]=range(30,45)
mesh3D.renumberNodes(renum,60)
#
zLev.sort()
#
tmp,cellIdsSol1=mesh3D.buildSlice3D([0.,0.,(zLev[1]+zLev[2])/2],[0.,0.,1.],1e-12)
-bary=mesh3D.getBarycenterAndOwner()
+bary=mesh3D.computeCellCenterOfMass()
baryZ=bary[:,2]
-cellIdsSol2=baryZ.getIdsInRange(zLev[1],zLev[2])
+cellIdsSol2=baryZ.findIdsInRange(zLev[1],zLev[2])
nodeIds=mesh3D.findNodesOnPlane([0.,0.,zLev[0]],[0.,0.,1.],1e-10)
mesh2D=mesh3D.buildFacePartOfMySelfNode(nodeIds,True)
-extMesh=MEDCouplingExtrudedMesh.New(mesh3D,mesh2D,0)
+extMesh=MEDCouplingMappedExtrudedMesh.New(mesh3D,mesh2D,0)
cellIdsSol3=extMesh.getMesh3DIds()[mesh2D.getNumberOfCells():2*mesh2D.getNumberOfCells()]
for i in xrange(3):
exec("print cellIdsSol%s.getValues()"%(i+1))
baryXY=bary[:,[0,1]]
baryXY-=[250.,150.]
magn=baryXY.magnitude()
-cellIds2Sol1=magn.getIdsInRange(0.,1e-12)
+cellIds2Sol1=magn.findIdsInRange(0.,1e-12)
#
-bary2=mesh2D.getBarycenterAndOwner()[:,[0,1]]
+bary2=mesh2D.computeCellCenterOfMass()[:,[0,1]]
bary2-=[250.,150.]
magn=bary2.magnitude()
-ids=magn.getIdsInRange(0.,1e-12)
+ids=magn.findIdsInRange(0.,1e-12)
idStart=int(ids) # ids is assumed to contain only one value, if not an exception is thrown
cellIds2Sol2=extMesh.getMesh3DIds()[range(idStart,mesh3D.getNumberOfCells(),mesh2D.getNumberOfCells())]
#
mesh3DSlice2=mesh3D[cellIds2Sol1]
mesh3DSlice2.zipCoords()
#
-mesh3DSlice2bis=mesh3DSlice2.deepCpy()
+mesh3DSlice2bis=mesh3DSlice2.deepCopy()
mesh3DSlice2bis.translate([0.,1000.,0.])
mesh3DSlice2All=MEDCouplingUMesh.MergeUMeshes([mesh3DSlice2,mesh3DSlice2bis])
mesh3DSlice2All.writeVTK("mesh3DSlice2All.vtu")
#
mesh3DSurf,desc,descIndx,revDesc,revDescIndx=mesh3D.buildDescendingConnectivity()
numberOf3DCellSharing=revDescIndx.deltaShiftIndex()
-cellIds=numberOf3DCellSharing.getIdsNotEqual(1)
+cellIds=numberOf3DCellSharing.findIdsNotEqual(1)
mesh3DSurfInside=mesh3DSurf[cellIds]
mesh3DSurfInside.writeVTK("mesh3DSurfInside.vtu")
f2.fillFromAnalytic(1,"(x-5.)*(x-5.)+(y-5.)*(y-5.)+(z-5.)*(z-5.)")
print "f and f2 are equal : %s"%(f.isEqualWithoutConsideringStr(f2,1e-13,1e-12)) ; assert f.isEqualWithoutConsideringStr(f2,1e-13,1e-12)
#
-ids1=f.getArray().getIdsInRange(0.,5.)
+ids1=f.getArray().findIdsInRange(0.,5.)
fPart1=f.buildSubPart(ids1)
-ids2=f.getArray().getIdsInRange(50.,1.e300)
+ids2=f.getArray().findIdsInRange(50.,1.e300)
fPart2=f.buildSubPart(ids2)
#Renumbering cells to follow MED file
-fPart1Cpy=fPart1.deepCpy()
+fPart1Cpy=fPart1.deepCopy()
o2n=fPart1Cpy.getMesh().sortCellsInMEDFileFrmt()
fPart1Cpy.getArray().renumberInPlace(o2n)
#Check that fPart1Cpy and fPart1 are the same
#
fPart12=MEDCouplingFieldDouble.MergeFields([fPart1,fPart2])
# evaluation on points
-bary=fPart12.getMesh().getBarycenterAndOwner()
+bary=fPart12.getMesh().computeCellCenterOfMass()
arr1=fPart12.getValueOnMulti(bary)
arr2=f.getValueOnMulti(bary)
delta=arr1-arr2
myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
targetMesh.setCoords(myCoords);
#
-MEDLoader.WriteUMesh("TargetMesh.med",targetMesh,True)
+WriteUMesh("TargetMesh.med",targetMesh,True)
#
-meshRead=MEDLoader.ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
+meshRead=ReadUMeshFromFile("TargetMesh.med",targetMesh.getName(),0)
print "Is the mesh read in file equals targetMesh ? %s"%(meshRead.isEqual(targetMesh,1e-12)) ; assert meshRead.isEqual(targetMesh,1e-12)
#
f=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME)
f.setTime(5.6,7,8)
-f.setArray(targetMesh.getBarycenterAndOwner())
+f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
-MEDLoader.WriteField("MyFirstField.med",f,True)
+WriteField("MyFirstField.med",f,True)
#
-f2=MEDLoader.ReadFieldCell("MyFirstField.med",f.getMesh().getName(),0,f.getName(),7,8)
+f2=ReadFieldCell("MyFirstField.med",f.getMesh().getName(),0,f.getName(),7,8)
print "Is the field read in file equals f ? %s"%(f2.isEqual(f,1e-12,1e-12)) ; assert f2.isEqual(f,1e-12,1e-12)
#
-MEDLoader.WriteUMesh("MySecondField.med",f.getMesh(),True)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f)
+WriteUMesh("MySecondField.med",f.getMesh(),True)
+WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f)
#
f2=f.clone(True)
f2.getArray()[:]*=2.0
f2.setTime(7.8,9,10)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
+WriteFieldUsingAlreadyWrittenMesh("MySecondField.med",f2)
#
-f3=MEDLoader.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),7,8)
+f3=ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),7,8)
print "Is the field read in file equals f ? %s"%(f.isEqual(f3,1e-12,1e-12)) ; assert f.isEqual(f3,1e-12,1e-12)
-f4=MEDLoader.ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),9,10)
+f4=ReadFieldCell("MySecondField.med",f.getMesh().getName(),0,f.getName(),9,10)
print "Is the field read in file equals f ? %s"%(f2.isEqual(f4,1e-12,1e-12)) ; assert f2.isEqual(f4,1e-12,1e-12)
#####
#
f=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME)
f.setTime(5.6,7,8)
-f.setArray(targetMesh.getBarycenterAndOwner())
+f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
#
NodeField1=NodeField[proc1] ; NodeField1.getMesh().setName(m0.getName()) ; CellField1=CellField[proc1] ; CellField1.setMesh(NodeField1.getMesh())
#
proc0_fname="proc0.med"
-MEDLoader.WriteField(proc0_fname,NodeField0,True)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh(proc0_fname,CellField0)
+WriteField(proc0_fname,NodeField0,True)
+WriteFieldUsingAlreadyWrittenMesh(proc0_fname,CellField0)
proc1_fname="proc1.med"
-MEDLoader.WriteField(proc1_fname,NodeField1,True)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh(proc1_fname,CellField1)
+WriteField(proc1_fname,NodeField1,True)
+WriteFieldUsingAlreadyWrittenMesh(proc1_fname,CellField1)
#
-CellField0_read=MEDLoader.ReadFieldCell("proc0.med","mesh",0,"CellField",5,6)
-CellField1_read=MEDLoader.ReadFieldCell("proc1.med","mesh",0,"CellField",5,6)
+CellField0_read=ReadFieldCell("proc0.med","mesh",0,"CellField",5,6)
+CellField1_read=ReadFieldCell("proc1.med","mesh",0,"CellField",5,6)
CellField_read=MEDCouplingFieldDouble.MergeFields([CellField0_read,CellField1_read])
-CellFieldCpy=CellField.deepCpy()
+CellFieldCpy=CellField.deepCopy()
CellFieldCpy.substractInPlaceDM(CellField_read,10,1e-12)
CellFieldCpy.getArray().abs()
print CellFieldCpy.getArray().isUniform(0.,1e-12)
#
-NodeField0_read=MEDLoader.ReadFieldNode("proc0.med","mesh",0,"NodeField",5,6)
-NodeField1_read=MEDLoader.ReadFieldNode("proc1.med","mesh",0,"NodeField",5,6)
+NodeField0_read=ReadFieldNode("proc0.med","mesh",0,"NodeField",5,6)
+NodeField1_read=ReadFieldNode("proc1.med","mesh",0,"NodeField",5,6)
NodeField_read=MEDCouplingFieldDouble.MergeFields([NodeField0_read,NodeField1_read])
NodeField_read.mergeNodes(1e-10)
-NodeFieldCpy=NodeField.deepCpy()
+NodeFieldCpy=NodeField.deepCopy()
NodeFieldCpy.mergeNodes(1e-10)
NodeFieldCpy.substractInPlaceDM(NodeField_read,10,1e-12)
print NodeFieldCpy.getArray().isUniform(0.,1e-12) ; assert NodeFieldCpy.getArray().isUniform(0.,1e-12)
if typp==ON_CELLS:
arr.renumberInPlace(o2nML[lev])
mcf=MEDCouplingFieldDouble(typp,ONE_TIME) ; mcf.setName(fieldName) ; mcf.setTime(tim,dt,it) ; mcf.setArray(arr)
- mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkCoherency()
+ mcf.setMesh(mergeMLMesh.getMeshAtLevel(lev)) ; mcf.checkConsistencyLight()
mergeField.appendFieldNoProfileSBT(mcf)
pass
pass
srcField.fillFromAnalytic(1,"7-sqrt((x-5.)*(x-5.)+(y-5.)*(y-5.))") ; CellField.getArray().setInfoOnComponent(0,"powercell [W]")
#
#remap.transferField(srcField,1e300)
-srcField.setNature(ConservativeVolumic)
+srcField.setNature(IntensiveMaximum)
trgFieldCV=remap.transferField(srcField,1e300)
#
-print "ConservativeVolumic %lf == %lf"%(srcField.integral(True)[0],trgFieldCV.integral(True)[0]) ; assert abs(srcField.integral(True)[0]-trgFieldCV.integral(True)[0])<1e-6
-print "ConservativeVolumic %lf != %lf"%(srcField.getArray().accumulate()[0],trgFieldCV.getArray().accumulate()[0]) ; assert abs(srcField.getArray().accumulate()[0]-trgFieldCV.getArray().accumulate()[0])>1e-6
+print "IntensiveMaximum %lf == %lf"%(srcField.integral(True)[0],trgFieldCV.integral(True)[0]) ; assert abs(srcField.integral(True)[0]-trgFieldCV.integral(True)[0])<1e-6
+print "IntensiveMaximum %lf != %lf"%(srcField.getArray().accumulate()[0],trgFieldCV.getArray().accumulate()[0]) ; assert abs(srcField.getArray().accumulate()[0]-trgFieldCV.getArray().accumulate()[0])>1e-6
#
-srcField.setNature(Integral)
+srcField.setNature(ExtensiveMaximum)
trgFieldI=remap.transferField(srcField,1e300)
#
-print "IntegralGlobConstraint %lf != %lf"%(srcField.integral(True)[0],trgFieldI.integral(True)[0]) ; assert abs(srcField.integral(True)[0]-trgFieldI.integral(True)[0])>1e-6
-print "IntegralGlobConstraint %lf == %lf"%(srcField.getArray().accumulate()[0],trgFieldI.getArray().accumulate()[0]) ; assert abs(srcField.getArray().accumulate()[0]-trgFieldI.getArray().accumulate()[0])<1e-6
+print "ExtensiveConservation %lf != %lf"%(srcField.integral(True)[0],trgFieldI.integral(True)[0]) ; assert abs(srcField.integral(True)[0]-trgFieldI.integral(True)[0])>1e-6
+print "ExtensiveConservation %lf == %lf"%(srcField.getArray().accumulate()[0],trgFieldI.getArray().accumulate()[0]) ; assert abs(srcField.getArray().accumulate()[0]-trgFieldI.getArray().accumulate()[0])<1e-6
######
fMc=f1ts.getFieldAtLevel(ON_CELLS,0)
arr=fMc.getArray()
arr.getMinMaxPerComponent() # juste pour voir la plage de variation du champ par compo
-ids=arr.getIdsInRange(0.,1.)
+ids=arr.findIdsInRange(0.,1.)
f2Mc=fMc[ids]
#
pressMts=data.getFields()["PRESSION_ELEM_DOM"]
agitateurMesh3DMc=pressOnAgitateurMc.getMesh()
m3DSurf,desc,descI,revDesc,revDescI=agitateurMesh3DMc.buildDescendingConnectivity()
nbOf3DCellSharing=revDescI.deltaShiftIndex()
-ids2=nbOf3DCellSharing.getIdsEqual(1)
+ids2=nbOf3DCellSharing.findIdsEqual(1)
agitateurSkinMc=m3DSurf[ids2]
OffsetsOfTupleIdsInField=revDescI[ids2]
tupleIdsInField=revDesc[OffsetsOfTupleIdsInField]
#
singlePolyhedron=agitateurMesh3DMc.buildSpreadZonesWithPoly()
singlePolyhedron.orientCorrectlyPolyhedrons()
-centerOfMass=singlePolyhedron.getBarycenterAndOwner()
+centerOfMass=singlePolyhedron.computeCellCenterOfMass()
-barySkin=agitateurSkinMc.getBarycenterAndOwner()
+barySkin=agitateurSkinMc.computeCellCenterOfMass()
posSkin=barySkin-centerOfMass
torquePerCellOnSkin=DataArrayDouble.CrossProduct(posSkin,forceVectSkin)
def computeAngle(locAgitateur1ts):
fMc=locAgitateur1ts.getFieldAtLevel(ON_CELLS,0)
arr=fMc.getArray()
- ids=arr.getIdsInRange(0.,1.)
+ ids=arr.findIdsInRange(0.,1.)
f2Mc=fMc[ids]
m3DSurf,desc,descI,revDesc,revDescI=f2Mc.getMesh().buildDescendingConnectivity()
nbOf3DCellSharing=revDescI.deltaShiftIndex()
- ids2=nbOf3DCellSharing.getIdsEqual(1)
+ ids2=nbOf3DCellSharing.findIdsEqual(1)
agitateurSkinMc=m3DSurf[ids2]
#
singlePolyhedron=agitateurMesh3DMc.buildSpreadZonesWithPoly()
singlePolyhedron.orientCorrectlyPolyhedrons()
- centerOfMass=singlePolyhedron.getBarycenterAndOwner()
- bary=agitateurSkinMc.getBarycenterAndOwner()
+ centerOfMass=singlePolyhedron.computeCellCenterOfMass()
+ bary=agitateurSkinMc.computeCellCenterOfMass()
posSkin=bary-centerOfMass
x2=posSkin[:,0]*posSkin[:,0] ; x2=x2.accumulate()[0]
y2=posSkin[:,1]*posSkin[:,1] ; y2=y2.accumulate()[0]
f1.setArray(array);
tmp=array.getPointer();
f1.setTime(2.,0,1);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
return f1;
def buildVecFieldOnNodes_1(cls):
array.setInfoOnComponent(1,"density [g/cm^3]");
array.setInfoOnComponent(2,"temperature [K]");
f1.setTime(2.12,2,3);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
return f1;
def buildVecFieldOnGauss_1(cls):
f.setName("MyFirstFieldOnGaussPoint");
array.setInfoOnComponent(0,"power [MW/m^3]");
array.setInfoOnComponent(1,"density");
- f.checkCoherency();
+ f.checkConsistencyLight();
return f;
def buildVecFieldOnGauss_2(cls):
f.setName("MyFirstFieldOnGaussPoint");
array.setInfoOnComponent(0,"power [MW/m^3]");
array.setInfoOnComponent(1,"density");
- f.checkCoherency();
+ f.checkConsistencyLight();
return f;
# idem buildVecFieldOnGauss_2 except that different discretizations are sorted inside one type
f.setName("MyFirstFieldOnGaussPoint");
array.setInfoOnComponent(0,"power [MW/m^3]");
array.setInfoOnComponent(1,"density");
- f.checkCoherency();
+ f.checkConsistencyLight();
return f;
def buildVecFieldOnGaussNE_1(cls):
array.setInfoOnComponent(0,"power [W]");
array.setInfoOnComponent(1,"temperature");
f.setName("MyFieldOnGaussNE");
- f.checkCoherency();
+ f.checkConsistencyLight();
return f;
def buildACompleteMEDDataStructureWithFieldsOnCells_1(cls):
f11Tmp.setMesh(m0)
arr=DataArrayDouble(m0.getNumberOfCells(),1) ; arr.iota() ; arr+=1+i ; arr*=0.1
f11Tmp.setArray(arr)
- f11Tmp.checkCoherency()
+ f11Tmp.checkConsistencyLight()
f11Tmp.setName(f1Name)
f1.appendFieldNoProfileSBT(f11Tmp)
pass
f21Tmp.setMesh(m0)
arr=DataArrayDouble(m0.getNumberOfCells(),1) ; arr.iota() ; arr+=1+i
f21Tmp.setArray(arr)
- f21Tmp.checkCoherency()
+ f21Tmp.checkConsistencyLight()
f21Tmp.setName(f2Name)
f2.appendFieldNoProfileSBT(f21Tmp)
f22Tmp=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME)
f22Tmp.setMesh(m1)
arr=DataArrayDouble(m1.getNumberOfCells(),1) ; arr.iota() ; arr+=100+1+i
f22Tmp.setArray(arr)
- f22Tmp.checkCoherency()
+ f22Tmp.checkConsistencyLight()
f22Tmp.setName(f2Name)
f2[it,order].setFieldNoProfileSBT(f22Tmp)
pass
f31Tmp.setMesh(m0Part)
arr=DataArrayDouble(m0Part.getNumberOfCells(),1) ; arr.iota() ; arr+=1000+i+1
f31Tmp.setArray(arr)
- f31Tmp.checkCoherency()
+ f31Tmp.checkConsistencyLight()
f31Tmp.setName(f3Name)
f3.appendFieldProfile(f31Tmp,mm,0,pfl1)
pfl2=DataArrayInt([0,3]) ; pfl2.setName("pfl2Bottom")
f32Tmp.setMesh(m1Part)
arr=DataArrayDouble(m1Part.getNumberOfCells(),1) ; arr.iota() ; arr+=2000+1+i
f32Tmp.setArray(arr)
- f32Tmp.checkCoherency()
+ f32Tmp.checkConsistencyLight()
f32Tmp.setName(f3Name)
f3[it,order].setFieldProfile(f32Tmp,mm,-1,pfl2)
pass
#! [PySnippetMeshAdvAPI1_1]
self.assertTrue(isinstance(myMesh,MEDCouplingUMesh))
myMesh.setName(meshName)
- MEDLoader.WriteUMesh("wFile1.med",myMesh,True)
+ WriteUMesh("wFile1.med",myMesh,True)
#! [PySnippetMeshAdvAPI1_1]
os.remove("wFile1.med")
#! [PySnippetMeshAdvAPI1_2]
self.assertTrue(isinstance(myMesh,MEDCouplingUMesh))
myMesh.setName(meshName)
- MEDLoader.WriteUMesh("wFile1.med",myMesh,False)
+ WriteUMesh("wFile1.med",myMesh,False)
#! [PySnippetMeshAdvAPI1_2]
f=myMesh.getMeasureField(ON_CELLS)
f=f.buildNewTimeReprFromThis(ONE_TIME,False)
f.setName("myField")
#! [PySnippetMeshAdvAPI1_3]
- MEDLoader.WriteUMesh("file3.med",f.getMesh(),True)
+ WriteUMesh("file3.med",f.getMesh(),True)
f.setTime(1.2,1,0)
fileNameMultiTimeStep="file3.med"
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileNameMultiTimeStep,f)
+ WriteFieldUsingAlreadyWrittenMesh(fileNameMultiTimeStep,f)
f.setTime(1.3,2,0)
f.applyFunc("sqrt(x)");
#Writing second time step with iteration==2 and order==0
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("file3.med",f);
+ WriteFieldUsingAlreadyWrittenMesh("file3.med",f);
#! [PySnippetMeshAdvAPI1_3]
#! [PySnippetMeshAdvAPI1_11]
- timeStepsIds=MEDLoader.GetCellFieldIterations("file3.med","Example2","myField")
+ timeStepsIds=GetCellFieldIterations("file3.med","Example2","myField")
self.assertEqual([(1, 0),(2, 0)],timeStepsIds)
- fs=MEDLoader.ReadFieldsOnSameMesh(ON_CELLS,"file3.med","Example2",0,"myField",timeStepsIds);
+ fs=ReadFieldsOnSameMesh(ON_CELLS,"file3.med","Example2",0,"myField",timeStepsIds);
#! [PySnippetMeshAdvAPI1_11]
###
myMesh0=myMesh[:] ; myMesh0.setName("Example2")
F1Cell.setArray(myMesh0.getCoords()[:myMesh0.getNumberOfCells()])
F1Cell.setTime(1000.,2,3)
F1Cell.setName("F1Cell")
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("file2.med",F1Cell)
- F1Cell1=F1Cell.deepCpy()
+ WriteFieldUsingAlreadyWrittenMesh("file2.med",F1Cell)
+ F1Cell1=F1Cell.deepCopy()
F1Cell1.setMesh(myMesh1)
- F1Cell1.setArray(myMesh1.getBarycenterAndOwner())
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh("file2.med",F1Cell1)
+ F1Cell1.setArray(myMesh1.computeCellCenterOfMass())
+ WriteFieldUsingAlreadyWrittenMesh("file2.med",F1Cell1)
#! [PySnippetMeshAdvAPI1_12]
- f1Cell_3D=MEDLoader.ReadFieldCell("file2.med","Example2",0,"F1Cell",2,3)
+ f1Cell_3D=ReadFieldCell("file2.med","Example2",0,"F1Cell",2,3)
#! [PySnippetMeshAdvAPI1_12]
#! [PySnippetMeshAdvAPI1_13]
- f1Cell_2D=MEDLoader.ReadFieldCell("file2.med","Example2",-1,"F1Cell",2,3)
+ f1Cell_2D=ReadFieldCell("file2.med","Example2",-1,"F1Cell",2,3)
#! [PySnippetMeshAdvAPI1_13]
self.assertTrue(F1Cell.isEqual(f1Cell_3D,1e-12,1e-12))
#! [PySnippetMeshAdvAPI1_8]
- self.assertEqual(3,MEDLoader.ReadUMeshDimFromFile("file2.med","Example2"))
+ self.assertEqual(3,ReadUMeshDimFromFile("file2.med","Example2"))
#! [PySnippetMeshAdvAPI1_8]
#! [PySnippetMeshAdvAPI1_7]
- m2D=MEDLoader.ReadUMeshFromFile("file2.med","Example2",0)
+ m2D=ReadUMeshFromFile("file2.med","Example2",0)
#! [PySnippetMeshAdvAPI1_7]
#! [PySnippetMeshAdvAPI1_4]
- m2D=MEDLoader.ReadUMeshFromFile("file2.med","Example2",-1)
+ m2D=ReadUMeshFromFile("file2.med","Example2",-1)
#! [PySnippetMeshAdvAPI1_4]
#! [PySnippetMeshAdvAPI1_5]
- m1D=MEDLoader.ReadUMeshFromFile("file2.med","Example2",-2)
+ m1D=ReadUMeshFromFile("file2.med","Example2",-2)
#! [PySnippetMeshAdvAPI1_5]
#! [PySnippetMeshAdvAPI1_6]
- m0D=MEDLoader.ReadUMeshFromFile("file2.med","Example2",-3)
+ m0D=ReadUMeshFromFile("file2.med","Example2",-3)
#! [PySnippetMeshAdvAPI1_6]
for i in xrange(4):
mm.removeMeshAtLevel(-i)
mm.setName("MyMesh")
mm.write("file1.med",2)
#! [PySnippetMeshAdvAPI1_9]
- m2D=MEDLoader.ReadUMeshFromFile("file1.med","MyMesh",0)
+ m2D=ReadUMeshFromFile("file1.med","MyMesh",0)
#! [PySnippetMeshAdvAPI1_9]
#! [PySnippetMeshAdvAPI1_10]
- m1D=MEDLoader.ReadUMeshFromFile("file1.med","MyMesh",-1)
+ m1D=ReadUMeshFromFile("file1.med","MyMesh",-1)
#! [PySnippetMeshAdvAPI1_10]
pass
from math import pi,e,sqrt
from MEDLoaderDataForTest import MEDLoaderDataForTest
-class MEDLoaderTest(unittest.TestCase):
+class MEDLoaderTest1(unittest.TestCase):
def testMesh1DRW(self):
mesh=MEDLoaderDataForTest.build1DMesh_1();
- mesh.checkCoherency();
- MEDLoader.MEDLoader.WriteUMesh("Pyfile1.med",mesh,True);
- mesh_rw=MEDLoader.MEDLoader.ReadUMeshFromFile("Pyfile1.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ MEDLoader.WriteUMesh("Pyfile1.med",mesh,True);
+ mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile1.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh2DCurveRW(self):
mesh=MEDLoaderDataForTest.build2DCurveMesh_1();
- mesh.checkCoherency();
- MEDLoader.MEDLoader.WriteUMesh("Pyfile2.med",mesh,True);
- mesh_rw=MEDLoader.MEDLoader.ReadUMeshFromFile("Pyfile2.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ MEDLoader.WriteUMesh("Pyfile2.med",mesh,True);
+ mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile2.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh2DRW(self):
mesh=MEDLoaderDataForTest.build2DMesh_1();
- mesh.checkCoherency();
- MEDLoader.MEDLoader.WriteUMesh("Pyfile3.med",mesh,True);
- mesh_rw=MEDLoader.MEDLoader.ReadUMeshFromFile("Pyfile3.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ MEDLoader.WriteUMesh("Pyfile3.med",mesh,True);
+ mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile3.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh3DSurfRW(self):
mesh=MEDLoaderDataForTest.build3DSurfMesh_1();
- mesh.checkCoherency();
- MEDLoader.MEDLoader.WriteUMesh("Pyfile4.med",mesh,True);
- mesh_rw=MEDLoader.MEDLoader.ReadUMeshFromFile("Pyfile4.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ MEDLoader.WriteUMesh("Pyfile4.med",mesh,True);
+ mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile4.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh3DRW(self):
mesh=MEDLoaderDataForTest.build3DMesh_1();
- mesh.checkCoherency();
- MEDLoader.MEDLoader.WriteUMesh("Pyfile5.med",mesh,True);
- mesh_rw=MEDLoader.MEDLoader.ReadUMeshFromFile("Pyfile5.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ MEDLoader.WriteUMesh("Pyfile5.med",mesh,True);
+ mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile5.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testFieldRW1(self):
f1=MEDLoaderDataForTest.buildVecFieldOnCells_1();
- MEDLoader.MEDLoader.WriteField("Pyfile6.med",f1,True);
- f2=MEDLoader.MEDLoader.ReadFieldCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1);
+ MEDLoader.WriteField("Pyfile6.med",f1,True);
+ f2=MEDLoader.ReadFieldCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
#
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
- MEDLoader.MEDLoader.WriteField("Pyfile7.med",f1,True);
- f2=MEDLoader.MEDLoader.ReadFieldNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3);
+ MEDLoader.WriteField("Pyfile7.med",f1,True);
+ f2=MEDLoader.ReadFieldNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
- self.assertRaises(Exception,MEDLoader.MEDLoader.ReadFieldCell,"Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3);
+ self.assertRaises(Exception,MEDLoader.ReadFieldCell,"Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3);
pass
def testFieldRW2(self):
VAL1=12345.67890314;
VAL2=-1111111111111.;
f1=MEDLoaderDataForTest.buildVecFieldOnCells_1();
- MEDLoader.MEDLoader.WriteField(fileName,f1,True);
+ MEDLoader.WriteField(fileName,f1,True);
f1.setTime(10.,8,9);
f1.getArray().setIJ(0,0,VAL1);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(10.14,18,19);
f1.getArray().setIJ(0,0,VAL2);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
#retrieving time steps...
- f2=MEDLoader.MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9);
+ f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9);
f1.setTime(10.,8,9);
f1.getArray().setIJ(0,0,VAL1);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1);
+ f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1);
f3=MEDLoaderDataForTest.buildVecFieldOnCells_1();
self.assertTrue(f3.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19);
+ f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19);
f1.setTime(10.14,18,19);
f1.getArray().setIJ(0,0,VAL2);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
#test of throw on invalid (dt,it)
- self.assertRaises(Exception,MEDLoader.MEDLoader.ReadFieldCell,fileName,f1.getMesh().getName(),0,f1.getName(),28,19);
+ self.assertRaises(Exception,MEDLoader.ReadFieldCell,fileName,f1.getMesh().getName(),0,f1.getName(),28,19);
#ON NODES
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
fileName2="Pyfile9.med";
- MEDLoader.MEDLoader.WriteField(fileName2,f1,True);
+ MEDLoader.WriteField(fileName2,f1,True);
f1.setTime(110.,108,109);
tmp=f1.getArray().getPointer();
f1.getArray().setIJ(0,3,VAL1);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
f1.setTime(210.,208,209);
f1.getArray().setIJ(0,3,VAL2);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
- f2=MEDLoader.MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
+ f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109);
f1.setTime(110.,108,109);
f1.getArray().setIJ(0,3,VAL1);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3);
+ f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3);
f3=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
self.assertTrue(f3.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209);
+ f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209);
f1.setTime(210.,208,209);
f1.getArray().setIJ(0,3,VAL2);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
f1.setTime(10.,8,9);
tmp=f1.getArray().getPointer();
f1.getArray().setIJ(0,0,VAL1);
- MEDLoader.MEDLoader.WriteField(fileName,f1,True);
+ MEDLoader.WriteField(fileName,f1,True);
f1.setTime(10.14,18,19);
f1.getArray().setIJ(0,0,VAL2);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.getMesh().setName(name3);
f1.setTime(10.55,28,29);
f1.getArray().setIJ(0,0,3*VAL1);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
- vec=MEDLoader.MEDLoader.GetMeshNamesOnField(fileName,name1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ vec=MEDLoader.GetMeshNamesOnField(fileName,name1);
f1.setTime(10.66,38,39);
f1.getArray().setIJ(0,0,3*VAL2);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(10.77,48,49);
f1.getArray().setIJ(0,0,4*VAL2);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
#ON NODES
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
f1.setName(name1);
f1.getMesh().setName(name3);
f1.setTime(110.,8,9);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(110.,108,109);
tmp=f1.getArray().getPointer();
f1.getArray().setIJ(0,3,VAL1);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(210.,208,209);
f1.getArray().setIJ(0,3,VAL2);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
#
- it1=MEDLoader.MEDLoader.GetCellFieldIterations(fileName,name3,name1);
+ it1=MEDLoader.GetCellFieldIterations(fileName,name3,name1);
self.assertEqual(5,len(it1));
self.assertEqual(8,it1[0][0]); self.assertEqual(9,it1[0][1]);
self.assertEqual(18,it1[1][0]); self.assertEqual(19,it1[1][1]);
self.assertEqual(28,it1[2][0]); self.assertEqual(29,it1[2][1]);
self.assertEqual(38,it1[3][0]); self.assertEqual(39,it1[3][1]);
self.assertEqual(48,it1[4][0]); self.assertEqual(49,it1[4][1]);
- it3=MEDLoader.MEDLoader.GetNodeFieldIterations(fileName,name3,name1);
+ it3=MEDLoader.GetNodeFieldIterations(fileName,name3,name1);
self.assertEqual(3,len(it3));
self.assertEqual(8,it3[0][0]); self.assertEqual(9,it3[0][1]);
self.assertEqual(108,it3[1][0]); self.assertEqual(109,it3[1][1]);
self.assertEqual(208,it3[2][0]); self.assertEqual(209,it3[2][1]);
#
#
- f1=MEDLoader.MEDLoader.ReadFieldCell(fileName,name3,0,name1,8,9);
+ f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,8,9);
self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.MEDLoader.ReadFieldCell(fileName,name3,0,name1,18,19);
+ f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,18,19);
self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.MEDLoader.ReadFieldCell(fileName,name3,0,name1,28,29);
+ f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,28,29);
self.assertAlmostEqual(3*VAL1,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.MEDLoader.ReadFieldCell(fileName,name3,0,name1,38,39);
+ f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,38,39);
self.assertAlmostEqual(3*VAL2,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.MEDLoader.ReadFieldCell(fileName,name3,0,name1,48,49);
+ f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,48,49);
self.assertAlmostEqual(4*VAL2,f1.getArray().getIJ(0,0),13);
#
- f1=MEDLoader.MEDLoader.ReadFieldNode(fileName,name3,0,name1,8,9);
+ f1=MEDLoader.ReadFieldNode(fileName,name3,0,name1,8,9);
self.assertAlmostEqual(71.,f1.getArray().getIJ(0,3),13);
- f1=MEDLoader.MEDLoader.ReadFieldNode(fileName,name3,0,name1,108,109);
+ f1=MEDLoader.ReadFieldNode(fileName,name3,0,name1,108,109);
self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,3),13);
- f1=MEDLoader.MEDLoader.ReadFieldNode(fileName,name3,0,name1,208,209);
+ f1=MEDLoader.ReadFieldNode(fileName,name3,0,name1,208,209);
self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,3),13);
pass
mesh4.setCoords(mesh1.getCoords());
meshes=[mesh1,mesh2,mesh3,mesh4]
mnane="3DToto";
- MEDLoader.MEDLoader.WriteUMeshesPartition(fileName,mnane,meshes,True);
+ MEDLoader.WriteUMeshesPartition(fileName,mnane,meshes,True);
#
- mesh5=MEDLoader.MEDLoader.ReadUMeshFromFile(fileName,mnane);
+ mesh5=MEDLoader.ReadUMeshFromFile(fileName,mnane);
mesh1.setName(mnane);
part3=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
mesh6=mesh5.buildPartOfMySelf(part3,True);
mesh6.setName(mnane);
self.assertTrue(mesh6.isEqual(mesh1,1e-12));
- grps=MEDLoader.MEDLoader.GetMeshGroupsNames(fileName,mnane);
+ grps=MEDLoader.GetMeshGroupsNames(fileName,mnane);
self.assertEqual(4,len(grps));
grps.index("mesh2");
grps.index("mesh3");
grps.index("3DMesh_1");
#
vec=("mesh2",);
- mesh2_2=MEDLoader.MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh2_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
self.assertTrue(mesh2_2.isEqual(mesh2,1e-12));
vec=["mesh3"];
- mesh3_2=MEDLoader.MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh3_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
self.assertTrue(mesh3_2.isEqual(mesh3,1e-12));
vec=["mesh4"];
- mesh4_2=MEDLoader.MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh4_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
self.assertTrue(mesh4_2.isEqual(mesh4,1e-12));
vec="3DMesh_1";
- mesh1_2=MEDLoader.MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh1_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
mesh1.setName("3DMesh_1");
self.assertTrue(mesh1_2.isEqual(mesh1,1e-12));
#
vec=["Family_-3","Family_-5"];
- mesh2_2=MEDLoader.MEDLoader.ReadUMeshFromFamilies(fileName,mnane,0,vec);
+ mesh2_2=MEDLoader.ReadUMeshFromFamilies(fileName,mnane,0,vec);
mesh2_2.setName("mesh2");
self.assertTrue(mesh2_2.isEqual(mesh2,1e-12));
#
- ret=MEDLoader.MEDLoader.GetMeshFamiliesNamesOnGroup(fileName,"3DToto","3DMesh_1");
+ ret=MEDLoader.GetMeshFamiliesNamesOnGroup(fileName,"3DToto","3DMesh_1");
self.assertEqual(4,len(ret));
ref=['Family_-3','Family_-4','Family_-2','Family_-5']
self.assertIn(ref[0],ret);
self.assertIn(ref[2],ret);
self.assertIn(ref[3],ret);
#
- ret1=MEDLoader.MEDLoader.GetMeshGroupsNamesOnFamily(fileName,"3DToto","Family_-3");
+ ret1=MEDLoader.GetMeshGroupsNamesOnFamily(fileName,"3DToto","Family_-3");
self.assertEqual(2,len(ret1));
self.assertEqual(ret1[0],"3DMesh_1");
self.assertEqual(ret1[1],"mesh2");
fileName="Pyfile12.med";
mesh1=MEDLoaderDataForTest.build3DMesh_1();
da,b,newNbOfNodes=mesh1.mergeNodes(1e-12);
- MEDLoader.MEDLoader.WriteUMesh(fileName,mesh1,True);
+ MEDLoader.WriteUMesh(fileName,mesh1,True);
part1=[1,2,4,13,15]
mesh2=mesh1.buildPartOfMySelf(part1,True);
mesh2.setName(mesh1.getName());#<- important for the test
arr1=[71.,171.,10.,110.,20.,120.,30.,130.,40.,140.]
array.setValues(arr1,nbOfCells,2);
f1.setTime(3.14,2,7);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
- MEDLoader.MEDLoader.WriteField(fileName,f1,False);#<- False important for the test
+ MEDLoader.WriteField(fileName,f1,False);#<- False important for the test
#
- f2=MEDLoader.MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
- tt=MEDLoader.MEDLoader.GetTypesOfField(fileName,f1.getMesh().getName(),f1.getName());
+ f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
+ tt=MEDLoader.GetTypesOfField(fileName,f1.getMesh().getName(),f1.getName());
self.assertEqual(tt,[MEDLoader.ON_CELLS]);
- f2.checkCoherency();
+ f2.checkConsistencyLight();
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
#
pass
def testFieldGaussRW1(self):
fileName="Pyfile13.med";
f1=MEDLoaderDataForTest.buildVecFieldOnGauss_1();
- MEDLoader.MEDLoader.WriteField(fileName,f1,True);
- f2=MEDLoader.MEDLoader.ReadField(MEDLoader.ON_GAUSS_PT,fileName,f1.getMesh().getName(),0,f1.getName(),1,5);
+ MEDLoader.WriteField(fileName,f1,True);
+ f2=MEDLoader.ReadField(MEDLoader.ON_GAUSS_PT,fileName,f1.getMesh().getName(),0,f1.getName(),1,5);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
pass
def testFieldGaussNERW1(self):
fileName="Pyfile14.med";
f1=MEDLoaderDataForTest.buildVecFieldOnGaussNE_1();
- MEDLoader.MEDLoader.WriteField(fileName,f1,True);
- self.assertEqual([MEDLoader.ON_GAUSS_NE],MEDLoader.MEDLoader.GetTypesOfField(fileName,'2DMesh_2','MyFieldOnGaussNE')) #Bug 22/5/2014
- f2=MEDLoader.MEDLoader.ReadField(MEDLoader.ON_GAUSS_NE,fileName,f1.getMesh().getName(),0,f1.getName(),1,5);
+ MEDLoader.WriteField(fileName,f1,True);
+ self.assertEqual([MEDLoader.ON_GAUSS_NE],MEDLoader.GetTypesOfField(fileName,'2DMesh_2','MyFieldOnGaussNE')) #Bug 22/5/2014
+ f2=MEDLoader.ReadField(MEDLoader.ON_GAUSS_NE,fileName,f1.getMesh().getName(),0,f1.getName(),1,5);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
pass
mesh=MEDLoaderDataForTest.build3DSurfMesh_1();
renumber1=[2,5,1,0,3,4]
mesh.renumberCells(renumber1,False);
- mesh.checkCoherency();
- MEDLoader.MEDLoader.WriteUMesh(fileName,mesh,True);
- mesh_rw=MEDLoader.MEDLoader.ReadUMeshFromFile(fileName,mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ MEDLoader.WriteUMesh(fileName,mesh,True);
+ mesh_rw=MEDLoader.ReadUMeshFromFile(fileName,mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
m.renumberCells(renum,False);
m.orientCorrectlyPolyhedrons();
# Writing
- MEDLoader.MEDLoader.WriteUMesh(fileName,m,True);
+ MEDLoader.WriteUMesh(fileName,m,True);
f1Tmp=m.getMeasureField(False);
f1=f1Tmp.buildNewTimeReprFromThis(MEDLoader.ONE_TIME,False);
f1.setTime(0.,1,2);
f_1=f1.cloneWithMesh(True);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.applyFunc("2*x");
f1.setTime(0.01,3,4);
f_2=f1.cloneWithMesh(True);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.applyFunc("2*x/3");
f1.setTime(0.02,5,6);
f_3=f1.cloneWithMesh(True);
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
# Reading
its=[(1,2),(3,4),(5,6)];
- fs=MEDLoader.MEDLoader.ReadFieldsOnSameMesh(MEDLoader.ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its);
+ fs=MEDLoader.ReadFieldsOnSameMesh(MEDLoader.ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its);
self.assertEqual(3,len(fs));
self.assertTrue(fs[0].isEqual(f_1,1e-12,1e-12));
self.assertTrue(fs[1].isEqual(f_2,1e-12,1e-12));
m2d.renumberCells(renumber,False);
m2d.setName("ExampleOfMultiDimW");
meshes=[m2d,m3d]
- MEDLoader.MEDLoader.WriteUMeshes(fileName,meshes,True);
- m3d_bis=MEDLoader.MEDLoader.ReadUMeshFromFile(fileName,m2d.getName(),0);
+ MEDLoader.WriteUMeshes(fileName,meshes,True);
+ m3d_bis=MEDLoader.ReadUMeshFromFile(fileName,m2d.getName(),0);
self.assertTrue(not m3d_bis.isEqual(m3d,1e-12));
m3d_bis.setName(m3d.getName());
self.assertTrue(m3d_bis.isEqual(m3d,1e-12));
- m2d_bis=MEDLoader.MEDLoader.ReadUMeshFromFile(fileName,m2d.getName(),-1);#-1 for faces
+ m2d_bis=MEDLoader.ReadUMeshFromFile(fileName,m2d.getName(),-1);#-1 for faces
self.assertTrue(m2d_bis.isEqual(m2d,1e-12));
# Creation of a field on faces.
f1=MEDLoader.MEDCouplingFieldDouble.New(MEDLoader.ON_CELLS,MEDLoader.ONE_TIME);
f1.setArray(array);
tmp=array.setValues(arr1,m2d.getNumberOfCells(),2);
f1.setTime(3.14,2,7);
- f1.checkCoherency();
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
- f2=MEDLoader.MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7);
+ f1.checkConsistencyLight();
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7);
self.assertTrue(f2.isEqual(f1,1e-12,1e-12));
pass
fileName2="Pyfile20.med";
m=MEDLoaderDataForTest.build2DMesh_1();
nbOfNodes=m.getNumberOfNodes();
- MEDLoader.MEDLoader.WriteUMesh(fileName,m,True);
+ MEDLoader.WriteUMesh(fileName,m,True);
f1=MEDLoader.MEDCouplingFieldDouble.New(MEDLoader.ON_NODES,MEDLoader.ONE_TIME);
f1.setName("VFieldOnNodes");
f1.setMesh(m);
array.setInfoOnComponent(0,"tyty [mm]");
array.setInfoOnComponent(1,"uiop [MW]");
f1.setTime(3.14,2,7);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
arr2=[1,4]
f2=f1.buildSubPart(arr2);
f2.getMesh().setName(f1.getMesh().getName());
- MEDLoader.MEDLoader.WriteField(fileName,f2,False);#<- False important for the test
+ MEDLoader.WriteField(fileName,f2,False);#<- False important for the test
#
- f3=MEDLoader.MEDLoader.ReadFieldNode(fileName,f2.getMesh().getName(),0,f2.getName(),2,7);
- f3.checkCoherency();
+ f3=MEDLoader.ReadFieldNode(fileName,f2.getMesh().getName(),0,f2.getName(),2,7);
+ f3.checkConsistencyLight();
self.assertTrue(f3.isEqual(f2,1e-12,1e-12));
#
arr3=[1,3,0,5,2,4]
f2.renumberNodes(arr3);
- MEDLoader.MEDLoader.WriteUMesh(fileName2,m,True);
- MEDLoader.MEDLoader.WriteField(fileName2,f2,False);#<- False important for the test
- f3=MEDLoader.MEDLoader.ReadFieldNode(fileName2,f2.getMesh().getName(),0,f2.getName(),2,7);
- f3.checkCoherency();
+ MEDLoader.WriteUMesh(fileName2,m,True);
+ MEDLoader.WriteField(fileName2,f2,False);#<- False important for the test
+ f3=MEDLoader.ReadFieldNode(fileName2,f2.getMesh().getName(),0,f2.getName(),2,7);
+ f3.checkConsistencyLight();
self.assertTrue(f3.isEqual(f2,1e-12,1e-12));
#
pass
def testFieldNodeProfilRW2(self):
fileName="Pyfile23.med";
mesh=MEDLoaderDataForTest.build3DSurfMesh_1();
- MEDLoader.MEDLoader.WriteUMesh(fileName,mesh,True);
+ MEDLoader.WriteUMesh(fileName,mesh,True);
#
f1=MEDLoader.MEDCouplingFieldDouble.New(MEDLoader.ON_NODES,MEDLoader.ONE_TIME);
f1.setName("FieldMix");
#
renumArr=[3,7,2,1,5,11,10,0,9,6,8,4]
f1.renumberNodes(renumArr);
- f1.checkCoherency();
- MEDLoader.MEDLoader.WriteField(fileName,f1,False);#<- False important for the test
- f2=MEDLoader.MEDLoader.ReadFieldNode(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
+ f1.checkConsistencyLight();
+ MEDLoader.WriteField(fileName,f1,False);#<- False important for the test
+ f2=MEDLoader.ReadFieldNode(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
self.assertTrue(f2.isEqual(f1,1e-12,1e-12));
#
pass
array.setInfoOnComponent(0,"plkj [mm]");
array.setInfoOnComponent(1,"pqqqss [mm]");
f1.setTime(3.14,2,7);
- f1.checkCoherency();
+ f1.checkConsistencyLight();
#
f2=MEDLoader.MEDCouplingFieldDouble.New(MEDLoader.ON_NODES,MEDLoader.ONE_TIME);
f2.setName("FieldMix");
array.setInfoOnComponent(0,"plkj [mm]");
array.setInfoOnComponent(1,"pqqqss [mm]");
f2.setTime(3.14,2,7);
- f2.checkCoherency();
+ f2.checkConsistencyLight();
#
- MEDLoader.MEDLoader.WriteField(fileName,f1,True);
- ts=MEDLoader.MEDLoader.GetTypesOfField(fileName,f1.getMesh().getName(),f1.getName());
+ MEDLoader.WriteField(fileName,f1,True);
+ ts=MEDLoader.GetTypesOfField(fileName,f1.getMesh().getName(),f1.getName());
self.assertEqual(1,len(ts));
self.assertEqual(MEDLoader.ON_CELLS,ts[0]);
- fs=MEDLoader.MEDLoader.GetAllFieldNamesOnMesh(fileName,f1.getMesh().getName());
+ fs=MEDLoader.GetAllFieldNamesOnMesh(fileName,f1.getMesh().getName());
self.assertEqual(1,len(fs));
self.assertTrue(fs[0]=="FieldMix");
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f2);
- fs=MEDLoader.MEDLoader.GetAllFieldNamesOnMesh(fileName,f1.getMesh().getName());
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f2);
+ fs=MEDLoader.GetAllFieldNamesOnMesh(fileName,f1.getMesh().getName());
self.assertEqual(1,len(fs));
self.assertTrue(fs[0]=="FieldMix");
#
- ts=MEDLoader.MEDLoader.GetTypesOfField(fileName,f1.getMesh().getName(),f1.getName());
+ ts=MEDLoader.GetTypesOfField(fileName,f1.getMesh().getName(),f1.getName());
self.assertEqual(2,len(ts));
self.assertEqual(MEDLoader.ON_NODES,ts[0]);
self.assertEqual(MEDLoader.ON_CELLS,ts[1]);
#
- f3=MEDLoader.MEDLoader.ReadFieldNode(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
+ f3=MEDLoader.ReadFieldNode(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
self.assertTrue(f3.isEqual(f2,1e-12,1e-12));
- f3=MEDLoader.MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
+ f3=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),2,7);
self.assertTrue(f3.isEqual(f1,1e-12,1e-12));
#
pass
f1.setTime(3.44,5,6);
f1.setMesh(mesh);
f1.fillFromAnalytic(2,"x+y");
- MEDLoader.MEDLoader.WriteField(fileName,f1,True);
+ MEDLoader.WriteField(fileName,f1,True);
f1.setTime(1002.3,7,8);
f1.fillFromAnalytic(2,"x+77.*y");
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setName("Field2");
- MEDLoader.MEDLoader.WriteField(fileName,f1,False);
+ MEDLoader.WriteField(fileName,f1,False);
f1.setName("Field3");
mesh.setName("2DMesh_2Bis");
- MEDLoader.MEDLoader.WriteField(fileName,f1,False);
+ MEDLoader.WriteField(fileName,f1,False);
f1=MEDLoader.MEDCouplingFieldDouble.New(MEDLoader.ON_CELLS,MEDLoader.ONE_TIME);
f1.setName("Field8");
f1.setTime(8.99,7,9);
f1.setMesh(mesh);
f1.fillFromAnalytic(3,"3*x+y");
- MEDLoader.MEDLoader.WriteField(fileName,f1,False);
- fs=MEDLoader.MEDLoader.GetAllFieldNames(fileName);
+ MEDLoader.WriteField(fileName,f1,False);
+ fs=MEDLoader.GetAllFieldNames(fileName);
self.assertEqual(4,len(fs));
self.assertTrue(fs[0]=="Field1");
self.assertTrue(fs[1]=="Field2");
arr.setInfoOnComponents(["c%i"%(i) for i in xrange(nbOfCompo)])
f.setArray(arr)
f.setName("FieldBigCompo")
- MEDLoader.MEDLoader.WriteField(fileName,f,True)
- f2=MEDLoader.MEDLoader.ReadFieldCell(fileName,m.getName(),0,f.getName(),-1,-1)
+ MEDLoader.WriteField(fileName,f,True)
+ f2=MEDLoader.ReadFieldCell(fileName,m.getName(),0,f.getName(),-1,-1)
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
pass
m.insertNextCell([0,2,1,3])
m.setCoords(MEDLoader.DataArrayDouble([0.,0.,1.,1.,1.,0.,0.,1.],4,2))
#
- ms=[m.deepCpy() for i in xrange(4)]
+ ms=[m.deepCopy() for i in xrange(4)]
for i,elt in enumerate(ms):
elt.translate([float(i)*1.5,0.])
pass
#
m0=MEDLoader.MEDCoupling1SGTUMesh.Merge1SGTUMeshes(ms)
f=m0.getMeasureField(False) ; f.getArray().setInfoOnComponents(["ABC [defg]"])
- MEDLoader.MEDLoader.WriteField(fname,f,True)
+ MEDLoader.WriteField(fname,f,True)
#
- fRead=MEDLoader.MEDLoader.ReadFieldCell(fname,"merge",0,f.getName(),-1,-1)
+ fRead=MEDLoader.ReadFieldCell(fname,"merge",0,f.getName(),-1,-1)
fRead.setMesh(MEDLoader.MEDCoupling1SGTUMesh(fRead.getMesh()))
self.assertTrue(f.isEqual(fRead,1e-12,1e-12))
#
m0=m0.buildUnstructured() ; m0.convertAllToPoly()
m0=MEDLoader.MEDCoupling1DGTUMesh(m0)
f=m0.getMeasureField(False) ; f.getArray().setInfoOnComponents(["ABC [defg]"])
- MEDLoader.MEDLoader.WriteField(fname,f,True)
+ MEDLoader.WriteField(fname,f,True)
#
- fRead=MEDLoader.MEDLoader.ReadFieldCell(fname,"merge",0,f.getName(),-1,-1)
+ fRead=MEDLoader.ReadFieldCell(fname,"merge",0,f.getName(),-1,-1)
fRead.setMesh(MEDLoader.MEDCoupling1DGTUMesh(fRead.getMesh()))
self.assertTrue(f.isEqual(fRead,1e-12,1e-12))
#
m0.setCoords(arr,arr)
m0.setName("mesh")
f=m0.getMeasureField(False) ; f.getArray().setInfoOnComponents(["ABC [defg]"])
- MEDLoader.MEDLoader.WriteField(fname,f,True)
+ MEDLoader.WriteField(fname,f,True)
#
- fRead=MEDLoader.MEDLoader.ReadFieldCell(fname,"mesh",0,f.getName(),-1,-1)
+ fRead=MEDLoader.ReadFieldCell(fname,"mesh",0,f.getName(),-1,-1)
self.assertTrue(f.isEqual(fRead,1e-12,1e-12))
#
c=m0.buildUnstructured().getCoords()
m0.setNodeGridStructure([4,4])
m0.setCoords(c)
f=m0.getMeasureField(False) ; f.getArray().setInfoOnComponents(["ABC [defg]"])
- MEDLoader.MEDLoader.WriteField(fname,f,True)
+ MEDLoader.WriteField(fname,f,True)
#
- fRead=MEDLoader.MEDLoader.ReadFieldCell(fname,"mesh",0,f.getName(),-1,-1)
+ fRead=MEDLoader.ReadFieldCell(fname,"mesh",0,f.getName(),-1,-1)
self.assertTrue(f.isEqual(fRead,1e-12,1e-12))
pass
m.insertNextCell([0,2,1,3])
m.setCoords(MEDLoader.DataArrayDouble([0.,0.,1.,1.,1.,0.,0.,1.],4,2))
#
- ms=[m.deepCpy() for i in xrange(4)]
+ ms=[m.deepCopy() for i in xrange(4)]
for i,elt in enumerate(ms):
elt.translate([float(i)*1.5,0.])
pass
m0=MEDLoader.MEDCoupling1SGTUMesh.Merge1SGTUMeshes(ms)
- MEDLoader.MEDLoader.WriteMesh(fname,m0,True)
+ MEDLoader.WriteMesh(fname,m0,True)
#
- mRead=MEDLoader.MEDLoader.ReadMeshFromFile(fname,"merge",0)
+ mRead=MEDLoader.ReadMeshFromFile(fname,"merge",0)
self.assertTrue(isinstance(mRead,MEDLoader.MEDCouplingUMesh))
mRead=MEDLoader.MEDCoupling1SGTUMesh(mRead)
self.assertTrue(m0.isEqual(mRead,1e-12))
#
m0=m0.buildUnstructured() ; m0.convertAllToPoly()
m0=MEDLoader.MEDCoupling1DGTUMesh(m0)
- MEDLoader.MEDLoader.WriteMesh(fname,m0,True)
+ MEDLoader.WriteMesh(fname,m0,True)
#
- mRead=MEDLoader.MEDLoader.ReadMeshFromFile(fname,"merge",0)
+ mRead=MEDLoader.ReadMeshFromFile(fname,"merge",0)
mRead=MEDLoader.MEDCoupling1DGTUMesh(mRead)
self.assertTrue(m0.isEqual(mRead,1e-12))
#
arr=MEDLoader.DataArrayDouble(4) ; arr.iota()
m0.setCoords(arr,arr)
m0.setName("mesh")
- MEDLoader.MEDLoader.WriteMesh(fname,m0,True)
+ MEDLoader.WriteMesh(fname,m0,True)
#
- mRead=MEDLoader.MEDLoader.ReadMeshFromFile(fname,0)
+ mRead=MEDLoader.ReadMeshFromFile(fname,0)
self.assertTrue(isinstance(mRead,MEDLoader.MEDCouplingCMesh))
self.assertTrue(m0.isEqual(mRead,1e-12))
#
m0=MEDLoader.MEDCouplingCurveLinearMesh("mesh")
m0.setNodeGridStructure([4,4])
m0.setCoords(c)
- MEDLoader.MEDLoader.WriteMesh(fname,m0,True)
+ MEDLoader.WriteMesh(fname,m0,True)
#
- mRead=MEDLoader.MEDLoader.ReadMeshFromFile(fname,0)
+ mRead=MEDLoader.ReadMeshFromFile(fname,0)
self.assertTrue(isinstance(mRead,MEDLoader.MEDCouplingCurveLinearMesh))
self.assertTrue(m0.isEqual(mRead,1e-12))
pass
f.setName("field")
#
mm=MEDLoader.MEDFileUMesh()
- MEDLoader.MEDLoader.SetTooLongStrPolicy(2)
- MEDLoader.MEDLoader.AssignStaticWritePropertiesTo(mm)
+ MEDLoader.SetTooLongStrPolicy(2)
+ MEDLoader.AssignStaticWritePropertiesTo(mm)
self.assertEqual(2,mm.getTooLongStrPolicy())
- MEDLoader.MEDLoader.SetTooLongStrPolicy(0)
- MEDLoader.MEDLoader.AssignStaticWritePropertiesTo(mm)
+ MEDLoader.SetTooLongStrPolicy(0)
+ MEDLoader.AssignStaticWritePropertiesTo(mm)
self.assertEqual(0,mm.getTooLongStrPolicy())
del mm
#
- MEDLoader.MEDLoader.SetTooLongStrPolicy(2)
- self.assertRaises(MEDLoader.InterpKernelException,MEDLoader.MEDLoader.WriteField,fname,f,True)# the component name is too long + policy 2 -> throw
+ MEDLoader.SetTooLongStrPolicy(2)
+ self.assertRaises(MEDLoader.InterpKernelException,MEDLoader.WriteField,fname,f,True)# the component name is too long + policy 2 -> throw
f.getArray().setInfoOnComponent(0,'I129')
- MEDLoader.MEDLoader.WriteField(fname,f,True)
+ MEDLoader.WriteField(fname,f,True)
pass
def testUsingAlreadyWrittenMesh2(self):
f1.setMesh(mesh)
arr=MEDLoader.DataArrayDouble(20) ; arr.iota()
f1.setArray(arr)
- f1.checkCoherency()
+ f1.checkConsistencyLight()
#
f2=MEDLoader.MEDCouplingFieldDouble(MEDLoader.ON_NODES) ; f2.setName("f2")
f2.setMesh(mesh)
arr=MEDLoader.DataArrayDouble(20) ; arr.iota() ; arr*=3
f2.setArray(arr)
- f2.checkCoherency()
+ f2.checkConsistencyLight()
#
- f11=f1.deepCpy() ; (f11.getArray())[:]*=4 ; f11.setTime(1.1,5,6)
+ f11=f1.deepCopy() ; (f11.getArray())[:]*=4 ; f11.setTime(1.1,5,6)
#
- MEDLoader.MEDLoader.WriteMesh(fname,f1.getMesh(),True)
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f1)
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
- MEDLoader.MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f11)
+ MEDLoader.WriteMesh(fname,f1.getMesh(),True)
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f1)
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+ MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f11)
##
- f1r=MEDLoader.MEDLoader.ReadFieldNode(fname,"mesh",0,"f1",-1,-1);
+ f1r=MEDLoader.ReadFieldNode(fname,"mesh",0,"f1",-1,-1);
self.assertTrue(f1.isEqual(f1r,1e-12,1e-12))
self.assertTrue(f1r.getArray().isEqual(MEDLoader.DataArrayDouble([0.,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15.,16.,17.,18.,19.]),1e-12))
- f2r=MEDLoader.MEDLoader.ReadFieldNode(fname,"mesh",0,"f2",-1,-1);
+ f2r=MEDLoader.ReadFieldNode(fname,"mesh",0,"f2",-1,-1);
self.assertTrue(f2.isEqual(f2r,1e-12,1e-12))
self.assertTrue(f2r.getArray().isEqual(MEDLoader.DataArrayDouble([0.,3.,6.,9.,12.,15.,18.,21.,24.,27.,30.,33.,36.,39.,42.,45.,48.,51.,54.,57.]),1e-12))
- f3r=MEDLoader.MEDLoader.ReadFieldNode(fname,"mesh",0,"f1",5,6);
+ f3r=MEDLoader.ReadFieldNode(fname,"mesh",0,"f1",5,6);
self.assertTrue(f11.isEqual(f3r,1e-12,1e-12))
self.assertTrue(f3r.getArray().isEqual(MEDLoader.DataArrayDouble([0.,4.,8.,12.,16.,20.,24.,28.,32.,36.,40.,44.,48.,52.,56.,60.,64.,68.,72.,76.]),1e-12))
pass
--- /dev/null
+if __name__ == "__main__":
+ import unittest
+
+ from MEDLoaderTest1 import MEDLoaderTest1
+ from MEDLoaderTest2 import MEDLoaderTest2
+ from MEDLoaderTest3 import MEDLoaderTest3
+
+ unittest.main()
from math import pi,e,sqrt
from MEDLoaderDataForTest import MEDLoaderDataForTest
-class MEDLoaderTest(unittest.TestCase):
+class MEDLoaderTest2(unittest.TestCase):
def testMesh1DRW(self):
mesh=MEDLoaderDataForTest.build1DMesh_1();
- mesh.checkCoherency();
- MEDLoader.WriteUMeshDep("Pyfile1.med",mesh,False);
- mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile1.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ WriteUMeshDep("Pyfile1.med",mesh,False);
+ mesh_rw=ReadUMeshFromFile("Pyfile1.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh2DCurveRW(self):
mesh=MEDLoaderDataForTest.build2DCurveMesh_1();
- mesh.checkCoherency();
- MEDLoader.WriteUMeshDep("Pyfile2.med",mesh,False);
- mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile2.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ WriteUMeshDep("Pyfile2.med",mesh,False);
+ mesh_rw=ReadUMeshFromFile("Pyfile2.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh2DRW(self):
mesh=MEDLoaderDataForTest.build2DMesh_1();
- mesh.checkCoherency();
- MEDLoader.WriteUMeshDep("Pyfile3.med",mesh,False);
- mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile3.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ WriteUMeshDep("Pyfile3.med",mesh,False);
+ mesh_rw=ReadUMeshFromFile("Pyfile3.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh3DSurfRW(self):
mesh=MEDLoaderDataForTest.build3DSurfMesh_1();
- mesh.checkCoherency();
- MEDLoader.WriteUMeshDep("Pyfile4.med",mesh,False);
- mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile4.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ WriteUMeshDep("Pyfile4.med",mesh,False);
+ mesh_rw=ReadUMeshFromFile("Pyfile4.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testMesh3DRW(self):
mesh=MEDLoaderDataForTest.build3DMesh_1();
- mesh.checkCoherency();
- MEDLoader.WriteUMeshDep("Pyfile5.med",mesh,False);
- mesh_rw=MEDLoader.ReadUMeshFromFile("Pyfile5.med",mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ WriteUMeshDep("Pyfile5.med",mesh,False);
+ mesh_rw=ReadUMeshFromFile("Pyfile5.med",mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
def testFieldRW1(self):
f1=MEDLoaderDataForTest.buildVecFieldOnCells_1();
- MEDLoader.WriteFieldDep("Pyfile6.med",f1,False);
- f2=MEDLoader.ReadFieldCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1);
+ WriteFieldDep("Pyfile6.med",f1,False);
+ f2=ReadFieldCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
#
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
- MEDLoader.WriteFieldDep("Pyfile7.med",f1,False);
- f2=MEDLoader.ReadFieldNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3);
+ WriteFieldDep("Pyfile7.med",f1,False);
+ f2=ReadFieldNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
pass
VAL1=12345.67890314;
VAL2=-1111111111111.;
f1=MEDLoaderDataForTest.buildVecFieldOnCells_1();
- MEDLoader.WriteFieldDep(fileName,f1,False);
+ WriteFieldDep(fileName,f1,False);
f1.setTime(10.,8,9);
f1.getArray().setIJ(0,0,VAL1);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(10.14,18,19);
f1.getArray().setIJ(0,0,VAL2);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
#retrieving time steps...
- f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9);
+ f2=ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9);
f1.setTime(10.,8,9);
f1.getArray().setIJ(0,0,VAL1);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1);
+ f2=ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1);
f3=MEDLoaderDataForTest.buildVecFieldOnCells_1();
self.assertTrue(f3.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19);
+ f2=ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19);
f1.setTime(10.14,18,19);
f1.getArray().setIJ(0,0,VAL2);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
#ON NODES
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
fileName2="Pyfile9.med";
- MEDLoader.WriteFieldDep(fileName2,f1,False);
+ WriteFieldDep(fileName2,f1,False);
f1.setTime(110.,108,109);
tmp=f1.getArray().getPointer();
f1.getArray().setIJ(0,3,VAL1);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
f1.setTime(210.,208,209);
f1.getArray().setIJ(0,3,VAL2);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
- f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109);
+ WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
+ f2=ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109);
f1.setTime(110.,108,109);
f1.getArray().setIJ(0,3,VAL1);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3);
+ f2=ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3);
f3=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
self.assertTrue(f3.isEqual(f2,1e-12,1e-12));
- f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209);
+ f2=ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209);
f1.setTime(210.,208,209);
f1.getArray().setIJ(0,3,VAL2);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12));
f1.setTime(10.,8,9);
tmp=f1.getArray().getPointer();
f1.getArray().setIJ(0,0,VAL1);
- MEDLoader.WriteFieldDep(fileName,f1,False);
+ WriteFieldDep(fileName,f1,False);
f1.setTime(10.14,18,19);
f1.getArray().setIJ(0,0,VAL2);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.getMesh().setName(name3);
f1.setTime(10.55,28,29);
f1.getArray().setIJ(0,0,3*VAL1);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(10.66,38,39);
f1.getArray().setIJ(0,0,3*VAL2);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(10.77,48,49);
f1.getArray().setIJ(0,0,4*VAL2);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
#ON NODES
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
f1.setName(name1);
f1.getMesh().setName(name3);
f1.setTime(110.,8,9);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(110.,108,109);
tmp=f1.getArray().getPointer();
f1.getArray().setIJ(0,3,VAL1);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.setTime(210.,208,209);
f1.getArray().setIJ(0,3,VAL2);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
#
- it1=MEDLoader.GetCellFieldIterations(fileName,name3,name1);
+ it1=GetCellFieldIterations(fileName,name3,name1);
self.assertEqual(5,len(it1));
self.assertEqual(8,it1[0][0]); self.assertEqual(9,it1[0][1]);
self.assertEqual(18,it1[1][0]); self.assertEqual(19,it1[1][1]);
self.assertEqual(28,it1[2][0]); self.assertEqual(29,it1[2][1]);
self.assertEqual(38,it1[3][0]); self.assertEqual(39,it1[3][1]);
self.assertEqual(48,it1[4][0]); self.assertEqual(49,it1[4][1]);
- it3=MEDLoader.GetNodeFieldIterations(fileName,name3,name1);
+ it3=GetNodeFieldIterations(fileName,name3,name1);
self.assertEqual(3,len(it3));
self.assertEqual(8,it3[0][0]); self.assertEqual(9,it3[0][1]);
self.assertEqual(108,it3[1][0]); self.assertEqual(109,it3[1][1]);
self.assertEqual(208,it3[2][0]); self.assertEqual(209,it3[2][1]);
#
#
- f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,8,9);
+ f1=ReadFieldCell(fileName,name3,0,name1,8,9);
self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,18,19);
+ f1=ReadFieldCell(fileName,name3,0,name1,18,19);
self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,28,29);
+ f1=ReadFieldCell(fileName,name3,0,name1,28,29);
self.assertAlmostEqual(3*VAL1,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,38,39);
+ f1=ReadFieldCell(fileName,name3,0,name1,38,39);
self.assertAlmostEqual(3*VAL2,f1.getArray().getIJ(0,0),13);
- f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,48,49);
+ f1=ReadFieldCell(fileName,name3,0,name1,48,49);
self.assertAlmostEqual(4*VAL2,f1.getArray().getIJ(0,0),13);
#
- f1=MEDLoader.ReadFieldNode(fileName,name3,0,name1,8,9);
+ f1=ReadFieldNode(fileName,name3,0,name1,8,9);
self.assertAlmostEqual(71.,f1.getArray().getIJ(0,3),13);
- f1=MEDLoader.ReadFieldNode(fileName,name3,0,name1,108,109);
+ f1=ReadFieldNode(fileName,name3,0,name1,108,109);
self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,3),13);
- f1=MEDLoader.ReadFieldNode(fileName,name3,0,name1,208,209);
+ f1=ReadFieldNode(fileName,name3,0,name1,208,209);
self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,3),13);
pass
mesh4.setCoords(mesh1.getCoords());
meshes=[mesh1,mesh2,mesh3,mesh4]
mnane="3DToto";
- MEDLoader.WriteUMeshesPartitionDep(fileName,mnane,meshes,False);
+ WriteUMeshesPartitionDep(fileName,mnane,meshes,False);
#
- mesh5=MEDLoader.ReadUMeshFromFile(fileName,mnane);
+ mesh5=ReadUMeshFromFile(fileName,mnane);
mesh1.setName(mnane);
part3=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
mesh6=mesh5.buildPartOfMySelf(part3,True);
mesh6.setName(mnane);
self.assertTrue(mesh6.isEqual(mesh1,1e-12));
- grps=MEDLoader.GetMeshGroupsNames(fileName,mnane);
+ grps=GetMeshGroupsNames(fileName,mnane);
self.assertEqual(4,len(grps));
grps.index("mesh2");
grps.index("mesh3");
grps.index("3DMesh_1");
#
vec=["mesh2"];
- mesh2_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh2_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
self.assertTrue(mesh2_2.isEqual(mesh2,1e-12));
vec=["mesh3"];
- mesh3_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh3_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
self.assertTrue(mesh3_2.isEqual(mesh3,1e-12));
vec=["mesh4"];
- mesh4_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh4_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
self.assertTrue(mesh4_2.isEqual(mesh4,1e-12));
vec=["3DMesh_1"];
- mesh1_2=MEDLoader.ReadUMeshFromGroups(fileName,mnane,0,vec);
+ mesh1_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
mesh1.setName("3DMesh_1");
self.assertTrue(mesh1_2.isEqual(mesh1,1e-12));
#
vec=["Family_-5","Family_-3"];
- mesh2_2=MEDLoader.ReadUMeshFromFamilies(fileName,mnane,0,vec);
+ mesh2_2=ReadUMeshFromFamilies(fileName,mnane,0,vec);
mesh2_2.setName("mesh2");
self.assertTrue(mesh2_2.isEqual(mesh2,1e-12));
pass
mesh=MEDLoaderDataForTest.build3DSurfMesh_1();
renumber1=[2,5,1,0,3,4]
mesh.renumberCells(renumber1,False);
- mesh.checkCoherency();
- MEDLoader.WriteUMeshDep(fileName,mesh,False);
- mesh_rw=MEDLoader.ReadUMeshFromFile(fileName,mesh.getName(),0);
+ mesh.checkConsistencyLight();
+ WriteUMeshDep(fileName,mesh,False);
+ mesh_rw=ReadUMeshFromFile(fileName,mesh.getName(),0);
self.assertTrue(mesh.isEqual(mesh_rw,1e-12));
pass
m.renumberCells(renum,False);
m.orientCorrectlyPolyhedrons();
# Writing
- MEDLoader.WriteUMeshDep(fileName,m,False);
+ WriteUMeshDep(fileName,m,False);
f1Tmp=m.getMeasureField(False);
f1=f1Tmp.buildNewTimeReprFromThis(ONE_TIME,False);
f1.setTime(0.,1,2);
f_1=f1.cloneWithMesh(True);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.applyFunc("2*x");
f1.setTime(0.01,3,4);
f_2=f1.cloneWithMesh(True);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1.applyFunc("2*x/3");
f1.setTime(0.02,5,6);
f_3=f1.cloneWithMesh(True);
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
# Reading
its=[(1,2),(3,4),(5,6)];
- fs=MEDLoader.ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its);
+ fs=ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its);
self.assertEqual(3,len(fs));
self.assertTrue(fs[0].isEqual(f_1,1e-12,1e-12));
self.assertTrue(fs[1].isEqual(f_2,1e-12,1e-12));
m2d.renumberCells(renumber,False);
m2d.setName("ExampleOfMultiDimW");
meshes=[m2d,m3d]
- MEDLoader.WriteUMeshes(fileName,meshes,False);
- m3d_bis=MEDLoader.ReadUMeshFromFile(fileName,m2d.getName(),0);
+ WriteUMeshes(fileName,meshes,False);
+ m3d_bis=ReadUMeshFromFile(fileName,m2d.getName(),0);
self.assertTrue(not m3d_bis.isEqual(m3d,1e-12));
m3d_bis.setName(m3d.getName());
self.assertTrue(m3d_bis.isEqual(m3d,1e-12));
- m2d_bis=MEDLoader.ReadUMeshFromFile(fileName,m2d.getName(),-1);#-1 for faces
+ m2d_bis=ReadUMeshFromFile(fileName,m2d.getName(),-1);#-1 for faces
self.assertTrue(m2d_bis.isEqual(m2d,1e-12));
# Creation of a field on faces.
f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME);
f1.setArray(array);
tmp=array.setValues(arr1,m2d.getNumberOfCells(),2);
f1.setTime(3.14,2,7);
- f1.checkCoherency();
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
- f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7);
+ f1.checkConsistencyLight();
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ f2=ReadFieldCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7);
self.assertTrue(f2.isEqual(f1,1e-12,1e-12));
pass
pass
from math import pi,e,sqrt
from MEDLoaderDataForTest import MEDLoaderDataForTest
-class MEDLoaderTest(unittest.TestCase):
+class MEDLoaderTest3(unittest.TestCase):
def testMEDMesh1(self):
fileName="Pyfile18.med"
mname="ExampleOfMultiDimW"
self.assertRaises(InterpKernelException,MEDFileMesh.New,fileName,"")
self.assertEqual((0,-1),medmesh.getNonEmptyLevels())
m1_0=medmesh.getLevel0Mesh(True)
- m1_1=MEDLoader.ReadUMeshFromFile(fileName,mname,0)
+ m1_1=ReadUMeshFromFile(fileName,mname,0)
self.assertTrue(m1_0.isEqual(m1_1,1e-12));
m2_0=medmesh.getLevelM1Mesh(True)
- m2_1=MEDLoader.ReadUMeshFromFile(fileName,mname,-1)
+ m2_1=ReadUMeshFromFile(fileName,mname,-1)
self.assertTrue(m2_0.isEqual(m2_1,1e-12));
pass
medmesh=MEDFileUMesh.New(fileName,mname)
self.assertEqual((0,),medmesh.getNonEmptyLevels())
m1_0=medmesh.getLevel0Mesh(True)
- m1_1=MEDLoader.ReadUMeshFromFile(fileName,mname,0)
+ m1_1=ReadUMeshFromFile(fileName,mname,0)
self.assertTrue(m1_0.isEqual(m1_1,1e-12));
g1_0=medmesh.getGroup(0,"mesh2",True)
- g1_1=MEDLoader.ReadUMeshFromGroups(fileName,mname,0,["mesh2"]);
+ g1_1=ReadUMeshFromGroups(fileName,mname,0,["mesh2"]);
self.assertTrue(g1_0.isEqual(g1_1,1e-12));
g1_0=medmesh.getGroup(0,"mesh3",True)
- g1_1=MEDLoader.ReadUMeshFromGroups(fileName,mname,0,["mesh3"]);
+ g1_1=ReadUMeshFromGroups(fileName,mname,0,["mesh3"]);
self.assertTrue(g1_0.isEqual(g1_1,1e-12));
g1_0=medmesh.getGroups(0,["mesh3","mesh2"])
- g1_1=MEDLoader.ReadUMeshFromGroups(fileName,mname,0,["mesh3","mesh2"]);
+ g1_1=ReadUMeshFromGroups(fileName,mname,0,["mesh3","mesh2"]);
g1_1.setName(g1_0.getName())
self.assertTrue(g1_0.isEqual(g1_1,1e-12));
g1_0=medmesh.getFamily(0,"Family_-3",True)
- g1_1=MEDLoader.ReadUMeshFromFamilies(fileName,mname,0,["Family_-3"]);
+ g1_1=ReadUMeshFromFamilies(fileName,mname,0,["Family_-3"]);
self.assertTrue(g1_0.isEqual(g1_1,1e-12));
g1_0=medmesh.getFamilies(0,["Family_-3","Family_-5"],True)
- g1_1=MEDLoader.ReadUMeshFromFamilies(fileName,mname,0,["Family_-3","Family_-5"]);
+ g1_1=ReadUMeshFromFamilies(fileName,mname,0,["Family_-3","Family_-5"]);
g1_1.setName(g1_0.getName())
self.assertTrue(g1_0.isEqual(g1_1,1e-12));
self.assertTrue(g1_0.isEqual(g1_1,1e-12));
m.insertNextCell(NORM_POLYGON,4,targetConn[14:18])
m.finishInsertingCells();
m.setCoords(c)
- m.checkCoherency()
+ m.checkConsistencyLight()
m1=MEDCouplingUMesh.New();
m1.setMeshDimension(1);
m1.allocateCells(3);
m1.insertNextCell(NORM_SEG3,3,[2,8,5])
m1.finishInsertingCells();
m1.setCoords(c)
- m1.checkCoherency()
+ m1.checkConsistencyLight()
m2=MEDCouplingUMesh.New();
m2.setMeshDimension(0);
m2.allocateCells(4);
m2.insertNextCell(NORM_POINT1,1,[6])
m2.finishInsertingCells();
m2.setCoords(c)
- m2.checkCoherency()
+ m2.checkConsistencyLight()
#
mm=MEDFileUMesh.New()
self.assertTrue(mm.getUnivNameWrStatus())
t=mm.getGroupArr(0,"GrpOnAllCell")
self.assertTrue(t.getValues()==range(5))
#
- mmCpy=mm.deepCpy()
+ mmCpy=mm.deepCopy()
self.assertTrue(mm.isEqual(mmCpy,1e-12)[0]) ; del mm
mmCpy.write(outFileName,2);
#
m.setName(mm.getName()) ; m.setDescription(mm.getDescription())
self.assertTrue(m.isEqual(mbis,1e-12));
#
- self.assertEqual(([[(3, 2), (4, 1), (5, 8)], [(1, 2), (2, 1)], [(0, 4)]], 2, 2, 9),MEDLoader.GetUMeshGlobalInfo(outFileName,"MyFirstMEDCouplingMEDmesh"))
+ self.assertEqual(([[(3, 2), (4, 1), (5, 8)], [(1, 2), (2, 1)], [(0, 4)]], 2, 2, 9),GetUMeshGlobalInfo(outFileName,"MyFirstMEDCouplingMEDmesh"))
pass
# this test is the testMEDMesh3 except that permutation is dealed here
m.insertNextCell(NORM_QUAD4,4,targetConn[14:18])
m.finishInsertingCells();
m.setCoords(c)
- m.checkCoherency()
+ m.checkConsistencyLight()
m1=MEDCouplingUMesh.New();
m1.setMeshDimension(1);
m1.allocateCells(3);
m1.insertNextCell(NORM_SEG2,2,[3,6])
m1.finishInsertingCells();
m1.setCoords(c)
- m1.checkCoherency()
+ m1.checkConsistencyLight()
m2=MEDCouplingUMesh.New();
m2.setMeshDimension(0);
m2.allocateCells(4);
m2.insertNextCell(NORM_POINT1,1,[6])
m2.finishInsertingCells();
m2.setCoords(c)
- m2.checkCoherency()
+ m2.checkConsistencyLight()
#
mm=MEDFileUMesh.New()
mm.setName("My2ndMEDCouplingMEDmesh")
mm.write("Pyfile19_bis.med",2)
ff=MEDFileFieldMultiTS.New("Pyfile19.med")
ff.write("Pyfile19_bis.med",0)
- self.assertEqual([('tyty','mm'),('uiop','MW')],MEDLoader.GetComponentsNamesOfField("Pyfile19_bis.med","VFieldOnNodes"))
+ self.assertEqual([('tyty','mm'),('uiop','MW')],GetComponentsNamesOfField("Pyfile19_bis.med","VFieldOnNodes"))
pass
#gauss points
ff.write("Pyfile13_bis.med",0)
ff=MEDFileField1TS.New("Pyfile13.med","MyFirstFieldOnGaussPoint",1,5)
f=ff.getFieldAtLevel(ON_GAUSS_PT,0)
- f2=MEDLoader.ReadFieldGauss("Pyfile13.med",'2DMesh_2',0,'MyFirstFieldOnGaussPoint',1,5)
+ f2=ReadFieldGauss("Pyfile13.med",'2DMesh_2',0,'MyFirstFieldOnGaussPoint',1,5)
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
ff3=MEDFileField1TS.New("Pyfile13.med","MyFirstFieldOnGaussPoint")
f3=ff3.getFieldAtLevel(ON_GAUSS_PT,0)
ff.write("Pyfile14_bis.med",0)
ff=MEDFileField1TS.New("Pyfile14.med","MyFieldOnGaussNE",1,5)
f=ff.getFieldAtLevel(ON_GAUSS_NE,0)
- f2=MEDLoader.ReadFieldGaussNE("Pyfile14.med",'2DMesh_2',0,"MyFieldOnGaussNE",1,5)
+ f2=ReadFieldGaussNE("Pyfile14.med",'2DMesh_2',0,"MyFieldOnGaussNE",1,5)
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
pass
def testMEDField5(self):
ff=MEDFileField1TS.New("Pyfile17.med","MeasureOfMesh_Extruded",1,2)
f=ff.getFieldAtLevel(ON_CELLS,0)
- f2=MEDLoader.ReadFieldCell("Pyfile17.med","Extruded",0,"MeasureOfMesh_Extruded",1,2)
+ f2=ReadFieldCell("Pyfile17.med","Extruded",0,"MeasureOfMesh_Extruded",1,2)
self.assertTrue(f.getMesh().getCoords().isEqual(f2.getMesh().getCoords(),1e-12))
f.getMesh().tryToShareSameCoords(f2.getMesh(),1e-12)
f.changeUnderlyingMesh(f2.getMesh(),22,1e-12)
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
# no with renumbering
f=ff.getFieldAtLevel(ON_CELLS,0,1)
- f2=MEDLoader.ReadFieldCell("Pyfile17.med","Extruded",0,"MeasureOfMesh_Extruded",1,2)
+ f2=ReadFieldCell("Pyfile17.med","Extruded",0,"MeasureOfMesh_Extruded",1,2)
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
f=ff.getFieldAtLevel(ON_CELLS,0,3)
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
its=ff.getIterations()
self.assertRaises(InterpKernelException,ff.getFieldAtLevel,ON_CELLS,its[0][0],its[0][1],0)# request on cell and it is not on cells
f=ff.getFieldAtLevel(ON_NODES,its[0][0],its[0][1],0)
- f2=MEDLoader.ReadFieldNode("Pyfile7.med",'3DSurfMesh_1',0,"VectorFieldOnNodes",its[0][0],its[0][1])
+ f2=ReadFieldNode("Pyfile7.med",'3DSurfMesh_1',0,"VectorFieldOnNodes",its[0][0],its[0][1])
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
ff=MEDFileFieldMultiTS.New("Pyfile19.med","VFieldOnNodes")
its=ff.getIterations()
f=ff.getFieldAtLevel(ON_NODES,its[0][0],its[0][1],0)
- f2=MEDLoader.ReadFieldNode("Pyfile19.med",'2DMesh_1',0,"VFieldOnNodes",its[0][0],its[0][1])
+ f2=ReadFieldNode("Pyfile19.med",'2DMesh_1',0,"VFieldOnNodes",its[0][0],its[0][1])
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
self.assertRaises(InterpKernelException,ff.getFieldAtLevel,ON_CELLS,its[0][0],its[0][1],0)# request on cell and it is not on cells
self.assertRaises(InterpKernelException,ff.getFieldAtLevel,ON_NODES,its[0][0],its[0][1],0,1)#request renumber following mesh : it is on profile !
ff=MEDFileFieldMultiTS.New("Pyfile12.med","VectorFieldOnCells")
its=ff.getIterations()
f=ff.getFieldAtLevel(ON_CELLS,its[0][0],its[0][1],0)
- f2=MEDLoader.ReadFieldCell("Pyfile12.med",'3DMesh_1',0,"VectorFieldOnCells",its[0][0],its[0][1])
+ f2=ReadFieldCell("Pyfile12.med",'3DMesh_1',0,"VectorFieldOnCells",its[0][0],its[0][1])
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
pass
ff1=MEDFileField1TS.New()
ff1.setFieldNoProfileSBT(f1)
ff1.write(fname,0)
- f2=MEDLoader.ReadFieldCell(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2]);
+ f2=ReadFieldCell(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2]);
itt,orr,ti=ff1.getTime()
self.assertEqual(0,itt); self.assertEqual(1,orr); self.assertAlmostEqual(2.,ti,14);
self.assertTrue(f1.isEqual(f2,1e-12,1e-12))
nv=1456.
da=ff1.getUndergroundDataArray().setIJ(0,0,nv)
ff1.write(fname,0)
- f2=MEDLoader.ReadFieldNode(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2])
+ f2=ReadFieldNode(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2])
self.assertTrue(not f1.isEqual(f2,1e-12,1e-12))
f1.getArray().setIJ(0,0,nv)
self.assertTrue(f1.isEqual(f2,1e-12,1e-12))
ff1=MEDFileField1TS.New()
ff1.setFieldNoProfileSBT(f1)
ff1.write(fname,0)
- f2=MEDLoader.ReadFieldGaussNE(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2])
+ f2=ReadFieldGaussNE(fname,f1.getMesh().getName(),0,f1.getName(),f1.getTime()[1],f1.getTime()[2])
self.assertTrue(f1.isEqual(f2,1e-12,1e-12))
da,infos=ff1.getUndergroundDataArrayExt()
f2.getArray().setName(da.getName())#da has the same name than f2
#
fname="Pyfile28.med"
f1=MEDLoaderDataForTest.buildVecFieldOnGauss_2_Simpler();
- f1InvalidCpy=f1.deepCpy()
+ f1InvalidCpy=f1.deepCopy()
f1InvalidCpy.setDiscretization(MEDCouplingFieldDiscretizationGauss())
- f1InvalidCpy2=f1.deepCpy()
+ f1InvalidCpy2=f1.deepCopy()
f1InvalidCpy2.setDiscretization(MEDCouplingFieldDiscretizationGauss())
m1=f1.getMesh()
mm1=MEDFileUMesh.New()
f21=m2.getMeasureField(True) ; f21.setName("f21") ; f21=f21.buildNewTimeReprFromThis(ONE_TIME,False)
f21.getArray().setInfoOnComponent(0,"sta [mm]") ;
ff21.appendFieldNoProfileSBT(f21)
- f22=f21.deepCpy() ; f22.setName("f22") ; f22=f22.buildNewTimeReprFromThis(ONE_TIME,False) ;
+ f22=f21.deepCopy() ; f22.setName("f22") ; f22=f22.buildNewTimeReprFromThis(ONE_TIME,False) ;
f22.applyFunc(2,"3*x*IVec+2*x*JVec")
f22.getArray().setInfoOnComponent(0,"distance [km]") ; f22.getArray().setInfoOnComponent(1,"displacement [cm]")
ff22.appendFieldNoProfileSBT(f22)
#
ff1.setFieldProfile(f1,mm1,0,da)
ff1.changePflsNames([(["sup1_NORM_QUAD4"],"ForV650")])
- ff1=ff1.deepCpy()
+ ff1=ff1.deepCopy()
ff1.write(fname,0)
#
vals,pfl=ff1.getFieldWithProfile(ON_CELLS,0,mm1) ; vals.setName("")
ff1.appendFieldProfile(f1,mm1,0,da)
f1.setTime(1.2,1,2) ; e=d.applyFunc("2*x") ; e.copyStringInfoFrom(d) ; f1.setArray(e) ;
ff1.appendFieldProfile(f1,mm1,0,da)
- ff1=ff1.deepCpy()
+ ff1=ff1.deepCopy()
ff1.write(fname,0)
#
vals,pfl=ff1.getFieldWithProfile(ON_CELLS,1,2,0,mm1) ; vals.setName("")
ff1.write(fname,0)
f1=ff1.getFieldOnMeshAtLevel(ON_GAUSS_NE,m1,0)
f2,p1=ff1.getFieldWithProfile(ON_GAUSS_NE,0,mm1) ; f2.setName("")
- self.assertTrue(p1.isIdentity2(5))
+ self.assertTrue(p1.isIota(5))
self.assertTrue(f1.getArray().isEqual(f2,1e-12))
pass
# Test for getFieldAtTopLevel method
ff1.appendFieldProfile(f1,mm1,0,da)
ffs.resize(1)
ffs.setFieldAtPos(0,ff1)
- ffs=ffs.deepCpy()
+ ffs=ffs.deepCopy()
ffs.write(fname,0)
#
ffsr=MEDFileFields.New(fname)
ff1.setFieldNoProfileSBT(f1)
ff1.write(fname,0)
# writing mesh1 and field1, now creation of mesh2 and field2
- f2=f1.deepCpy()
+ f2=f1.deepCopy()
m2=f2.getMesh()
m2.translate([0.5,0.6,0.7])
m2.setName("3DSurfMesh_2")
ff2.setFieldNoProfileSBT(f2)
ff2.write(fname,0)
#
- f3=MEDLoader.ReadFieldCell(fname,"3DSurfMesh_1",0,"VectorFieldOnCells",0,1)
+ f3=ReadFieldCell(fname,"3DSurfMesh_1",0,"VectorFieldOnCells",0,1)
self.assertTrue(f3.isEqual(f1,1e-12,1e-12))
- f4=MEDLoader.ReadFieldCell(fname,"3DSurfMesh_2",0,"VectorFieldOnCells2",0,1)
+ f4=ReadFieldCell(fname,"3DSurfMesh_2",0,"VectorFieldOnCells2",0,1)
self.assertTrue(f4.isEqual(f2,1e-12,1e-12))
pass
da2.iota(7.)
da2.rearrange(len(compNames1))
da2.setInfoOnComponents(compNames1)
- f2=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f2.setName(FieldName1) ; f2.setArray(da2) ; f2.setMesh(m2) ; f2.checkCoherency()
+ f2=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f2.setName(FieldName1) ; f2.setArray(da2) ; f2.setMesh(m2) ; f2.checkConsistencyLight()
ff1.setFieldNoProfileSBT(f2)
self.assertEqual(ff1.getNonEmptyLevels(),(2, [0]))
da0=DataArrayDouble.New()
da0.iota(190.)
da0.rearrange(len(compNames1))
da0.setInfoOnComponents(compNames1)
- f0=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f0.setName(FieldName1) ; f0.setArray(da0) ; f0.setMesh(m0) ; f0.checkCoherency()
+ f0=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f0.setName(FieldName1) ; f0.setArray(da0) ; f0.setMesh(m0) ; f0.checkConsistencyLight()
ff1.setFieldNoProfileSBT(f0)
self.assertEqual(ff1.getNonEmptyLevels(),(2, [0,-2]))
da1=DataArrayDouble.New()
da1.iota(90.)
da1.rearrange(len(compNames1))
da1.setInfoOnComponents(compNames1)
- f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f1.setName(FieldName1) ; f1.setArray(da1) ; f1.setMesh(m1) ; f1.checkCoherency()
+ f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f1.setName(FieldName1) ; f1.setArray(da1) ; f1.setMesh(m1) ; f1.checkConsistencyLight()
ff1.setFieldNoProfileSBT(f1)
self.assertEqual(ff1.getNonEmptyLevels(),(2, [0,-1,-2]))
#
da0.iota(-190.)
da0.rearrange(2)
da0.setInfoOnComponents(compNames2)
- f0=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f0.setName(FieldName2) ; f0.setArray(da0) ; f0.setMesh(m0) ; f0.checkCoherency()
+ f0=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f0.setName(FieldName2) ; f0.setArray(da0) ; f0.setMesh(m0) ; f0.checkConsistencyLight()
ff2.setFieldNoProfileSBT(f0)
self.assertEqual(ff2.getNonEmptyLevels(),(0, [0]))
da1=DataArrayDouble.New()
da1.iota(-90.)
da1.rearrange(len(compNames2))
da1.setInfoOnComponents(compNames2)
- f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f1.setName(FieldName2) ; f1.setArray(da1) ; f1.setMesh(m1) ; f1.checkCoherency()
+ f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME) ; f1.setName(FieldName2) ; f1.setArray(da1) ; f1.setMesh(m1) ; f1.checkConsistencyLight()
ff2.setFieldNoProfileSBT(f1)
self.assertEqual(ff2.getNonEmptyLevels(),(1, [0,-1]))
#
fread=ff2.getFieldOnMeshAtLevel(ON_CELLS,0,mm)
fread2=ff2.getFieldAtLevel(ON_CELLS,0)
#
- fread.checkCoherency()
- fread2.checkCoherency()
+ fread.checkConsistencyLight()
+ fread2.checkConsistencyLight()
self.assertTrue(fread.isEqual(f1,1e-12,1e-12))
self.assertTrue(fread2.isEqual(f1,1e-12,1e-12))
pass
tr=[[0.,4.],[2.,4.],[4.,4.],[6.,4.],[8.,4.],[10.,4.],[12.,4.],[14.,4.],[16.,4.],[18.,4.],[20.,4.],[0.,0.],[2.,0.], [0.,2.],[2.,2.],[4.,2.],[6.,2.],[8.,2.],[10.,2.],[12.,2.]]
ms=11*[mT3]+2*[mQ4]+7*[mQ8]
- ms[:]=(elt.deepCpy() for elt in ms)
+ ms[:]=(elt.deepCopy() for elt in ms)
for m,t in zip(ms,tr):
d=m.getCoords() ; d+= t
pass
da=DataArrayDouble(34) ; da.iota(3.)
f.setArray(da)
f.setName("fieldCellOnPflWithoutPfl")
- fInvalid=f.deepCpy()
+ fInvalid=f.deepCopy()
f.setGaussLocalizationOnCells([0,1,2,3,4,5,6,7,8],[0.,0.,1.,0.,1.,1.],[0.3,0.3,0.7,0.7],[0.8,0.2])
f.setGaussLocalizationOnCells([9,10],[0.,0.,1.,0.,1.,1.],[0.3,0.3,0.7,0.7,0.8,0.8],[0.8,0.07,0.13])
f.setGaussLocalizationOnCells([11,12],[0.,0.,1.,0.,1.,1.,0.,1.],[0.3,0.3,0.7,0.7,0.8,0.8,0.8,0.8,0.8,0.8],[0.8,0.07,0.1,0.01,0.02])
- f.checkCoherency()
- fInvalid2=fInvalid.deepCpy()
+ f.checkConsistencyLight()
+ fInvalid2=fInvalid.deepCopy()
fInvalid2.getDiscretization().setArrayOfDiscIds(f.getDiscretization().getArrayOfDiscIds())
#
mm=MEDFileUMesh()
f1tsRead.getFieldOnMeshAtLevel(ON_GAUSS_PT,0,mRead)
f2=f1tsRead.getFieldOnMeshAtLevel(ON_GAUSS_PT,0,mRead)
self.assertTrue(f.isEqual(f2,1e-12,1e-12))
- f2_bis=MEDLoader.ReadFieldGauss(fname,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
- f2_bis.checkCoherency()
+ f2_bis=ReadFieldGauss(fname,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
+ f2_bis.checkConsistencyLight()
self.assertTrue(f.isEqual(f2_bis,1e-12,1e-12))
#
- MEDLoader.WriteField(fname2,f,True)
- f2_ter=MEDLoader.ReadFieldGauss(fname2,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
+ WriteField(fname2,f,True)
+ f2_ter=ReadFieldGauss(fname2,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
self.assertTrue(f.isEqual(f2_ter,1e-12,1e-12))
## Use case 2 : Pfl on part tri3 with 2 disc and on part quad8 with 1 disc
f=MEDCouplingFieldDouble.New(ON_GAUSS_PT,ONE_TIME)
f.setGaussLocalizationOnCells([0,1,3],[0.,0.,1.,0.,1.,1.],[0.3,0.3,0.7,0.7],[0.8,0.2])
f.setGaussLocalizationOnCells([2,4,5],[0.,0.,1.,0.,1.,1.],[0.3,0.3,0.7,0.7,0.8,0.8],[0.8,0.07,0.13])
f.setGaussLocalizationOnCells([6,7,8,9],[0.,0.,1.,0.,1.,1.,0.,1.,0.5,0.,1.,0.5,0.5,1.,0.,0.5],[0.3,0.3,0.7,0.7,0.8,0.8,0.8,0.8,0.8,0.8],[0.8,0.07,0.1,0.01,0.02])
- f.checkCoherency()
+ f.checkConsistencyLight()
#
mm=MEDFileUMesh()
mm.setMeshAtLevel(0,m)
f3=f1tsRead.getFieldOnMeshAtLevel(ON_GAUSS_PT,0,mRead)
f3.renumberCells([0,1,3,2,4,5,6,7,8,9])
self.assertTrue(f.isEqual(f3,1e-12,1e-12))
- f3_bis=MEDLoader.ReadFieldGauss(fname,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
+ f3_bis=ReadFieldGauss(fname,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
f3_bis.renumberCells([0,1,3,2,4,5,6,7,8,9])
self.assertTrue(f.isEqual(f3_bis,1e-12,1e-12))
#
- MEDLoader.WriteField(fname2,f,True)
- f3_ter=MEDLoader.ReadFieldGauss(fname2,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
+ WriteField(fname2,f,True)
+ f3_ter=ReadFieldGauss(fname2,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
f3_ter.renumberCells([0,1,3,2,4,5,6,7,8,9])
self.assertTrue(f.isEqual(f3_ter,1e-12,1e-12))
## Use case 3 : no pfl but creation of pfls due to gauss pts
f.setGaussLocalizationOnCells([11,12],[0.,0.,1.,0.,1.,1.,0.,1.],[0.3,0.3,0.7,0.7,0.8,0.8,0.8,0.8,0.8,0.8],[0.8,0.07,0.1,0.01,0.02])
f.setGaussLocalizationOnCells([13,14,15,17,18],[0.,0.,1.,0.,1.,1.,0.,1.,0.5,0.,1.,0.5,0.5,1.,0.,0.5],[0.3,0.3,0.7,0.7,0.8,0.8,0.8,0.8],[0.8,0.1,0.03,0.07])
f.setGaussLocalizationOnCells([16,19],[0.,0.,1.,0.,1.,1.,0.,1.,0.5,0.,1.,0.5,0.5,1.,0.,0.5],[0.3,0.3,0.7,0.7,0.8,0.8],[0.8,0.1,0.1])
- f.checkCoherency()
+ f.checkConsistencyLight()
mm=MEDFileUMesh()
mm.setMeshAtLevel(0,m)
f1ts=MEDFileField1TS.New()
f3=f1tsRead.getFieldOnMeshAtLevel(ON_GAUSS_PT,0,mRead)
f3.renumberCells([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,16,19])
self.assertTrue(f.isEqual(f3,1e-12,1e-12))
- f3_bis=MEDLoader.ReadFieldGauss(fname,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
+ f3_bis=ReadFieldGauss(fname,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
f3_bis.renumberCells([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,16,19])
self.assertTrue(f.isEqual(f3_bis,1e-12,1e-12))
#
- MEDLoader.WriteField(fname2,f,True)
- f3_ter=MEDLoader.ReadFieldGauss(fname2,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
+ WriteField(fname2,f,True)
+ f3_ter=ReadFieldGauss(fname2,m.getName(),0,f.getName(),f.getTime()[1],f.getTime()[2])
f3_ter.renumberCells([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,16,19])
self.assertTrue(f.isEqual(f3_ter,1e-12,1e-12))
pass
## Reading from file
m=MEDFileMesh.New(fname)
m0=m.getMeshAtLevel(0)
- m00=m0.deepCpy() ; m00=m00[[0,2]] ; m00.setName(m.getName()) ; m00.zipCoords()
+ m00=m0.deepCopy() ; m00=m00[[0,2]] ; m00.setName(m.getName()) ; m00.zipCoords()
fieldNode0.setMesh(m00)
f0=MEDFileField1TS.New(fname,fieldNode0.getName(),dt,it)
ff0_1=f0.getFieldOnMeshAtLevel(ON_NODES,m0)
- ff0_1.checkCoherency()
+ ff0_1.checkConsistencyLight()
self.assertTrue(ff0_1.isEqual(fieldNode0,1e-12,1e-12))
ff0_2=f0.getFieldAtLevel(ON_NODES,0)
- ff0_2.checkCoherency()
+ ff0_2.checkConsistencyLight()
self.assertTrue(ff0_2.isEqual(fieldNode0,1e-12,1e-12))
ff0_3=f0.getFieldOnMeshAtLevel(ON_NODES,0,m)
- ff0_3.checkCoherency()
+ ff0_3.checkConsistencyLight()
self.assertTrue(ff0_3.isEqual(fieldNode0,1e-12,1e-12))
- ff0_4=MEDLoader.ReadFieldNode(fname,m.getName(),0,fieldNode0.getName(),dt,it)
- ff0_4.checkCoherency()
+ ff0_4=ReadFieldNode(fname,m.getName(),0,fieldNode0.getName(),dt,it)
+ ff0_4.checkConsistencyLight()
self.assertTrue(ff0_4.isEqual(fieldNode0,1e-12,1e-12))
f1=MEDFileField1TS.New(fname,fieldNode1.getName(),dt,it)
m1=m.getMeshAtLevel(-1)
- m10=m1.deepCpy() ; m10=m10[[0,1,2,3,4,5,6,7]] ; m10.setName(m.getName()) ; m10.zipCoords()
+ m10=m1.deepCopy() ; m10=m10[[0,1,2,3,4,5,6,7]] ; m10.setName(m.getName()) ; m10.zipCoords()
fieldNode1.setMesh(m10)
ff1_1=f1.getFieldOnMeshAtLevel(ON_NODES,m1)
- ff1_1.checkCoherency()
+ ff1_1.checkConsistencyLight()
self.assertTrue(ff1_1.isEqual(fieldNode1,1e-12,1e-12))
ff1_2=f1.getFieldAtLevel(ON_NODES,-1)
- ff1_2.checkCoherency()
+ ff1_2.checkConsistencyLight()
self.assertTrue(ff1_2.isEqual(fieldNode1,1e-12,1e-12))
ff1_3=f1.getFieldOnMeshAtLevel(ON_NODES,-1,m)
- ff1_3.checkCoherency()
+ ff1_3.checkConsistencyLight()
self.assertTrue(ff1_3.isEqual(fieldNode1,1e-12,1e-12))
- ff1_4=MEDLoader.ReadFieldNode(fname,m.getName(),-1,fieldNode1.getName(),dt,it)
- ff1_4.checkCoherency()
+ ff1_4=ReadFieldNode(fname,m.getName(),-1,fieldNode1.getName(),dt,it)
+ ff1_4.checkConsistencyLight()
self.assertTrue(ff1_4.getMesh().isEqual(m10,1e-12))
self.assertRaises(InterpKernelException,f1.getFieldOnMeshAtLevel,ON_NODES,m0) # error because impossible to build a sub mesh at level 0 lying on nodes [0,1,2,3,4,5,6]
self.assertRaises(InterpKernelException,f1.getFieldAtLevel,ON_NODES,0) # error because impossible to build a sub mesh at level 0 lying on nodes [0,1,2,3,4,5,6]
## Reading from file
m=MEDFileMesh.New(fname)
m0=m.getMeshAtLevel(0)
- m00=m0.deepCpy() ; m00=m00[pfl0] ; m00.setName(m.getName())
+ m00=m0.deepCopy() ; m00=m00[pfl0] ; m00.setName(m.getName())
fieldCell0.setMesh(m00)
f0=MEDFileField1TS.New(fname,fieldCell0.getName(),dt,it)
ff0_1=f0.getFieldOnMeshAtLevel(ON_CELLS,m0)
- ff0_1.checkCoherency()
+ ff0_1.checkConsistencyLight()
self.assertTrue(ff0_1.isEqual(fieldCell0,1e-12,1e-12))
ff0_2=f0.getFieldAtLevel(ON_CELLS,0)
- ff0_2.checkCoherency()
+ ff0_2.checkConsistencyLight()
self.assertTrue(ff0_2.isEqual(fieldCell0,1e-12,1e-12))
ff0_3=f0.getFieldOnMeshAtLevel(ON_CELLS,0,m)
- ff0_3.checkCoherency()
+ ff0_3.checkConsistencyLight()
self.assertTrue(ff0_3.isEqual(fieldCell0,1e-12,1e-12))
- ff0_4=MEDLoader.ReadFieldCell(fname,m.getName(),0,fieldCell0.getName(),dt,it)
- ff0_4.checkCoherency()
+ ff0_4=ReadFieldCell(fname,m.getName(),0,fieldCell0.getName(),dt,it)
+ ff0_4.checkConsistencyLight()
self.assertTrue(ff0_4.isEqual(fieldCell0,1e-12,1e-12))
f1=MEDFileField1TS.New(fname,fieldCell1.getName(),dt,it)
m1=m.getMeshAtLevel(-1)
- m10=m1.deepCpy() ; m10=m10[pfl1] ; m10.setName(m.getName())
+ m10=m1.deepCopy() ; m10=m10[pfl1] ; m10.setName(m.getName())
fieldCell1.setMesh(m10)
ff1_1=f1.getFieldOnMeshAtLevel(ON_CELLS,m1)
- ff1_1.checkCoherency()
+ ff1_1.checkConsistencyLight()
self.assertTrue(ff1_1.isEqual(fieldCell1,1e-12,1e-12))
ff1_2=f1.getFieldAtLevel(ON_CELLS,-1)
- ff1_2.checkCoherency()
+ ff1_2.checkConsistencyLight()
self.assertTrue(ff1_2.isEqual(fieldCell1,1e-12,1e-12))
ff1_3=f1.getFieldOnMeshAtLevel(ON_CELLS,-1,m)
- ff1_3.checkCoherency()
+ ff1_3.checkConsistencyLight()
self.assertTrue(ff1_3.isEqual(fieldCell1,1e-12,1e-12))
- ff1_4=MEDLoader.ReadFieldCell(fname,m.getName(),-1,fieldCell1.getName(),dt,it)
- ff1_4.checkCoherency()
+ ff1_4=ReadFieldCell(fname,m.getName(),-1,fieldCell1.getName(),dt,it)
+ ff1_4.checkConsistencyLight()
self.assertTrue(ff1_4.getMesh().isEqual(m10,1e-12))
self.assertRaises(InterpKernelException,f1.getFieldOnMeshAtLevel,ON_CELLS,m0) # error because impossible to build a sub mesh at level 0 lying on cells [0,1,2,3,4,5,6]
self.assertRaises(InterpKernelException,f1.getFieldAtLevel,ON_CELLS,0) # error because impossible to build a sub mesh at level 0 lying on cells [0,1,2,3,4,5,6]
m1.setCoords(coo) ; m.setMeshAtLevel(-1,m1)
m2.setCoords(coo) ; m.setMeshAtLevel(-2,m2)
#
- mm=m.deepCpy()
+ mm=m.deepCopy()
famCoo=DataArrayInt([0,2,0,3,2,0,-1,0,0,0,0,-1,3]) ; mm.setFamilyFieldArr(1,famCoo)
da0=DataArrayInt([0,0,0]) ; mm.setFamilyFieldArr(0,da0)
da1=DataArrayInt([0,3]) ; mm.setFamilyFieldArr(-1,da1)
m1.setCoords(coo) ; m.setMeshAtLevel(-1,m1)
m2.setCoords(coo) ; m.setMeshAtLevel(-2,m2)
#
- mm=m.deepCpy()
+ mm=m.deepCopy()
famCoo=DataArrayInt([0,2,0,3,2,0,-1,0,0,0,0,-1,3]) ; mm.setFamilyFieldArr(0,famCoo)
da0=DataArrayInt([0,0,0]) ; mm.setFamilyFieldArr(1,da0)
da1=DataArrayInt([0,3]) ; mm.setFamilyFieldArr(-1,da1)
a1.iota(7.) ; a1.rearrange(3);
mesh.setCoords(a1);
mesh.setNodeGridStructure([4,5]);
- mesh.checkCoherency();
+ mesh.checkConsistencyLight();
#
m=MEDFileCurveLinearMesh()
m.setMesh(mesh)
pts.setName("A") ; pts.setDescription("An example of parameter") ; pts.setTimeUnit("ms")
pts.appendValue(1,2,3.4,567.89)
pts.appendValue(2,3,5.6,999.123)
- pts2=pts.deepCpy() ; pts2.setName("B") ; pts2.setDescription("A second example")
+ pts2=pts.deepCopy() ; pts2.setName("B") ; pts2.setDescription("A second example")
p.pushParam(pts) ; p.pushParam(pts2)
data.write(fname,2)
p2=MEDFileParameters(fname)
self.assertTrue(p.isEqual(p2,1e-14)[0])
self.assertAlmostEqual(p[1][1,2].getValue(),567.89,13)
- p3=p.deepCpy()
- pts4=pts2.deepCpy()
- pts3=pts2.deepCpy()
+ p3=p.deepCopy()
+ pts4=pts2.deepCopy()
+ pts3=pts2.deepCopy()
self.assertTrue(pts3.isEqual(pts2,1e-14)[0])
pts2.eraseTimeStepIds([0])
self.assertTrue(not pts3.isEqual(pts2,1e-14)[0])
namesCellL0=DataArrayAsciiChar(6,16)
namesCellL0[:]=["CellL0#%.3d "%(i) for i in xrange(6)]
mm.setNameFieldAtLevel(0,namesCellL0)
- namesCellL1=DataArrayAsciiChar.Aggregate([namesCellL0,namesCellL0,namesCellL0.substr(2)])
+ namesCellL1=DataArrayAsciiChar.Aggregate([namesCellL0,namesCellL0,namesCellL0.subArray(2)])
namesCellL1[:]=["CellLM1#%.3d "%(i) for i in xrange(16)]
mm.setNameFieldAtLevel(-1,namesCellL1)
- namesNodes=namesCellL1.substr(4,16)
+ namesNodes=namesCellL1.subArray(4,16)
namesNodes[:]=["Node#%.3d "%(i) for i in xrange(12)]
mm.setNameFieldAtLevel(1,namesNodes)
mm.write(fname,2)
self.assertTrue(not mm.isEqual(mmr,1e-12)[0])
mmr.getNameFieldAtLevel(1).setIJ(0,0,'N')
self.assertTrue(mm.isEqual(mmr,1e-12)[0])
- mmCpy=mm.deepCpy()
+ mmCpy=mm.deepCopy()
self.assertTrue(mm.isEqual(mmCpy,1e-12)[0])
# remove names on nodes
mmCpy.setNameFieldAtLevel(1,None)
self.assertTrue(not cc.isEqual(ccr,1e-12)[0])
ccr.getNameFieldAtLevel(1).setIJ(0,0,'N')
self.assertTrue(cc.isEqual(ccr,1e-12)[0])
- ccCpy=cc.deepCpy()
+ ccCpy=cc.deepCopy()
self.assertTrue(cc.isEqual(ccCpy,1e-12)[0])
pass
c2.transformWithIndArr(whichGrp)
splitOfM1=len(grps)*[None]
for grpId,grp in enumerate(grps):
- tmp=c2.getIdsEqual(grpId)
+ tmp=c2.findIdsEqual(grpId)
splitOfM1[grpId]=tmp
pass
splitOfM1[0].isEqual(DataArrayInt([0,1,2,3,6,8,10,11,12,13]))
#
mm0=MEDFileMesh.New(fileName)
mm1=MEDFileMesh.New(fileName)
- groupNamesIni=MEDLoader.GetMeshGroupsNames(fileName,"ma")
+ groupNamesIni=GetMeshGroupsNames(fileName,"ma")
for name in groupNamesIni:
mm1.changeGroupName(name,name+'N')
pass
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
pass
# add a mismatch of nb of compos
pass
- fmts0_2=fmts0_0.deepCpy()
- fmts0_3=fmts0_0.deepCpy()
- fmts0_4=fmts0_0.deepCpy()
+ fmts0_2=fmts0_0.deepCopy()
+ fmts0_3=fmts0_0.deepCopy()
+ fmts0_4=fmts0_0.deepCopy()
fmts0_5=fmts0_0.shallowCpy()
self.assertTrue(len(fmts0_0)==10 and len(fmts0_1)==10 and len(fmts0_2)==10 and len(fmts0_3)==10 and len(fmts0_4)==10 and len(fmts0_5)==10)
del fmts0_2[::2]
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
fmts0_0.zipPflsNames()
self.assertEqual(fmts0_0.getPfls(),('pfl_NORM_QUAD4',))
self.assertTrue(fmts0_1.getProfile("pfl_NORM_QUAD4").isEqual(fmts0_0.getProfile("pfl_NORM_QUAD4")))
- fmts0_2=fmts0_0.deepCpy()
- fmts0_3=fmts0_0.deepCpy()
- fmts0_4=fmts0_0.deepCpy()
+ fmts0_2=fmts0_0.deepCopy()
+ fmts0_3=fmts0_0.deepCopy()
+ fmts0_4=fmts0_0.deepCopy()
fs0=MEDFileFields()
fs0.pushField(fmts0_0)
fmts0_2.setName("2ndField") ; fs0.pushField(fmts0_2)
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
#
ff0=MEDFileField1TS()
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m) ; arr=DataArrayDouble(m.getNumberOfCells()*2) ; arr.iota() ; arr.rearrange(2) ; arr.setInfoOnComponents(["X [km]","YY [mm]"]) ; f0.setArray(arr) ; f0.setName("FieldCell")
- f0.checkCoherency()
+ f0.checkConsistencyLight()
ff0.setFieldNoProfileSBT(f0)
#
fspExp=[(3,[(0,(0,4),'','')]),(4,[(0,(4,9),'','')])]
del arr,f0,ff0,ff1,ff0i,fspExp
ff0=MEDFileField1TS()
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m[:7]) ; arr=DataArrayDouble(7*2) ; arr.iota() ; arr.rearrange(2) ; arr.setInfoOnComponents(["XX [pm]","YYY [hm]"]) ; f0.setArray(arr) ; f0.setName("FieldCellPfl")
- f0.checkCoherency()
+ f0.checkConsistencyLight()
pfl=DataArrayInt.Range(0,7,1) ; pfl.setName("pfl")
ff0.setFieldProfile(f0,mm,0,pfl)
fspExp=[(3,[(0,(0,4),'','')]),(4,[(0,(4,7),'pfl_NORM_QUAD4','')])]
## MultiTimeSteps
ff0=MEDFileFieldMultiTS()
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m[:7]) ; arr=DataArrayDouble(7*2) ; arr.iota() ; arr.rearrange(2) ; arr.setInfoOnComponents(["X [km]","YY [mm]"]) ; f0.setArray(arr) ; f0.setName("FieldCellMTime") ; f0.setTime(0.1,0,10)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
ff0.appendFieldProfile(f0,mm,0,pfl)
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m[:7]) ; arr=DataArrayDouble(7*2) ; arr.iota(100) ; arr.rearrange(2) ; arr.setInfoOnComponents(["X [km]","YY [mm]"]) ; f0.setArray(arr) ; f0.setName("FieldCellMTime") ; f0.setTime(1.1,1,11)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
ff0.appendFieldProfile(f0,mm,0,pfl)
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m[:7]) ; arr=DataArrayDouble(7*2) ; arr.iota(200) ; arr.rearrange(2) ; arr.setInfoOnComponents(["X [km]","YY [mm]"]) ; f0.setArray(arr) ; f0.setName("FieldCellMTime") ; f0.setTime(2.1,2,12)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
ff0.appendFieldProfile(f0,mm,0,pfl)
ff1=ff0.convertToInt()
self.assertTrue(isinstance(ff1,MEDFileIntFieldMultiTS))
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(30)]
+ tris=[tri.deepCopy() for i in xrange(30)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(40)]
+ quads=[quad.deepCopy() for i in xrange(40)]
for i,elt in enumerate(quads): elt.translate([40+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
#
ff0=MEDFileField1TS()
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m) ; arr=DataArrayDouble(m.getNumberOfCells()*2) ; arr.iota() ; arr.rearrange(2) ; arr.setInfoOnComponents(["X [km]","YY [mm]"]) ; f0.setArray(arr) ; f0.setName("FieldCell")
- f0.checkCoherency()
+ f0.checkConsistencyLight()
ff0.setFieldNoProfileSBT(f0)
ff0.write(fname,0)
#
# With profiles
ff0=MEDFileField1TS()
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m[:50]) ; arr=DataArrayDouble(50*2) ; arr.iota() ; arr.rearrange(2) ; arr.setInfoOnComponents(["XX [pm]","YYY [hm]"]) ; f0.setArray(arr) ; f0.setName("FieldCellPfl")
- f0.checkCoherency()
+ f0.checkConsistencyLight()
pfl=DataArrayInt.Range(0,50,1) ; pfl.setName("pfl")
ff0.setFieldProfile(f0,mm,0,pfl)
fspExp=[(3,[(0,(0,30),'','')]),(4,[(0,(30,50),'pfl_NORM_QUAD4','')])]
for t in xrange(20):
f0=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f0.setMesh(m) ; arr=DataArrayDouble(m.getNumberOfCells()*2) ; arr.iota(float(t+1000)) ; arr.rearrange(2) ; arr.setInfoOnComponents(["X [km]","YY [mm]"]) ; f0.setArray(arr) ; f0.setName(fieldName)
f0.setTime(float(t)+0.1,t,100+t)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
ff0.appendFieldNoProfileSBT(f0)
pass
ff0.write(fname,0)
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
m.insertNextCell([0,2,1,3])
m.setCoords(DataArrayDouble([0.,0.,1.,1.,1.,0.,0.,1.],4,2))
#
- ms=[m.deepCpy() for i in xrange(4)]
+ ms=[m.deepCopy() for i in xrange(4)]
for i,elt in enumerate(ms):
elt.translate([float(i)*1.5,0.])
pass
m0=MEDCoupling1SGTUMesh.Merge1SGTUMeshes(ms).buildUnstructured()
m0.convertAllToPoly()
#
- ms=[m.deepCpy() for i in xrange(5)]
+ ms=[m.deepCopy() for i in xrange(5)]
for i,elt in enumerate(ms):
elt.translate([float(i)*1.5,1.5])
pass
arr0=DataArrayDouble(9) ; arr0.iota()
arr1=DataArrayDouble(9) ; arr1.iota(100)
arr=DataArrayDouble.Meld(arr0,arr1) ; arr.setInfoOnComponents(["mm [kg]","sds [m]"])
- f.setArray(arr) ; f.checkCoherency()
+ f.setArray(arr) ; f.checkConsistencyLight()
f.setTime(5.6,1,2)
ff=MEDFileField1TS()
ff.setFieldNoProfileSBT(f)
for elt in [[0,1,2,3,4,5],[1,2,3,4,5,6],[2,3,4,5,6,7],[3,4,5,6,7,8]]:#4
m0.insertNextCell(NORM_PENTA6,elt)
pass
- m0.checkCoherency1()
+ m0.checkConsistency()
m1=MEDCouplingUMesh(); m1.setName("mesh")
m1.setMeshDimension(2);
m1.allocateCells(5);
m.changeSpaceDimension(3,0.)
infos=["aa [b]","cc [de]","gg [klm]"]
m.getCoords().setInfoOnComponents(infos)
- m.checkCoherency1()
+ m.checkConsistency()
mm=MEDFileUMesh()
mm.setMeshAtLevel(0,m)
m1=MEDCouplingCMesh() ; m1.setCoords(arr) ; m1.setName("Mesh")
m.changeSpaceDimension(3,0.)
infos=["aa [b]","cc [de]","gg [klm]"]
m.getCoords().setInfoOnComponents(infos)
- m.checkCoherency1()
+ m.checkConsistency()
f=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f.setMesh(m)
f.setName("Field")
arr=DataArrayDouble(25,2) ; arr.setInfoOnComponents(compos)
arr[:,0]=range(25)
arr[:,1]=range(100,125)
f.setArray(arr)
- MEDLoader.WriteField(fileName,f,2)
+ 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)
+ f.checkConsistencyLight()
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f)
#
ms=MEDFileMeshes()
mm=MEDFileUMesh.LoadPartOf(fileName,meshName,[NORM_QUAD4],[0,6,1])
mm=MEDFileUMesh.LoadPartOf(fileName,meshName,[NORM_QUAD4],[3,15,1])
ms.pushMesh(mm)
fs=MEDFileFields.LoadPartOf(fileName,False,ms)
- fs=fs.deepCpy()
+ fs=fs.deepCopy()
fs[0][0].loadArrays()
arr=DataArrayDouble(12,2) ; arr[:,0]=range(3,15) ; arr[:,1]=range(103,115)
arr.setInfoOnComponents(compos)
m.changeSpaceDimension(3,0.)
infos=["aa [b]","cc [de]","gg [klm]"]
m.getCoords().setInfoOnComponents(infos)
- m.checkCoherency1()
+ m.checkConsistency()
f=MEDCouplingFieldDouble(ON_CELLS,ONE_TIME) ; f.setMesh(m)
f.setName("Field")
arr=DataArrayDouble(25,2) ; arr.setInfoOnComponents(compos)
arr[:,0]=range(25)
arr[:,1]=range(100,125)
f.setArray(arr)
- MEDLoader.WriteField(fileName,f,2)
+ 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)
+ f.checkConsistencyLight()
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f)
#
ms=MEDFileMeshes()
mm=MEDFileUMesh.LoadPartOf(fileName,meshName,[NORM_QUAD4],[4,6,1])
m=MEDCouplingUMesh.MergeUMeshesOnSameCoords([m0,m1])
m.setName(meshName2D)
mMinus1,a,b,c,d=m.buildDescendingConnectivity()
- e=d.deltaShiftIndex().getIdsEqual(1)
+ e=d.deltaShiftIndex().findIdsEqual(1)
#
mm=MEDFileUMesh()
mm.setMeshAtLevel(0,m) ; mm.setMeshAtLevel(-1,mMinus1)
m.insertNextCell(NORM_POLYGON,4,targetConn[14:18])
m.finishInsertingCells();
m.setCoords(c)
- m.checkCoherency()
+ m.checkConsistencyLight()
m1=MEDCouplingUMesh.New();
m1.setMeshDimension(1);
m1.allocateCells(3);
m1.insertNextCell(NORM_SEG3,3,[2,8,5])
m1.finishInsertingCells();
m1.setCoords(c)
- m1.checkCoherency()
+ m1.checkConsistencyLight()
m2=MEDCouplingUMesh.New();
m2.setMeshDimension(0);
m2.allocateCells(4);
m2.insertNextCell(NORM_POINT1,1,[6])
m2.finishInsertingCells();
m2.setCoords(c)
- m2.checkCoherency()
+ m2.checkConsistencyLight()
#
mm=MEDFileUMesh.New()
self.assertTrue(mm.getUnivNameWrStatus())
st=cPickle.dumps(mm,cPickle.HIGHEST_PROTOCOL)
mm2=cPickle.loads(st)
self.assertTrue(mm.isEqual(mm2,1e-12)[0])
- self.assertEqual(mm.getAxType(),AX_CART)
+ self.assertEqual(mm.getAxisType(),AX_CART)
#
- mm.setAxType(AX_CYL)
+ mm.setAxisType(AX_CYL)
st=cPickle.dumps(mm,cPickle.HIGHEST_PROTOCOL)
mm2=cPickle.loads(st)
self.assertTrue(mm.isEqual(mm2,1e-12)[0])
- self.assertEqual(mm2.getAxType(),AX_CYL)
+ self.assertEqual(mm2.getAxisType(),AX_CYL)
pass
def testMEDFileFieldsLoadSpecificEntities1(self):
d[key]=[val]
pass
import re
- allFields=MEDLoader.GetAllFieldNames(fileName)
+ allFields=GetAllFieldNames(fileName)
allFieldsDict={}
pat=re.compile("([\d]+)([\s\S]+)$")
for st in allFields:
field.setMesh(m)
field.setArray(DataArrayDouble([1.2,2.3,3.4,4.5]))
field.setName("Field")
- field.checkCoherency()
+ field.checkConsistencyLight()
pfl=DataArrayInt([0,1,2,3]) ; pfl.setName("TUTU") #<- false profile because defined on all cells !
ff.setFieldProfile(field,mm,0,pfl) # <- bug was revealed here !
self.assertEqual(ff.getPfls(),())
field.setMesh(m)
field.setArray(DataArrayDouble([1.2,2.3,3.4,4.5]))
field.setName("Field")
- field.checkCoherency()
+ field.checkConsistencyLight()
pfl=DataArrayInt([0,1,2,3]) ; pfl.setName("TUTU")
ff.setFieldProfile(field,mm,0,pfl)
self.assertEqual(ff.getPfls(),())
m3D=m.buildExtrudedMesh(m1D,0)
m3D.sortCellsInMEDFileFrmt()
m3D.setName(meshName)
- m2D=m ; m2D.setCoords(m3D.getCoords()) ; m2D.shiftNodeNumbersInConn(delta) ; m2D.setName(meshName) ; m2D.checkCoherency1()
+ m2D=m ; m2D.setCoords(m3D.getCoords()) ; m2D.shiftNodeNumbersInConn(delta) ; m2D.setName(meshName) ; m2D.checkConsistency()
m1D=m2D.computeSkin() ; m1D.setName(meshName)
m0D=MEDCouplingUMesh.Build0DMeshFromCoords(m3D.getCoords()) ; m0D.setName(meshName) ; m0D=m0D[[2,4,10]]
#
self.assertEqual(mm.getGroupsNames(),('grp0','grp1','grp2','grp3'))
delta=12
for grp in [grp0,grp1,grp2,grp3]:
- grpNode=grp.deepCpy() ; grpNode+=delta ; grpNode.setName("%s_node"%grp.getName())
+ grpNode=grp.deepCopy() ; grpNode+=delta ; grpNode.setName("%s_node"%grp.getName())
mm.addGroup(1,grpNode)
self.assertEqual(mm.getGroupsNames(),('grp0','grp0_node','grp1','grp1_node','grp2','grp2_node','grp3','grp3_node'))
for grp in [grp0,grp1,grp2,grp3]:
f.setMesh(m)
f.setArray(DataArrayDouble(100))
f.getArray()[:]=100.
- f.checkCoherency()
+ f.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldNoProfileSBT(f)
# redirect stderr
mesh=MEDFileUMesh() ; mesh[0]=m
m1=m.computeSkin() ; mesh[-1]=m1
#
- bary1=m1.getBarycenterAndOwner()[:,2]
- grp1=bary1.getIdsInRange(hauteur-1e-12,hauteur+1e-12) ; grp1.setName(grpName1)
- grp2=bary1.getIdsInRange(0.-1e-12,0.+1e-12) ; grp2.setName(grpName2)
+ bary1=m1.computeCellCenterOfMass()[:,2]
+ grp1=bary1.findIdsInRange(hauteur-1e-12,hauteur+1e-12) ; grp1.setName(grpName1)
+ grp2=bary1.findIdsInRange(0.-1e-12,0.+1e-12) ; grp2.setName(grpName2)
mesh.setGroupsAtLevel(-1,[grp1,grp2])
import cPickle
c.setArrayForType(NORM_QUAD4,corr)
self.assertEqual(eq0.getCell().size(),1)
self.assertTrue(eq0.getCell().getArray(NORM_QUAD4).isEqual(corr))
- mm2=mm.deepCpy()
+ mm2=mm.deepCopy()
self.assertTrue(mm.isEqual(mm2,1e-12)[0])
self.assertEqual(mm2.getEquivalences().size(),1)
self.assertTrue(mm2.getEquivalences().getEquivalence(0).getCell().getArray(NORM_QUAD4).isEqual(corr))
ref2=mm[0].getNodalConnectivityIndex().getHiddenCppPointer()
ref3=mm.getDirectUndergroundSingleGeoTypeMesh(NORM_QUAD4).getNodalConnectivity().getHiddenCppPointer()
self.assertEqual(ref0,mm.getDirectUndergroundSingleGeoTypeMesh(NORM_QUAD4).getCoords().getHiddenCppPointer())
- mm.setAxType(AX_CYL) #<- important
+ mm.setAxisType(AX_CYL) #<- important
mm2=mm.cartesianize() # the trigger
- self.assertEqual(mm2.getAxType(),AX_CART)
- mm.setAxType(AX_CART) # this is here only to avoid complaints
+ self.assertEqual(mm2.getAxisType(),AX_CART)
+ mm.setAxisType(AX_CART) # this is here only to avoid complaints
self.assertTrue(isinstance(mm2,MEDFileUMesh))
self.assertTrue(mm.getHiddenCppPointer()!=mm2.getHiddenCppPointer())
self.assertTrue(ref0==mm.getCoords().getHiddenCppPointer()) # <- here important
self.assertEqual(mm.getFamilyFieldAtLevel(1).getHiddenCppPointer(),d0.getHiddenCppPointer())
self.assertEqual(mm2.getFamilyFieldAtLevel(1).getHiddenCppPointer(),d0.getHiddenCppPointer()) # <- here very important
# UMesh cart
- mm.setAxType(AX_CART)
+ mm.setAxisType(AX_CART)
mm2=mm.cartesianize() # the trigger
- self.assertEqual(mm2.getAxType(),AX_CART)
+ self.assertEqual(mm2.getAxisType(),AX_CART)
self.assertTrue(isinstance(mm2,MEDFileUMesh))
self.assertTrue(mm.getHiddenCppPointer()==mm2.getHiddenCppPointer()) # optimization
# CurveLinearMesh non cart
arr=DataArrayDouble(4) ; arr.iota() ; m=MEDCouplingCMesh() ; m.setCoords(arr,arr) ; m=m.buildCurveLinear()
- mm=MEDFileCurveLinearMesh() ; mm.setMesh(m) ; mm.setAxType(AX_CYL) #<- important
+ mm=MEDFileCurveLinearMesh() ; mm.setMesh(m) ; mm.setAxisType(AX_CYL) #<- important
mm.setFamilyFieldArr(0,d1) ; mm.setFamilyFieldArr(1,d0)
mm.setName("a") ; mm.setDescription("b") ; mm.setTime(3,4,5.) ; mm.addFamily("c",-4) ; mm.setFamiliesOnGroup("d",["c"]) ; mm.setTimeUnit("ms")
ref0=mm.getMesh().getCoords().getHiddenCppPointer()
mm2=mm.cartesianize() # the trigger
- self.assertEqual(mm2.getAxType(),AX_CART)
+ self.assertEqual(mm2.getAxisType(),AX_CART)
self.assertTrue(isinstance(mm2,MEDFileCurveLinearMesh))
self.assertTrue(mm.getHiddenCppPointer()!=mm2.getHiddenCppPointer())
self.assertTrue(ref0==mm.getMesh().getCoords().getHiddenCppPointer()) # <- here important
self.assertEqual(mm.getFamilyFieldAtLevel(1).getHiddenCppPointer(),d0.getHiddenCppPointer())
self.assertEqual(mm2.getFamilyFieldAtLevel(1).getHiddenCppPointer(),d0.getHiddenCppPointer()) # <- here very important
# CurveLinearMesh cart
- mm.setAxType(AX_CART)
+ mm.setAxisType(AX_CART)
mm2=mm.cartesianize() # the trigger
- self.assertEqual(mm2.getAxType(),AX_CART)
+ self.assertEqual(mm2.getAxisType(),AX_CART)
self.assertTrue(isinstance(mm2,MEDFileCurveLinearMesh))
self.assertTrue(mm.getHiddenCppPointer()==mm2.getHiddenCppPointer()) # optimization
# CMesh non cart
arr=DataArrayDouble(4) ; arr.iota() ; m=MEDCouplingCMesh() ; m.setCoords(arr,arr)
- mm=MEDFileCMesh() ; mm.setMesh(m) ; mm.setAxType(AX_CYL) #<- important
+ mm=MEDFileCMesh() ; mm.setMesh(m) ; mm.setAxisType(AX_CYL) #<- important
mm.setFamilyFieldArr(0,d1) ; mm.setFamilyFieldArr(1,d0)
mm.setName("a") ; mm.setDescription("b") ; mm.setTime(3,4,5.) ; mm.addFamily("c",-4) ; mm.setFamiliesOnGroup("d",["c"]) ; mm.setTimeUnit("ms")
mm2=mm.cartesianize() # the trigger
- self.assertEqual(mm2.getAxType(),AX_CART)
+ self.assertEqual(mm2.getAxisType(),AX_CART)
self.assertTrue(isinstance(mm2,MEDFileCurveLinearMesh))
self.assertEqual(mm2.getMesh().getNodeGridStructure(),mm.getMesh().getNodeGridStructure())
self.assertEqual(mm2.getName(),mm.getName())
self.assertEqual(mm.getFamilyFieldAtLevel(1).getHiddenCppPointer(),d0.getHiddenCppPointer())
self.assertEqual(mm2.getFamilyFieldAtLevel(1).getHiddenCppPointer(),d0.getHiddenCppPointer()) # <- here very important
# CMesh cart
- mm.setAxType(AX_CART)
+ mm.setAxisType(AX_CART)
mm2=mm.cartesianize() # the trigger
- self.assertEqual(mm2.getAxType(),AX_CART)
+ self.assertEqual(mm2.getAxisType(),AX_CART)
self.assertTrue(isinstance(mm2,MEDFileCMesh))
self.assertTrue(mm.getHiddenCppPointer()==mm2.getHiddenCppPointer()) # optimization
pass
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
fs.pushBackTimeStep(f)
##### Time step 1
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(1100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(1200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
fs.pushBackTimeStep(f)
##### Time step 2
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(2100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(2200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
fs.pushBackTimeStep(f)
##### Time step 3
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(3100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(3200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
#
fs.pushBackTimeStep(f)
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(4100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(4200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
fs.pushBackTimeStep(f)
mm.write(fname,2)
fs.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,m1,mm,fs,f,fCell0,fCell1
########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
#
fNode=MEDCouplingFieldDouble(ON_NODES) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName) ; fNode.setMesh(m1)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(300) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs.pushBackTimeStep(f)
##### Time step 1
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(1100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(1200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
#
fNode=MEDCouplingFieldDouble(ON_NODES) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName) ; fNode.setMesh(m1)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(1300) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs.pushBackTimeStep(f)
##### Time step 2
fNode.setName(fieldName) ; fNode.setMesh(m1)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(2300) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
#
fCell0=MEDCouplingFieldDouble(ON_CELLS) ; fCell0.setTime(float(i),i,0)
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(2100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(2200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
fs.pushBackTimeStep(f)
##### Time step 3
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(3100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(3200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
#
fNode=MEDCouplingFieldDouble(ON_NODES) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName) ; fNode.setMesh(m1)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(3300) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
#
fs.pushBackTimeStep(f)
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(4100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(4200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
#
fNode=MEDCouplingFieldDouble(ON_NODES) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName) ; fNode.setMesh(m1)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(4300) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
#
fs.pushBackTimeStep(f)
mm.write(fname,2)
fs.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,m1,mm,fs,f,fCell0,fCell1
########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
fs.pushBackTimeStep(f)
##### Time step 1 on nodes
fNode.setName(fieldName) ; fNode.setMesh(m1)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(1300) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs.pushBackTimeStep(f)
##### Time step 2 on cells
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(2100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(2200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
fs.pushBackTimeStep(f)
##### Time step 3 on nodes
fNode.setName(fieldName) ; fNode.setMesh(m1)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(3300) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs.pushBackTimeStep(f)
##### Time step 4
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfCells()) ; arr.iota(4100) ; arr.rearrange(2)
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell0.checkCoherency()
+ fCell0.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell0)
#
fCell1=MEDCouplingFieldDouble(ON_CELLS) ; fCell1.setTime(float(i),i,0)
fCell1.setName(fieldName) ; fCell1.setMesh(m1)
arr=DataArrayDouble(2*m1.getNumberOfCells()) ; arr.iota(4200) ; arr.rearrange(2)
fCell1.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]","Com2 [s^2]"])
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
f.setFieldNoProfileSBT(fCell1)
#
fs.pushBackTimeStep(f)
mm.write(fname,2)
fs.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,m1,mm,fs,f,fCell0,fCell1
########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
tri=MEDCouplingUMesh("tri",2)
tri.allocateCells() ; tri.insertNextCell(NORM_TRI3,[0,1,2])
tri.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,0.)]))
- tris=[tri.deepCpy() for i in xrange(4)]
+ tris=[tri.deepCopy() for i in xrange(4)]
for i,elt in enumerate(tris): elt.translate([i,0])
tris=MEDCouplingUMesh.MergeUMeshes(tris)
quad=MEDCouplingUMesh("quad",2)
quad.allocateCells() ; quad.insertNextCell(NORM_QUAD4,[0,1,2,3])
quad.setCoords(DataArrayDouble([(0.,0.),(0.,1.),(1.,1.),(1.,0.)]))
- quads=[quad.deepCpy() for i in xrange(5)]
+ quads=[quad.deepCopy() for i in xrange(5)]
for i,elt in enumerate(quads): elt.translate([5+i,0])
quads=MEDCouplingUMesh.MergeUMeshes(quads)
m=MEDCouplingUMesh.MergeUMeshes(tris,quads)
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(0+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
#
fNode.setName(fieldName2) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(100+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs2.pushBackTimeStep(f)
#
fNode.setName(fieldName3) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(200+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs3.pushBackTimeStep(f)
##### Time step 1
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(0+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
#
fNode.setName(fieldName2) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(100+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs2.pushBackTimeStep(f)
#
fNode.setName(fieldName3) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(200+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs3.pushBackTimeStep(f)
##### Time step 2
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(0+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
#
fNode.setName(fieldName2) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(100+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs2.pushBackTimeStep(f)
#
fNode.setName(fieldName3) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(200+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs3.pushBackTimeStep(f)
##### Time step 3
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(0+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
#
fNode.setName(fieldName2) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(100+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs2.pushBackTimeStep(f)
#
fNode.setName(fieldName3) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(200+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs3.pushBackTimeStep(f)
##### Time step 4
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(0+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
#
fNode.setName(fieldName2) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(100+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs2.pushBackTimeStep(f)
#
fNode.setName(fieldName3) ; fNode.setMesh(m)
arr=DataArrayDouble(2*m.getNumberOfNodes()) ; arr.iota(200+1000*i) ; arr.rearrange(2)
fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"])
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs3.pushBackTimeStep(f)
#
mm.write(fname,2)
fs1.write(fname,0) ; fs2.write(fname,0) ; fs3.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs1,fs2,fs3,f,fNode
########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
pass
mm.write(fname,2)
fs1.write(fname,0) ; fs2.write(fname,0) ; fs3.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs1,fs2,fs3,f,fNode
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName0) ; fNode.setMesh(m)
arr=DataArrayDouble(2*8) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_NODES) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName4) ; fNode.setMesh(m)
arr=DataArrayDouble(2*15) ; arr.iota(400+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_4 [m]","Com2_4 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_4 [m]","Com2_4 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs4.pushBackTimeStep(f)
pass
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName0) ; fNode.setMesh(m)
arr=DataArrayDouble(2*8) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_NODES) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName4) ; fNode.setMesh(m)
arr=DataArrayDouble(2*15) ; arr.iota(400+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_4 [m]","Com2_4 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_4 [m]","Com2_4 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs4.pushBackTimeStep(f)
pass
fNode=MEDCouplingFieldDouble(ON_GAUSS_NE) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName0) ; fNode.setMesh(m)
arr=DataArrayDouble(2*38) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*11) ; arr.iota(100+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
#
fNode.setGaussLocalizationOnCells([6,7,8],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2],[0.8,0.05,0.1,0.04])
fNode.setGaussLocalizationOnCells([9,10],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.8,0.8],[0.8,0.05,0.1,0.01,0.02,0.005,0.005])
arr=DataArrayDouble(2*(4*2+2*5+3*4+2*7)) ; arr.iota(300+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs2.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_NODES) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName3) ; fNode.setMesh(m)
arr=DataArrayDouble(2*15) ; arr.iota(400+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_3 [m]","Com2_3 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_3 [m]","Com2_3 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs3.pushBackTimeStep(f)
#
#
mm.write(fname,2)
fs0.write(fname,0) ; fs1.write(fname,0) ; fs2.write(fname,0) ; fs3.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs1,fs2,fs3,f,fNode
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fNode.setGaussLocalizationOnCells([2,3],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2],[0.8,0.05,0.1,0.04])
fNode.setGaussLocalizationOnCells([4],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.8,0.8],[0.8,0.05,0.1,0.01,0.02,0.005,0.005])
arr=DataArrayDouble(2*(2*1+5*1+4*2+7*1)) ; arr.iota(300+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldProfile(fNode,mm,0,pfl1)
fs2.pushBackTimeStep(f)
#
#
mm.write(fname,2)
fs0.write(fname,0) ; fs1.write(fname,0) ; fs2.write(fname,0) ; fs3.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs1,fs2,fs3,f,fNode
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
#
mm.write(fname,2)
fs0.write(fname,0) ; fs1.write(fname,0) ; fs2.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs1,fs2,f,fNode
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fNode.setGaussLocalizationOnCells([6,10,13],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2],[0.8,0.05,0.1,0.04])
fNode.setGaussLocalizationOnCells([11,12,14],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.8,0.8],[0.8,0.05,0.1,0.01,0.02,0.005,0.005])
arr=DataArrayDouble(2*(2*6+5*4+4*3+7*3)) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
pass
mm.write(fname,2)
fs0.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs0,f,fNode
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fNode.setGaussLocalizationOnCells([6,10,13],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2],[0.8,0.05,0.1,0.04])
fNode.setGaussLocalizationOnCells([11,12,14],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.8,0.8],[0.8,0.05,0.1,0.01,0.02,0.005,0.005])
arr=DataArrayDouble(2*(2*6+5*4+4*3+7*3)) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*16) ; arr.iota(300+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
pass
mm.write(fname,2)
fs0.write(fname,0) ; fs1.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs0,fs1,f,fNode
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName0) ; fNode.setMesh(m)
arr=DataArrayDouble(2*5) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*5) ; arr.iota(100+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName2) ; fNode.setMesh(m[pfl1])
arr=DataArrayDouble(2*2) ; arr.iota(200+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldProfile(fNode,mm,0,pfl1)
fs2.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName3) ; fNode.setMesh(m[pfl2])
arr=DataArrayDouble(2*3) ; arr.iota(300+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_3 [m]","Com2_3 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_3 [m]","Com2_3 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldProfile(fNode,mm,0,pfl2)
fs3.pushBackTimeStep(f)
pass
mm.write(fname,2)
fs0.write(fname,0) ; fs1.write(fname,0) ; fs2.write(fname,0) ; fs3.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs0
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName0) ; fNode.setMesh(m)
arr=DataArrayDouble(2*3) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*3) ; arr.iota(100+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
pass
mm.write(fname,2)
fs0.write(fname,0) ; fs1.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs0
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
fCell.setArray(a)
fCell.setTime(*t)
- fCell.checkCoherency()
+ fCell.checkConsistencyLight()
a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode.setArray(a)
fNode.setTime(*t)
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f1ts.setFieldNoProfileSBT(fCell)
f1ts.setFieldNoProfileSBT(fNode)
ffs.pushBackTimeStep(f1ts)
a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
fCell.setArray(a)
fCell.setTime(*t)
- fCell.checkCoherency()
+ fCell.checkConsistencyLight()
a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode.setArray(a)
fNode.setTime(*t)
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f1ts.setFieldNoProfileSBT(fCell)
f1ts.setFieldNoProfileSBT(fNode)
ffs.pushBackTimeStep(f1ts)
a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
fCell.setArray(a)
fCell.setTime(*t)
- fCell.checkCoherency()
+ fCell.checkConsistencyLight()
a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode.setArray(a)
fNode.setTime(*t)
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f1ts.setFieldNoProfileSBT(fCell)
f1ts.setFieldNoProfileSBT(fNode)
ffs.pushBackTimeStep(f1ts)
a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
fCell.setArray(a)
fCell.setTime(*t)
- fCell.checkCoherency()
+ fCell.checkConsistencyLight()
a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode.setArray(a)
fNode.setTime(*t)
- fNode.checkCoherency()
+ fNode.checkConsistencyLight()
f1ts.setFieldNoProfileSBT(fCell)
f1ts.setFieldNoProfileSBT(fNode)
ffs.pushBackTimeStep(f1ts)
mm1.setFamiliesIdsOnGroup("Grp1_1",[0,1]) ; mm1.setFamiliesIdsOnGroup("Grp1_2",[2,3])
mms.pushMesh(mm1) ; del mm1
#
- m1=m0.deepCpy() ; m1.translate([2.5,0.,0.]) ; m1.setName("mesh2")
+ m1=m0.deepCopy() ; m1.translate([2.5,0.,0.]) ; m1.setName("mesh2")
#
fCell2=MEDCouplingFieldDouble(ON_CELLS)
fCell2.setName("zeField3_1")
a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
fCell1.setArray(a)
fCell1.setTime(*t)
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode1.setArray(a)
fNode1.setTime(*t)
- fNode1.checkCoherency()
+ fNode1.checkConsistencyLight()
f1ts1.setFieldNoProfileSBT(fCell1) ; ffs1_1.pushBackTimeStep(f1ts1)
f1ts2.setFieldNoProfileSBT(fNode1) ; ffs1_2.pushBackTimeStep(f1ts2)
#
a=DataArrayDouble(m1.getNumberOfCells()) ; a.iota(1000.+off) ; a.setInfoOnComponents(["xx [m]"])
fCell2.setArray(a)
fCell2.setTime(*t)
- fCell2.checkCoherency()
+ fCell2.checkConsistencyLight()
a=DataArrayDouble(m1.getNumberOfNodes()) ; a.iota(1000+off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode2.setArray(a)
fNode2.setTime(*t)
- fNode2.checkCoherency()
+ fNode2.checkConsistencyLight()
f1ts1.setFieldNoProfileSBT(fCell2) ; ffs2_1.pushBackTimeStep(f1ts1)
f1ts2.setFieldNoProfileSBT(fNode2) ; ffs2_2.pushBackTimeStep(f1ts2)
# TimeStep 1
a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
fCell1.setArray(a)
fCell1.setTime(*t)
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode1.setArray(a)
fNode1.setTime(*t)
- fNode1.checkCoherency()
+ fNode1.checkConsistencyLight()
f1ts1.setFieldNoProfileSBT(fCell1) ; ffs1_1.pushBackTimeStep(f1ts1)
f1ts2.setFieldNoProfileSBT(fNode1) ; ffs1_2.pushBackTimeStep(f1ts2)
#
a=DataArrayDouble(m1.getNumberOfCells()) ; a.iota(1000.+off) ; a.setInfoOnComponents(["xx [m]"])
fCell2.setArray(a)
fCell2.setTime(*t)
- fCell2.checkCoherency()
+ fCell2.checkConsistencyLight()
a=DataArrayDouble(m1.getNumberOfNodes()) ; a.iota(1000+off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode2.setArray(a)
fNode2.setTime(*t)
- fNode2.checkCoherency()
+ fNode2.checkConsistencyLight()
f1ts1.setFieldNoProfileSBT(fCell2) ; ffs2_1.pushBackTimeStep(f1ts1)
f1ts2.setFieldNoProfileSBT(fNode2) ; ffs2_2.pushBackTimeStep(f1ts2)
# TimeStep 2
a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
fCell1.setArray(a)
fCell1.setTime(*t)
- fCell1.checkCoherency()
+ fCell1.checkConsistencyLight()
a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode1.setArray(a)
fNode1.setTime(*t)
- fNode1.checkCoherency()
+ fNode1.checkConsistencyLight()
f1ts1.setFieldNoProfileSBT(fCell1) ; ffs1_1.pushBackTimeStep(f1ts1)
f1ts2.setFieldNoProfileSBT(fNode1) ; ffs1_2.pushBackTimeStep(f1ts2)
#
a=DataArrayDouble(m1.getNumberOfCells()) ; a.iota(1000.+off) ; a.setInfoOnComponents(["xx [m]"])
fCell2.setArray(a)
fCell2.setTime(*t)
- fCell2.checkCoherency()
+ fCell2.checkConsistencyLight()
a=DataArrayDouble(m1.getNumberOfNodes()) ; a.iota(1000+off) ; a.setInfoOnComponents(["xx [m]"])
a=a.negate()
fNode2.setArray(a)
fNode2.setTime(*t)
- fNode2.checkCoherency()
+ fNode2.checkConsistencyLight()
f1ts1.setFieldNoProfileSBT(fCell2) ; ffs2_1.pushBackTimeStep(f1ts1)
f1ts2.setFieldNoProfileSBT(fNode2) ; ffs2_2.pushBackTimeStep(f1ts2)
#
m.allocateCells()
m.insertNextCell(NORM_QUAD4,[0,3,4,1])
m.insertNextCell(NORM_QUAD4,[1,4,5,2])
- m.checkCoherency1()
+ m.checkConsistency()
#
t=(1.1,0,-1)
f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setTime(*t) ; f.setMesh(m)
f.setArray(DataArrayDouble([3.,5.,7.,6.,2.,3.,11.,8.]))
f.setName(fieldName1)
- f.checkCoherency()
- MEDLoader.WriteField(fname,f,True)
+ f.checkConsistencyLight()
+ WriteField(fname,f,True)
f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
f2.setArray(DataArrayDouble([7.,11.],2,1))
f2.setName(fieldName2)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f2)
f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
f3.setArray(DataArrayDouble([1.,2.,4.,1.,2.,4.],6,1))
f3.setName(fieldName3)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f3)
#
t=(2.1,1,-1)
f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setTime(*t) ; f.setMesh(m)
f.setArray(DataArrayDouble([7.,6.,3.,5.,11.,8.,2.,3.]))
f.setName(fieldName1)
- f.checkCoherency()
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f)
+ f.checkConsistencyLight()
+ WriteFieldUsingAlreadyWrittenMesh(fname,f)
f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
f2.setArray(DataArrayDouble([11.,7.],2,1))
f2.setName(fieldName2)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f2)
f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
f3.setArray(DataArrayDouble([4.,2.,1.,4.,2.,1.],6,1))
f3.setName(fieldName3)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f3)
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fields=MEDFileFields(fname,False)
m.allocateCells()
m.insertNextCell(NORM_QUAD4,[0,3,4,1])
m.insertNextCell(NORM_QUAD4,[1,4,5,2])
- m.checkCoherency1()
+ m.checkConsistency()
#
t=(1.1,0,-1)
f=MEDCouplingFieldDouble(ON_GAUSS_PT) ; f.setTime(*t) ; f.setMesh(m)
f.setGaussLocalizationOnType(NORM_QUAD4,[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.2,0.2,0.8,0.8],[0.7,0.3])
f.setArray(DataArrayDouble([3.,5.,4.,6.])) ; f.getArray().setInfoOnComponents(["Smth"])
f.setName(fieldName1)
- f.checkCoherency()
- MEDLoader.WriteField(fname,f,True)
+ f.checkConsistencyLight()
+ WriteField(fname,f,True)
f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
f2.setArray(DataArrayDouble([7.,11.],2,1))
f2.setName(fieldName2)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f2)
f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
f3.setArray(DataArrayDouble([1.,2.,4.,1.,2.,4.],6,1))
f3.setName(fieldName3)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f3)
#
t=(2.1,1,-1)
f=MEDCouplingFieldDouble(ON_GAUSS_PT) ; f.setTime(*t) ; f.setMesh(m)
f.setGaussLocalizationOnType(NORM_QUAD4,[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.2,0.2,0.8,0.8],[0.7,0.3])
f.setArray(DataArrayDouble([5.,3.,6.,4.])) ; f.getArray().setInfoOnComponents(["Smth"])
f.setName(fieldName1)
- f.checkCoherency()
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f)
+ f.checkConsistencyLight()
+ WriteFieldUsingAlreadyWrittenMesh(fname,f)
f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
f2.setArray(DataArrayDouble([11.,7.],2,1))
f2.setName(fieldName2)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f2)
f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
f3.setArray(DataArrayDouble([4.,2.,1.,4.,2.,1.],6,1))
f3.setName(fieldName3)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f3)
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fields=MEDFileFields(fname,False)
f.setName(fieldName)
arr=DataArrayDouble(24) ; arr.iota() ; arr.setInfoOnComponents(["AStr"])
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
f1ts=MEDFileField1TS() ; f1ts.setFieldNoProfileSBT(f)
ff.pushBackTimeStep(f1ts)
# time 1
f.setName(fieldName)
arr=DataArrayDouble(24) ; arr.iota() ; arr.reverse() ; arr.setInfoOnComponents(["AStr"])
f.setArray(arr)
- f.checkCoherency()
+ f.checkConsistencyLight()
f1ts=MEDFileField1TS() ; f1ts.setFieldNoProfileSBT(f)
ff.pushBackTimeStep(f1ts)
#
f0.setName(fieldName0) ; f0.setTime(*t)
da=m.getCoords().magnitude() ; da.setInfoOnComponents(["zeInfo"])
f0.setArray(da)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldNoProfileSBT(f0)
fmts0.pushBackTimeStep(f1ts)
#
f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(m)
f1.setName(fieldName1) ; f1.setTime(*t)
- da=m.getBarycenterAndOwner().magnitude() ; da.setInfoOnComponents(["zeInfoCell"])
+ da=m.computeCellCenterOfMass().magnitude() ; da.setInfoOnComponents(["zeInfoCell"])
f1.setArray(da)
- f1.checkCoherency()
+ f1.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldNoProfileSBT(f1)
fmts1.pushBackTimeStep(f1ts)
f2.setName(fieldName2) ; f2.setTime(*t)
da=m.getCoords().magnitude()[pfl2] ; da.setInfoOnComponents(["zzzz"])
f2.setArray(da)
- f2.checkCoherency()
+ f2.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldProfile(f2,mm,0,pfl2)
fmts2.pushBackTimeStep(f1ts)
#
f3=MEDCouplingFieldDouble(ON_CELLS) ; mTmp=m[pfl3] ; mTmp.setName(m.getName()) ; f3.setMesh(mTmp)
f3.setName(fieldName3) ; f3.setTime(*t)
- da=mTmp.getBarycenterAndOwner().magnitude() ; da.setInfoOnComponents(["abcdefg"])
+ da=mTmp.computeCellCenterOfMass().magnitude() ; da.setInfoOnComponents(["abcdefg"])
f3.setArray(da)
- f3.checkCoherency()
+ f3.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldProfile(f3,mm,0,pfl3)
fmts3.pushBackTimeStep(f1ts)
f0.setName(fieldName0) ; f0.setTime(*t)
da=m.getCoords().magnitude() ; da.reverse() ; da.setInfoOnComponents(["zeInfo"])
f0.setArray(da)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldNoProfileSBT(f0)
fmts0.pushBackTimeStep(f1ts)
#
f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(m)
f1.setName(fieldName1) ; f1.setTime(*t)
- da=m.getBarycenterAndOwner().magnitude() ; da.reverse() ; da.setInfoOnComponents(["zeInfoCell"])
+ da=m.computeCellCenterOfMass().magnitude() ; da.reverse() ; da.setInfoOnComponents(["zeInfoCell"])
f1.setArray(da)
- f1.checkCoherency()
+ f1.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldNoProfileSBT(f1)
fmts1.pushBackTimeStep(f1ts)
f2.setName(fieldName2) ; f2.setTime(*t)
da=m.getCoords().magnitude()[pfl2] ; da.reverse() ; da.setInfoOnComponents(["zzzz"])
f2.setArray(da)
- f2.checkCoherency()
+ f2.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldProfile(f2,mm,0,pfl2)
fmts2.pushBackTimeStep(f1ts)
#
f3=MEDCouplingFieldDouble(ON_CELLS) ; mTmp=m[pfl3] ; mTmp.setName(m.getName()) ; f3.setMesh(mTmp)
f3.setName(fieldName3) ; f3.setTime(*t)
- da=mTmp.getBarycenterAndOwner().magnitude() ; da.reverse() ; da.setInfoOnComponents(["abcdefg"])
+ da=mTmp.computeCellCenterOfMass().magnitude() ; da.reverse() ; da.setInfoOnComponents(["abcdefg"])
f3.setArray(da)
- f3.checkCoherency()
+ f3.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldProfile(f3,mm,0,pfl3)
fmts3.pushBackTimeStep(f1ts)
f0.setName(fieldName0) ; f0.setTime(*t)
da=DataArrayDouble(9) ; da.iota() ; da.setInfoOnComponents(["zeInfo"])
f0.setArray(da)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldNoProfileSBT(f0)
fmts0.pushBackTimeStep(f1ts)
f0.setName(fieldName0) ; f0.setTime(*t)
da=DataArrayDouble(9) ; da.iota() ; da.reverse() ; da.setInfoOnComponents(["zeInfo"])
f0.setArray(da)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldNoProfileSBT(f0)
fmts0.pushBackTimeStep(f1ts)
f0.setName(fieldName0) ; f0.setTime(*t)
da=DataArrayDouble(4) ; da.iota() ; da.setInfoOnComponents(["zeInfo"])
f0.setArray(da)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldProfile(f0,mm,-1,pfl)
fmts0.pushBackTimeStep(f1ts)
f0.setName(fieldName0) ; f0.setTime(*t)
da=DataArrayDouble(4) ; da.iota() ; da.reverse() ; da.setInfoOnComponents(["zeInfo"])
f0.setArray(da)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
f1ts=MEDFileField1TS()
f1ts.setFieldProfile(f0,mm,-1,pfl)
fmts0.pushBackTimeStep(f1ts)
pfl1=DataArrayInt([1,3,5]) ; pfl1.setName(pflName1)
tmp=m0[pfl1] ; f2.setMesh(tmp)
f2.setGaussLocalizationOnType(NORM_QUAD4,[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[-0.5,-0.5,0.5,-0.5,0.5,0.5,-0.5,0.5,0.,0.],[0.1,0.1,0.1,0.1,0.6])
- f2.checkCoherency()
+ f2.checkConsistencyLight()
f1ts.setFieldProfile(f2,m,0,pfl1)
fmts.pushBackTimeStep(f1ts)
#
f0=MEDCouplingFieldDouble(ON_NODES) ; f0.setMesh(m0) ; f0.setName("f0NoPfl")
arr0=DataArrayDouble([0.,1.,2.,3.,1.,1.5,2.2,3.1,2.,2.2,3.,3.1,3.,3.1,3.5,4.])
f0.setArray(arr0)
- f0.checkCoherency()
+ f0.checkConsistencyLight()
f1ts0.setFieldNoProfileSBT(f0)
self.assertEqual(f1ts0.getMeshName(),"mesh")
#
fCell=MEDCouplingFieldDouble(ON_CELLS) ; fCell.setName("fCell")
arrCell=DataArrayDouble([7.]) ; arrCell.setInfoOnComponent(0,"smth") ; fCell.setArray(arrCell)
fCell.setMesh(m)
- MEDLoader.WriteField(fname,fCell,True)
+ WriteField(fname,fCell,True)
refCoo=[-1.,-1.,-1.,-1.,1.,-1.,1.,1.,-1.,1.,-1.,-1.,-1.,-1.,1.,-1.,1.,1.,1.,1.,1.,1.,-1.,1.,-1.,0.,-1.,0.,1.,-1.,1.,0.,-1.,0.,-1.,-1.,-1.,0.,1.,0.,1.,1.,1.,0.,1.,0.,-1.,1.,-1.,-1.,0.,-1.,1.,0.,1.,1.,0.,1.,-1.,0.,0.,0.,-1.,-1.,0.,0.,0.,1.,0.,1.,0.,0.,0.,-1.,0.,0.,0.,1.,0.,0.,0.]
weights=[0.1714677640603571,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.43895747599451346,0.7023319615912209,0.43895747599451346,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.1714677640603571]
gCoords=[-0.774596669241483,-0.774596669241483,-0.774596669241483,-0.774596669241483,-0.774596669241483,0.0,-0.774596669241483,-0.774596669241483,0.774596669241483,-0.774596669241483,0.0,-0.774596669241483,-0.774596669241483,0.0,0.0,-0.774596669241483,0.0,0.774596669241483,-0.774596669241483,0.774596669241483,-0.774596669241483,-0.774596669241483,0.774596669241483,0.0,-0.774596669241483,0.774596669241483,0.774596669241483,0.0,-0.774596669241483,-0.774596669241483,0.0,-0.774596669241483,0.0,0.0,-0.774596669241483,0.774596669241483,0.0,0.0,-0.774596669241483,0.0,0.0,0.0,0.0,0.0,0.774596669241483,0.0,0.774596669241483,-0.774596669241483,0.0,0.774596669241483,0.0,0.0,0.774596669241483,0.774596669241483,0.774596669241483,-0.774596669241483,-0.774596669241483,0.774596669241483,-0.774596669241483,0.0,0.774596669241483,-0.774596669241483,0.774596669241483,0.774596669241483,0.0,-0.774596669241483,0.774596669241483,0.0,0.0,0.774596669241483,0.0,0.774596669241483,0.774596669241483,0.774596669241483,-0.774596669241483,0.774596669241483,0.774596669241483,0.0,0.774596669241483,0.774596669241483,0.774596669241483]
fGauss.setGaussLocalizationOnType(NORM_HEXA27,refCoo,gCoords,weights)
arrGauss=DataArrayDouble(fGauss.getNumberOfTuplesExpected()) ; arrGauss.setInfoOnComponent(0,"gaussc") ; arrGauss.iota()
fGauss.setArray(arrGauss)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,fGauss)
+ WriteFieldUsingAlreadyWrittenMesh(fname,fGauss)
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fields=MEDFileFields(fname,False)
fCell0.setName(fieldName) ; fCell0.setMesh(m)
arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota(0) ; arr[i%10]=100.
fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]"])
- fCell0.checkCoherency()
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,fCell0)
+ fCell0.checkConsistencyLight()
+ WriteFieldUsingAlreadyWrittenMesh(fname,fCell0)
pass
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
fNode.setGaussLocalizationOnCells([6,10,13],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2],[0.8,0.05,0.1,0.04])
fNode.setGaussLocalizationOnCells([11,12,14],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.8,0.8],[0.8,0.05,0.1,0.01,0.02,0.005,0.005])
arr=DataArrayDouble(2*(2*6+5*4+4*3+7*3)) ; arr.iota(0+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs0.pushBackTimeStep(f)
#
fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
fNode.setName(fieldName1) ; fNode.setMesh(m)
arr=DataArrayDouble(2*16) ; arr.iota(300+1000*i) ; arr.rearrange(2)
- fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkCoherency()
+ fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkConsistencyLight()
f.setFieldNoProfileSBT(fNode)
fs1.pushBackTimeStep(f)
pass
mm.write(fname,2)
fs0.write(fname,0) ; fs1.write(fname,0)
- a0Exp=mm.getCoords().deepCpy()
+ a0Exp=mm.getCoords().deepCopy()
del m,mm,fs0,fs1,f,fNode
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes(fname) ; ms.cartesianizeMe()
arrY=DataArrayDouble([0.,1.])
m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY) ; m=m.buildUnstructured() ; m=m[[0,5,1,4,2,3]] ; m.changeSpaceDimension(3,0.) ; m.setName("Mesh")
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m) ; f.setName("Field") ; f.setArray(DataArrayDouble([(0.1,1.1),(2.1,3.1),(4.1,5.1),(6.1,7.1),(8.1,9.1),(10.1,11.1)])) ; f.getArray().setInfoOnComponents(["aa","bbb"])
- MEDLoader.WriteUMesh(fname,m,True)
- MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f)
+ WriteUMesh(fname,m,True)
+ WriteFieldUsingAlreadyWrittenMesh(fname,f)
########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
ms=MEDFileMeshes() # here we reproduce what is done by ParaMEDFileMeshes.ParaNew
ms.pushMesh(MEDFileUMesh.LoadPartOf(fname,"Mesh",[NORM_QUAD4],[0,2,1],-1,-1));
arr=DataArrayDouble(7) ; arr.iota(2000)
f1.setArray(arr)
f1.setName("bbb")
- f1.checkCoherency()
+ f1.checkConsistencyLight()
f1.setTime(*zeTime)
ff1.setFieldNoProfileSBT(f1)
#
arr=DataArrayDouble(9) ; arr.iota(4000)
f2.setArray(arr)
f2.setName("ddd")
- f2.checkCoherency()
+ f2.checkConsistencyLight()
f2.setTime(*zeTime)
ff2.setFieldNoProfileSBT(f2)
#
f3.setGaussLocalizationOnType(NORM_TRI3,[0,0,1,0,0,1],[0.333333,0.333333],[0.5])
arr=DataArrayDouble(3) ; arr.iota(1000)
f3.setArray(arr)
- f3.checkCoherency()
+ f3.checkConsistencyLight()
f3.setTime(*zeTime)
f3.setName("aaa")
ff3.setFieldNoProfileSBT(f3)
#
ff4=MEDFileField1TS()
- m0d=m0.deepCpy() ; m0d.zipCoords()
+ m0d=m0.deepCopy() ; m0d.zipCoords()
f4=MEDCouplingFieldDouble(ON_NODES) ; f4.setMesh(m0d)
arr=DataArrayDouble(5) ; arr.iota(3000)
f4.setArray(arr)
f4.setName("ccc")
- f4.checkCoherency()
+ f4.checkConsistencyLight()
f4.setTime(*zeTime)
pfl=DataArrayInt([0,1,2,3,4]) ; pfl.setName("PFL")
ff4.setFieldProfile(f4,mm,0,pfl)
arrZ=DataArrayDouble(5) ; arrZ.iota() ; arrZ*=1.6 ; arrZ-=8. ; arrZ.setInfoOnComponent(0,comps[2])
m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY,arrZ) ; m.setName(meshName)
mm=MEDFileCMesh() ; mm.setMesh(m) ; mm.setDescription(description)
- mm.setAxType(AX_CYL) # the test is here !
+ mm.setAxisType(AX_CYL) # the test is here !
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m) ; f.setName("Field")
- arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkCoherency()
+ arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkConsistencyLight()
ff=MEDFileField1TS() ; ff.setFieldNoProfileSBT(f)
fmts=MEDFileFieldMultiTS() ; fmts.pushBackTimeStep(ff)
#
arrZ=DataArrayDouble(5) ; arrZ.iota() ; arrZ*=2*pi/(len(arrZ)-1) ; arrZ.setInfoOnComponent(0,comps[2])
m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY,arrZ) ; m.setName(meshName)
mm=MEDFileCMesh() ; mm.setMesh(m) ; mm.setDescription(description)
- mm.setAxType(AX_SPHER) # the test is here !
+ mm.setAxisType(AX_SPHER) # the test is here !
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m) ; f.setName("Field")
- arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkCoherency()
+ arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkConsistencyLight()
ff=MEDFileField1TS() ; ff.setFieldNoProfileSBT(f)
fmts=MEDFileFieldMultiTS() ; fmts.pushBackTimeStep(ff)
#
arrZ=DataArrayDouble(5) ; arrZ.iota() ; arrZ*=2*pi/(len(arrZ)-1) ; arrZ.setInfoOnComponent(0,comps[2])
m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY,arrZ) ; m.setName(meshName) ; m=m.buildUnstructured()
mm=MEDFileUMesh() ; mm[0]=m ; mm.setDescription(description) # the test is here : UMesh !
- mm.setAxType(AX_SPHER) # the test is here !
+ mm.setAxisType(AX_SPHER) # the test is here !
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m) ; f.setName("Field")
- arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkCoherency()
+ arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkConsistencyLight()
ff=MEDFileField1TS() ; ff.setFieldNoProfileSBT(f)
fmts=MEDFileFieldMultiTS() ; fmts.pushBackTimeStep(ff)
#
arrZ=DataArrayDouble(5) ; arrZ.iota() ; arrZ*=2*pi/(len(arrZ)-1) ; arrZ.setInfoOnComponent(0,comps[2])
m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY,arrZ) ; m.setName(meshName) ; m=m.buildCurveLinear()
mm=MEDFileCurveLinearMesh() ; mm.setMesh(m) ; mm.setDescription(description) # the test is here CLMesh!
- mm.setAxType(AX_SPHER) # the test is here !
+ mm.setAxisType(AX_SPHER) # the test is here !
f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m) ; f.setName("Field")
- arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkCoherency()
+ arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota() ; arr*=0.1 ; f.setArray(arr) ; f.checkConsistencyLight()
ff=MEDFileField1TS() ; ff.setFieldNoProfileSBT(f)
fmts=MEDFileFieldMultiTS() ; fmts.pushBackTimeStep(ff)
#
#include <vector>
-static PyObject *convertMEDFileMesh(ParaMEDMEM::MEDFileMesh* mesh, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileMesh(MEDCoupling::MEDFileMesh* mesh, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!mesh)
Py_XINCREF(Py_None);
return Py_None;
}
- if(dynamic_cast<ParaMEDMEM::MEDFileUMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDFileUMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDFileCMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDFileCMesh,owner);
- if(dynamic_cast<ParaMEDMEM::MEDFileCurveLinearMesh *>(mesh))
- ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDFileCurveLinearMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDFileUMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDFileCMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDFileCMesh,owner);
+ if(dynamic_cast<MEDCoupling::MEDFileCurveLinearMesh *>(mesh))
+ ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_MEDCoupling__MEDFileCurveLinearMesh,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of MEDFileMesh on downcast !");
return ret;
}
-static PyObject *convertMEDFileParameter1TS(ParaMEDMEM::MEDFileParameter1TS* p1ts, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileParameter1TS(MEDCoupling::MEDFileParameter1TS* p1ts, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!p1ts)
return Py_None;
}
if(dynamic_cast<MEDFileParameterDouble1TS *>(p1ts))
- ret=SWIG_NewPointerObj((void*)p1ts,SWIGTYPE_p_ParaMEDMEM__MEDFileParameterDouble1TS,owner);
+ ret=SWIG_NewPointerObj((void*)p1ts,SWIGTYPE_p_MEDCoupling__MEDFileParameterDouble1TS,owner);
if(dynamic_cast<MEDFileParameterDouble1TSWTI *>(p1ts))
- ret=SWIG_NewPointerObj((void*)p1ts,SWIGTYPE_p_ParaMEDMEM__MEDFileParameterDouble1TSWTI,owner);
+ ret=SWIG_NewPointerObj((void*)p1ts,SWIGTYPE_p_MEDCoupling__MEDFileParameterDouble1TSWTI,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of MEDFileParameter1TS on downcast !");
return ret;
}
-static PyObject *convertMEDFileField1TS(ParaMEDMEM::MEDFileAnyTypeField1TS *p, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileField1TS(MEDCoupling::MEDFileAnyTypeField1TS *p, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!p)
return Py_None;
}
if(dynamic_cast<MEDFileField1TS *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_ParaMEDMEM__MEDFileField1TS,owner);
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileField1TS,owner);
if(dynamic_cast<MEDFileIntField1TS *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_ParaMEDMEM__MEDFileIntField1TS,owner);
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileIntField1TS,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of MEDFileAnyTypeField1TS on downcast !");
return ret;
}
-static PyObject *convertMEDFileFieldMultiTS(ParaMEDMEM::MEDFileAnyTypeFieldMultiTS *p, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDFileFieldMultiTS(MEDCoupling::MEDFileAnyTypeFieldMultiTS *p, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!p)
return Py_None;
}
if(dynamic_cast<MEDFileFieldMultiTS *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_ParaMEDMEM__MEDFileFieldMultiTS,owner);
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileFieldMultiTS,owner);
if(dynamic_cast<MEDFileIntFieldMultiTS *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_ParaMEDMEM__MEDFileIntFieldMultiTS,owner);
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileIntFieldMultiTS,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of MEDFileAnyTypeFieldMultiTS on downcast !");
return ret;
}
-static PyObject *convertMEDMeshMultiLev(ParaMEDMEM::MEDMeshMultiLev *p, int owner) throw(INTERP_KERNEL::Exception)
+static PyObject *convertMEDMeshMultiLev(MEDCoupling::MEDMeshMultiLev *p, int owner) throw(INTERP_KERNEL::Exception)
{
PyObject *ret=0;
if(!p)
return Py_None;
}
if(dynamic_cast<MEDUMeshMultiLev *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_ParaMEDMEM__MEDUMeshMultiLev,owner);
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDUMeshMultiLev,owner);
if(dynamic_cast<MEDCMeshMultiLev *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_ParaMEDMEM__MEDCMeshMultiLev,owner);
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDCMeshMultiLev,owner);
if(dynamic_cast<MEDCurveLinearMeshMultiLev *>(p))
- ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_ParaMEDMEM__MEDCurveLinearMeshMultiLev,owner);
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDCurveLinearMeshMultiLev,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of MEDMeshMultiLev on downcast !");
return ret;
}
}
-static PyObject *convertFieldDoubleVecToPy(const std::vector<ParaMEDMEM::MEDCouplingFieldDouble *>& li)
+static PyObject *convertFieldDoubleVecToPy(const std::vector<MEDCoupling::MEDCouplingFieldDouble *>& li)
{
int sz=li.size();
PyObject *ret=PyList_New(sz);
for(int i=0;i<sz;i++)
{
- PyObject *o=SWIG_NewPointerObj((void*)li[i],SWIGTYPE_p_ParaMEDMEM__MEDCouplingFieldDouble,SWIG_POINTER_OWN | 0);
+ PyObject *o=SWIG_NewPointerObj((void*)li[i],SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,SWIG_POINTER_OWN | 0);
PyList_SetItem(ret,i,o);
}
return ret;
os.remove(sauvFile)
pass
- @unittest.skipUnless(MEDLoader.HasXDR(),"requires XDR")
+ @unittest.skipUnless(HasXDR(),"requires XDR")
def testMissingGroups(self):
"""test for issue 0021749: [CEA 601] Some missing groups in mesh after reading a SAUV file with SauvReader."""
sauvFile = os.path.join(self.__getResourcesDirectory(),"BDC-714.sauv")
wgt=[0.3,0.3,0.3,0.3,0.4,0.4,0.4,0.4,0.7]
f.setGaussLocalizationOnType(NORM_QUAD8,refCoo,gpCoo,wgt)
f.setName("SIGT")
- f.checkCoherency()
+ f.checkConsistencyLight()
#
mm=MEDFileUMesh()
mm.setMeshAtLevel(0,m)
offsets=np.memmap(fd,dtype=rd._type_off,mode='r',offset=ref+rd._off_off,shape=(rd._nb_cells,))
offsets=self.__swapIfNecessary(rd._bo,offsets) ; connLgth=offsets[-1] ; offsets2=DataArrayInt(rd._nb_cells+1) ; offsets2.setIJ(0,0,0)
offsets2[1:]=DataArrayInt(offsets)
- offsets3=offsets2.deltaShiftIndex() ; offsets2=offsets3.deepCpy() ; offsets3+=1 ; offsets3.computeOffsets2()
+ offsets3=offsets2.deltaShiftIndex() ; offsets2=offsets3.deepCopy() ; offsets3+=1 ; offsets3.computeOffsetsFull()
offsets=offsets3
- tmp1=DataArrayInt(len(offsets2),2) ; tmp1[:,0]=1 ; tmp1[:,1]=offsets2 ; tmp1.rearrange(1) ; tmp1.computeOffsets2()
+ tmp1=DataArrayInt(len(offsets2),2) ; tmp1[:,0]=1 ; tmp1[:,1]=offsets2 ; tmp1.rearrange(1) ; tmp1.computeOffsetsFull()
tmp1=DataArrayInt.Range(1,2*len(offsets2),2).buildExplicitArrByRanges(tmp1)
conn=np.memmap(fd,dtype=rd._type_conn,mode='r',offset=ref+rd._off_conn,shape=(connLgth,))
conn=self.__swapIfNecessary(rd._bo,conn)
conn2[offsets[0:-1]]=types
conn2[tmp1]=DataArrayInt(conn)
m.setConnectivity(conn2,offsets,True)
- m.checkCoherency() ; mm=MEDFileUMesh() ; mm.setMeshAtLevel(0,m) ; ms.pushMesh(mm)
+ m.checkConsistencyLight() ; mm=MEDFileUMesh() ; mm.setMeshAtLevel(0,m) ; ms.pushMesh(mm)
# Fields on nodes and on cells
for spatialDisc,nbEnt,fields in [(ON_NODES,rd._nb_nodes,rd._node_fields),(ON_CELLS,rd._nb_cells,rd._cell_fields)]:
for name,typ,nbCompo,off in fields:
vals=np.memmap(fd,dtype=typ,mode='r',offset=ref+off,shape=(nbEnt*nbCompo))
vals=self.__swapIfNecessary(rd._bo,vals)
arr=DataArrayDouble(np.array(vals,dtype='float64')) ; arr.rearrange(nbCompo)
- f.setArray(arr) ; f.checkCoherency()
+ f.setArray(arr) ; f.checkConsistencyLight()
f.setTime(self._time[0],self._time[1],0)
ff.appendFieldNoProfileSBT(f)
fs.pushField(ff)
#include <cmath>
#include <numeric>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MEDLoaderTest::testMesh1DRW()
{
MEDCouplingUMesh *mesh=build1DMesh_1();
- mesh->checkCoherency();
- MEDLoader::WriteUMesh("file1.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file1.med",mesh->getName().c_str(),0);
+ mesh->checkConsistencyLight();
+ WriteUMesh("file1.med",mesh,true);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile("file1.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
void MEDLoaderTest::testMesh2DCurveRW()
{
MEDCouplingUMesh *mesh=build2DCurveMesh_1();
- mesh->checkCoherency();
- MEDLoader::WriteUMesh("file2.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file2.med",mesh->getName().c_str(),0);
+ mesh->checkConsistencyLight();
+ WriteUMesh("file2.med",mesh,true);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile("file2.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
void MEDLoaderTest::testMesh2DRW()
{
MEDCouplingUMesh *mesh=build2DMesh_1();
- mesh->checkCoherency();
- MEDLoader::WriteUMesh("file3.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file3.med",mesh->getName().c_str(),0);
+ mesh->checkConsistencyLight();
+ WriteUMesh("file3.med",mesh,true);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile("file3.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
void MEDLoaderTest::testMesh3DSurfRW()
{
MEDCouplingUMesh *mesh=build3DSurfMesh_1();
- mesh->checkCoherency();
- MEDLoader::WriteUMesh("file4.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file4.med",mesh->getName().c_str(),0);
+ mesh->checkConsistencyLight();
+ WriteUMesh("file4.med",mesh,true);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile("file4.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
void MEDLoaderTest::testMesh3DRW()
{
MEDCouplingUMesh *mesh=build3DMesh_1();
- mesh->checkCoherency();
- MEDLoader::WriteUMesh("file5.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file5.med",mesh->getName().c_str(),0);
+ mesh->checkConsistencyLight();
+ WriteUMesh("file5.med",mesh,true);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile("file5.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
void MEDLoaderTest::testFieldRW1()
{
MEDCouplingFieldDouble *f1=buildVecFieldOnCells_1();
- MEDLoader::WriteField("file6.med",f1,true);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell("file6.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
+ WriteField("file6.med",f1,true);
+ MEDCouplingFieldDouble *f2=ReadFieldCell("file6.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f1->decrRef();
f2->decrRef();
//
f1=buildVecFieldOnNodes_1();
- MEDLoader::WriteField("file7.med",f1,true);
- f2=MEDLoader::ReadFieldNode("file7.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3);
+ WriteField("file7.med",f1,true);
+ f2=ReadFieldNode("file7.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
// testing kind message on error of field type.
- CPPUNIT_ASSERT_THROW(MEDLoader::ReadFieldCell("file7.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(ReadFieldCell("file7.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3),INTERP_KERNEL::Exception);
//
f1->decrRef();
f2->decrRef();
static const double VAL1=12345.67890314;
static const double VAL2=-1111111111111.;
MEDCouplingFieldDouble *f1=buildVecFieldOnCells_1();
- MEDLoader::WriteField(fileName,f1,true);
+ WriteField(fileName,f1,true);
f1->setTime(10.,8,9);
double *tmp=f1->getArray()->getPointer();
tmp[0]=VAL1;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setTime(10.14,18,19);
tmp[0]=VAL2;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
//retrieving time steps...
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),8,9);
+ MEDCouplingFieldDouble *f2=ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),8,9);
f1->setTime(10.,8,9);
tmp[0]=VAL1;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
- f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
+ f2=ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
MEDCouplingFieldDouble *f3=buildVecFieldOnCells_1();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
f2->decrRef();
- f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),18,19);
+ f2=ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),18,19);
f1->setTime(10.14,18,19);
tmp[0]=VAL2;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
//test of throw on invalid (dt,it)
- CPPUNIT_ASSERT_THROW(MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),28,19),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),28,19),INTERP_KERNEL::Exception);
f2->decrRef();
f1->decrRef();
//ON NODES
f1=buildVecFieldOnNodes_1();
const char fileName2[]="file9.med";
- MEDLoader::WriteField(fileName2,f1,true);
+ WriteField(fileName2,f1,true);
f1->setTime(110.,108,109);
tmp=f1->getArray()->getPointer();
tmp[3]=VAL1;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
f1->setTime(210.,208,209);
tmp[3]=VAL2;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
- f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),108,109);
+ WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
+ f2=ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),108,109);
f1->setTime(110.,108,109);
tmp[3]=VAL1;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
- f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3);
+ f2=ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3);
f3=buildVecFieldOnNodes_1();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
f2->decrRef();
- f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),208,209);
+ f2=ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),208,209);
f1->setTime(210.,208,209);
tmp[3]=VAL2;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f1->setTime(10.,8,9);
double *tmp=f1->getArray()->getPointer();
tmp[0]=VAL1;
- MEDLoader::WriteField(fileName,f1,true);
+ WriteField(fileName,f1,true);
f1->setTime(10.14,18,19);
tmp[0]=VAL2;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setTime(10.55,28,29);
tmp[0]=3*VAL1;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setTime(10.66,38,39);
tmp[0]=3*VAL2;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setTime(10.77,48,49);
tmp[0]=4*VAL2;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
//ON NODES
f1->decrRef();
f1=buildVecFieldOnNodes_1();
f1->setName(name1);
(const_cast<MEDCouplingMesh *>(f1->getMesh()))->setName(name3);
f1->setTime(110.,8,9);
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setTime(110.,108,109);
tmp=f1->getArray()->getPointer();
tmp[3]=VAL1;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setTime(210.,208,209);
tmp[3]=VAL2;
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
//
- std::vector< std::pair<int,int> > it1=MEDLoader::GetCellFieldIterations(fileName,name3,name1);
+ std::vector< std::pair<int,int> > it1=GetCellFieldIterations(fileName,name3,name1);
CPPUNIT_ASSERT_EQUAL(5,(int)it1.size());
CPPUNIT_ASSERT_EQUAL(8,it1[0].first); CPPUNIT_ASSERT_EQUAL(9,it1[0].second);
CPPUNIT_ASSERT_EQUAL(18,it1[1].first); CPPUNIT_ASSERT_EQUAL(19,it1[1].second);
CPPUNIT_ASSERT_EQUAL(28,it1[2].first); CPPUNIT_ASSERT_EQUAL(29,it1[2].second);
CPPUNIT_ASSERT_EQUAL(38,it1[3].first); CPPUNIT_ASSERT_EQUAL(39,it1[3].second);
CPPUNIT_ASSERT_EQUAL(48,it1[4].first); CPPUNIT_ASSERT_EQUAL(49,it1[4].second);
- std::vector< std::pair<int,int> > it3=MEDLoader::GetNodeFieldIterations(fileName,name3,name1);
+ std::vector< std::pair<int,int> > it3=GetNodeFieldIterations(fileName,name3,name1);
CPPUNIT_ASSERT_EQUAL(3,(int)it3.size());
CPPUNIT_ASSERT_EQUAL(8,it3[0].first); CPPUNIT_ASSERT_EQUAL(9,it3[0].second);
CPPUNIT_ASSERT_EQUAL(108,it3[1].first); CPPUNIT_ASSERT_EQUAL(109,it3[1].second);
//
f1->decrRef();
//
- f1=MEDLoader::ReadFieldCell(fileName,name3,0,name1,8,9);
+ f1=ReadFieldCell(fileName,name3,0,name1,8,9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL1,f1->getArray()->getConstPointer()[0],1e-13);
f1->decrRef();
- f1=MEDLoader::ReadFieldCell(fileName,name3,0,name1,18,19);
+ f1=ReadFieldCell(fileName,name3,0,name1,18,19);
CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL2,f1->getArray()->getConstPointer()[0],1e-13);
f1->decrRef();
- f1=MEDLoader::ReadFieldCell(fileName,name3,0,name1,28,29);
+ f1=ReadFieldCell(fileName,name3,0,name1,28,29);
CPPUNIT_ASSERT_DOUBLES_EQUAL(3*VAL1,f1->getArray()->getConstPointer()[0],1e-13);
f1->decrRef();
- f1=MEDLoader::ReadFieldCell(fileName,name3,0,name1,38,39);
+ f1=ReadFieldCell(fileName,name3,0,name1,38,39);
CPPUNIT_ASSERT_DOUBLES_EQUAL(3*VAL2,f1->getArray()->getConstPointer()[0],1e-13);
f1->decrRef();
- f1=MEDLoader::ReadFieldCell(fileName,name3,0,name1,48,49);
+ f1=ReadFieldCell(fileName,name3,0,name1,48,49);
CPPUNIT_ASSERT_DOUBLES_EQUAL(4*VAL2,f1->getArray()->getConstPointer()[0],1e-13);
f1->decrRef();
//
- f1=MEDLoader::ReadFieldNode(fileName,name3,0,name1,8,9);
+ f1=ReadFieldNode(fileName,name3,0,name1,8,9);
CPPUNIT_ASSERT_DOUBLES_EQUAL(71.,f1->getArray()->getConstPointer()[3],1e-13);
f1->decrRef();
- f1=MEDLoader::ReadFieldNode(fileName,name3,0,name1,108,109);
+ f1=ReadFieldNode(fileName,name3,0,name1,108,109);
CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL1,f1->getArray()->getConstPointer()[3],1e-13);
f1->decrRef();
- f1=MEDLoader::ReadFieldNode(fileName,name3,0,name1,208,209);
+ f1=ReadFieldNode(fileName,name3,0,name1,208,209);
CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL2,f1->getArray()->getConstPointer()[3],1e-13);
f1->decrRef();
}
meshes.push_back(mesh3);
meshes.push_back(mesh4);
const char mnane[]="3DToto";
- MEDLoader::WriteUMeshesPartition(fileName,mnane,meshes,true);
+ WriteUMeshesPartition(fileName,mnane,meshes,true);
//
- MEDCouplingUMesh *mesh5=MEDLoader::ReadUMeshFromFile(fileName,mnane);
+ MEDCouplingUMesh *mesh5=ReadUMeshFromFile(fileName,mnane);
mesh1->setName(mnane);
const int part3[18]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
MEDCouplingUMesh *mesh6=(MEDCouplingUMesh *)mesh5->buildPartOfMySelf(part3,part3+18,true);
mesh5->decrRef();
CPPUNIT_ASSERT(mesh6->isEqual(mesh1,1e-12));
mesh6->decrRef();
- std::vector<std::string> grps=MEDLoader::GetMeshGroupsNames(fileName,mnane);
+ std::vector<std::string> grps=GetMeshGroupsNames(fileName,mnane);
CPPUNIT_ASSERT_EQUAL(4,(int)grps.size());
CPPUNIT_ASSERT(std::find(grps.begin(),grps.end(),std::string("mesh2"))!=grps.end());
CPPUNIT_ASSERT(std::find(grps.begin(),grps.end(),std::string("mesh3"))!=grps.end());
//
std::vector<std::string> vec;
vec.push_back(std::string("mesh2"));
- MEDCouplingUMesh *mesh2_2=MEDLoader::ReadUMeshFromGroups(fileName,mnane,0,vec);
+ MEDCouplingUMesh *mesh2_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
CPPUNIT_ASSERT(mesh2_2->isEqual(mesh2,1e-12));
mesh2_2->decrRef();
vec.clear(); vec.push_back(std::string("mesh3"));
- MEDCouplingUMesh *mesh3_2=MEDLoader::ReadUMeshFromGroups(fileName,mnane,0,vec);
+ MEDCouplingUMesh *mesh3_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
CPPUNIT_ASSERT(mesh3_2->isEqual(mesh3,1e-12));
mesh3_2->decrRef();
vec.clear(); vec.push_back(std::string("mesh4"));
- MEDCouplingUMesh *mesh4_2=MEDLoader::ReadUMeshFromGroups(fileName,mnane,0,vec);
+ MEDCouplingUMesh *mesh4_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
CPPUNIT_ASSERT(mesh4_2->isEqual(mesh4,1e-12));
mesh4_2->decrRef();
vec.clear(); vec.push_back(std::string("3DMesh_1"));
- MEDCouplingUMesh *mesh1_2=MEDLoader::ReadUMeshFromGroups(fileName,mnane,0,vec);
+ MEDCouplingUMesh *mesh1_2=ReadUMeshFromGroups(fileName,mnane,0,vec);
mesh1->setName("3DMesh_1");
CPPUNIT_ASSERT(mesh1_2->isEqual(mesh1,1e-12));
mesh1_2->decrRef();
//
vec.clear(); vec.push_back(std::string("Family_-3")); vec.push_back(std::string("Family_-5"));
- mesh2_2=MEDLoader::ReadUMeshFromFamilies(fileName,mnane,0,vec);
+ mesh2_2=ReadUMeshFromFamilies(fileName,mnane,0,vec);
mesh2_2->setName("mesh2");
CPPUNIT_ASSERT(mesh2_2->isEqual(mesh2,1e-12));
mesh2_2->decrRef();
//
- std::vector<std::string> ret(MEDLoader::GetMeshFamiliesNamesOnGroup(fileName,"3DToto","3DMesh_1"));
+ std::vector<std::string> ret(GetMeshFamiliesNamesOnGroup(fileName,"3DToto","3DMesh_1"));
std::set<std::string> s(ret.begin(),ret.end());
std::set<std::string> ref_s;
ref_s.insert("Family_-2");
CPPUNIT_ASSERT_EQUAL(4,(int)ret.size());
CPPUNIT_ASSERT(s==ref_s);
//
- std::vector<std::string> ret1=MEDLoader::GetMeshGroupsNamesOnFamily(fileName,"3DToto","Family_-3");
+ std::vector<std::string> ret1=GetMeshGroupsNamesOnFamily(fileName,"3DToto","Family_-3");
CPPUNIT_ASSERT_EQUAL(2,(int)ret1.size());
CPPUNIT_ASSERT(ret1[0]=="3DMesh_1");
CPPUNIT_ASSERT(ret1[1]=="mesh2");
int newNbOfNodes;
DataArrayInt *da=mesh1->mergeNodes(1e-12,b,newNbOfNodes);
da->decrRef();
- MEDLoader::WriteUMesh(fileName,mesh1,true);
+ WriteUMesh(fileName,mesh1,true);
const int part1[5]={1,2,4,13,15};
MEDCouplingUMesh *mesh2=(MEDCouplingUMesh *)mesh1->buildPartOfMySelf(part1,part1+5,true);
mesh2->setName(mesh1->getName().c_str());//<- important for the test
const double arr1[10]={71.,171.,10.,110.,20.,120.,30.,130.,40.,140.};
std::copy(arr1,arr1+10,tmp);
f1->setTime(3.14,2,7);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
- MEDLoader::WriteField(fileName,f1,false);//<- false important for the test
+ WriteField(fileName,f1,false);//<- false important for the test
//
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
- std::vector<ParaMEDMEM::TypeOfField> types=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
+ MEDCouplingFieldDouble *f2=ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
+ std::vector<MEDCoupling::TypeOfField> types=GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)types.size());
CPPUNIT_ASSERT(types[0]==ON_CELLS);
- f2->checkCoherency();
+ f2->checkConsistencyLight();
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
//
f2->decrRef();
const char fileName2[]="file20.med";
MEDCouplingUMesh *m=build2DMesh_1();
int nbOfNodes=m->getNumberOfNodes();
- MEDLoader::WriteUMesh(fileName,m,true);
+ WriteUMesh(fileName,m,true);
MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_NODES,ONE_TIME);
f1->setName("VFieldOnNodes");
f1->setMesh(m);
array->setInfoOnComponent(1,"uiop [MW]");
array->decrRef();
f1->setTime(3.14,2,7);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
const int arr2[2]={1,4};//node ids are 2,4,5,3,6,7
MEDCouplingFieldDouble *f2=f1->buildSubPart(arr2,arr2+2);
(const_cast<MEDCouplingMesh *>(f2->getMesh()))->setName(f1->getMesh()->getName().c_str());
- MEDLoader::WriteField(fileName,f2,false);//<- false important for the test
+ WriteField(fileName,f2,false);//<- false important for the test
//
- MEDCouplingFieldDouble *f3=MEDLoader::ReadFieldNode(fileName,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7);
- f3->checkCoherency();
+ MEDCouplingFieldDouble *f3=ReadFieldNode(fileName,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7);
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
//
const int arr3[6]={1,3,0,5,2,4};
f2->renumberNodes(arr3);
- MEDLoader::WriteUMesh(fileName2,m,true);
- MEDLoader::WriteField(fileName2,f2,false);//<- false important for the test
- f3=MEDLoader::ReadFieldNode(fileName2,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7);
- f3->checkCoherency();
+ WriteUMesh(fileName2,m,true);
+ WriteField(fileName2,f2,false);//<- false important for the test
+ f3=ReadFieldNode(fileName2,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7);
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
f2->decrRef();
{
const char fileName[]="file23.med";
MEDCouplingUMesh *mesh=build3DSurfMesh_1();
- MEDLoader::WriteUMesh(fileName,mesh,true);
+ WriteUMesh(fileName,mesh,true);
//
MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_NODES,ONE_TIME);
f1->setName("FieldMix");
//
const int renumArr[12]={3,7,2,1,5,11,10,0,9,6,8,4};
f1->renumberNodes(renumArr);
- f1->checkCoherency();
- MEDLoader::WriteField(fileName,f1,false);//<- false important for the test
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldNode(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
+ f1->checkConsistencyLight();
+ WriteField(fileName,f1,false);//<- false important for the test
+ MEDCouplingFieldDouble *f2=ReadFieldNode(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12));
//
f2->decrRef();
{
const char fileName[]="file13.med";
MEDCouplingFieldDouble *f1=buildVecFieldOnGauss_1();
- MEDLoader::WriteField(fileName,f1,true);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_PT,fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),1,5);
+ WriteField(fileName,f1,true);
+ MEDCouplingFieldDouble *f2=ReadField(ON_GAUSS_PT,fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),1,5);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
f1->decrRef();
{
const char fileName[]="file14.med";
MEDCouplingFieldDouble *f1=buildVecFieldOnGaussNE_1();
- MEDLoader::WriteField(fileName,f1,true);
- std::vector<ParaMEDMEM::TypeOfField> tof(MEDLoader::GetTypesOfField(fileName,"2DMesh_2","MyFieldOnGaussNE"));
+ WriteField(fileName,f1,true);
+ std::vector<MEDCoupling::TypeOfField> tof(GetTypesOfField(fileName,"2DMesh_2","MyFieldOnGaussNE"));
CPPUNIT_ASSERT_EQUAL(1,(int)tof.size());
CPPUNIT_ASSERT(ON_GAUSS_NE==tof[0]);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_NE,fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),1,5);
+ MEDCouplingFieldDouble *f2=ReadField(ON_GAUSS_NE,fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),1,5);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
f1->decrRef();
MEDCouplingUMesh *mesh=build3DSurfMesh_1();
const int renumber1[6]={2,5,1,0,3,4};
mesh->renumberCells(renumber1,false);
- mesh->checkCoherency();
- MEDLoader::WriteUMesh(fileName,mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile(fileName,mesh->getName().c_str(),0);
+ mesh->checkConsistencyLight();
+ WriteUMesh(fileName,mesh,true);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile(fileName,mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
const double arr1[12]={71.,171.,10.,110.,20.,120.,30.,130.,40.,140.,50.,150.};
std::copy(arr1,arr1+12,tmp);
f1->setTime(3.14,2,7);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
const int renumber1[6]={2,1,5,0,3,4};
f1->renumberCells(renumber1,false);
- MEDLoader::WriteField(fileName,f1,true);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,mesh->getName().c_str(),0,f1->getName().c_str(),2,7);
+ WriteField(fileName,f1,true);
+ MEDCouplingFieldDouble *f2=ReadFieldCell(fileName,mesh->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12));
f2->decrRef();
//
m->renumberCells(renum,false);
m->orientCorrectlyPolyhedrons();
// Writing
- MEDLoader::WriteUMesh(fileName,m,true);
+ WriteUMesh(fileName,m,true);
MEDCouplingFieldDouble *f1Tmp=m->getMeasureField(false);
MEDCouplingFieldDouble *f1=f1Tmp->buildNewTimeReprFromThis(ONE_TIME,false);
f1Tmp->decrRef();
f1->setTime(0.,1,2);
MEDCouplingFieldDouble *f_1=f1->cloneWithMesh(true);
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->applyFunc("2*x");
f1->setTime(0.01,3,4);
MEDCouplingFieldDouble *f_2=f1->cloneWithMesh(true);
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->applyFunc("2*x/3");
f1->setTime(0.02,5,6);
MEDCouplingFieldDouble *f_3=f1->cloneWithMesh(true);
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->decrRef();
// Reading
std::vector<std::pair<int,int> > its;
its.push_back(std::pair<int,int>(1,2));
its.push_back(std::pair<int,int>(3,4));
its.push_back(std::pair<int,int>(5,6));
- std::vector<MEDCouplingFieldDouble *> fs=MEDLoader::ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1->getMesh()->getName().c_str(),0,f_1->getName().c_str(),its);
+ std::vector<MEDCouplingFieldDouble *> fs=ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1->getMesh()->getName().c_str(),0,f_1->getName().c_str(),its);
CPPUNIT_ASSERT_EQUAL(3,(int)fs.size());
const MEDCouplingMesh *mm=fs[0]->getMesh();
CPPUNIT_ASSERT(fs[0]->isEqual(f_1,1e-12,1e-12));
std::vector<const MEDCouplingUMesh *> meshes;
meshes.push_back(m2d);
meshes.push_back(m3d);
- MEDLoader::WriteUMeshes(fileName,meshes,true);
- MEDCouplingUMesh *m3d_bis=MEDLoader::ReadUMeshFromFile(fileName,m2d->getName().c_str(),0);
+ WriteUMeshes(fileName,meshes,true);
+ MEDCouplingUMesh *m3d_bis=ReadUMeshFromFile(fileName,m2d->getName().c_str(),0);
CPPUNIT_ASSERT(!m3d_bis->isEqual(m3d,1e-12));
m3d_bis->setName(m3d->getName().c_str());
CPPUNIT_ASSERT(m3d_bis->isEqual(m3d,1e-12));
- MEDCouplingUMesh *m2d_bis=MEDLoader::ReadUMeshFromFile(fileName,m2d->getName().c_str(),-1);//-1 for faces
+ MEDCouplingUMesh *m2d_bis=ReadUMeshFromFile(fileName,m2d->getName().c_str(),-1);//-1 for faces
CPPUNIT_ASSERT(m2d_bis->isEqual(m2d,1e-12));
// Creation of a field on faces.
MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
const double arr1[10]={71.,171.,10.,110.,20.,120.,30.,130.,40.,140.};
std::copy(arr1,arr1+10,tmp);
f1->setTime(3.14,2,7);
- f1->checkCoherency();
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),-1,f1->getName().c_str(),2,7);
+ f1->checkConsistencyLight();
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ MEDCouplingFieldDouble *f2=ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),-1,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12));
f1->decrRef();
f2->decrRef();
const double arr1[12]={71.,171.,10.,110.,20.,120.,30.,130.,40.,140.,50.,150.};
std::copy(arr1,arr1+12,tmp);
f1->setTime(3.14,2,7);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
//
MEDCouplingFieldDouble *f2=MEDCouplingFieldDouble::New(ON_NODES,ONE_TIME);
f2->setName("FieldMix");
};
std::copy(arr2,arr2+24,tmp);
f2->setTime(3.14,2,7);
- f2->checkCoherency();
+ f2->checkConsistencyLight();
//
- MEDLoader::WriteField(fileName,f1,true);
- std::vector<ParaMEDMEM::TypeOfField> ts=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
+ WriteField(fileName,f1,true);
+ std::vector<MEDCoupling::TypeOfField> ts=GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)ts.size());
CPPUNIT_ASSERT_EQUAL(ON_CELLS,ts[0]);
- std::vector<std::string> fs=MEDLoader::GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName().c_str());
+ std::vector<std::string> fs=GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)fs.size());
CPPUNIT_ASSERT(fs[0]=="FieldMix");
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f2);
- fs=MEDLoader::GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName().c_str());
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f2);
+ fs=GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)fs.size());
CPPUNIT_ASSERT(fs[0]=="FieldMix");
//
- ts=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
+ ts=GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
CPPUNIT_ASSERT_EQUAL(2,(int)ts.size());
CPPUNIT_ASSERT_EQUAL(ON_NODES,ts[0]);
CPPUNIT_ASSERT_EQUAL(ON_CELLS,ts[1]);
//
- MEDCouplingFieldDouble *f3=MEDLoader::ReadFieldNode(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
+ MEDCouplingFieldDouble *f3=ReadFieldNode(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
- f3=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
+ f3=ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f3->isEqual(f1,1e-12,1e-12));
f3->decrRef();
//
f1->setTime(3.44,5,6);
f1->setMesh(mesh);
f1->fillFromAnalytic(2,"x+y");
- MEDLoader::WriteField(fileName,f1,true);
+ WriteField(fileName,f1,true);
f1->setTime(1002.3,7,8);
f1->fillFromAnalytic(2,"x+77.*y");
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
+ WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setName("Field2");
- MEDLoader::WriteField(fileName,f1,false);
+ WriteField(fileName,f1,false);
f1->setName("Field3");
mesh->setName("2DMesh_2Bis");
- MEDLoader::WriteField(fileName,f1,false);
+ WriteField(fileName,f1,false);
f1->decrRef();
f1=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
f1->setName("Field8");
f1->setTime(8.99,7,9);
f1->setMesh(mesh);
f1->fillFromAnalytic(3,"3*x+y");
- MEDLoader::WriteField(fileName,f1,false);
+ WriteField(fileName,f1,false);
f1->decrRef();
- std::vector<std::string> fs=MEDLoader::GetAllFieldNames(fileName);
+ std::vector<std::string> fs=GetAllFieldNames(fileName);
CPPUNIT_ASSERT_EQUAL(4,(int)fs.size());
CPPUNIT_ASSERT(fs[0]=="Field1");
CPPUNIT_ASSERT(fs[1]=="Field2");
using namespace INTERP_KERNEL;
string fileName= INTERP_TEST::getResourceFile("pointe.med", 3);
- vector<string> meshNames=MEDLoader::GetMeshNames(fileName.c_str());
+ vector<string> meshNames=GetMeshNames(fileName.c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)meshNames.size());
- MEDCouplingUMesh *mesh=MEDLoader::ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
+ MEDCouplingUMesh *mesh=ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(16,mesh->getNumberOfCells());
CPPUNIT_ASSERT_DOUBLES_EQUAL(46.,std::accumulate(mesh->getCoords()->getPointer(),mesh->getCoords()->getPointer()+57,0),1e-12);
mesh->decrRef();
//
- vector<string> families=MEDLoader::GetMeshFamiliesNames(fileName.c_str(),meshNames[0].c_str());
+ vector<string> families=GetMeshFamiliesNames(fileName.c_str(),meshNames[0].c_str());
CPPUNIT_ASSERT_EQUAL(8,(int)families.size());
CPPUNIT_ASSERT(families[2]=="FAMILLE_ELEMENT_3");
//
vector<string> families2;
families2.push_back(families[2]);
- mesh=MEDLoader::ReadUMeshFromFamilies(fileName.c_str(),meshNames[0].c_str(),0,families2);
+ mesh=ReadUMeshFromFamilies(fileName.c_str(),meshNames[0].c_str(),0,families2);
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(2,mesh->getNumberOfCells());
CPPUNIT_ASSERT_DOUBLES_EQUAL(46.,std::accumulate(mesh->getCoords()->getPointer(),mesh->getCoords()->getPointer()+57,0),1e-12);
mesh->decrRef();
//
- vector<string> groups=MEDLoader::GetMeshGroupsNames(fileName.c_str(),meshNames[0].c_str());
+ vector<string> groups=GetMeshGroupsNames(fileName.c_str(),meshNames[0].c_str());
CPPUNIT_ASSERT_EQUAL(5,(int)groups.size());
CPPUNIT_ASSERT(groups[0]=="groupe1");
CPPUNIT_ASSERT(groups[1]=="groupe2");
CPPUNIT_ASSERT(groups[4]=="groupe5");
vector<string> groups2;
groups2.push_back(groups[0]);
- mesh=MEDLoader::ReadUMeshFromGroups(fileName.c_str(),meshNames[0].c_str(),0,groups2);
+ mesh=ReadUMeshFromGroups(fileName.c_str(),meshNames[0].c_str(),0,groups2);
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(7,mesh->getNumberOfCells());
CPPUNIT_ASSERT_DOUBLES_EQUAL(46.,std::accumulate(mesh->getCoords()->getPointer(),mesh->getCoords()->getPointer()+57,0),1e-12);
mesh->decrRef();
//
- std::vector<std::string> fieldsName=MEDLoader::GetCellFieldNamesOnMesh(fileName.c_str(),meshNames[0].c_str());
+ std::vector<std::string> fieldsName=GetCellFieldNamesOnMesh(fileName.c_str(),meshNames[0].c_str());
CPPUNIT_ASSERT_EQUAL(2,(int)fieldsName.size());
CPPUNIT_ASSERT(fieldsName[0]=="fieldcelldoublescalar");
CPPUNIT_ASSERT(fieldsName[1]=="fieldcelldoublevector");
- std::vector<std::pair<int,int> > its0=MEDLoader::GetCellFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsName[0].c_str());
+ std::vector<std::pair<int,int> > its0=GetCellFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsName[0].c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)its0.size());
CPPUNIT_ASSERT_EQUAL(-1,its0[0].first);
CPPUNIT_ASSERT_EQUAL(-1,its0[0].second);
- std::vector<std::pair<int,int> > its1=MEDLoader::GetCellFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsName[1].c_str());
+ std::vector<std::pair<int,int> > its1=GetCellFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsName[1].c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)its1.size());
CPPUNIT_ASSERT_EQUAL(-1,its1[0].first);
CPPUNIT_ASSERT_EQUAL(-1,its1[0].second);
//
- MEDCouplingFieldDouble *field0=MEDLoader::ReadFieldCell(fileName.c_str(),meshNames[0].c_str(),0,fieldsName[0].c_str(),its0[0].first,its0[0].second);
- field0->checkCoherency();
+ MEDCouplingFieldDouble *field0=ReadFieldCell(fileName.c_str(),meshNames[0].c_str(),0,fieldsName[0].c_str(),its0[0].first,its0[0].second);
+ field0->checkConsistencyLight();
CPPUNIT_ASSERT(field0->getName()==fieldsName[0]);
CPPUNIT_ASSERT_EQUAL(1,field0->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(16,field0->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(46.,std::accumulate(constMesh->getCoords()->getConstPointer(),constMesh->getCoords()->getConstPointer()+57,0),1e-12);
field0->decrRef();
//
- MEDCouplingFieldDouble *field1=MEDLoader::ReadFieldCell(fileName.c_str(),meshNames[0].c_str(),0,fieldsName[1].c_str(),its1[0].first,its1[0].second);
- field1->checkCoherency();
+ MEDCouplingFieldDouble *field1=ReadFieldCell(fileName.c_str(),meshNames[0].c_str(),0,fieldsName[1].c_str(),its1[0].first,its1[0].second);
+ field1->checkConsistencyLight();
CPPUNIT_ASSERT(field1->getName()==fieldsName[1]);
CPPUNIT_ASSERT_EQUAL(3,field1->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(16,field1->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(46.,std::accumulate(constMesh->getCoords()->getConstPointer(),constMesh->getCoords()->getConstPointer()+57,0),1e-12);
field1->decrRef();
//fields on nodes
- std::vector<std::string> fieldsNameNode=MEDLoader::GetNodeFieldNamesOnMesh(fileName.c_str(),meshNames[0].c_str());
+ std::vector<std::string> fieldsNameNode=GetNodeFieldNamesOnMesh(fileName.c_str(),meshNames[0].c_str());
CPPUNIT_ASSERT_EQUAL(2,(int)fieldsNameNode.size());
CPPUNIT_ASSERT(fieldsNameNode[0]=="fieldnodedouble");
CPPUNIT_ASSERT(fieldsNameNode[1]=="fieldnodeint");
- std::vector<std::pair<int,int> > its0Node=MEDLoader::GetNodeFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsNameNode[0].c_str());
+ std::vector<std::pair<int,int> > its0Node=GetNodeFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsNameNode[0].c_str());
CPPUNIT_ASSERT_EQUAL(3,(int)its0Node.size());
CPPUNIT_ASSERT_EQUAL(-1,its0Node[0].first);
CPPUNIT_ASSERT_EQUAL(-1,its0Node[0].second);
CPPUNIT_ASSERT_EQUAL(-1,its0Node[1].second);
CPPUNIT_ASSERT_EQUAL(2,its0Node[2].first);
CPPUNIT_ASSERT_EQUAL(-1,its0Node[2].second);
- MEDCouplingFieldDouble *field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[0].first,its0Node[0].second);
- field0Nodes->checkCoherency();
+ MEDCouplingFieldDouble *field0Nodes=ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[0].first,its0Node[0].second);
+ field0Nodes->checkConsistencyLight();
CPPUNIT_ASSERT(field0Nodes->getName()==fieldsNameNode[0]);
CPPUNIT_ASSERT_EQUAL(1,field0Nodes->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(19,field0Nodes->getNumberOfTuples());
CPPUNIT_ASSERT(constMesh);
field0Nodes->decrRef();
//
- field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[2].first,its0Node[2].second);
- field0Nodes->checkCoherency();
+ field0Nodes=ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[2].first,its0Node[2].second);
+ field0Nodes->checkConsistencyLight();
CPPUNIT_ASSERT(field0Nodes->getName()==fieldsNameNode[0]);
CPPUNIT_ASSERT_EQUAL(1,field0Nodes->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(19,field0Nodes->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(46.,std::accumulate(constMesh->getCoords()->getConstPointer(),constMesh->getCoords()->getConstPointer()+57,0),1e-12);
field0Nodes->decrRef();
//
- field0Nodes=MEDLoader::ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[0].first,its0Node[0].second);
- field0Nodes->checkCoherency();
+ field0Nodes=ReadFieldNode(fileName.c_str(),meshNames[0].c_str(),0,fieldsNameNode[0].c_str(),its0Node[0].first,its0Node[0].second);
+ field0Nodes->checkConsistencyLight();
CPPUNIT_ASSERT(field0Nodes->getName()==fieldsNameNode[0]);
CPPUNIT_ASSERT_EQUAL(1,field0Nodes->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(19,field0Nodes->getNumberOfTuples());
using namespace INTERP_KERNEL;
string fileName=INTERP_TEST::getResourceFile("polygones.med", 3);
- vector<string> meshNames=MEDLoader::GetMeshNames(fileName.c_str());
+ vector<string> meshNames=GetMeshNames(fileName.c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)meshNames.size());
CPPUNIT_ASSERT(meshNames[0]=="Bord");
- MEDCouplingUMesh *mesh=MEDLoader::ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
- mesh->checkCoherency();
+ MEDCouplingUMesh *mesh=ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(538,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(725943,std::accumulate(mesh->getNodalConnectivityIndex()->getPointer(),mesh->getNodalConnectivityIndex()->getPointer()+539,0));
mesh->decrRef();
//
- std::vector<std::string> fieldsName=MEDLoader::GetCellFieldNamesOnMesh(fileName.c_str(),meshNames[0].c_str());
+ std::vector<std::string> fieldsName=GetCellFieldNamesOnMesh(fileName.c_str(),meshNames[0].c_str());
CPPUNIT_ASSERT_EQUAL(3,(int)fieldsName.size());
CPPUNIT_ASSERT(fieldsName[0]=="bord_:_distorsion");
CPPUNIT_ASSERT(fieldsName[1]=="bord_:_familles");
CPPUNIT_ASSERT(fieldsName[2]=="bord_:_non-ortho");
- std::vector<std::pair<int,int> > its0=MEDLoader::GetCellFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsName[0].c_str());
+ std::vector<std::pair<int,int> > its0=GetCellFieldIterations(fileName.c_str(),meshNames[0].c_str(),fieldsName[0].c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)its0.size());
- MEDCouplingFieldDouble *field=MEDLoader::ReadFieldCell(fileName.c_str(),meshNames[0].c_str(),0,fieldsName[0].c_str(),its0[0].first,its0[0].second);
- field->checkCoherency();
+ MEDCouplingFieldDouble *field=ReadFieldCell(fileName.c_str(),meshNames[0].c_str(),0,fieldsName[0].c_str(),its0[0].first,its0[0].second);
+ field->checkConsistencyLight();
CPPUNIT_ASSERT(field->getName()==fieldsName[0]);
CPPUNIT_ASSERT_EQUAL(1,field->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(538,field->getNumberOfTuples());
using namespace INTERP_KERNEL;
string fileName=INTERP_TEST::getResourceFile("poly3D.med", 3);
- vector<string> meshNames=MEDLoader::GetMeshNames(fileName.c_str());
+ vector<string> meshNames=GetMeshNames(fileName.c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)meshNames.size());
CPPUNIT_ASSERT(meshNames[0]=="poly3D");
- MEDCouplingUMesh *mesh=MEDLoader::ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
- mesh->checkCoherency();
+ MEDCouplingUMesh *mesh=ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),0);
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(3,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(155,std::accumulate(mesh->getNodalConnectivityIndex()->getPointer(),mesh->getNodalConnectivityIndex()->getPointer()+4,0));
mesh->decrRef();
//
- mesh=MEDLoader::ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),-1);
- mesh->checkCoherency();
+ mesh=ReadUMeshFromFile(fileName.c_str(),meshNames[0].c_str(),-1);
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(17,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(619,std::accumulate(mesh->getNodalConnectivity()->getPointer(),mesh->getNodalConnectivity()->getPointer()+83,0));
mesh->decrRef();
//
- vector<string> families=MEDLoader::GetMeshFamiliesNames(fileName.c_str(),meshNames[0].c_str());
+ vector<string> families=GetMeshFamiliesNames(fileName.c_str(),meshNames[0].c_str());
CPPUNIT_ASSERT_EQUAL(4,(int)families.size());
CPPUNIT_ASSERT(families[0]=="FAMILLE_FACE_POLYGONS3");
CPPUNIT_ASSERT(families[1]=="FAMILLE_FACE_QUAD41");
CPPUNIT_ASSERT(families[3]=="FAMILLE_ZERO");
vector<string> families2;
families2.push_back(families[0]);
- mesh=MEDLoader::ReadUMeshFromFamilies(fileName.c_str(),meshNames[0].c_str(),-1,families2);
- mesh->checkCoherency();
+ mesh=ReadUMeshFromFamilies(fileName.c_str(),meshNames[0].c_str(),-1,families2);
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension());
CPPUNIT_ASSERT_EQUAL(3,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(117,std::accumulate(mesh->getNodalConnectivity()->getPointer(),mesh->getNodalConnectivity()->getPointer()+19,0));
mesh->decrRef();
//
- mesh=MEDLoader::ReadUMeshFromFamilies(fileName.c_str(),meshNames[0].c_str(),0,families2);
+ mesh=ReadUMeshFromFamilies(fileName.c_str(),meshNames[0].c_str(),0,families2);
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(0,mesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
const double arr1[18]={0.,10.,20.,1.,11.,21.,2.,12.,22.,3.,13.,23.,4.,14.,24.,5.,15.,25.};
std::copy(arr1,arr1+18,tmp);
f1->setTime(2.,0,1);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
mesh->decrRef();
return f1;
}
};
std::copy(arr1,arr1+36,tmp);
f1->setTime(2.12,2,3);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
mesh->decrRef();
return f1;
}
array->setInfoOnComponent(0,"power [MW/m^3]");
array->setInfoOnComponent(1,"density");
array->decrRef();
- f->checkCoherency();
+ f->checkConsistencyLight();
m->decrRef();
return f;
}
array->setInfoOnComponent(1,"temperature");
f->setName("MyFieldOnGaussNE");
array->decrRef();
- f->checkCoherency();
+ f->checkConsistencyLight();
m->decrRef();
return f;
}
#include <cppunit/extensions/HelperMacros.h>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
class MEDCouplingFieldDouble;
#include <vector>
#include <string>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void SauvLoaderTest::testSauv2Med()
{
// read a file containing all types of readable piles
std::string file = INTERP_TEST::getResourceFile("allPillesTest.sauv", 3);
- MEDCouplingAutoRefCountObjectPtr<SauvReader> sr=SauvReader::New(file.c_str());
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> d2=sr->loadInMEDFileDS();
+ MCAuto<SauvReader> sr=SauvReader::New(file.c_str());
+ MCAuto<MEDFileData> d2=sr->loadInMEDFileDS();
// write MED
d2->write("allPillesTest.med",0);
// check
const int nbOfNodes = 6;
double coords[nbOfNodes*spaceDim] = {0,0, 1,0, 1,1, 0,1, 2,0, 2,1};
int conn[8]={0,1,2,3, 1,4,5,2};
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh2d=MEDCouplingUMesh::New("Mesh",spaceDim);
+ MCAuto<MEDCouplingUMesh> mesh2d=MEDCouplingUMesh::New("Mesh",spaceDim);
mesh2d->allocateCells(2);
mesh2d->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn);
mesh2d->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+4);
mesh2d->finishInsertingCells();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> myCoords=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> myCoords=DataArrayDouble::New();
myCoords->alloc(nbOfNodes,spaceDim);
std::copy(coords,coords+nbOfNodes*spaceDim,myCoords->getPointer());
mesh2d->setCoords(myCoords);
// create a MedFileUMesh
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m= MEDFileUMesh::New();
+ MCAuto<MEDFileUMesh> m= MEDFileUMesh::New();
m->setMeshAtLevel(0,mesh2d);
// Create families and groups
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> fam = DataArrayInt::New();
+ MCAuto<DataArrayInt> fam = DataArrayInt::New();
fam->alloc(2,1);
int elemsFams[2] = {-2,-3};
std::copy(elemsFams,elemsFams+2,fam->getPointer());
// write to SAUV
const char* sauvFile = "mesh_with_void_family.sauv";
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> medData = MEDFileData::New();
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> medMeshes = MEDFileMeshes::New();
- MEDCouplingAutoRefCountObjectPtr<SauvWriter> sw=SauvWriter::New();
+ MCAuto<MEDFileData> medData = MEDFileData::New();
+ MCAuto<MEDFileMeshes> medMeshes = MEDFileMeshes::New();
+ MCAuto<SauvWriter> sw=SauvWriter::New();
medMeshes->setMeshAtPos(0, m);
medData->setMeshes(medMeshes);
sw->setMEDFileDS(medData);
sw->write(sauvFile);
// read SAUV and check groups
- MEDCouplingAutoRefCountObjectPtr<SauvReader> sr=SauvReader::New(sauvFile);
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> d2=sr->loadInMEDFileDS();
+ MCAuto<SauvReader> sr=SauvReader::New(sauvFile);
+ MCAuto<MEDFileData> d2=sr->loadInMEDFileDS();
MEDFileUMesh* m2 = static_cast<MEDFileUMesh*>( d2->getMeshes()->getMeshAtPos(0) );
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> group1 = m2->getGroup(0, "Group1");
+ MCAuto<MEDCouplingUMesh> group1 = m2->getGroup(0, "Group1");
CPPUNIT_ASSERT_EQUAL(1,(int)group1->getNumberOfCells());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> group2 = m2->getGroup(0, "Group2");
+ MCAuto<MEDCouplingUMesh> group2 = m2->getGroup(0, "Group2");
CPPUNIT_ASSERT_EQUAL(1,(int)group2->getNumberOfCells());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> grptot = m2->getGroup(0, "Grouptot");
+ MCAuto<MEDCouplingUMesh> grptot = m2->getGroup(0, "Grouptot");
CPPUNIT_ASSERT_EQUAL(2,(int)grptot->getNumberOfCells());
}
{
// read SAUV
std::string sauvFile = INTERP_TEST::getResourceFile("portico_3subs.sauv", 3);
- MEDCouplingAutoRefCountObjectPtr<SauvReader> sr=SauvReader::New(sauvFile.c_str());
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> d2=sr->loadInMEDFileDS();
+ MCAuto<SauvReader> sr=SauvReader::New(sauvFile.c_str());
+ MCAuto<MEDFileData> d2=sr->loadInMEDFileDS();
// check mesh
MEDFileUMesh* m2 = static_cast<MEDFileUMesh*>(d2->getMeshes()->getMeshAtPos(0));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh1d = m2->getMeshAtLevel(0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> length1dField = mesh1d->getMeasureField(0);
+ MCAuto<MEDCouplingUMesh> mesh1d = m2->getMeshAtLevel(0);
+ MCAuto<MEDCouplingFieldDouble> length1dField = mesh1d->getMeasureField(0);
std::cout << "Length of 1d elements: " << length1dField->accumulate(0) << std::endl;
CPPUNIT_ASSERT_DOUBLES_EQUAL(3, length1dField->accumulate(0), 1e-12);
// check field
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> field =
+ MCAuto<MEDFileFieldMultiTS> field =
dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName("CHAM1D"));
std::cout << "Number of components in field: " << field->getInfo().size() << std::endl;
CPPUNIT_ASSERT_EQUAL(6,(int)field->getInfo().size());
std::vector< std::pair<int,int> > timesteps = field->getIterations();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field1d =
+ MCAuto<MEDCouplingFieldDouble> field1d =
field->getFieldOnMeshAtLevel(ON_GAUSS_NE, timesteps[0].first, timesteps[0].second, 0, m2);
// Check first component of the field
{
// read pointe.med
std::string file = INTERP_TEST::getResourceFile("pointe.med", 3);
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> pointeMed=MEDFileData::New(file.c_str());
+ MCAuto<MEDFileData> pointeMed=MEDFileData::New(file.c_str());
// add 3 faces to pointeMed
MEDFileUMesh* pointeMedMesh = static_cast<MEDFileUMesh*>(pointeMed->getMeshes()->getMeshAtPos(0));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> pointeM1D = MEDCouplingUMesh::New();
+ MCAuto<MEDCouplingUMesh> pointeM1D = MEDCouplingUMesh::New();
DataArrayDouble *coords = pointeMedMesh->getCoords();
pointeM1D->setCoords( coords );
pointeM1D->setMeshDimension( 2 );
pointeMed->getMeshes()->setMeshAtPos( 0, pointeMedMesh );
// add a field on 2 faces to pointeMed
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ff1=MEDFileFieldMultiTS::New();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=MEDCouplingFieldDouble::New(ON_GAUSS_NE,ONE_TIME);
+ MCAuto<MEDFileFieldMultiTS> ff1=MEDFileFieldMultiTS::New();
+ MCAuto<MEDCouplingFieldDouble> f1=MEDCouplingFieldDouble::New(ON_GAUSS_NE,ONE_TIME);
f1->setMesh( pointeM1D );
f1->setName("Field on 2 faces");
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> d=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> d=DataArrayDouble::New();
d->alloc(3+4,2);
d->setInfoOnComponent(0,"sigX [MPa]");
d->setInfoOnComponent(1,"sigY [GPa]");
};
std::copy(vals,vals+d->getNbOfElems(),d->getPointer());
f1->setArray(d);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=DataArrayInt::New();
+ MCAuto<DataArrayInt> da=DataArrayInt::New();
int ids[] =
{
0,2
MEDFileFields* pointeFields = pointeMed->getFields();
for ( int i = 0; i < pointeFields->getNumberOfFields(); ++i )
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> ts = pointeFields->getFieldAtPos(i);
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ts = pointeFields->getFieldAtPos(i);
if ( std::string("fieldnodeint") == ts->getName())
{
pointeFields->destroyFieldAtPos( i );
}
// write pointeMed to SAUV
const char* sauvFile = "pointe.sauv";
- MEDCouplingAutoRefCountObjectPtr<SauvWriter> sw=SauvWriter::New();
+ MCAuto<SauvWriter> sw=SauvWriter::New();
sw->setMEDFileDS(pointeMed);
sw->write(sauvFile);
// read SAUV and check
- MEDCouplingAutoRefCountObjectPtr<SauvReader> sr=SauvReader::New(sauvFile);
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> d2=sr->loadInMEDFileDS();
+ MCAuto<SauvReader> sr=SauvReader::New(sauvFile);
+ MCAuto<MEDFileData> d2=sr->loadInMEDFileDS();
CPPUNIT_ASSERT_EQUAL(1,d2->getNumberOfMeshes());
CPPUNIT_ASSERT_EQUAL(4,d2->getNumberOfFields());
MEDFileUMesh * m = static_cast<MEDFileUMesh*>( d2->getMeshes()->getMeshAtPos(0) );
CPPUNIT_ASSERT( std::find(groups.begin(),groups.end(),"groupe5") != groups.end() );
CPPUNIT_ASSERT( std::find(groups.begin(),groups.end(),"maa1") != groups.end() );
CPPUNIT_ASSERT_EQUAL(16,m->getSizeAtLevel(0));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> um0 = m->getMeshAtLevel(0);
+ MCAuto<MEDCouplingMesh> um0 = m->getMeshAtLevel(0);
CPPUNIT_ASSERT_EQUAL(12, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TETRA4 ));
CPPUNIT_ASSERT_EQUAL(2, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_PYRA5 ));
CPPUNIT_ASSERT_EQUAL(2, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_HEXA8 ));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> um1 = m->getMeshAtLevel(-1);
+ MCAuto<MEDCouplingMesh> um1 = m->getMeshAtLevel(-1);
CPPUNIT_ASSERT_EQUAL(2, um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 ));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> pointeUM0 =
+ MCAuto<MEDCouplingUMesh> pointeUM0 =
static_cast<MEDCouplingUMesh*>( pointeMedMesh->getMeshAtLevel(0));
DataArrayDouble *coo = m->getCoords();
DataArrayDouble *pointeCoo = pointeMedMesh->getCoords();
CPPUNIT_ASSERT(coo->isEqualWithoutConsideringStr(*pointeCoo,1e-12));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol = um0->getMeasureField(0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> pointeVol = pointeUM0->getMeasureField(0);
+ MCAuto<MEDCouplingFieldDouble> vol = um0->getMeasureField(0);
+ MCAuto<MEDCouplingFieldDouble> pointeVol = pointeUM0->getMeasureField(0);
CPPUNIT_ASSERT_DOUBLES_EQUAL( vol->accumulate(0), pointeVol->accumulate(0),1e-12);
// check fields
// fieldnodedouble
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> fieldnodedoubleTS1 =
+ MCAuto<MEDFileFieldMultiTS> fieldnodedoubleTS1 =
dynamic_cast<MEDFileFieldMultiTS *>(pointeMed->getFields()->getFieldWithName("fieldnodedouble"));
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> fieldnodedoubleTS2 =
+ MCAuto<MEDFileFieldMultiTS> fieldnodedoubleTS2 =
dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName("fieldnodedouble"));
CPPUNIT_ASSERT_EQUAL( fieldnodedoubleTS1->getInfo().size(), fieldnodedoubleTS2->getInfo().size());
for ( size_t i = 0; i < fieldnodedoubleTS1->getInfo().size(); ++i )
std::vector< std::pair<int,int> > io2 = fieldnodedoubleTS2->getIterations();
for ( int i =0; i < fieldnodedoubleTS1->getNumberOfTS(); ++i )
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fnd1 =
+ MCAuto<MEDCouplingFieldDouble> fnd1 =
fieldnodedoubleTS1->getFieldOnMeshAtLevel(ON_NODES, io1[i].first,io1[i].second,pointeUM0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fnd2 =
+ MCAuto<MEDCouplingFieldDouble> fnd2 =
fieldnodedoubleTS2->getFieldOnMeshAtLevel(ON_NODES, io2[i].first,io2[i].second,um0);
CPPUNIT_ASSERT( fnd1->getArray()->isEqual( *fnd2->getArray(), 1e-12 ));
}
// fieldcelldoublevector
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> fieldcelldoublevectorTS1 =
+ MCAuto<MEDFileFieldMultiTS> fieldcelldoublevectorTS1 =
dynamic_cast<MEDFileFieldMultiTS *>(pointeMed->getFields()->getFieldWithName("fieldcelldoublevector"));
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> fieldcelldoublevectorTS2 =
+ MCAuto<MEDFileFieldMultiTS> fieldcelldoublevectorTS2 =
dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName("fieldcelldoublevector"));
CPPUNIT_ASSERT_EQUAL( fieldcelldoublevectorTS1->getInfo().size(), fieldcelldoublevectorTS2->getInfo().size());
for ( size_t i = 0; i < fieldcelldoublevectorTS1->getInfo().size(); ++i )
io2 = fieldcelldoublevectorTS2->getIterations();
for ( int i =0; i < fieldcelldoublevectorTS1->getNumberOfTS(); ++i )
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fnd1 =
+ MCAuto<MEDCouplingFieldDouble> fnd1 =
fieldcelldoublevectorTS1->getFieldOnMeshAtLevel(ON_CELLS, io1[i].first,io1[i].second,pointeUM0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fnd2 =
+ MCAuto<MEDCouplingFieldDouble> fnd2 =
fieldcelldoublevectorTS2->getFieldOnMeshAtLevel(ON_CELLS, io2[i].first,io2[i].second,um0);
CPPUNIT_ASSERT_DOUBLES_EQUAL( fnd1->accumulate(0), fnd2->accumulate(0), 1e-12 );
CPPUNIT_ASSERT_DOUBLES_EQUAL( fnd1->accumulate(1), fnd2->accumulate(1), 1e-12 );
CPPUNIT_ASSERT_DOUBLES_EQUAL( fnd1->accumulate(2), fnd2->accumulate(2), 1e-12 );
}
// "Field on 2 faces"
- MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> fieldOnFaces =
+ MCAuto<MEDFileFieldMultiTS> fieldOnFaces =
dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName(f1->getName().c_str()));
io1 = fieldOnFaces->getIterations();
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fof =
+ MCAuto<MEDCouplingFieldDouble> fof =
fieldOnFaces->getFieldOnMeshAtLevel(f1->getTypeOfField(),io1[0].first,io1[0].second,um1);
CPPUNIT_ASSERT( d->isEqual( *fof->getArray(), 1e-12 ));
}
#include "MEDLoaderTest.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class SauvLoaderTest : public CppUnit::TestFixture
{
#include "CppUnitTest.hxx"
#include "MEDLoaderTest.hxx"
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::MEDLoaderTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDLoaderTest );
#include "BasicMainTest.hxx"
#include "CppUnitTest.hxx"
#include "SauvLoaderTest.hxx"
-CPPUNIT_TEST_SUITE_REGISTRATION( ParaMEDMEM::SauvLoaderTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::SauvLoaderTest );
#include "BasicMainTest.hxx"
#include <map>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDPARTITIONER::ConnectZone::ConnectZone():
_name("")
return _local_domain_number;
}
-ParaMEDMEM::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getLocalMesh() const
+MEDCoupling::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getLocalMesh() const
{
return _local_mesh;
}
-ParaMEDMEM::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getDistantMesh() const
+MEDCoupling::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getDistantMesh() const
{
return _distant_mesh;
}
return _node_corresp->getNumberOf();
}
-const ParaMEDMEM::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getNodeCorresp() const
+const MEDCoupling::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getNodeCorresp() const
{
return _node_corresp;
}
return _face_corresp->getNumberOf();
}
-const ParaMEDMEM::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getFaceCorresp() const
+const MEDCoupling::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getFaceCorresp() const
{
return _face_corresp;
}
return 0;
}
-const ParaMEDMEM::MEDCouplingSkyLineArray *
+const MEDCoupling::MEDCouplingSkyLineArray *
MEDPARTITIONER::ConnectZone::getEntityCorresp(int localEntity, int distantEntity) const
{
typedef std::map<std::pair<int,int>, MEDCouplingSkyLineArray*>::const_iterator map_iter;
_local_domain_number=localDomainNumber;
}
-void MEDPARTITIONER::ConnectZone::setLocalMesh(ParaMEDMEM::MEDCouplingUMesh * localMesh)
+void MEDPARTITIONER::ConnectZone::setLocalMesh(MEDCoupling::MEDCouplingUMesh * localMesh)
{
_local_mesh=localMesh;
}
-void MEDPARTITIONER::ConnectZone::setDistantMesh(ParaMEDMEM::MEDCouplingUMesh * distantMesh)
+void MEDPARTITIONER::ConnectZone::setDistantMesh(MEDCoupling::MEDCouplingUMesh * distantMesh)
{
_distant_mesh=distantMesh;
}
*/
void MEDPARTITIONER::ConnectZone::setNodeCorresp(const int * nodeCorresp, int nbnode)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> indexArr( DataArrayInt::New() );
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> valueArr( DataArrayInt::New() );
+ MCAuto<DataArrayInt> indexArr( DataArrayInt::New() );
+ MCAuto<DataArrayInt> valueArr( DataArrayInt::New() );
indexArr->alloc( nbnode+1 );
valueArr->alloc( 2*nbnode );
int * index = indexArr->getPointer();
*/
void MEDPARTITIONER::ConnectZone::setFaceCorresp(const int * faceCorresp, int nbface)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> indexArr( DataArrayInt::New() );
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> valueArr( DataArrayInt::New() );
+ MCAuto<DataArrayInt> indexArr( DataArrayInt::New() );
+ MCAuto<DataArrayInt> valueArr( DataArrayInt::New() );
indexArr->alloc( nbface+1 );
valueArr->alloc( 2*nbface );
int * index = indexArr->getPointer();
void MEDPARTITIONER::ConnectZone::setEntityCorresp(int localEntity, int distantEntity,
const int *entityCorresp, int nbentity)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> indexArr( DataArrayInt::New() );
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> valueArr( DataArrayInt::New() );
+ MCAuto<DataArrayInt> indexArr( DataArrayInt::New() );
+ MCAuto<DataArrayInt> valueArr( DataArrayInt::New() );
indexArr->alloc( nbentity+1 );
valueArr->alloc( 2*nbentity );
int * index = indexArr->getPointer();
void MEDPARTITIONER::ConnectZone::setEntityCorresp(int localEntity, int distantEntity,
MEDCouplingSkyLineArray *array)
{
- ParaMEDMEM::MEDCouplingSkyLineArray * nullArray = 0;
- std::map < std::pair <int,int>, ParaMEDMEM::MEDCouplingSkyLineArray * >::iterator it;
+ MEDCoupling::MEDCouplingSkyLineArray * nullArray = 0;
+ std::map < std::pair <int,int>, MEDCoupling::MEDCouplingSkyLineArray * >::iterator it;
it = _entity_corresp.insert
( std::make_pair( std::make_pair(localEntity,distantEntity), nullArray )).first;
if ( it->second != nullArray ) delete it->second;
#include "MEDPARTITIONER.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
class MEDCouplingSkyLineArray;
std::string getDescription() const ;
int getDistantDomainNumber() const ;
int getLocalDomainNumber() const ;
- ParaMEDMEM::MEDCouplingUMesh *getLocalMesh() const ;
- ParaMEDMEM::MEDCouplingUMesh *getDistantMesh() const ;
+ MEDCoupling::MEDCouplingUMesh *getLocalMesh() const ;
+ MEDCoupling::MEDCouplingUMesh *getDistantMesh() const ;
bool isEntityCorrespPresent(int localEntity,int distantEntity) const;
const int *getNodeCorrespIndex() const;
const int *getNodeCorrespValue() const;
int getNodeNumber() const;
- const ParaMEDMEM::MEDCouplingSkyLineArray * getNodeCorresp() const;
+ const MEDCoupling::MEDCouplingSkyLineArray * getNodeCorresp() const;
const int *getFaceCorrespIndex() const;
const int *getFaceCorrespValue() const;
int getFaceNumber() const;
- const ParaMEDMEM::MEDCouplingSkyLineArray * getFaceCorresp() const;
+ const MEDCoupling::MEDCouplingSkyLineArray * getFaceCorresp() const;
const int *getEntityCorrespIndex(int localEntity,
int distantEntity) const;
const int *getEntityCorrespValue(int localEntity,
int distantEntity) const;
int getEntityCorrespLength(int localEntity,
int distantEntity) const;
- const ParaMEDMEM::MEDCouplingSkyLineArray * getEntityCorresp(int localEntity,
+ const MEDCoupling::MEDCouplingSkyLineArray * getEntityCorresp(int localEntity,
int distantEntity) const;
std::vector< std::pair< int,int > > getEntities() const;
void setDescription(const std::string& description) ;
void setDistantDomainNumber(int distantDomainNumber) ;
void setLocalDomainNumber(int distantDomainNumber) ;
- void setLocalMesh(ParaMEDMEM::MEDCouplingUMesh * localMesh) ;
- void setDistantMesh(ParaMEDMEM::MEDCouplingUMesh * distantMesh) ;
+ void setLocalMesh(MEDCoupling::MEDCouplingUMesh * localMesh) ;
+ void setDistantMesh(MEDCoupling::MEDCouplingUMesh * distantMesh) ;
void setNodeCorresp(const int * nodeCorresp, int nbnode);
- void setNodeCorresp(ParaMEDMEM::MEDCouplingSkyLineArray* array);
+ void setNodeCorresp(MEDCoupling::MEDCouplingSkyLineArray* array);
void setFaceCorresp(const int * faceCorresp, int nbface);
- void setFaceCorresp(ParaMEDMEM::MEDCouplingSkyLineArray* array);
+ void setFaceCorresp(MEDCoupling::MEDCouplingSkyLineArray* array);
void setEntityCorresp(int localEntity, int distantEntity,
const int * entityCorresp, int nbentity);
void setEntityCorresp(int localEntity, int distantEntity,
- ParaMEDMEM::MEDCouplingSkyLineArray *array);
+ MEDCoupling::MEDCouplingSkyLineArray *array);
private :
std::string _name;
std::string _description;
int _local_domain_number;
int _distant_domain_number;
- ParaMEDMEM::MEDCouplingUMesh * _local_mesh;
- ParaMEDMEM::MEDCouplingUMesh * _distant_mesh;
+ MEDCoupling::MEDCouplingUMesh * _local_mesh;
+ MEDCoupling::MEDCouplingUMesh * _distant_mesh;
- ParaMEDMEM::MEDCouplingSkyLineArray * _node_corresp;
- ParaMEDMEM::MEDCouplingSkyLineArray * _face_corresp;
+ MEDCoupling::MEDCouplingSkyLineArray * _node_corresp;
+ MEDCoupling::MEDCouplingSkyLineArray * _face_corresp;
- std::map < std::pair <int,int>, ParaMEDMEM::MEDCouplingSkyLineArray * > _entity_corresp;
+ std::map < std::pair <int,int>, MEDCoupling::MEDCouplingSkyLineArray * > _entity_corresp;
};
}
# endif
#include <set>
-MEDPARTITIONER::Graph::Graph(ParaMEDMEM::MEDCouplingSkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0)
+MEDPARTITIONER::Graph::Graph(MEDCoupling::MEDCouplingSkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0)
{
}
{
std::set<int> domains;
if ( _partition )
- if ( ParaMEDMEM::DataArrayInt* array = _partition->getValueArray() )
+ if ( MEDCoupling::DataArrayInt* array = _partition->getValueArray() )
{
for ( const int * dom = array->begin(); dom != array->end(); ++dom )
domains.insert( *dom );
#include <string>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingSkyLineArray;
}
Graph(){};
//creates a graph from a SKYLINEARRAY
- Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight=0);
+ Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight=0);
virtual ~Graph();
void setEdgesWeights(int *edgeweight) { _edge_weight=edgeweight; }
// returns nb of domains in _partition
int nbDomains() const;
- const ParaMEDMEM::MEDCouplingSkyLineArray *getGraph() const { return _graph; }
- const ParaMEDMEM::MEDCouplingSkyLineArray *getPartition() const { return _partition; }
+ const MEDCoupling::MEDCouplingSkyLineArray *getGraph() const { return _graph; }
+ const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const { return _partition; }
protected:
- ParaMEDMEM::MEDCouplingSkyLineArray* _graph;
- ParaMEDMEM::MEDCouplingSkyLineArray* _partition;
+ MEDCoupling::MEDCouplingSkyLineArray* _graph;
+ MEDCoupling::MEDCouplingSkyLineArray* _partition;
int* _edge_weight;
int* _cell_weight;
};
int nbproc=_domain_selector->nbProcs();
std::vector<BBTreeOfDim* > bbtree(nbdomain,(BBTreeOfDim*) 0);
std::vector<double* > bbxi(nbdomain,(double*) 0);
- std::vector<ParaMEDMEM::DataArrayInt*> rev(nbdomain,(ParaMEDMEM::DataArrayInt*) 0);
- std::vector<ParaMEDMEM::DataArrayInt*> revIndx(nbdomain,(ParaMEDMEM::DataArrayInt*) 0);
+ std::vector<MEDCoupling::DataArrayInt*> rev(nbdomain,(MEDCoupling::DataArrayInt*) 0);
+ std::vector<MEDCoupling::DataArrayInt*> revIndx(nbdomain,(MEDCoupling::DataArrayInt*) 0);
int meshDim=-1;
int spaceDim=-1;
{
if(!_domain_selector->isMyDomain(mydomain))
continue;
- const ParaMEDMEM::MEDCouplingUMesh* myMesh=_mesh_collection.getMesh(mydomain);
+ const MEDCoupling::MEDCouplingUMesh* myMesh=_mesh_collection.getMesh(mydomain);
meshDim = myMesh->getMeshDimension();
spaceDim= myMesh->getSpaceDimension();
- rev[mydomain] = ParaMEDMEM::DataArrayInt::New();
- revIndx[mydomain] = ParaMEDMEM::DataArrayInt::New();
+ rev[mydomain] = MEDCoupling::DataArrayInt::New();
+ revIndx[mydomain] = MEDCoupling::DataArrayInt::New();
myMesh->getReverseNodalConnectivity(rev[mydomain],revIndx[mydomain]);
double* bbx=new double[2*spaceDim*myMesh->getNumberOfNodes()];
for (int i=0; i<myMesh->getNumberOfNodes()*spaceDim; i++)
{
for (int itarget=0; itarget<nbdomain; itarget++)
{
- const ParaMEDMEM::MEDCouplingUMesh* sourceMesh=_mesh_collection.getMesh(isource);
+ const MEDCoupling::MEDCouplingUMesh* sourceMesh=_mesh_collection.getMesh(isource);
if (_domain_selector->isMyDomain(isource)&&_domain_selector->isMyDomain(itarget))
continue;
if (_domain_selector->isMyDomain(isource))
parallelizer.evaluateMemory();
}
-MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* filedata, int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory):
+MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const MEDCoupling::MEDFileData* filedata, int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory):
_input_collection( 0 ), _output_collection( 0 ), _new_topology( 0 )
{
MyGlobals::_World_Size = 1;
parallelizer.evaluateMemory();
}
-MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* filedata, MEDPARTITIONER ::Graph* graph, bool creates_boundary_faces, bool create_joints, bool mesure_memory):
+MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const MEDCoupling::MEDFileData* filedata, MEDPARTITIONER ::Graph* graph, bool creates_boundary_faces, bool create_joints, bool mesure_memory):
_input_collection( 0 ), _output_collection( 0 ), _new_topology( 0 )
{
MyGlobals::_World_Size = 1;
parallelizer.evaluateMemory();
}
-ParaMEDMEM::MEDFileData* MEDPARTITIONER::MEDPartitioner::getMEDFileData()
+MEDCoupling::MEDFileData* MEDPARTITIONER::MEDPartitioner::getMEDFileData()
{
return _output_collection->retrieveDriver()->getMEDFileData();
}
-MEDPARTITIONER::Graph* MEDPARTITIONER::MEDPartitioner::Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split, int* edgeweight)
+MEDPARTITIONER::Graph* MEDPARTITIONER::MEDPartitioner::Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split, int* edgeweight)
{
MEDPARTITIONER::Graph* cellGraph=0;
- ParaMEDMEM::MEDCouplingSkyLineArray* arr = new ParaMEDMEM::MEDCouplingSkyLineArray(graph->getIndexArray(), graph->getValueArray());
+ MEDCoupling::MEDCouplingSkyLineArray* arr = new MEDCoupling::MEDCouplingSkyLineArray(graph->getIndexArray(), graph->getValueArray());
switch (split)
{
case Graph::METIS:
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileData;
}
{
public:
MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
- MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
- MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
- static MEDPARTITIONER::Graph* Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0);
+ MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
+ MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
+ static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0);
void write(const std::string& filename);
- ParaMEDMEM::MEDFileData* getMEDFileData();
+ MEDCoupling::MEDFileData* getMEDFileData();
~MEDPartitioner();
- ParaMEDMEM::MEDFileData *convertToMEDFileData(MeshCollection* meshcollection);
+ MEDCoupling::MEDFileData *convertToMEDFileData(MeshCollection* meshcollection);
void createPartitionCollection(int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory);
private:
#include "MEDPARTITIONER_JointFinder.hxx"
#endif
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingNormalizedUnstructuredMesh.hxx"
_joint_finder(0)
{
std::vector<std::vector<std::vector<int> > > new2oldIds(initialCollection.getTopology()->nbDomain());
- std::vector<ParaMEDMEM::DataArrayInt*> o2nRenumber;
+ std::vector<MEDCoupling::DataArrayInt*> o2nRenumber;
castCellMeshes(initialCollection, new2oldIds, o2nRenumber );
void MEDPARTITIONER::MeshCollection::castCellMeshes(MeshCollection& initialCollection,
std::vector<std::vector<std::vector<int> > >& new2oldIds,
- std::vector<ParaMEDMEM::DataArrayInt*> & o2nRenumber)
+ std::vector<MEDCoupling::DataArrayInt*> & o2nRenumber)
{
if (MyGlobals::_Verbose>10)
std::cout << "proc " << MyGlobals::_Rank << " : castCellMeshes" << std::endl;
o2nRenumber.resize(nbNewDomain,0);
int rank=MyGlobals::_Rank;
//splitting the initial domains into smaller bits
- std::vector<std::vector<ParaMEDMEM::MEDCouplingUMesh*> > splitMeshes;
+ std::vector<std::vector<MEDCoupling::MEDCouplingUMesh*> > splitMeshes;
splitMeshes.resize(nbNewDomain);
for (int inew=0; inew<nbNewDomain; inew++)
{
- splitMeshes[inew].resize(nbOldDomain, (ParaMEDMEM::MEDCouplingUMesh*)0);
+ splitMeshes[inew].resize(nbOldDomain, (MEDCoupling::MEDCouplingUMesh*)0);
}
for (int iold=0; iold<nbOldDomain; iold++)
}
for (int inew=0; inew<nbNewDomain; inew++)
{
- splitMeshes[inew][iold]=(ParaMEDMEM::MEDCouplingUMesh*)
+ splitMeshes[inew][iold]=(MEDCoupling::MEDCouplingUMesh*)
(initialCollection.getMesh())[iold]->buildPartOfMySelf(&new2oldIds[iold][inew][0],
&new2oldIds[iold][inew][0]+new2oldIds[iold][inew].size(),
true);
std::cout << "proc " << rank << " : castCellMeshes fusing" << std::endl;
for (int inew=0; inew<nbNewDomain ;inew++)
{
- std::vector<const ParaMEDMEM::MEDCouplingUMesh*> meshes;
+ std::vector<const MEDCoupling::MEDCouplingUMesh*> meshes;
for (int i=0; i<(int)splitMeshes[inew].size(); i++)
if (splitMeshes[inew][i]!=0)
}
else
{
- _mesh[inew]=ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes(meshes);
+ _mesh[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshes(meshes);
o2nRenumber[inew]=_mesh[inew]->sortCellsInMEDFileFrmt();
bool areNodesMerged;
int nbNodesMerged;
if (meshes.size()>1)
{
- ParaMEDMEM::DataArrayInt* array=_mesh[inew]->mergeNodes(1e-12,areNodesMerged,nbNodesMerged);
+ MEDCoupling::DataArrayInt* array=_mesh[inew]->mergeNodes(1e-12,areNodesMerged,nbNodesMerged);
array->decrRef(); // array is not used in this case
}
_mesh[inew]->zipCoords();
if (!isParallelMode() || (_domain_selector->isMyDomain(iold)))
{
// std::map<pair<double,pair<double, double> >, int > nodeClassifier;
- ParaMEDMEM::DataArrayDouble* coords = initialCollection.getMesh(iold)->getCoords();
+ MEDCoupling::DataArrayDouble* coords = initialCollection.getMesh(iold)->getCoords();
double* coordsPtr=coords->getPointer();
dim = coords->getNumberOfComponents();
int nvertices=initialCollection.getMesh(iold)->getNumberOfNodes();
_domain_selector->sendMesh(*(getMesh(inew)), _domain_selector->getProcessorID(iold));
else if (isParallelMode() && !_domain_selector->isMyDomain(inew)&& _domain_selector->isMyDomain(iold))
{
- ParaMEDMEM::MEDCouplingUMesh* mesh;
+ MEDCoupling::MEDCouplingUMesh* mesh;
_domain_selector->recvMesh(mesh, _domain_selector->getProcessorID(inew));
- ParaMEDMEM::DataArrayDouble* coords = mesh->getCoords();
+ MEDCoupling::DataArrayDouble* coords = mesh->getCoords();
for (int inode=0; inode<mesh->getNumberOfNodes();inode++)
{
double* coordsPtr=coords->getPointer()+inode*dim;
if (!isParallelMode() || (_domain_selector->isMyDomain(inew) && _domain_selector->isMyDomain(iold)))
#endif
{
- ParaMEDMEM::DataArrayDouble* coords = getMesh(inew)->getCoords();
+ MEDCoupling::DataArrayDouble* coords = getMesh(inew)->getCoords();
for (int inode=0; inode<_mesh[inew]->getNumberOfNodes();inode++)
{
double* coordsPtr=coords->getPointer()+inode*dim;
}
-void getNodeIds(ParaMEDMEM::MEDCouplingUMesh& meshOne, ParaMEDMEM::MEDCouplingUMesh& meshTwo, std::vector<int>& nodeIds)
+void getNodeIds(MEDCoupling::MEDCouplingUMesh& meshOne, MEDCoupling::MEDCouplingUMesh& meshTwo, std::vector<int>& nodeIds)
{
using std::vector;
using MEDPARTITIONER::BBTreeOfDim;
double* bbox;
BBTreeOfDim* tree = 0;
int nv1=meshOne.getNumberOfNodes();
- ParaMEDMEM::DataArrayDouble* coords=meshOne.getCoords();
+ MEDCoupling::DataArrayDouble* coords=meshOne.getCoords();
int dim = coords->getNumberOfComponents();
bbox=new double[nv1*2*dim];
int nbNewDomain=_topology->nbDomain();
int nbOldDomain=initialCollection.getTopology()->nbDomain();
- vector<ParaMEDMEM::MEDCouplingUMesh*>& meshesCastFrom=initialCollection.getFaceMesh();
- vector<ParaMEDMEM::MEDCouplingUMesh*>& meshesCastTo=this->getFaceMesh();
+ vector<MEDCoupling::MEDCouplingUMesh*>& meshesCastFrom=initialCollection.getFaceMesh();
+ vector<MEDCoupling::MEDCouplingUMesh*>& meshesCastTo=this->getFaceMesh();
- vector< vector<ParaMEDMEM::MEDCouplingUMesh*> > splitMeshes;
+ vector< vector<MEDCoupling::MEDCouplingUMesh*> > splitMeshes;
splitMeshes.resize(nbNewDomain);
for (int inew=0; inew<nbNewDomain; inew++)
{
- splitMeshes[inew].resize(nbOldDomain, (ParaMEDMEM::MEDCouplingUMesh*)0);
+ splitMeshes[inew].resize(nbOldDomain, (MEDCoupling::MEDCouplingUMesh*)0);
}
new2oldIds.resize(nbOldDomain);
for (int iold=0; iold<nbOldDomain; iold++) new2oldIds[iold].resize(nbNewDomain);
if (meshesCastFrom[iold]->getNumberOfCells() > 0)
{
splitMeshes[inew][iold]=
- (ParaMEDMEM::MEDCouplingUMesh*)
+ (MEDCoupling::MEDCouplingUMesh*)
( meshesCastFrom[iold]->buildPartOfMySelf(&new2oldIds[iold][inew][0],
&new2oldIds[iold][inew][0]+new2oldIds[iold][inew].size(),
true)
//send/receive stuff
if (isParallelMode())
{
- ParaMEDMEM::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh();
+ MEDCoupling::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh();
for (int iold=0; iold<nbOldDomain; iold++)
for (int inew=0; inew<nbNewDomain; inew++)
{
meshesCastTo.resize(nbNewDomain);
for (int inew=0; inew<nbNewDomain; inew++)
{
- vector<const ParaMEDMEM::MEDCouplingUMesh*> myMeshes;
+ vector<const MEDCoupling::MEDCouplingUMesh*> myMeshes;
for (int iold=0; iold<nbOldDomain; iold++)
{
- ParaMEDMEM::MEDCouplingUMesh *umesh=splitMeshes[inew][iold];
+ MEDCoupling::MEDCouplingUMesh *umesh=splitMeshes[inew][iold];
if (umesh!=0)
if (umesh->getNumberOfCells()>0)
myMeshes.push_back(umesh);
}
- ParaMEDMEM::MEDCouplingUMesh *bndMesh = 0;
+ MEDCoupling::MEDCouplingUMesh *bndMesh = 0;
if ( _subdomain_boundary_creates &&
_mesh[inew] &&
_mesh[inew]->getNumberOfCells()>0 )
{
bndMesh =
- ((ParaMEDMEM::MEDCouplingUMesh *)_mesh[inew]->buildBoundaryMesh(/*keepCoords=*/true));
+ ((MEDCoupling::MEDCouplingUMesh *)_mesh[inew]->buildBoundaryMesh(/*keepCoords=*/true));
if (bndMesh->getNumberOfCells()>0)
myMeshes.push_back( bndMesh );
}
if (myMeshes.size()>0)
{
- meshesCastTo[inew]=ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes(myMeshes);
+ meshesCastTo[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshes(myMeshes);
meshesCastTo[inew]->sortCellsInMEDFileFrmt()->decrRef();
}
else
{
- ParaMEDMEM::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh();
+ MEDCoupling::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh();
meshesCastTo[inew]=empty;
}
for (int iold=0; iold<nbOldDomain; iold++)
-void MEDPARTITIONER::MeshCollection::castIntField(std::vector<ParaMEDMEM::MEDCouplingUMesh*>& meshesCastFrom,
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>& meshesCastTo,
- std::vector<ParaMEDMEM::DataArrayInt*>& arrayFrom,
+void MEDPARTITIONER::MeshCollection::castIntField(std::vector<MEDCoupling::MEDCouplingUMesh*>& meshesCastFrom,
+ std::vector<MEDCoupling::MEDCouplingUMesh*>& meshesCastTo,
+ std::vector<MEDCoupling::DataArrayInt*>& arrayFrom,
std::string nameArrayTo)
{
using std::vector;
if (MyGlobals::_Verbose>99)
std::cout<<"making accelerating structures"<<std::endl;
std::vector<BBTreeOfDim* > acceleratingStructures(ioldMax);
- std::vector<ParaMEDMEM::DataArrayDouble*>bbox(ioldMax);
+ std::vector<MEDCoupling::DataArrayDouble*>bbox(ioldMax);
for (int iold =0; iold< ioldMax; iold++)
if (isParallelMode() && _domain_selector->isMyDomain(iold))
{
- ParaMEDMEM::DataArrayDouble* sourceCoords=meshesCastFrom[iold]->getBarycenterAndOwner();
+ MEDCoupling::DataArrayDouble* sourceCoords=meshesCastFrom[iold]->computeCellCenterOfMass();
bbox[iold]=sourceCoords->computeBBoxPerTuple(1.e-6);
acceleratingStructures[iold]=new BBTreeOfDim( sourceCoords->getNumberOfComponents(), bbox[iold]->getConstPointer(),0,0,bbox[iold]->getNumberOfTuples());
sourceCoords->decrRef();
{
//receive mesh
vector<int> recvIds;
- ParaMEDMEM::MEDCouplingUMesh* recvMesh;
+ MEDCoupling::MEDCouplingUMesh* recvMesh;
_domain_selector->recvMesh(recvMesh,_domain_selector->getProcessorID(iold));
//receive vector
if (MyGlobals::_Verbose>400) std::cout<<"proc "<<_domain_selector->rank()<<" : castIntField recIntVec "<<std::endl;
}
void MEDPARTITIONER::MeshCollection::remapIntField(int inew, int iold,
- const ParaMEDMEM::MEDCouplingUMesh& sourceMesh,
- const ParaMEDMEM::MEDCouplingUMesh& targetMesh,
+ const MEDCoupling::MEDCouplingUMesh& sourceMesh,
+ const MEDCoupling::MEDCouplingUMesh& targetMesh,
const int* fromArray,
std::string nameArrayTo,
const BBTreeOfDim* myTree)
{
if (sourceMesh.getNumberOfCells()<=0) return; //empty mesh could exist
- ParaMEDMEM::DataArrayDouble* targetCoords=targetMesh.getBarycenterAndOwner();
+ MEDCoupling::DataArrayDouble* targetCoords=targetMesh.computeCellCenterOfMass();
const double* tc=targetCoords->getConstPointer();
int targetSize=targetMesh.getNumberOfCells();
int sourceSize=sourceMesh.getNumberOfCells();
const BBTreeOfDim* tree;
bool cleantree=false;
- ParaMEDMEM::DataArrayDouble* sourceBBox=0;
+ MEDCoupling::DataArrayDouble* sourceBBox=0;
int dim = targetCoords->getNumberOfComponents();
if (myTree==0)
{
- sourceBBox=sourceMesh.getBarycenterAndOwner()->computeBBoxPerTuple(1e-8);
+ sourceBBox=sourceMesh.computeCellCenterOfMass()->computeBBoxPerTuple(1e-8);
tree=new BBTreeOfDim( dim, sourceBBox->getConstPointer(),0,0, sourceBBox->getNumberOfTuples(),1e-10);
cleantree=true;
}
{
if (MyGlobals::_Is0verbose>100)
std::cout << "create " << cle << " size " << targetSize << std::endl;
- ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New();
p->alloc(targetSize,1);
p->fillWithZero();
toArray=p->getPointer();
if (isParallelMode() && _domain_selector->isMyDomain(iold) && !_domain_selector->isMyDomain(inew))
{
int target=_domain_selector->getProcessorID(inew);
- ParaMEDMEM::DataArrayDouble* field=initialCollection.getField(descriptionField,iold);
+ MEDCoupling::DataArrayDouble* field=initialCollection.getField(descriptionField,iold);
if (MyGlobals::_Verbose>10)
std::cout << "proc " << _domain_selector->rank() << " : castAllFields sendDouble" << std::endl;
SendDataArrayDouble(field, target);
//receive vector
if (MyGlobals::_Verbose>10)
std::cout << "proc " << _domain_selector->rank() << " : castAllFields recvDouble" << std::endl;
- ParaMEDMEM::DataArrayDouble* field=RecvDataArrayDouble(source);
+ MEDCoupling::DataArrayDouble* field=RecvDataArrayDouble(source);
remapDoubleField(inew,iold,field,nameArrayTo,descriptionField);
}
}
for (int iold=0; iold<ioldMax; iold++)
if (!isParallelMode() || ( _domain_selector->isMyDomain(iold) && _domain_selector->isMyDomain(inew)))
{
- ParaMEDMEM::DataArrayDouble* field=initialCollection.getField(descriptionField,iold);
+ MEDCoupling::DataArrayDouble* field=initialCollection.getField(descriptionField,iold);
remapDoubleField(inew,iold,field,nameArrayTo,descriptionField);
}
}
}
void MEDPARTITIONER::MeshCollection::remapDoubleField(int inew, int iold,
- ParaMEDMEM::DataArrayDouble* fromArray,
+ MEDCoupling::DataArrayDouble* fromArray,
std::string nameArrayTo,
std::string descriptionField)
//here we use 'cellFamily_ccI inew iold' set in remapIntField
throw INTERP_KERNEL::Exception("Error remapDoubleField only on cellFieldDouble");
std::string key=Cle2ToStr("cellFamily_ccI",inew,iold);
- std::map<std::string,ParaMEDMEM::DataArrayInt*>::iterator it1;
+ std::map<std::string,MEDCoupling::DataArrayInt*>::iterator it1;
it1=_map_dataarray_int.find(key);
if (it1==_map_dataarray_int.end())
{
return;
}
//create ccI in remapIntField
- ParaMEDMEM::DataArrayInt *ccI=it1->second;
+ MEDCoupling::DataArrayInt *ccI=it1->second;
if (MyGlobals::_Verbose>300)
std::cout << "proc " << MyGlobals::_Rank << " : remapDoubleField " << key << " size " << ccI->getNbOfElems() << std::endl;
" nbComponents " << fromArray->getNumberOfComponents() << std::endl;
}
- ParaMEDMEM::DataArrayDouble* field=0;
- std::map<std::string,ParaMEDMEM::DataArrayDouble*>::iterator it2;
+ MEDCoupling::DataArrayDouble* field=0;
+ std::map<std::string,MEDCoupling::DataArrayDouble*>::iterator it2;
it2=_map_dataarray_double.find(key);
if (it2==_map_dataarray_double.end())
{
if (MyGlobals::_Verbose>300)
std::cout << "proc "<< MyGlobals::_Rank << " : remapDoubleField key '" << key << "' not found and create it" << std::endl;
- field=ParaMEDMEM::DataArrayDouble::New();
+ field=MEDCoupling::DataArrayDouble::New();
_map_dataarray_double[key]=field;
field->alloc(nbcell*nbPtGauss,nbcomp);
field->fillWithZero();
namespace
{
- using namespace ParaMEDMEM;
+ using namespace MEDCoupling;
//================================================================================
/*!
* \brief Sort correspondence ids of one domain and permute ids of the other accordingly
bool removeEqual = false)
{
// sort
- MEDCouplingAutoRefCountObjectPtr< DataArrayInt > renumN2O = ids1->buildPermArrPerLevel();
+ MCAuto< DataArrayInt > renumN2O = ids1->buildPermArrPerLevel();
ids1->renumberInPlaceR( renumN2O->begin() );
ids2->renumberInPlaceR( renumN2O->begin() );
//================================================================================
void MEDPARTITIONER::MeshCollection::buildConnectZones( const NodeMapping& nodeMapping,
- const std::vector<ParaMEDMEM::DataArrayInt*> & o2nRenumber,
+ const std::vector<MEDCoupling::DataArrayInt*> & o2nRenumber,
int nbInitialDomains)
{
if ( !MyGlobals::_Create_Joints || _topology->nbDomain() < 2 )
cz->getLocalDomainNumber () > (int)_mesh.size() ||
cz->getDistantDomainNumber() > (int)_mesh.size() )
continue;
- ParaMEDMEM::MEDCouplingUMesh* mesh1 = _mesh[ cz->getLocalDomainNumber () ];
- ParaMEDMEM::MEDCouplingUMesh* mesh2 = _mesh[ cz->getDistantDomainNumber() ];
+ MEDCoupling::MEDCouplingUMesh* mesh1 = _mesh[ cz->getLocalDomainNumber () ];
+ MEDCoupling::MEDCouplingUMesh* mesh2 = _mesh[ cz->getDistantDomainNumber() ];
// separate ids of two domains
- const ParaMEDMEM::MEDCouplingSkyLineArray *corrArray = cz->getEntityCorresp( 0, 0 );
+ const MEDCoupling::MEDCouplingSkyLineArray *corrArray = cz->getEntityCorresp( 0, 0 );
const DataArrayInt* ids12 = corrArray->getValueArray();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids1, ids2, ids12Sorted;
- ids1 = ids12->selectByTupleId2( 0, corrArray->getLength(), 2 );
- ids2 = ids12->selectByTupleId2( 1, corrArray->getLength(), 2 );
+ MCAuto<DataArrayInt> ids1, ids2, ids12Sorted;
+ ids1 = ids12->selectByTupleIdSafeSlice( 0, corrArray->getLength(), 2 );
+ ids2 = ids12->selectByTupleIdSafeSlice( 1, corrArray->getLength(), 2 );
// renumber cells according to mesh->sortCellsInMEDFileFrmt()
renumber( ids1, o2nRenumber[ cz->getLocalDomainNumber() ]);
cz21 = czVec[j];
// separate ids of two domains
- const ParaMEDMEM::MEDCouplingSkyLineArray *corrArray = cz->getNodeCorresp();
+ const MEDCoupling::MEDCouplingSkyLineArray *corrArray = cz->getNodeCorresp();
const DataArrayInt *ids12 = corrArray->getValueArray();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ids1, ids2, ids12Sorted;
- ids1 = ids12->selectByTupleId2( 0, corrArray->getLength(), 2 );
- ids2 = ids12->selectByTupleId2( 1, corrArray->getLength(), 2 );
+ MCAuto<DataArrayInt> ids1, ids2, ids12Sorted;
+ ids1 = ids12->selectByTupleIdSafeSlice( 0, corrArray->getLength(), 2 );
+ ids2 = ids12->selectByTupleIdSafeSlice( 1, corrArray->getLength(), 2 );
ids12Sorted = sortCorrespondences( ids1, ids2, /*delta=*/0, removeEqual );
cz->setNodeCorresp( ids12Sorted->begin(), ids12Sorted->getNbOfElems() / 2 );
if ( getMeshDimension() < 2 )
return;
- using ParaMEDMEM::MEDCouplingUMesh;
- using ParaMEDMEM::DataArrayDouble;
- using ParaMEDMEM::DataArrayInt;
+ using MEDCoupling::MEDCouplingUMesh;
+ using MEDCoupling::DataArrayDouble;
+ using MEDCoupling::DataArrayInt;
std::vector<MEDCouplingUMesh*>& faceMeshes = getFaceMesh();
int nbMeshes = faceMeshes.size();
for (int inew = 0; inew < nbMeshes-1; inew++)
if ( !isParallelMode() || _domain_selector->isMyDomain(inew) )
{
- DataArrayDouble* bcCoords = faceMeshes[inew]->getBarycenterAndOwner();
+ DataArrayDouble* bcCoords = faceMeshes[inew]->computeCellCenterOfMass();
bbox [inew] = bcCoords->computeBBoxPerTuple(1.e-6);
bbTrees[inew] = new BBTreeOfDim( bcCoords->getNumberOfComponents(),
bbox[inew]->getConstPointer(),0,0,
std::vector< int > faces1, faces2;
if ( mesh1 && mesh2 )
{
- const DataArrayDouble* coords2 = mesh2->getBarycenterAndOwner();
+ const DataArrayDouble* coords2 = mesh2->computeCellCenterOfMass();
const double* c2 = coords2->getConstPointer();
const int dim = coords2->getNumberOfComponents();
const int nbFaces2 = mesh2->getNumberOfCells();
{
if ( totalNbFaces > 0 )
{
- ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New();
p->alloc( totalNbFaces, 1 );
p->fillWithZero();
famIDs = p->getPointer();
</mesh>\n \
</mapping>\n \
</root>\n";
- std::vector<std::string> meshNames=MEDLoader::GetMeshNames(myfile);
+ std::vector<std::string> meshNames=GetMeshNames(myfile);
xml.replace(xml.find("$fileName"),9,myfile);
xml.replace(xml.find("$meshName"),9,meshNames[0]);
xml.replace(xml.find("$meshName"),9,meshNames[0]);
if (_face_family_ids[i]!=0)
_face_family_ids[i]->decrRef();
- for (std::map<std::string, ParaMEDMEM::DataArrayInt*>::iterator it=_map_dataarray_int.begin() ; it!=_map_dataarray_int.end(); it++ )
+ for (std::map<std::string, MEDCoupling::DataArrayInt*>::iterator it=_map_dataarray_int.begin() ; it!=_map_dataarray_int.end(); it++ )
if ((*it).second!=0)
(*it).second->decrRef();
- for (std::map<std::string, ParaMEDMEM::DataArrayDouble*>::iterator it=_map_dataarray_double.begin() ; it!=_map_dataarray_double.end(); it++ )
+ for (std::map<std::string, MEDCoupling::DataArrayDouble*>::iterator it=_map_dataarray_double.begin() ; it!=_map_dataarray_double.end(); it++ )
if ((*it).second!=0)
(*it).second->decrRef();
return nb;
}
-std::vector<ParaMEDMEM::MEDCouplingUMesh*>& MEDPARTITIONER::MeshCollection::getMesh()
+std::vector<MEDCoupling::MEDCouplingUMesh*>& MEDPARTITIONER::MeshCollection::getMesh()
{
return _mesh;
}
-std::vector<ParaMEDMEM::MEDCouplingUMesh*>& MEDPARTITIONER::MeshCollection::getFaceMesh()
+std::vector<MEDCoupling::MEDCouplingUMesh*>& MEDPARTITIONER::MeshCollection::getFaceMesh()
{
return _face_mesh;
}
-ParaMEDMEM::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getMesh(int idomain) const
+MEDCoupling::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getMesh(int idomain) const
{
return _mesh[idomain];
}
-ParaMEDMEM::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getFaceMesh(int idomain)
+MEDCoupling::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getFaceMesh(int idomain)
{
return _face_mesh[idomain];
}
* \param edgeweight returns the pointer to the table that contains the edgeweights
* (only used if indivisible regions are required)
*/
-void MEDPARTITIONER::MeshCollection::buildCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array, int *& edgeweights )
+void MEDPARTITIONER::MeshCollection::buildCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array, int *& edgeweights )
{
using std::map;
using std::pair;
if (_topology->nbDomain()>1) throw INTERP_KERNEL::Exception("buildCellGraph should be used for one domain only");
- const ParaMEDMEM::MEDCouplingUMesh* mesh=_mesh[0];
+ const MEDCoupling::MEDCouplingUMesh* mesh=_mesh[0];
if (MyGlobals::_Verbose>50)
std::cout<<"getting nodal connectivity"<<std::endl;
vector<int> value;
vector<int> index(1,0);
- array=new ParaMEDMEM::MEDCouplingSkyLineArray(index,value);
+ array=new MEDCoupling::MEDCouplingSkyLineArray(index,value);
return;
}
array=mesh->generateGraph();
* \param edgeweight returns the pointer to the table that contains the edgeweights
* (only used if indivisible regions are required)
*/
-void MEDPARTITIONER::MeshCollection::buildParallelCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array, int *& edgeweights )
+void MEDPARTITIONER::MeshCollection::buildParallelCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array, int *& edgeweights )
{
using std::multimap;
using std::vector;
continue;
meshDim = _mesh[idomain]->getMeshDimension();
- ParaMEDMEM::DataArrayInt* index=ParaMEDMEM::DataArrayInt::New();
- ParaMEDMEM::DataArrayInt* revConn=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* index=MEDCoupling::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* revConn=MEDCoupling::DataArrayInt::New();
int nbNodes=_mesh[idomain]->getNumberOfNodes();
_mesh[idomain]->getReverseNodalConnectivity(revConn,index);
//problem saturation over 1 000 000 nodes for 1 proc
}
}
- array=new ParaMEDMEM::MEDCouplingSkyLineArray(index,value);
+ array=new MEDCoupling::MEDCouplingSkyLineArray(index,value);
if (MyGlobals::_Verbose>100)
{
if (nbdomain <1)
throw INTERP_KERNEL::Exception("Number of subdomains must be > 0");
- ParaMEDMEM::MEDCouplingSkyLineArray* array=0;
+ MEDCoupling::MEDCouplingSkyLineArray* array=0;
int* edgeweights=0;
if (_topology->nbDomain()>1 || isParallelMode())
*/
MEDPARTITIONER::Topology* MEDPARTITIONER::MeshCollection::createPartition(const int* partition)
{
- ParaMEDMEM::MEDCouplingSkyLineArray* array=0;
+ MEDCoupling::MEDCouplingSkyLineArray* array=0;
int* edgeweights=0;
if ( _topology->nbDomain()>1)
}
}
-ParaMEDMEM::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::string descriptionField, int iold)
+MEDCoupling::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::string descriptionField, int iold)
//getField look for and read it if not done, and assume decrRef() in ~MeshCollection;
-//something like MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(name,f1->getMesh()->getName(),0,f1->getName(),0,1);
+//something like MEDCouplingFieldDouble *f2=ReadFieldCell(name,f1->getMesh()->getName(),0,f1->getName(),0,1);
{
int rank=MyGlobals::_Rank;
std::string tag="ioldFieldDouble="+IntToStr(iold);
{
if (MyGlobals::_Verbose>300)
std::cout << "proc " << rank << " : YET READ getField : " << descriptionIold << std::endl;
- ParaMEDMEM::DataArrayDouble* res=_map_dataarray_double[descriptionIold];
+ MEDCoupling::DataArrayDouble* res=_map_dataarray_double[descriptionIold];
return res;
}
if (MyGlobals::_Verbose>200)
FieldShortDescriptionToData(descriptionIold, fieldName, typeField, entity, DT, IT);
meshName=MyGlobals::_Mesh_Names[iold];
- ParaMEDMEM::MEDCouplingFieldDouble* f2=MEDLoader::ReadField((ParaMEDMEM::TypeOfField) typeField,
- fileName, meshName, 0, fieldName, DT, IT);
+ MEDCoupling::MEDCouplingFieldDouble* f2=ReadField((MEDCoupling::TypeOfField) typeField,
+ fileName, meshName, 0, fieldName, DT, IT);
- ParaMEDMEM::DataArrayDouble* res=f2->getArray();
+ MEDCoupling::DataArrayDouble* res=f2->getArray();
//to know names of components
std::vector<std::string> browse=BrowseFieldDouble(f2);
std::string localFieldInformation=descriptionIold+SerializeFromVectorOfString(browse);
{
if (MyGlobals::_Verbose>200)
std::cout << "proc " << MyGlobals::_Rank << " : filterFaceOnCell on inewDomain " << inew << " nbOfFaces " << _face_mesh[inew]->getNumberOfCells() << std::endl;
- ParaMEDMEM::MEDCouplingUMesh* mcel=_mesh[inew];
- ParaMEDMEM::MEDCouplingUMesh* mfac=_face_mesh[inew];
+ MEDCoupling::MEDCouplingUMesh* mcel=_mesh[inew];
+ MEDCoupling::MEDCouplingUMesh* mfac=_face_mesh[inew];
//to have cellnode=f(facenode)... inodeCell=nodeIds[inodeFace]
std::vector<int> nodeIds;
if (nodeIds.size()==0)
continue; //one empty mesh nothing to do
- ParaMEDMEM::DataArrayInt *revNodalCel=ParaMEDMEM::DataArrayInt::New();
- ParaMEDMEM::DataArrayInt *revNodalIndxCel=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt *revNodalCel=MEDCoupling::DataArrayInt::New();
+ MEDCoupling::DataArrayInt *revNodalIndxCel=MEDCoupling::DataArrayInt::New();
mcel->getReverseNodalConnectivity(revNodalCel,revNodalIndxCel);
int *revC=revNodalCel->getPointer();
int *revIndxC=revNodalIndxCel->getPointer();
if ( faceOnCell.empty() )
_face_mesh[inew] = CreateEmptyMEDCouplingUMesh();
else
- _face_mesh[inew] = (ParaMEDMEM::MEDCouplingUMesh *)
+ _face_mesh[inew] = (MEDCoupling::MEDCouplingUMesh *)
mfac->buildPartOfMySelf( &faceOnCell[0], &faceOnCell[0] + faceOnCell.size(),true);
mfac->decrRef();
std::string key = Cle1ToStr("faceFamily_toArray",inew);
if ( getMapDataArrayInt().count( key ))
{
- ParaMEDMEM::DataArrayInt * & fam = getMapDataArrayInt()[ key ];
- ParaMEDMEM::DataArrayInt * famFilter = ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt * & fam = getMapDataArrayInt()[ key ];
+ MEDCoupling::DataArrayInt * famFilter = MEDCoupling::DataArrayInt::New();
famFilter->alloc(faceOnCell.size(),1);
int* pfamFilter = famFilter->getPointer();
int* pfam = fam->getPointer();
#include "BBTree.txx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
class DataArrayInt;
void setDriverType(MEDPARTITIONER::DriverType type) { _driver_type=type; }
//creation of the cell graph
- void buildCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array,int *& edgeweights );
+ void buildCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array,int *& edgeweights );
//creation of the cell graph
- void buildParallelCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array,int *& edgeweights );
+ void buildParallelCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array,int *& edgeweights );
//creation and partition of the associated graph
Topology* createPartition(int nbdomain, Graph::splitter_type type = Graph::METIS,
int getNbOfLocalFaces() const;
//getting a reference to mesh vector
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>& getMesh();
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>& getFaceMesh();
- std::vector<std::vector<ParaMEDMEM::MEDCouplingUMesh*> >& getGroupMeshes();
+ std::vector<MEDCoupling::MEDCouplingUMesh*>& getMesh();
+ std::vector<MEDCoupling::MEDCouplingUMesh*>& getFaceMesh();
+ std::vector<std::vector<MEDCoupling::MEDCouplingUMesh*> >& getGroupMeshes();
- ParaMEDMEM::MEDCouplingUMesh* getMesh(int idomain) const;
- ParaMEDMEM::MEDCouplingUMesh* getFaceMesh(int idomain);
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>& getGroupMeshes(int idomain);
+ MEDCoupling::MEDCouplingUMesh* getMesh(int idomain) const;
+ MEDCoupling::MEDCouplingUMesh* getFaceMesh(int idomain);
+ std::vector<MEDCoupling::MEDCouplingUMesh*>& getGroupMeshes(int idomain);
- std::vector<ParaMEDMEM::DataArrayInt*>& getCellFamilyIds() { return _cell_family_ids; }
- std::vector<ParaMEDMEM::DataArrayInt*>& getFaceFamilyIds() { return _face_family_ids; }
+ std::vector<MEDCoupling::DataArrayInt*>& getCellFamilyIds() { return _cell_family_ids; }
+ std::vector<MEDCoupling::DataArrayInt*>& getFaceFamilyIds() { return _face_family_ids; }
- std::map<std::string, ParaMEDMEM::DataArrayInt*>& getMapDataArrayInt() { return _map_dataarray_int; }
- std::map<std::string, ParaMEDMEM::DataArrayDouble*>& getMapDataArrayDouble() { return _map_dataarray_double; }
+ std::map<std::string, MEDCoupling::DataArrayInt*>& getMapDataArrayInt() { return _map_dataarray_int; }
+ std::map<std::string, MEDCoupling::DataArrayDouble*>& getMapDataArrayDouble() { return _map_dataarray_double; }
std::map<std::string,int>& getFamilyInfo() { return _family_info; }
std::map<std::string, std::vector<std::string> >& getGroupInfo() { return _group_info; }
- ParaMEDMEM::DataArrayDouble* getField(std::string descriptionField, int iold);
+ MEDCoupling::DataArrayDouble* getField(std::string descriptionField, int iold);
std::vector<std::string>& getFieldDescriptions() { return _field_descriptions; }
void prepareFieldDescriptions();
void filterFaceOnCell();
void castCellMeshes(MeshCollection& initialCollection,
std::vector<std::vector<std::vector<int> > >& new2oldIds,
- std::vector<ParaMEDMEM::DataArrayInt*> & o2nRenumber);
+ std::vector<MEDCoupling::DataArrayInt*> & o2nRenumber);
//creates faces on the new collection
void castFaceMeshes(MeshCollection& initialCollection,
//constructing connect zones
void buildConnectZones( const NodeMapping& nodeMapping,
- const std::vector<ParaMEDMEM::DataArrayInt*> & o2nRenumber,
+ const std::vector<MEDCoupling::DataArrayInt*> & o2nRenumber,
int nbInitialDomains );
// Find faces common with neighbor domains and put them in groups
void buildBoundaryFaces();
private:
- void castIntField(std::vector<ParaMEDMEM::MEDCouplingUMesh*>& meshesCastFrom,
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>& meshesCastTo,
- std::vector<ParaMEDMEM::DataArrayInt*>& arrayFrom,
+ void castIntField(std::vector<MEDCoupling::MEDCouplingUMesh*>& meshesCastFrom,
+ std::vector<MEDCoupling::MEDCouplingUMesh*>& meshesCastTo,
+ std::vector<MEDCoupling::DataArrayInt*>& arrayFrom,
std::string nameArrayTo);
void castAllFields(MeshCollection& initialCollection,
void remapIntField(int inew, int iold,
- const ParaMEDMEM::MEDCouplingUMesh& sourceMesh,
- const ParaMEDMEM::MEDCouplingUMesh& targetMesh,
+ const MEDCoupling::MEDCouplingUMesh& sourceMesh,
+ const MEDCoupling::MEDCouplingUMesh& targetMesh,
const int* fromArray,
std::string nameArrayTo,
const BBTreeOfDim* tree);
void remapDoubleField(int inew, int iold,
- ParaMEDMEM::DataArrayDouble* fromArray,
+ MEDCoupling::DataArrayDouble* fromArray,
std::string nameArrayTo,
std::string descriptionField);
ParaDomainSelector* _domain_selector;
//links to meshes
- std::vector<ParaMEDMEM::MEDCouplingUMesh*> _mesh;
- std::vector<ParaMEDMEM::MEDCouplingUMesh*> _face_mesh;
+ std::vector<MEDCoupling::MEDCouplingUMesh*> _mesh;
+ std::vector<MEDCoupling::MEDCouplingUMesh*> _face_mesh;
//index of a non empty mesh within _mesh (in parallel mode all of meshes can be empty)
int _i_non_empty_mesh;
//family ids storages
- std::vector<ParaMEDMEM::DataArrayInt*> _cell_family_ids;
- std::vector<ParaMEDMEM::DataArrayInt*> _face_family_ids;
+ std::vector<MEDCoupling::DataArrayInt*> _cell_family_ids;
+ std::vector<MEDCoupling::DataArrayInt*> _face_family_ids;
//DataArrayInt* storages
- std::map<std::string, ParaMEDMEM::DataArrayInt*> _map_dataarray_int;
+ std::map<std::string, MEDCoupling::DataArrayInt*> _map_dataarray_int;
//DataArrayDouble* storages
- std::map<std::string, ParaMEDMEM::DataArrayDouble*> _map_dataarray_double;
+ std::map<std::string, MEDCoupling::DataArrayDouble*> _map_dataarray_double;
//fields to be partitioned
std::vector<std::string> _field_descriptions;
MyGlobals::_File_Names.resize(1);
MyGlobals::_File_Names[0]=std::string(filename);
- ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(filename,meshname);
+ MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(filename,meshname);
//puts the only mesh in the mesh vector
(_collection->getMesh()).push_back(mfm->getLevel0Mesh(false));
(_collection->getFaceMesh()).push_back(mfm->getLevelM1Mesh(false));
//reading family ids
- ParaMEDMEM::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCpy());
- ParaMEDMEM::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCpy());
+ MEDCoupling::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCopy());
+ MEDCoupling::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCopy());
(_collection->getCellFamilyIds()).push_back(cellIds);
(_collection->getFaceFamilyIds()).push_back(faceIds);
}
-void MeshCollectionDriver::readMEDFileData(const ParaMEDMEM::MEDFileData* filedata)
+void MeshCollectionDriver::readMEDFileData(const MEDCoupling::MEDFileData* filedata)
{
const int nbDomains = filedata->getMeshes()->getNumberOfMeshes();
_collection->getMesh() .resize( nbDomains, 0 );
for (int i=0; i<nbDomains; i++)
{
- ParaMEDMEM::MEDFileUMesh *mfm = dynamic_cast<ParaMEDMEM::MEDFileUMesh *>(filedata->getMeshes()->getMeshAtPos(i));
+ MEDCoupling::MEDFileUMesh *mfm = dynamic_cast<MEDCoupling::MEDFileUMesh *>(filedata->getMeshes()->getMeshAtPos(i));
readData(mfm,i);
if ( mfm && mfm->getMeshDimension() > 0 )
_collection->setNonEmptyMesh( i );
void MeshCollectionDriver::readFileData(std::string file,std::string meshname,int idomain) const
{
- ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(file,meshname);
+ MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(file,meshname);
readData(mfm,idomain);
mfm->decrRef();
}
-void MeshCollectionDriver::readData(ParaMEDMEM::MEDFileUMesh* mfm, int idomain) const
+void MeshCollectionDriver::readData(MEDCoupling::MEDFileUMesh* mfm, int idomain) const
{
std::vector<int> nonEmpty=mfm->getNonEmptyLevels();
try
{
(_collection->getMesh())[idomain]=mfm->getLevel0Mesh(false);
//reading families groups
- ParaMEDMEM::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCpy());
+ MEDCoupling::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCopy());
(_collection->getCellFamilyIds())[idomain]=cellIds;
}
catch(...)
{
(_collection->getMesh())[idomain]=CreateEmptyMEDCouplingUMesh(); // or 0 if you want tests;
- ParaMEDMEM::DataArrayInt* empty=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* empty=MEDCoupling::DataArrayInt::New();
empty->alloc(0,1);
(_collection->getCellFamilyIds())[idomain]=empty;
std::cout<<"\nNO Level0Mesh (Cells)\n";
{
(_collection->getFaceMesh())[idomain]=mfm->getLevelM1Mesh(false);
//reading families groups
- ParaMEDMEM::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCpy());
+ MEDCoupling::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCopy());
(_collection->getFaceFamilyIds())[idomain]=faceIds;
if (MyGlobals::_Verbose>10)
std::cout << "proc " << MyGlobals::_Rank << " : WITH Faces\n";
catch(...)
{
(_collection->getFaceMesh())[idomain]=CreateEmptyMEDCouplingUMesh(); // or 0 if you want test;
- ParaMEDMEM::DataArrayInt* empty=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* empty=MEDCoupling::DataArrayInt::New();
(_collection->getFaceFamilyIds())[idomain]=empty;
if (MyGlobals::_Verbose>10)
std::cout << "proc " << MyGlobals::_Rank << " : WITHOUT Faces\n";
MyGlobals::_Field_Descriptions.push_back(SerializeFromVectorOfString(localFields));
}
-ParaMEDMEM::MEDFileMesh* MeshCollectionDriver::getMesh(int idomain) const
+MEDCoupling::MEDFileMesh* MeshCollectionDriver::getMesh(int idomain) const
{
- ParaMEDMEM::MEDFileUMesh* mfm = ParaMEDMEM::MEDFileUMesh::New();
+ MEDCoupling::MEDFileUMesh* mfm = MEDCoupling::MEDFileUMesh::New();
- ParaMEDMEM::MEDCouplingUMesh* cellMesh=_collection->getMesh(idomain);
- ParaMEDMEM::MEDCouplingUMesh* faceMesh=_collection->getFaceMesh(idomain);
+ MEDCoupling::MEDCouplingUMesh* cellMesh=_collection->getMesh(idomain);
+ MEDCoupling::MEDCouplingUMesh* faceMesh=_collection->getFaceMesh(idomain);
// std::string cleFilter=Cle1ToStr("filterFaceOnCell",idomain);
- // ParaMEDMEM::DataArrayInt* filter=0;
+ // MEDCoupling::DataArrayInt* filter=0;
// if (_collection->getMapDataArrayInt().find(cleFilter)!=_collection->getMapDataArrayInt().end())
// {
// filter=_collection->getMapDataArrayInt().find(cleFilter)->second;
// int* index=filter->getPointer();
- // faceMeshFilter=(ParaMEDMEM::MEDCouplingUMesh *) faceMesh->buildPartOfMySelf(index,index+filter->getNbOfElems(),true);
+ // faceMeshFilter=(MEDCoupling::MEDCouplingUMesh *) faceMesh->buildPartOfMySelf(index,index+filter->getNbOfElems(),true);
// faceMesh=faceMeshFilter;
// }
// if (faceMeshFilter!=0)
cellMesh->setName(finalMeshName);
mfm->setMeshAtLevel( 0, cellMesh );
- faceMesh->checkCoherency();
+ faceMesh->checkConsistencyLight();
if (faceMesh->getNumberOfCells()>0)
{
faceMesh->tryToShareSameCoordsPermute(*cellMesh, 1e-10);
mfm->setMeshAtLevel( -1, faceMesh );
}
- // ParaMEDMEM::MEDCouplingUMesh* boundaryMesh=0;
+ // MEDCoupling::MEDCouplingUMesh* boundaryMesh=0;
// if (MyGlobals::_Creates_Boundary_Faces>0)
// {
// //try to write Boundary meshes
// bool keepCoords=false; //TODO or true
- // boundaryMesh=(ParaMEDMEM::MEDCouplingUMesh *) cellMesh->buildBoundaryMesh(keepCoords);
+ // boundaryMesh=(MEDCoupling::MEDCouplingUMesh *) cellMesh->buildBoundaryMesh(keepCoords);
// boundaryMesh->setName("boundaryMesh");
// if (boundaryMesh!=0)
// {
// //doing that testMesh becomes second mesh sorted by alphabetical order of name
- // MEDLoader::WriteUMesh(distfilename, boundaryMesh, false);
+ // WriteUMesh(distfilename, boundaryMesh, false);
// boundaryMesh->decrRef();
// }
// add joints
- using ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr;
- using ParaMEDMEM::MEDCouplingSkyLineArray;
- using ParaMEDMEM::MEDFileJoint;
- using ParaMEDMEM::MEDFileJointCorrespondence;
- using ParaMEDMEM::MEDFileJointOneStep;
- using ParaMEDMEM::MEDFileJoints;
- using ParaMEDMEM::MEDFileJoints;
+ using MEDCoupling::MCAuto;
+ using MEDCoupling::MEDCouplingSkyLineArray;
+ using MEDCoupling::MEDFileJoint;
+ using MEDCoupling::MEDFileJointCorrespondence;
+ using MEDCoupling::MEDFileJointOneStep;
+ using MEDCoupling::MEDFileJoints;
+ using MEDCoupling::MEDFileJoints;
if ( _collection->getCZ().size() > 0 )
{
- MEDCouplingAutoRefCountObjectPtr< MEDFileJoints > joints = MEDFileJoints::New();
+ MCAuto< MEDFileJoints > joints = MEDFileJoints::New();
for ( size_t i = 0; i < _collection->getCZ().size(); ++i )
{
cz->setDescription( oss.str() );
}
- MEDCouplingAutoRefCountObjectPtr< MEDFileJoint>
+ MCAuto< MEDFileJoint>
joint = MEDFileJoint::New( cz->getName(), finalMeshName,
finalMeshName, cz->getDistantDomainNumber() );
joint->setDescription( cz->getDescription() );
joints->pushJoint( joint );
- MEDCouplingAutoRefCountObjectPtr< MEDFileJointOneStep> j1st = MEDFileJointOneStep::New();
+ MCAuto< MEDFileJointOneStep> j1st = MEDFileJointOneStep::New();
joint->pushStep( j1st );
const MEDCouplingSkyLineArray * nodeCorr = cz->getNodeCorresp();
if ( nodeCorr )
{
- MEDCouplingAutoRefCountObjectPtr< MEDFileJointCorrespondence >
+ MCAuto< MEDFileJointCorrespondence >
corr = MEDFileJointCorrespondence::New( nodeCorr->getValueArray() );
j1st->pushCorrespondence( corr );
}
{
t1 = INTERP_KERNEL::NormalizedCellType( types[it].first );
t2 = INTERP_KERNEL::NormalizedCellType( types[it].second );
- MEDCouplingAutoRefCountObjectPtr< MEDFileJointCorrespondence>
+ MCAuto< MEDFileJointCorrespondence>
corr = MEDFileJointCorrespondence::New( cellCorr->getValueArray(), t1, t2 );
j1st->pushCorrespondence( corr );
}
return mfm;
}
-ParaMEDMEM::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string key, std::string description, ParaMEDMEM::DataArrayDouble* data, ParaMEDMEM::MEDFileMesh* mfm, int idomain) const
+MEDCoupling::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string key, std::string description, MEDCoupling::DataArrayDouble* data, MEDCoupling::MEDFileMesh* mfm, int idomain) const
{
std::string desc=description;
if (MyGlobals::_Verbose>20)
double time=StrToDouble(ExtractFromDescription(desc, "time="));
int typeData=StrToInt(ExtractFromDescription(desc, "typeData="));
std::string entityName=ExtractFromDescription(desc, "entityName=");
- ParaMEDMEM::MEDCouplingFieldDouble* field=0;
+ MEDCoupling::MEDCouplingFieldDouble* field=0;
if (typeData!=6)
{
std::cout << "WARNING : writeMedFile : typeData " << typeData << " not implemented for fields\n";
if (entityName=="MED_CELL")
{
//there is a field of idomain to write
- field=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ field=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
}
if (entityName=="MED_NODE_ELEMENT")
{
//there is a field of idomain to write
- field=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_GAUSS_NE,ParaMEDMEM::ONE_TIME);
+ field=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_GAUSS_NE,MEDCoupling::ONE_TIME);
}
if (!field)
{
{
field->setName(fieldName);
field->setMesh(mfm->getMeshAtLevel(0));
- ParaMEDMEM::DataArrayDouble *da=data;
+ MEDCoupling::DataArrayDouble *da=data;
//get information for components etc..
std::vector<std::string> r1;
r1=SelectTagsInVectorOfString(MyGlobals::_General_Informations,"fieldName="+fieldName);
}
field->setArray(da);
field->setTime(time,DT,IT);
- field->checkCoherency();
+ field->checkConsistencyLight();
}
return field;
}
void MeshCollectionDriver::writeMedFile(int idomain, const std::string& distfilename) const
{
- ParaMEDMEM::MEDFileMesh* mfm = getMesh( idomain );
+ MEDCoupling::MEDFileMesh* mfm = getMesh( idomain );
mfm->write(distfilename,2);
std::string key="/inewFieldDouble="+IntToStr(idomain)+"/";
- std::map<std::string,ParaMEDMEM::DataArrayDouble*>::iterator it;
+ std::map<std::string,MEDCoupling::DataArrayDouble*>::iterator it;
int nbfFieldFound=0;
for (it=_collection->getMapDataArrayDouble().begin() ; it!=_collection->getMapDataArrayDouble().end(); it++)
{
size_t found=(*it).first.find(key);
if (found==std::string::npos)
continue;
- ParaMEDMEM::MEDCouplingFieldDouble* field=0;
+ MEDCoupling::MEDCouplingFieldDouble* field=0;
field = getField(key, (*it).first, (*it).second, mfm, idomain);
nbfFieldFound++;
try
{
- MEDLoader::WriteField(distfilename,field,false);
+ WriteField(distfilename,field,false);
}
catch(INTERP_KERNEL::Exception& e)
{
fieldName=field->getName();
tmp+="_"+fieldName+"_"+IntToStr(nbfFieldFound)+".med";
newName.replace(newName.find(".med"),4,tmp);
- std::cout << "WARNING : writeMedFile : create a new file name with only one field because MEDLoader::WriteField throw:" << newName << std::endl;
- MEDLoader::WriteField(newName,field,true);
+ std::cout << "WARNING : writeMedFile : create a new file name with only one field because WriteField throw:" << newName << std::endl;
+ WriteField(newName,field,true);
}
}
mfm->decrRef();
}
-ParaMEDMEM::MEDFileData* MeshCollectionDriver::getMEDFileData()
+MEDCoupling::MEDFileData* MeshCollectionDriver::getMEDFileData()
{
- ParaMEDMEM::MEDFileData* newdata = ParaMEDMEM::MEDFileData::New();
+ MEDCoupling::MEDFileData* newdata = MEDCoupling::MEDFileData::New();
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileMeshes> meshes;
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDFileFields> fields;
- meshes = ParaMEDMEM::MEDFileMeshes::New();
- fields = ParaMEDMEM::MEDFileFields::New();
+ MEDCoupling::MCAuto<MEDCoupling::MEDFileMeshes> meshes;
+ MEDCoupling::MCAuto<MEDCoupling::MEDFileFields> fields;
+ meshes = MEDCoupling::MEDFileMeshes::New();
+ fields = MEDCoupling::MEDFileFields::New();
for (size_t i=0; i<_collection->getMesh().size(); i++)
{
- ParaMEDMEM::MEDFileMesh* mfm = getMesh( i );
+ MEDCoupling::MEDFileMesh* mfm = getMesh( i );
meshes->pushMesh(mfm);
std::string key="/inewFieldDouble="+IntToStr(i)+"/";
- std::map<std::string,ParaMEDMEM::DataArrayDouble*>::iterator it;
- ParaMEDMEM::MEDFileFieldMultiTS* fieldsMTS = ParaMEDMEM::MEDFileFieldMultiTS::New();
+ std::map<std::string,MEDCoupling::DataArrayDouble*>::iterator it;
+ MEDCoupling::MEDFileFieldMultiTS* fieldsMTS = MEDCoupling::MEDFileFieldMultiTS::New();
for (it=_collection->getMapDataArrayDouble().begin() ; it!=_collection->getMapDataArrayDouble().end(); it++)
{
size_t found=(*it).first.find(key);
if (found==std::string::npos)
continue;
- ParaMEDMEM::MEDCouplingFieldDouble* field=0;
+ MEDCoupling::MEDCouplingFieldDouble* field=0;
field=getField(key, (*it).first, (*it).second, mfm, i);
- ParaMEDMEM::MEDFileField1TS* f1ts = ParaMEDMEM::MEDFileField1TS::New();
+ MEDCoupling::MEDFileField1TS* f1ts = MEDCoupling::MEDFileField1TS::New();
f1ts->setFieldNoProfileSBT(field);
fieldsMTS->pushBackTimeStep(f1ts);
#include <vector>
#include <string>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayDouble;
class MEDCouplingFieldDouble;
virtual ~MeshCollectionDriver() { }
virtual int read(const char*, ParaDomainSelector* sel=0) = 0;
int readSeq(const char*,const char*);
- ParaMEDMEM::MEDFileData *getMEDFileData();
+ MEDCoupling::MEDFileData *getMEDFileData();
virtual void write(const char*, ParaDomainSelector* sel=0) const = 0;
- void readMEDFileData(const ParaMEDMEM::MEDFileData* filedata);
+ void readMEDFileData(const MEDCoupling::MEDFileData* filedata);
protected:
void readSubdomain(int idomain);
- void readData(ParaMEDMEM::MEDFileUMesh* mfm, int idomain) const;
+ void readData(MEDCoupling::MEDFileUMesh* mfm, int idomain) const;
void readFileData(std::string file,std::string meshname,int idomain) const;
- ParaMEDMEM::MEDFileMesh* getMesh(int idomain) const;
- ParaMEDMEM::MEDCouplingFieldDouble* getField(std::string key, std::string description, ParaMEDMEM::DataArrayDouble* data, ParaMEDMEM::MEDFileMesh* mfm, int idomain) const;
+ MEDCoupling::MEDFileMesh* getMesh(int idomain) const;
+ MEDCoupling::MEDCouplingFieldDouble* getField(std::string key, std::string description, MEDCoupling::DataArrayDouble* data, MEDCoupling::MEDFileMesh* mfm, int idomain) const;
void writeMedFile(int idomain, const std::string& distfilename) const;
protected:
MeshCollection* _collection;
*\param filename ascii file containing the list of MED v2.3 files
* */
-int MeshCollectionMedAsciiDriver::read(ParaMEDMEM::MEDFileData* filedata)
+int MeshCollectionMedAsciiDriver::read(MEDCoupling::MEDFileData* filedata)
{
readMEDFileData(filedata);
if ( !domainSelector || domainSelector->isMyDomain( idomain ) )
{
if ( !_collection->getMesh()[idomain]->getNumberOfCells()==0 ) continue;//empty domain
- MEDLoader::WriteUMesh(distfilename.c_str(),(_collection->getMesh())[idomain],true);
+ WriteUMesh(distfilename.c_str(),(_collection->getMesh())[idomain],true);
//writeSubdomain(idomain, nbdomains, distfilename.c_str(), domainSelector);
}
}
MeshCollectionMedAsciiDriver(MeshCollection*);
virtual ~MeshCollectionMedAsciiDriver() { }
int read(const char*, ParaDomainSelector* sel=0);
- int read(ParaMEDMEM::MEDFileData*);
+ int read(MEDCoupling::MEDFileData*);
void write(const char*, ParaDomainSelector* sel=0) const;
private:
std::string _master_filename;
{
}
-METISGraph::METISGraph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight)
+METISGraph::METISGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight)
:Graph(graph,edgeweight)
{
}
//creating a skylinearray with no copy of the index and partition array
//the fifth argument true specifies that only the pointers are passed
//to the object
- _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value);
+ _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value);
#endif
}
{
public:
METISGraph();
- METISGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, int *edgeweight=0);
+ METISGraph(MEDCoupling::MEDCouplingSkyLineArray*, int *edgeweight=0);
virtual ~METISGraph();
void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0);
};
{
}
-ParMETISGraph::ParMETISGraph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight)
+ParMETISGraph::ParMETISGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight)
:Graph(graph,edgeweight)
{
}
//the fifth argument true specifies that only the pointers are passed
//to the object
- _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value);
+ _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value);
#endif
}
{
public:
ParMETISGraph();
- ParMETISGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, int *edgeweight=0);
+ ParMETISGraph(MEDCoupling::MEDCouplingSkyLineArray*, int *edgeweight=0);
virtual ~ParMETISGraph();
void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0);
};
* 1) for MED_CELL to know global id shift for domains at graph construction;
* 2) for sub-entity to know total nb of sub-entities before creating those of joints
*/
-void MEDPARTITIONER::ParaDomainSelector::gatherNbOf(const std::vector<ParaMEDMEM::MEDCouplingUMesh*>& domain_meshes)
+void MEDPARTITIONER::ParaDomainSelector::gatherNbOf(const std::vector<MEDCoupling::MEDCouplingUMesh*>& domain_meshes)
{
evaluateMemory();
// get nb of elems of each domain mesh
\param target processor id of the target
*/
-void MEDPARTITIONER::ParaDomainSelector::sendMesh(const ParaMEDMEM::MEDCouplingUMesh& mesh, int target) const
+void MEDPARTITIONER::ParaDomainSelector::sendMesh(const MEDCoupling::MEDCouplingUMesh& mesh, int target) const
{
#ifndef HAVE_MPI
throw INTERP_KERNEL::Exception("ParaDomainSelector::sendMesh : incoherent call in non_MPI mode");
if (mesh.getNumberOfCells()>0) //no sends if empty
{
- ParaMEDMEM::DataArrayInt *v1Local=0;
- ParaMEDMEM::DataArrayDouble *v2Local=0;
+ MEDCoupling::DataArrayInt *v1Local=0;
+ MEDCoupling::DataArrayDouble *v2Local=0;
//serialization of local mesh to send data to distant proc.
mesh.serialize(v1Local,v2Local);
int nbLocalElems=0;
\param mesh pointer to mesh that is filled
\param source processor id of the incoming messages
*/
-void MEDPARTITIONER::ParaDomainSelector::recvMesh(ParaMEDMEM::MEDCouplingUMesh*& mesh, int source)const
+void MEDPARTITIONER::ParaDomainSelector::recvMesh(MEDCoupling::MEDCouplingUMesh*& mesh, int source)const
{
#ifndef HAVE_MPI
throw INTERP_KERNEL::Exception("ParaDomainSelector::recvMesh : incoherent call in non_MPI mode");
int NumberOfCells=tinyInfoDistant[tinyVecSize-1];
if (NumberOfCells>0)
{
- ParaMEDMEM::DataArrayInt *v1Distant=ParaMEDMEM::DataArrayInt::New();
- ParaMEDMEM::DataArrayDouble *v2Distant=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayInt *v1Distant=MEDCoupling::DataArrayInt::New();
+ MEDCoupling::DataArrayDouble *v2Distant=MEDCoupling::DataArrayDouble::New();
//Building the right instance of copy of distant mesh.
- ParaMEDMEM::MEDCouplingPointSet *distant_mesh_tmp=
- ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType(
- (ParaMEDMEM::MEDCouplingMeshType) tinyInfoDistant[0]);
+ MEDCoupling::MEDCouplingPointSet *distant_mesh_tmp=
+ MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType(
+ (MEDCoupling::MEDCouplingMeshType) tinyInfoDistant[0]);
std::vector<std::string> unusedTinyDistantSts;
- mesh=dynamic_cast<ParaMEDMEM::MEDCouplingUMesh*> (distant_mesh_tmp);
+ mesh=dynamic_cast<MEDCoupling::MEDCouplingUMesh*> (distant_mesh_tmp);
mesh->resizeForUnserialization(tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
int nbDistElem=0;
#include <memory>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
}
int getNbTotalFaces() { return _face_shift_by_domain.back(); };
//Collect nb of entities on procs
- void gatherNbOf(const std::vector<ParaMEDMEM::MEDCouplingUMesh*>& domain_meshes);
+ void gatherNbOf(const std::vector<MEDCoupling::MEDCouplingUMesh*>& domain_meshes);
//distribution of the graph vertices among the processors
int* getProcVtxdist() const;
//Evaluate current memory usage and return the maximal one in KB
int evaluateMemory() const;
- void sendMesh(const ParaMEDMEM::MEDCouplingUMesh& mesh, int target) const;
- void recvMesh(ParaMEDMEM::MEDCouplingUMesh*& mesh, int source) const;
+ void sendMesh(const MEDCoupling::MEDCouplingUMesh& mesh, int target) const;
+ void recvMesh(MEDCoupling::MEDCouplingUMesh*& mesh, int source) const;
private:
int _rank; //my rank
int _world_size; //nb of processors
}
//constructing topology according to mesh collection without global numerotation (use setGlobalNumerotation later)
-ParallelTopology::ParallelTopology(const std::vector<ParaMEDMEM::MEDCouplingUMesh*>& meshes)
+ParallelTopology::ParallelTopology(const std::vector<MEDCoupling::MEDCouplingUMesh*>& meshes)
{
_nb_domain=meshes.size();
_nb_cells.resize(_nb_domain);
}
//constructing topology according to mesh collection
-ParallelTopology::ParallelTopology(const std::vector<ParaMEDMEM::MEDCouplingUMesh*>& meshes,
+ParallelTopology::ParallelTopology(const std::vector<MEDCoupling::MEDCouplingUMesh*>& meshes,
const std::vector<MEDPARTITIONER::ConnectZone*>& cz,
std::vector<int*>& cellglobal,
std::vector<int*>& nodeglobal,
{
cellCorresp[ idomain ].resize( nb_domain );
}
- const ParaMEDMEM::MEDCouplingSkyLineArray* skylinegraph = graph->getGraph();
+ const MEDCoupling::MEDCouplingSkyLineArray* skylinegraph = graph->getGraph();
const int* index = skylinegraph->getIndex();
const int* value = skylinegraph->getValue();
const int nbCells = skylinegraph->getNumberOf();
public:
ParallelTopology();
- ParallelTopology(const std::vector<ParaMEDMEM::MEDCouplingUMesh*>&);
- ParallelTopology(const std::vector<ParaMEDMEM::MEDCouplingUMesh*>&,
+ ParallelTopology(const std::vector<MEDCoupling::MEDCouplingUMesh*>&);
+ ParallelTopology(const std::vector<MEDCoupling::MEDCouplingUMesh*>&,
const std::vector<MEDPARTITIONER::ConnectZone*>&,
std::vector<int*>&,
std::vector<int*>&,
{
}
-SCOTCHGraph::SCOTCHGraph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight):Graph(graph,edgeweight)
+SCOTCHGraph::SCOTCHGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight):Graph(graph,edgeweight)
{
}
//creating a skylinearray with no copy of the index and partition array
//the fifth argument true specifies that only the pointers are passed
//to the object
- _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value);
+ _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value);
#endif
}
{
public:
SCOTCHGraph();
- SCOTCHGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, int* edgeweight=0);
+ SCOTCHGraph(MEDCoupling::MEDCouplingSkyLineArray*, int* edgeweight=0);
virtual ~SCOTCHGraph();
void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector* sel=0);
};
#include <map>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDCouplingUMesh;
}
{
public:
Topology() { }
- Topology(std::vector<ParaMEDMEM::MEDCouplingUMesh*>, std::vector<MEDPARTITIONER::ConnectZone*>) { }
+ Topology(std::vector<MEDCoupling::MEDCouplingUMesh*>, std::vector<MEDPARTITIONER::ConnectZone*>) { }
virtual ~Topology() { }
/*! converts a list of global cell numbers
* (domain numbers range from 0 to ndomain-1
* \param n number of cells in the mesh
*/
-UserGraph::UserGraph(ParaMEDMEM::MEDCouplingSkyLineArray *array, const int *partition, int n):Graph(array,0)
+UserGraph::UserGraph(MEDCoupling::MEDCouplingSkyLineArray *array, const int *partition, int n):Graph(array,0)
{
std::vector<int> index(n+1),value(n);
value[i]=partition[i];
}
- _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value);
+ _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value);
}
class MEDPARTITIONER_EXPORT UserGraph : public Graph
{
public:
- UserGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, const int*, int);
+ UserGraph(MEDCoupling::MEDCouplingSkyLineArray*, const int*, int);
virtual ~UserGraph();
void partGraph(int, const std::string& options=std::string(""), ParaDomainSelector *sel=0);
};
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "InterpKernelException.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelAutoPtr.hxx"
#include <fstream>
IT=StrToInt(ExtractFromDescription(description,"IT="));
}
-ParaMEDMEM::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector<int>& v)
+MEDCoupling::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector<int>& v)
{
- ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New();
p->alloc(v.size(),1);
std::copy(v.begin(),v.end(),p->getPointer());
return p;
}
-ParaMEDMEM::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector<int>& v,const int nbComponents)
+MEDCoupling::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector<int>& v,const int nbComponents)
{
- ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New();
if (v.size()%nbComponents!=0)
throw INTERP_KERNEL::Exception("Problem size modulo nbComponents != 0");
p->alloc(v.size()/nbComponents,nbComponents);
return p;
}
-ParaMEDMEM::DataArrayDouble* MEDPARTITIONER::CreateDataArrayDoubleFromVector(const std::vector<double>& v)
+MEDCoupling::DataArrayDouble* MEDPARTITIONER::CreateDataArrayDoubleFromVector(const std::vector<double>& v)
{
- ParaMEDMEM::DataArrayDouble* p=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble* p=MEDCoupling::DataArrayDouble::New();
p->alloc(v.size(),1);
std::copy(v.begin(),v.end(),p->getPointer());
return p;
/*!
*/
-std::vector<std::string> MEDPARTITIONER::BrowseFieldDouble(const ParaMEDMEM::MEDCouplingFieldDouble* fd)
+std::vector<std::string> MEDPARTITIONER::BrowseFieldDouble(const MEDCoupling::MEDCouplingFieldDouble* fd)
{
std::vector<std::string> res;
if (fd->getArray())
std::vector<std::string> MEDPARTITIONER::BrowseAllFields(const std::string& myfile)
{
std::vector<std::string> res;
- std::vector<std::string> meshNames=MEDLoader::GetMeshNames(myfile);
+ std::vector<std::string> meshNames=MEDCoupling::GetMeshNames(myfile);
for (std::size_t i=0; i<meshNames.size(); i++)
{
std::vector<std::string> fieldNames=
- MEDLoader::GetAllFieldNamesOnMesh(myfile,meshNames[i]);
+ MEDCoupling::GetAllFieldNamesOnMesh(myfile,meshNames[i]);
for (std::size_t j = 0; j < fieldNames.size(); j++)
{
- std::vector< ParaMEDMEM::TypeOfField > typeFields=
- MEDLoader::GetTypesOfField(myfile, meshNames[i], fieldNames[j]);
+ std::vector< MEDCoupling::TypeOfField > typeFields=
+ MEDCoupling::GetTypesOfField(myfile, meshNames[i], fieldNames[j]);
for (std::size_t k = 0; k < typeFields.size(); k++)
{
std::vector< std::pair< int, int > > its=
- MEDLoader::GetFieldIterations(typeFields[k], myfile, meshNames[i], fieldNames[j]);
+ GetFieldIterations(typeFields[k], myfile, meshNames[i], fieldNames[j]);
if (MyGlobals::_Is0verbose>100)
std::cout<< "fieldName " << fieldNames[j] << " typeField " << typeFields[k] << " its.size() " << its.size() << std::endl;
for (std::size_t m = 0; m < its.size(); m++)
resi.push_back("fileName="); resi.back()+=fileName;
resi.push_back("meshName="); resi.back()+=curMeshName;
resi.push_back("fieldName="); resi.back()+=curFieldName;
- resi.push_back("typeField="); resi.back()+=IntToStr((int)ParaMEDMEM::ON_NODES);
+ resi.push_back("typeField="); resi.back()+=IntToStr((int)MEDCoupling::ON_NODES);
resi.push_back("typeData="); resi.back()+=IntToStr((int)typcha); //6 for double?
resi.push_back("nbComponent="); resi.back()+=IntToStr((int)ncomp);
resi.push_back("DT="); resi.back()+=IntToStr((int)numdt);
nbOfVal << " profilName '" << pflname << "' profileSize " << profilesize << " nbPtGauss " << nbi << std::endl;
int typeField=-1; //unknown
if (enttype==MED_CELL)
- typeField=ParaMEDMEM::ON_CELLS;
+ typeField=MEDCoupling::ON_CELLS;
if (enttype==MED_NODE_ELEMENT)
- typeField=ParaMEDMEM::ON_GAUSS_NE;
+ typeField=MEDCoupling::ON_GAUSS_NE;
//if (enttype==??) typeField=ON_GAUSS_PT;
std::vector<std::string> resi;
resi.push_back("idomain="); resi.back()+=IntToStr(idomain);
/*!
* create empty MEDCouplingUMesh* dim 3
*/
-ParaMEDMEM::MEDCouplingUMesh* MEDPARTITIONER::CreateEmptyMEDCouplingUMesh()
+MEDCoupling::MEDCouplingUMesh* MEDPARTITIONER::CreateEmptyMEDCouplingUMesh()
{
- ParaMEDMEM::MEDCouplingUMesh* umesh=ParaMEDMEM::MEDCouplingUMesh::New();
+ MEDCoupling::MEDCouplingUMesh* umesh=MEDCoupling::MEDCouplingUMesh::New();
umesh->setMeshDimension(3);
umesh->allocateCells(0);
umesh->finishInsertingCells();
- ParaMEDMEM::DataArrayDouble *myCoords=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble *myCoords=MEDCoupling::DataArrayDouble::New();
myCoords->alloc(0,3);
umesh->setCoords(myCoords);
umesh->setName("EMPTY");
myCoords->decrRef();
- umesh->checkCoherency();
+ umesh->checkConsistencyLight();
return umesh;
}
MEDPARTITIONER_EXPORT void FieldShortDescriptionToData(const std::string& description,
std::string& fieldName, int& typeField, int& entity, int& DT, int& IT);
- ParaMEDMEM::DataArrayInt *CreateDataArrayIntFromVector(const std::vector<int>& v);
- ParaMEDMEM::DataArrayInt *CreateDataArrayIntFromVector(const std::vector<int>& v, const int nbComponents);
- ParaMEDMEM::DataArrayDouble *CreateDataArrayDoubleFromVector(const std::vector<double>& v);
+ MEDCoupling::DataArrayInt *CreateDataArrayIntFromVector(const std::vector<int>& v);
+ MEDCoupling::DataArrayInt *CreateDataArrayIntFromVector(const std::vector<int>& v, const int nbComponents);
+ MEDCoupling::DataArrayDouble *CreateDataArrayDoubleFromVector(const std::vector<double>& v);
- ParaMEDMEM::MEDCouplingUMesh *CreateEmptyMEDCouplingUMesh();
+ MEDCoupling::MEDCouplingUMesh *CreateEmptyMEDCouplingUMesh();
- std::vector<std::string> BrowseFieldDouble(const ParaMEDMEM::MEDCouplingFieldDouble* fd);
+ std::vector<std::string> BrowseFieldDouble(const MEDCoupling::MEDCouplingFieldDouble* fd);
std::vector<std::string> BrowseAllFields(const std::string& myfile);
std::vector<std::string> BrowseAllFieldsOnMesh(const std::string& myfile, const std::string& mymesh, const int idomain);
std::vector<std::string> GetInfosOfField(const char *fileName, const char *meshName, const int idomain );
std::vector<int>* RecvIntVec(int source);
void RecvIntVec(std::vector<int>& vec, const int source);
- void SendDataArrayInt(const ParaMEDMEM::DataArrayInt* da, const int target);
- ParaMEDMEM::DataArrayInt *RecvDataArrayInt(const int source);
- void SendDataArrayDouble(const ParaMEDMEM::DataArrayDouble* da, const int target);
- ParaMEDMEM::DataArrayDouble *RecvDataArrayDouble(const int source);
+ void SendDataArrayInt(const MEDCoupling::DataArrayInt* da, const int target);
+ MEDCoupling::DataArrayInt *RecvDataArrayInt(const int source);
+ void SendDataArrayDouble(const MEDCoupling::DataArrayDouble* da, const int target);
+ MEDCoupling::DataArrayDouble *RecvDataArrayDouble(const int source);
void TestVectorOfStringMpi();
void TestMapOfStringIntMpi();
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "InterpKernelException.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelAutoPtr.hxx"
#include <fstream>
\param da dataArray to be sent
\param target processor id of the target
*/
-void MEDPARTITIONER::SendDataArrayInt(const ParaMEDMEM::DataArrayInt *da, const int target)
+void MEDPARTITIONER::SendDataArrayInt(const MEDCoupling::DataArrayInt *da, const int target)
{
if (da==0)
throw INTERP_KERNEL::Exception("Problem send DataArrayInt* NULL");
\param da dataArrayInt that is filled
\param source processor id of the incoming messages
*/
-ParaMEDMEM::DataArrayInt *MEDPARTITIONER::RecvDataArrayInt(const int source)
+MEDCoupling::DataArrayInt *MEDPARTITIONER::RecvDataArrayInt(const int source)
{
int tag = 111004;
int size[3];
std::cout << "proc " << MyGlobals::_Rank << " : <-- RecvDataArrayInt " << size[0] << std::endl;
if (size[0]!=(size[1]*size[2]))
throw INTERP_KERNEL::Exception("Problem in RecvDataArrayInt incoherent sizes");
- ParaMEDMEM::DataArrayInt* da=ParaMEDMEM::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* da=MEDCoupling::DataArrayInt::New();
da->alloc(size[1],size[2]);
int *p=da->getPointer();
MPI_Recv(const_cast<int*>(&p[0]), size[0], MPI_INT, source, tag+100, MPI_COMM_WORLD, &status);
\param da dataArray to be sent
\param target processor id of the target
*/
-void MEDPARTITIONER::SendDataArrayDouble(const ParaMEDMEM::DataArrayDouble *da, const int target)
+void MEDPARTITIONER::SendDataArrayDouble(const MEDCoupling::DataArrayDouble *da, const int target)
{
if (da==0)
throw INTERP_KERNEL::Exception("Problem send DataArrayDouble* NULL");
\param da dataArrayDouble that is filled
\param source processor id of the incoming messages
*/
-ParaMEDMEM::DataArrayDouble* MEDPARTITIONER::RecvDataArrayDouble(const int source)
+MEDCoupling::DataArrayDouble* MEDPARTITIONER::RecvDataArrayDouble(const int source)
{
int tag = 111005;
int size[3];
std::cout << "proc " << MyGlobals::_Rank << " : <-- RecvDataArrayDouble " << size[0] << std::endl;
if (size[0]!=(size[1]*size[2]))
throw INTERP_KERNEL::Exception("Problem in RecvDataArrayDouble incoherent sizes");
- ParaMEDMEM::DataArrayDouble* da=ParaMEDMEM::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble* da=MEDCoupling::DataArrayDouble::New();
da->alloc(size[1],size[2]);
double *p=da->getPointer();
MPI_Recv(const_cast<double*>(&p[0]), size[0], MPI_DOUBLE, source, tag+100, MPI_COMM_WORLD, &status);
int rank=MyGlobals::_Rank;
//int
{
- ParaMEDMEM::DataArrayInt* send=ParaMEDMEM::DataArrayInt::New();
- ParaMEDMEM::DataArrayInt* recv=0;
+ MEDCoupling::DataArrayInt* send=MEDCoupling::DataArrayInt::New();
+ MEDCoupling::DataArrayInt* recv=0;
int nbOfTuples=5;
int numberOfComponents=3;
send->alloc(nbOfTuples,numberOfComponents);
}
//double
{
- ParaMEDMEM::DataArrayDouble* send=ParaMEDMEM::DataArrayDouble::New();
- ParaMEDMEM::DataArrayDouble* recv=0;
+ MEDCoupling::DataArrayDouble* send=MEDCoupling::DataArrayDouble::New();
+ MEDCoupling::DataArrayDouble* recv=0;
int nbOfTuples=5;
int numberOfComponents=3;
send->alloc(nbOfTuples,numberOfComponents);
#include "MEDLoader.hxx"
#include "MEDLoaderBase.hxx"
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingMultiFields.hxx"
#endif
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace MEDPARTITIONER;
void MEDPARTITIONERTest::setSize(int ni, int nj, int nk)
{
}
-ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh()
+MEDCoupling::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh()
//only hexa8
{
vector<int> conn;
mesh->setCoords(myCoords);
mesh->setName(_mesh_name.c_str());
myCoords->decrRef();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
return mesh;
}
-ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCARRE3DMesh()
+MEDCoupling::MEDCouplingUMesh * MEDPARTITIONERTest::buildCARRE3DMesh()
//only quad4 in oblique (k=j)
{
vector<int> conn;
mesh->setCoords(myCoords);
mesh->setName(_mesh_name.c_str());
myCoords->decrRef();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
return mesh;
}
-ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildFACE3DMesh()
+MEDCoupling::MEDCouplingUMesh * MEDPARTITIONERTest::buildFACE3DMesh()
//only quad4 on a global face of the CUBE3D (k=0)
{
vector<int> conn;
mesh->setCoords(myCoords);
mesh->setName(_mesh_name.c_str());
myCoords->decrRef();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
return mesh;
}
field.push_back(k+.3);
}
- MEDCouplingUMesh *mesh=MEDLoader::ReadUMeshFromFile(myfileName.c_str(),_mesh_name.c_str(),0);
+ MEDCouplingUMesh *mesh=ReadUMeshFromFile(myfileName.c_str(),_mesh_name.c_str(),0);
int nbOfCells=mesh->getNumberOfCells();
MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
f1->setName("VectorFieldOnCells");
myField->setInfoOnComponent(2,"vz");
myField->decrRef();
f1->setTime(2.,0,1);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
mesh->decrRef();
return f1;
}
field.push_back(k+.3);
}
- MEDCouplingUMesh *mesh=MEDLoader::ReadUMeshFromFile(_file_name.c_str(),_mesh_name.c_str(),0);
+ MEDCouplingUMesh *mesh=ReadUMeshFromFile(_file_name.c_str(),_mesh_name.c_str(),0);
int nbOfNodes=mesh->getNumberOfNodes();
MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_NODES,ONE_TIME);
f1->setName("VectorFieldOnNodes");
myField->setInfoOnComponent(2,"vz");
myField->decrRef();
f1->setTime(2.,0,1);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
mesh->decrRef();
return f1;
}
{
{
MEDCouplingUMesh * mesh = buildCUBE3DMesh();
- MEDLoader::WriteUMesh(_file_name.c_str(),mesh,true);
+ WriteUMesh(_file_name.c_str(),mesh,true);
if (_verbose) cout<<endl<<_file_name<<" created"<<endl;
if (_ntot<1000000) //too long
{
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile(_file_name.c_str(),mesh->getName().c_str(),0);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile(_file_name.c_str(),mesh->getName().c_str(),0);
if (_verbose) cout<<_file_name<<" reread"<<endl;
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
}
{
- vector<const ParaMEDMEM::MEDCouplingUMesh*> meshes;
+ vector<const MEDCoupling::MEDCouplingUMesh*> meshes;
MEDCouplingUMesh * mesh1 = buildCUBE3DMesh();
MEDCouplingUMesh * mesh2 = buildFACE3DMesh();
mesh1->setName("testMesh");
mesh2->setName("theFaces");
mesh2->tryToShareSameCoordsPermute(*mesh1, 1e-9);
- mesh2->checkCoherency();
- mesh1->checkCoherency();
+ mesh2->checkConsistencyLight();
+ mesh1->checkConsistencyLight();
meshes.push_back(mesh1);
meshes.push_back(mesh2);
- MEDLoader::WriteUMeshes(_file_name_with_faces.c_str(), meshes, true);
+ WriteUMeshes(_file_name_with_faces.c_str(), meshes, true);
- ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName().c_str());
+ MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName().c_str());
DataArrayInt* FacesFam=DataArrayInt::New();
FacesFam->alloc(mfm->getSizeAtLevel(-1),1);
FacesFam->fillWithValue(-1);
CellsFam->decrRef();
/*ce truc marche pas!
- ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName());
- vector<const ParaMEDMEM::MEDCouplingUMesh*> ms;
+ MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName());
+ vector<const MEDCoupling::MEDCouplingUMesh*> ms;
ms.push_back(mesh2);
mfm->setGroupsFromScratch(-1, ms);
mfm->write(_file_name_with_faces.c_str(),0);
if (_verbose) cout<<endl<<_file_name_with_faces<<" created"<<endl;
if (_ntot<1000000) //too long
{
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile(_file_name_with_faces.c_str(),mesh1->getName().c_str(),0);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile(_file_name_with_faces.c_str(),mesh1->getName().c_str(),0);
if (_verbose) cout<<_file_name_with_faces<<" reread"<<endl;
CPPUNIT_ASSERT(mesh1->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
{
MEDCouplingUMesh * mesh = buildCARRE3DMesh();
- MEDLoader::WriteUMesh(_file_name2.c_str(),mesh,true);
+ WriteUMesh(_file_name2.c_str(),mesh,true);
if (_verbose) cout<<endl<<_file_name2<<" created"<<endl;
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile(_file_name2.c_str(),mesh->getName().c_str(),0);
+ MEDCouplingUMesh *mesh_rw=ReadUMeshFromFile(_file_name2.c_str(),mesh->getName().c_str(),0);
if (_verbose) cout<<_file_name2<<" reread"<<endl;
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
int xyz=1;
string sxyz;
- DataArrayDouble* coordsInit=mesh->getCoords()->deepCpy();
+ DataArrayDouble* coordsInit=mesh->getCoords()->deepCopy();
double* ptrInit=coordsInit->getPointer();
double deltax=cooFin[0]-cooDep[0];
double deltay=cooFin[1]-cooDep[1];
*ptr=(*ptrini)+dz; ptr++; ptrini++;
}
- MEDLoader::WriteUMesh(fileName.c_str(),mesh,true);
+ WriteUMesh(fileName.c_str(),mesh,true);
tagSubfiles+=tagSubfile;
tagSubfiles.replace(tagSubfiles.find("$xyz"),4,sxyz);
string name=_file_name;
MEDCouplingFieldDouble *f1=buildVecFieldOnCells(name);
name.replace(name.find(".med"),4,"_WithVecFieldOnCells.med");
- MEDLoader::WriteField(name.c_str(),f1,true);
+ WriteField(name.c_str(),f1,true);
f1->setTime(3.,1,1); //time,it,order
f1->applyFunc("x/2.");
- MEDLoader::WriteField(name.c_str(),f1,false);
+ WriteField(name.c_str(),f1,false);
if (_verbose) cout<<endl<<name<<" created"<<endl;
if (_ntot<1000000) //too long
{
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(name.c_str(),f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
+ MEDCouplingFieldDouble *f2=ReadFieldCell(name.c_str(),f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
//DataArrayDouble *res=f2->getArray();
if (_verbose) cout<<name<<" reread"<<endl;
//CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f3->setTime(4.,5,6);
f3->setArray(array);
array->decrRef();
- MEDLoader::WriteField(name.c_str(),f3,true);
+ WriteField(name.c_str(),f3,true);
if (_verbose) cout<<endl<<name<<" created"<<endl;
- f3->checkCoherency();
+ f3->checkConsistencyLight();
f1->decrRef();
if (_ntot<1000000) //too long
{
- MEDCouplingFieldDouble* f4=MEDLoader::ReadField(ON_GAUSS_NE,
- name.c_str(), f3->getMesh()->getName().c_str(), 0, "MyFieldOnGaussNE", 5, 6);
+ MEDCouplingFieldDouble* f4=ReadField(ON_GAUSS_NE, name.c_str(), f3->getMesh()->getName().c_str(), 0, "MyFieldOnGaussNE", 5, 6);
if (_verbose) cout<<"MyFieldOnGaussNE reread"<<endl;
f4->decrRef();
}
string name=_file_name_with_faces;
MEDCouplingFieldDouble *f1=buildVecFieldOnCells(name);
name.replace(name.find(".med"),4,"_WithVecFieldOnCells.med");
- MEDLoader::WriteField(name.c_str(),f1,true);
+ WriteField(name.c_str(),f1,true);
if (_verbose) cout<<endl<<name<<" created"<<endl;
if (_ntot<1000000) //too long
{
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(name.c_str(),f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
+ MEDCouplingFieldDouble *f2=ReadFieldCell(name.c_str(),f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
if (_verbose) cout<<name<<" reread"<<endl;
//CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); assertion failed!!
f2->decrRef();
MEDCouplingFieldDouble *f1=buildVecFieldOnNodes();
string name=_file_name;
name.replace(name.find(".med"),4,"_WithVecFieldOnNodes.med");
- MEDLoader::WriteField(name.c_str(),f1,true);
+ WriteField(name.c_str(),f1,true);
if (_verbose) cout<<endl<<name<<" created"<<endl;
if (_ntot<1000000) //too long
{
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldNode(name.c_str(),f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
+ MEDCouplingFieldDouble *f2=ReadFieldNode(name.c_str(),f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
if (_verbose) cout<<name<<" reread"<<endl;
//CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); assertion failed!!
f2->decrRef();
{
string name=_file_name;
name.replace(name.find(".med"),4,"_WithVecFieldOnNodes.med");
- MEDCouplingUMesh * m=MEDLoader::ReadUMeshFromFile(name.c_str(),_mesh_name.c_str(),0);
+ MEDCouplingUMesh * m=ReadUMeshFromFile(name.c_str(),_mesh_name.c_str(),0);
std::set<INTERP_KERNEL::NormalizedCellType> types(m->getAllGeoTypes());
if (_verbose)
{
execName=getPartitionerExe();
fileName=_file_name_with_faces;
- ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
- ParaMEDMEM::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false);
+ MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false);
cmd=execName+" --ndomains=5 --split-method="+MetisOrScotch; //on same proc
sourceName=fileName;
MEDPARTITIONER::ParaDomainSelector parallelizer(false);
MEDPARTITIONER::MeshCollection collection(input,parallelizer);
CPPUNIT_ASSERT_EQUAL(3, collection.getMeshDimension());
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>cellMeshes=collection.getMesh();
+ std::vector<MEDCoupling::MEDCouplingUMesh*>cellMeshes=collection.getMesh();
CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size());
int nbcells=0;
for (std::size_t i = 0; i < cellMeshes.size(); i++)
nbcells+=cellMeshes[i]->getNumberOfCells();
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>faceMeshes=collection.getFaceMesh();
+ std::vector<MEDCoupling::MEDCouplingUMesh*>faceMeshes=collection.getFaceMesh();
CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size());
int nbfaces=0;
for (std::size_t i=0; i < faceMeshes.size(); i++)
CPPUNIT_ASSERT_EQUAL(0, res);
string refusedName=targetName+"1.med";
- ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
- ParaMEDMEM::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false);
+ MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), refusedFaceMesh->getNumberOfCells());
/*not the good job
- ParaMEDMEM::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh);
+ MEDCoupling::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), mergeCell->getNumberOfCells());
- ParaMEDMEM::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh);
+ MEDCoupling::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh);
CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), mergeFace->getNumberOfCells());
CPPUNIT_ASSERT(faceMesh->isEqual(refusedFaceMesh,1e-12));
fileName=_file_name;
fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnCells.med");
- ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
cmd=execName+" --ndomains=5 --split-method="+MetisOrScotch; //on same proc
sourceName=fileName;
CPPUNIT_ASSERT_EQUAL(0, res);
string refusedName=targetName+"1.med";
- ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells());
MEDCouplingUMesh* fusedCell=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), fusedCell->getNumberOfCells());
- MEDCouplingFieldDouble* field1=MEDLoader::ReadFieldCell(fileName.c_str(),initialMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
- MEDCouplingFieldDouble* field2=MEDLoader::ReadFieldCell(refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
+ MEDCouplingFieldDouble* field1=ReadFieldCell(fileName.c_str(),initialMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
+ MEDCouplingFieldDouble* field2=ReadFieldCell(refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
int nbcells=corr[1]->getNumberOfTuples();
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
fileName=_file_name;
fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnGaussNe.med");
- ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
cmd=execName+" --ndomains=5 --split-method="+MetisOrScotch; //on same proc
sourceName=fileName;
CPPUNIT_ASSERT_EQUAL(0, res);
string refusedName=targetName+"1.med";
- ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells());
MEDCouplingUMesh* fusedCell=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), fusedCell->getNumberOfCells());
- MEDCouplingFieldDouble* field1=MEDLoader::ReadField(ON_GAUSS_NE,fileName.c_str(),initialMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
- MEDCouplingFieldDouble* field2=MEDLoader::ReadField(ON_GAUSS_NE,refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
+ MEDCouplingFieldDouble* field1=ReadField(ON_GAUSS_NE,fileName.c_str(),initialMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
+ MEDCouplingFieldDouble* field2=ReadField(ON_GAUSS_NE,refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
int nbcells=corr[1]->getNumberOfTuples();
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
mesh->setCoords(myCoords);
mesh->setName("FacesIn2D");
myCoords->decrRef();
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
// groups of cells
DataArrayInt* cellsFam=DataArrayInt::New();
std::map< int, int > famId2nb; // count total nb of cells in divided families
std::map< int, int >::iterator id2nn;
{
- const std::vector<ParaMEDMEM::DataArrayInt*>& famIdsVec = new_collection.getCellFamilyIds();
+ const std::vector<MEDCoupling::DataArrayInt*>& famIdsVec = new_collection.getCellFamilyIds();
for ( size_t i = 0; i < famIdsVec.size(); ++i )
{
- ParaMEDMEM::DataArrayInt* famIdsArr = famIdsVec[i];
+ MEDCoupling::DataArrayInt* famIdsArr = famIdsVec[i];
for ( int j = famIdsArr->getNbOfElems()-1; j >= 0; --j )
{
id2nn = famId2nb.insert( make_pair( famIdsArr->getPointer()[j], 0 )).first;
// Check that "creates boundary faces option is handled"
famId2nb.clear();
- const std::vector<ParaMEDMEM::DataArrayInt*>& famIdsVec = new_collection.getFaceFamilyIds();
+ const std::vector<MEDCoupling::DataArrayInt*>& famIdsVec = new_collection.getFaceFamilyIds();
for ( size_t i = 0; i < famIdsVec.size(); ++i )
{
- ParaMEDMEM::DataArrayInt* famIdsArr = famIdsVec[i];
+ MEDCoupling::DataArrayInt* famIdsArr = famIdsVec[i];
for ( int j = famIdsArr->getNbOfElems()-1; j >= 0; --j )
{
id2nn = famId2nb.insert( make_pair( famIdsArr->getPointer()[j], 0 )).first;
#include <iostream>
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
class MEDPARTITIONERTEST_EXPORT MEDPARTITIONERTest : public CppUnit::TestFixture
void setbigSize();
std::string getPartitionerExe() const;
std::string getPartitionerParaExe() const;
- ParaMEDMEM::MEDCouplingUMesh * buildCUBE3DMesh();
- ParaMEDMEM::MEDCouplingUMesh * buildFACE3DMesh();
- ParaMEDMEM::MEDCouplingUMesh * buildCARRE3DMesh();
- ParaMEDMEM::MEDCouplingFieldDouble * buildVecFieldOnCells(std::string myfileName);
- ParaMEDMEM::MEDCouplingFieldDouble * buildVecFieldOnNodes();
+ MEDCoupling::MEDCouplingUMesh * buildCUBE3DMesh();
+ MEDCoupling::MEDCouplingUMesh * buildFACE3DMesh();
+ MEDCoupling::MEDCouplingUMesh * buildCARRE3DMesh();
+ MEDCoupling::MEDCouplingFieldDouble * buildVecFieldOnCells(std::string myfileName);
+ MEDCoupling::MEDCouplingFieldDouble * buildVecFieldOnNodes();
void createTestMeshWithoutField();
void createTestMeshWithVecFieldOnCells();
void createTestMeshWithVecFieldOnNodes();
#include "MEDLoader.hxx"
#include "MEDLoaderBase.hxx"
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingMultiFields.hxx"
#include <mpi.h>
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace MEDPARTITIONER;
#if defined(HAVE_MPI)
execName=getPartitionerParaExe();
fileName=_file_name_with_faces;
- ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
- ParaMEDMEM::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false);
+ MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false);
cmd="mpirun -np 5 "+execName+" --ndomains=5 --split-method=metis"; //on same proc
sourceName=fileName;
MEDPARTITIONER::ParaDomainSelector parallelizer(false);
MEDPARTITIONER::MeshCollection collection(input,parallelizer);
CPPUNIT_ASSERT_EQUAL(3, collection.getMeshDimension());
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>cellMeshes=collection.getMesh();
+ std::vector<MEDCoupling::MEDCouplingUMesh*>cellMeshes=collection.getMesh();
CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size());
int nbcells=0;
for (std::size_t i = 0; i < cellMeshes.size(); i++)
nbcells+=cellMeshes[i]->getNumberOfCells();
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
- std::vector<ParaMEDMEM::MEDCouplingUMesh*>faceMeshes=collection.getFaceMesh();
+ std::vector<MEDCoupling::MEDCouplingUMesh*>faceMeshes=collection.getFaceMesh();
CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size());
int nbfaces=0;
for (std::size_t i=0; i < faceMeshes.size(); i++)
CPPUNIT_ASSERT_EQUAL(0, res);
string refusedName=targetName+"1.med";
- ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
- ParaMEDMEM::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false);
+ MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), refusedFaceMesh->getNumberOfCells());
/*not the good job
- ParaMEDMEM::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh);
+ MEDCoupling::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), mergeCell->getNumberOfCells());
- ParaMEDMEM::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh);
+ MEDCoupling::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh);
CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), mergeFace->getNumberOfCells());
CPPUNIT_ASSERT(faceMesh->isEqual(refusedFaceMesh,1e-12));
fileName=_file_name;
fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnCells.med");
- ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
cmd="mpirun -np 5 "+execName+" --ndomains=5 --split-method=metis"; //on same proc
sourceName=fileName;
CPPUNIT_ASSERT_EQUAL(0, res);
string refusedName=targetName+"1.med";
- ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells());
MEDCouplingUMesh* fusedCell=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), fusedCell->getNumberOfCells());
- MEDCouplingFieldDouble* field1=MEDLoader::ReadFieldCell(fileName.c_str(),initialMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
- MEDCouplingFieldDouble* field2=MEDLoader::ReadFieldCell(refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
+ MEDCouplingFieldDouble* field1=ReadFieldCell(fileName.c_str(),initialMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
+ MEDCouplingFieldDouble* field2=ReadFieldCell(refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"VectorFieldOnCells",0,1);
int nbcells=corr[1]->getNumberOfTuples();
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
fileName=_file_name;
fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnGaussNe.med");
- ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false);
cmd="mpirun -np 5 "+execName+" --ndomains=5 --split-method=metis"; //on same proc
sourceName=fileName;
CPPUNIT_ASSERT_EQUAL(0, res);
string refusedName=targetName+"1.med";
- ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
- ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
+ MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str());
+ MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells());
MEDCouplingUMesh* fusedCell=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr);
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), fusedCell->getNumberOfCells());
- MEDCouplingFieldDouble* field1=MEDLoader::ReadField(ON_GAUSS_NE,fileName.c_str(),initialMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
- MEDCouplingFieldDouble* field2=MEDLoader::ReadField(ON_GAUSS_NE,refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
+ MEDCouplingFieldDouble* field1=ReadField(ON_GAUSS_NE,fileName.c_str(),initialMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
+ MEDCouplingFieldDouble* field2=ReadField(ON_GAUSS_NE,refusedName.c_str(),refusedCellMesh->getName().c_str(),0,"MyFieldOnGaussNE",5,6);
int nbcells=corr[1]->getNumberOfTuples();
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
// %pythoncode %{
-// def ParaMEDMEMDataArrayDoublenew(cls,*args):
+// def MEDCouplingDataArrayDoublenew(cls,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDouble____new___(cls,args)
-// def ParaMEDMEMDataArrayDoubleIadd(self,*args):
+// def MEDCouplingDataArrayDoubleIadd(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDouble____iadd___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleIsub(self,*args):
+// def MEDCouplingDataArrayDoubleIsub(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDouble____isub___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleImul(self,*args):
+// def MEDCouplingDataArrayDoubleImul(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDouble____imul___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
+// def MEDCouplingDataArrayDoubleIdiv(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDouble____idiv___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleIpow(self,*args):
+// def MEDCouplingDataArrayDoubleIpow(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDouble____ipow___(self, self, *args)
-// def ParaMEDMEMDataArrayIntnew(cls,*args):
+// def MEDCouplingDataArrayIntnew(cls,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayInt____new___(cls,args)
-// def ParaMEDMEMDataArrayIntIadd(self,*args):
+// def MEDCouplingDataArrayIntIadd(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayInt____iadd___(self, self, *args)
-// def ParaMEDMEMDataArrayIntIsub(self,*args):
+// def MEDCouplingDataArrayIntIsub(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayInt____isub___(self, self, *args)
-// def ParaMEDMEMDataArrayIntImul(self,*args):
+// def MEDCouplingDataArrayIntImul(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayInt____imul___(self, self, *args)
-// def ParaMEDMEMDataArrayIntIdiv(self,*args):
+// def MEDCouplingDataArrayIntIdiv(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayInt____idiv___(self, self, *args)
-// def ParaMEDMEMDataArrayIntImod(self,*args):
+// def MEDCouplingDataArrayIntImod(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayInt____imod___(self, self, *args)
-// def ParaMEDMEMDataArrayIntIpow(self,*args):
+// def MEDCouplingDataArrayIntIpow(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayInt____ipow___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
+// def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDoubleTuple____iadd___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
+// def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDoubleTuple____isub___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
+// def MEDCouplingDataArrayDoubleTupleImul(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDoubleTuple____imul___(self, self, *args)
-// def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
+// def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayDoubleTuple____idiv___(self, self, *args)
-// def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
+// def MEDCouplingDataArrayIntTupleIadd(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayIntTuple____iadd___(self, self, *args)
-// def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
+// def MEDCouplingDataArrayIntTupleIsub(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayIntTuple____isub___(self, self, *args)
-// def ParaMEDMEMDataArrayIntTupleImul(self,*args):
+// def MEDCouplingDataArrayIntTupleImul(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayIntTuple____imul___(self, self, *args)
-// def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
+// def MEDCouplingDataArrayIntTupleIdiv(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayIntTuple____idiv___(self, self, *args)
-// def ParaMEDMEMDataArrayIntTupleImod(self,*args):
+// def MEDCouplingDataArrayIntTupleImod(self,*args):
// import _MEDPartitioner
// return _MEDPartitioner.DataArrayIntTuple____imod___(self, self, *args)
// %}
// %pythoncode %{
-// DataArrayDouble.__new__=classmethod(ParaMEDMEMDataArrayDoublenew)
-// DataArrayDouble.__iadd__=ParaMEDMEMDataArrayDoubleIadd
-// DataArrayDouble.__isub__=ParaMEDMEMDataArrayDoubleIsub
-// DataArrayDouble.__imul__=ParaMEDMEMDataArrayDoubleImul
-// DataArrayDouble.__idiv__=ParaMEDMEMDataArrayDoubleIdiv
-// DataArrayDouble.__ipow__=ParaMEDMEMDataArrayDoubleIpow
+// DataArrayDouble.__new__=classmethod(MEDCouplingDataArrayDoublenew)
+// DataArrayDouble.__iadd__=MEDCouplingDataArrayDoubleIadd
+// DataArrayDouble.__isub__=MEDCouplingDataArrayDoubleIsub
+// DataArrayDouble.__imul__=MEDCouplingDataArrayDoubleImul
+// DataArrayDouble.__idiv__=MEDCouplingDataArrayDoubleIdiv
+// DataArrayDouble.__ipow__=MEDCouplingDataArrayDoubleIpow
-// DataArrayInt.__new__=classmethod(ParaMEDMEMDataArrayIntnew)
-// DataArrayInt.__iadd__=ParaMEDMEMDataArrayIntIadd
-// DataArrayInt.__isub__=ParaMEDMEMDataArrayIntIsub
-// DataArrayInt.__imul__=ParaMEDMEMDataArrayIntImul
-// DataArrayInt.__idiv__=ParaMEDMEMDataArrayIntIdiv
-// DataArrayInt.__imod__=ParaMEDMEMDataArrayIntImod
-// DataArrayInt.__ipow__=ParaMEDMEMDataArrayIntIpow
+// DataArrayInt.__new__=classmethod(MEDCouplingDataArrayIntnew)
+// DataArrayInt.__iadd__=MEDCouplingDataArrayIntIadd
+// DataArrayInt.__isub__=MEDCouplingDataArrayIntIsub
+// DataArrayInt.__imul__=MEDCouplingDataArrayIntImul
+// DataArrayInt.__idiv__=MEDCouplingDataArrayIntIdiv
+// DataArrayInt.__imod__=MEDCouplingDataArrayIntImod
+// DataArrayInt.__ipow__=MEDCouplingDataArrayIntIpow
-// DataArrayDoubleTuple.__iadd__=ParaMEDMEMDataArrayDoubleTupleIadd
-// DataArrayDoubleTuple.__isub__=ParaMEDMEMDataArrayDoubleTupleIsub
-// DataArrayDoubleTuple.__imul__=ParaMEDMEMDataArrayDoubleTupleImul
-// DataArrayDoubleTuple.__idiv__=ParaMEDMEMDataArrayDoubleTupleIdiv
+// DataArrayDoubleTuple.__iadd__=MEDCouplingDataArrayDoubleTupleIadd
+// DataArrayDoubleTuple.__isub__=MEDCouplingDataArrayDoubleTupleIsub
+// DataArrayDoubleTuple.__imul__=MEDCouplingDataArrayDoubleTupleImul
+// DataArrayDoubleTuple.__idiv__=MEDCouplingDataArrayDoubleTupleIdiv
-// DataArrayIntTuple.__iadd__=ParaMEDMEMDataArrayIntTupleIadd
-// DataArrayIntTuple.__isub__=ParaMEDMEMDataArrayIntTupleIsub
-// DataArrayIntTuple.__imul__=ParaMEDMEMDataArrayIntTupleImul
-// DataArrayIntTuple.__idiv__=ParaMEDMEMDataArrayIntTupleIdiv
-// DataArrayIntTuple.__imod__=ParaMEDMEMDataArrayIntTupleImod
+// DataArrayIntTuple.__iadd__=MEDCouplingDataArrayIntTupleIadd
+// DataArrayIntTuple.__isub__=MEDCouplingDataArrayIntTupleIsub
+// DataArrayIntTuple.__imul__=MEDCouplingDataArrayIntTupleImul
+// DataArrayIntTuple.__idiv__=MEDCouplingDataArrayIntTupleIdiv
+// DataArrayIntTuple.__imod__=MEDCouplingDataArrayIntTupleImod
-// del ParaMEDMEMDataArrayDoublenew
-// del ParaMEDMEMDataArrayDoubleIadd
-// del ParaMEDMEMDataArrayDoubleIsub
-// del ParaMEDMEMDataArrayDoubleImul
-// del ParaMEDMEMDataArrayDoubleIdiv
-// del ParaMEDMEMDataArrayIntnew
-// del ParaMEDMEMDataArrayIntIadd
-// del ParaMEDMEMDataArrayIntIsub
-// del ParaMEDMEMDataArrayIntImul
-// del ParaMEDMEMDataArrayIntIdiv
-// del ParaMEDMEMDataArrayIntImod
-// del ParaMEDMEMDataArrayDoubleTupleIadd
-// del ParaMEDMEMDataArrayDoubleTupleIsub
-// del ParaMEDMEMDataArrayDoubleTupleImul
-// del ParaMEDMEMDataArrayDoubleTupleIdiv
-// del ParaMEDMEMDataArrayIntTupleIadd
-// del ParaMEDMEMDataArrayIntTupleIsub
-// del ParaMEDMEMDataArrayIntTupleImul
-// del ParaMEDMEMDataArrayIntTupleIdiv
-// del ParaMEDMEMDataArrayIntTupleImod
+// del MEDCouplingDataArrayDoublenew
+// del MEDCouplingDataArrayDoubleIadd
+// del MEDCouplingDataArrayDoubleIsub
+// del MEDCouplingDataArrayDoubleImul
+// del MEDCouplingDataArrayDoubleIdiv
+// del MEDCouplingDataArrayIntnew
+// del MEDCouplingDataArrayIntIadd
+// del MEDCouplingDataArrayIntIsub
+// del MEDCouplingDataArrayIntImul
+// del MEDCouplingDataArrayIntIdiv
+// del MEDCouplingDataArrayIntImod
+// del MEDCouplingDataArrayDoubleTupleIadd
+// del MEDCouplingDataArrayDoubleTupleIsub
+// del MEDCouplingDataArrayDoubleTupleImul
+// del MEDCouplingDataArrayDoubleTupleIdiv
+// del MEDCouplingDataArrayIntTupleIadd
+// del MEDCouplingDataArrayIntTupleIsub
+// del MEDCouplingDataArrayIntTupleImul
+// del MEDCouplingDataArrayIntTupleIdiv
+// del MEDCouplingDataArrayIntTupleImod
// %}
#include "MEDPARTITIONER.hxx"
#include "MEDPARTITIONER_Graph.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace INTERP_KERNEL;
using namespace MEDPARTITIONER;
%}
%newobject MEDPARTITIONER::MEDPartitioner::New;
%newobject MEDPARTITIONER::MEDPartitioner::Graph;
%newobject MEDPARTITIONER::MEDPartitioner::getMEDFileData;
-%feature("unref") ParaMEDMEM::MEDFileData "$this->decrRef();"
+%feature("unref") MEDCoupling::MEDFileData "$this->decrRef();"
%nodefaultctor;
{
public:
virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) throw(INTERP_KERNEL::Exception);
- const ParaMEDMEM::MEDCouplingSkyLineArray *getGraph() const;
- const ParaMEDMEM::MEDCouplingSkyLineArray *getPartition() const;
+ const MEDCoupling::MEDCouplingSkyLineArray *getGraph() const;
+ const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const;
int nbVertices() const;
};
{
public:
MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
- MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
- MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
- static MEDPARTITIONER::Graph* Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0) throw(INTERP_KERNEL::Exception);
- ParaMEDMEM::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception);
+ MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
+ MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
+ static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception);
void write(const std::string& filename) throw(INTERP_KERNEL::Exception);
};
}
// Author : Anthony Geay (EDF R&D)
#include "ParaMEDFileMesh.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDFileMesh.hxx"
#include "MEDFileMeshLL.hxx"
#include "MEDLoader.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDFileMesh *ParaMEDFileMesh::New(int iPart, int nbOfParts, const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUtilities::CheckFileForRead(fileName);
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
MEDFileUtilities::AutoFid fid(MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY));
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,dummy3,dummy0,dummy1,dummy2);
switch(meshType)
{
MEDFileMesh *ParaMEDFileMesh::ParaNew(int iPart, int nbOfParts, const MPI_Comm& com, const MPI_Info& nfo, const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MEDFileUtilities::CheckFileForRead(fileName);
- ParaMEDMEM::MEDCouplingMeshType meshType;
+ MEDCoupling::MEDCouplingMeshType meshType;
MEDFileUtilities::AutoFid fid(MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY));
int dummy0,dummy1;
std::string dummy2;
- ParaMEDMEM::MEDCouplingAxisType dummy3;
+ MEDCoupling::MEDCouplingAxisType dummy3;
MEDFileMeshL2::GetMeshIdFromName(fid,mName,meshType,dummy3,dummy0,dummy1,dummy2);
switch(meshType)
{
MEDFileUMesh *ParaMEDFileUMesh::NewPrivate(med_idt fid, int iPart, int nbOfParts, const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret;
+ MCAuto<MEDFileUMesh> ret;
int meshDim, spaceDim, numberOfNodes;
- std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > typesDistrib(MEDLoader::GetUMeshGlobalInfo(fileName,mName,meshDim,spaceDim,numberOfNodes));
+ std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > typesDistrib(GetUMeshGlobalInfo(fileName,mName,meshDim,spaceDim,numberOfNodes));
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector<int> distrib;
for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it0=typesDistrib.begin();it0!=typesDistrib.end();it0++)
MEDFileMeshes *ParaMEDFileMeshes::New(int iPart, int nbOfParts, const std::string& fileName)
{
- std::vector<std::string> ms(MEDLoader::GetMeshNames(fileName));
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> ret(MEDFileMeshes::New());
+ std::vector<std::string> ms(GetMeshNames(fileName));
+ MCAuto<MEDFileMeshes> ret(MEDFileMeshes::New());
for(std::vector<std::string>::const_iterator it=ms.begin();it!=ms.end();it++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mesh(ParaMEDFileMesh::New(iPart,nbOfParts,fileName,(*it)));
+ MCAuto<MEDFileMesh> mesh(ParaMEDFileMesh::New(iPart,nbOfParts,fileName,(*it)));
ret->pushMesh(mesh);
}
return ret.retn();
MEDFileMeshes *ParaMEDFileMeshes::ParaNew(int iPart, int nbOfParts, const MPI_Comm& com, const MPI_Info& nfo, const std::string& fileName)
{
- std::vector<std::string> ms(MEDLoader::GetMeshNames(fileName));
- MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> ret(MEDFileMeshes::New());
+ std::vector<std::string> ms(GetMeshNames(fileName));
+ MCAuto<MEDFileMeshes> ret(MEDFileMeshes::New());
for(std::vector<std::string>::const_iterator it=ms.begin();it!=ms.end();it++)
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mesh(ParaMEDFileMesh::ParaNew(iPart,nbOfParts,com,nfo,fileName,(*it)));
+ MCAuto<MEDFileMesh> mesh(ParaMEDFileMesh::ParaNew(iPart,nbOfParts,com,nfo,fileName,(*it)));
ret->pushMesh(mesh);
}
return ret.retn();
#include <string>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class MEDFileMesh;
class MEDFileUMesh;
#include <fstream>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
ParaMEDLoader::ParaMEDLoader()
{
}
-void ParaMEDLoader::WriteParaMesh(const char *fileName, ParaMEDMEM::ParaMESH *mesh)
+void ParaMEDLoader::WriteParaMesh(const char *fileName, MEDCoupling::ParaMESH *mesh)
{
if(!mesh->getBlockTopology()->getProcGroup()->containsMyRank())
return ;
}
if(myRank==0)
WriteMasterFile(fileName,fileNames,mesh->getCellMesh()->getName().c_str());
- MEDLoader::WriteUMesh(fileNames[myRank].c_str(),dynamic_cast<MEDCouplingUMesh *>(mesh->getCellMesh()),true);
+ WriteUMesh(fileNames[myRank].c_str(),dynamic_cast<MEDCouplingUMesh *>(mesh->getCellMesh()),true);
}
/*!
#include <string>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ParaMESH;
class ParaFIELD;
class ParaMEDLoader
{
public:
- static void WriteParaMesh(const char *fileName, ParaMEDMEM::ParaMESH *mesh);
+ static void WriteParaMesh(const char *fileName, MEDCoupling::ParaMESH *mesh);
static void WriteMasterFile(const char *fileName, const std::vector<std::string>& fileNames, const char *meshName);
private:
ParaMEDLoader();
dans MxN_Mapping.hxx
. Le choix des options se fait avec le Data Exchange Channel :
- + ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ + MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
+ dec.setOption("Asynchronous",true);
+ dec.setOption("TimeInterpolation",LinearTimeInterp);
+ dec.setOption("AllToAllMethod",PointToPoint);
et TimeInterpolation : methodes Asynchronous et
SetTimeInterpolator de MPI_AccessDEC.
-. ParaMEDMEM::InterpKernelDEC comporte maintenant une surcharge des
+. MEDCoupling::InterpKernelDEC comporte maintenant une surcharge des
methodes recvData() et sendData() :
+ void InterpKernelDEC::recvData( double time ) qui appelle
SetTime(time) de MPI_AccessDEC et
SetTime(time,deltatime) de MPI_AccessDEC et
sendData()
-. recvData() et sendData() de ParaMEDMEM::InterpKernelDEC
+. recvData() et sendData() de MEDCoupling::InterpKernelDEC
appellent multiply et transposeMultiply de l'InterpolationMatrix
qui appellent sendRecv et reverseSendRecv de MxN_Mapping
qui appellent comm_interface.allToAllV en mode "Native"
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Default ctor.
}
_cycle_type.resize(_dimension);
for (int i=0; i<_dimension; i++)
- _cycle_type[i]=ParaMEDMEM::Block;
+ _cycle_type[i]=MEDCoupling::Block;
}
/*!
_nb_elems+=nbelems_per_proc[i-1];
}
_cycle_type.resize(1);
- _cycle_type[0]=ParaMEDMEM::Block;
+ _cycle_type[0]=MEDCoupling::Block;
delete[] nbelems_per_proc;
}
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ComponentTopology;
class MEDCouplingCMesh;
#include "CommInterface.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*! \anchor CommInterface-det
\class CommInterface
{
//initialization
MPI_Init(&argc, &argv);
- ParaMEDMEM::CommInterface comm_interface;
+ MEDCoupling::CommInterface comm_interface;
//setting up a processor group with proc 0
set<int> procs;
procs.insert(0);
- ParaMEDMEM::ProcessorGroup group(procs, comm_interface);
+ MEDCoupling::ProcessorGroup group(procs, comm_interface);
//cleanup
MPI_Finalize();
#define __COMMINTERFACE_HXX__
#include <mpi.h>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class CommInterface
#include "ProcessorGroup.hxx"
#include "InterpolationUtils.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/* Generic constructor for \a nb_comp components equally parted
* in \a nb_blocks blocks
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ProcessorGroup;
#include <cmath>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
DEC::DEC():_comm_interface(0)
{
#include "NormalizedUnstructuredMesh.hxx"
#include "DECOptions.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class CommInterface;
#include <string>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
//! Enum describing the allToAll method used in the communication pattern
typedef enum { Native, PointToPoint } AllToAllMethod;
#include <iostream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
*
* Abstract interface class representing a link between two
* processor groups for exchanging mesh or field data. The two processor groups must
- * have a void intersection (\ref ParaMEDMEM::OverlapDEC "OverlapDEC" is to be considered otherwise).
+ * have a void intersection (\ref MEDCoupling::OverlapDEC "OverlapDEC" is to be considered otherwise).
* The %DEC is initialized by attaching a field on the receiving or on the
* sending side.
*
* The data is sent or received through calls to the (abstract) methods recvData() and sendData().
*
- * One can attach either a \c ParaMEDMEM::ParaFIELD, or a
- * \c ICoCo::Field, or directly a \c ParaMEDMEM::MEDCouplingFieldDouble instance.
+ * One can attach either a \c MEDCoupling::ParaFIELD, or a
+ * \c ICoCo::Field, or directly a \c MEDCoupling::MEDCouplingFieldDouble instance.
* See the various signatures of the method DisjointDEC::attachLocalField()
*
* The derivations of this class should be considered for practical instanciation:
*
* \section DisjointDEC-options DisjointDEC options
* The options supported by %DisjointDEC objects are the same that the ones supported for all
- * DECs in general and are all inherited from the class \ref ParaMEDMEM::DECOptions "DECOptions"
+ * DECs in general and are all inherited from the class \ref MEDCoupling::DECOptions "DECOptions"
*
*/
DEC::copyFrom(other);
if(other._target_group)
{
- _target_group=other._target_group->deepCpy();
+ _target_group=other._target_group->deepCopy();
_owns_groups=true;
}
if(other._source_group)
{
- _source_group=other._source_group->deepCpy();
+ _source_group=other._source_group->deepCopy();
_owns_groups=true;
}
if (_source_group && _target_group)
_comm_interface(0),
_union_comm(MPI_COMM_NULL)
{
- ParaMEDMEM::CommInterface comm;
+ MEDCoupling::CommInterface comm;
// Create the list of procs including source and target
std::set<int> union_ids; // source and target ids in world_comm
union_ids.insert(source_ids.begin(),source_ids.end());
class MEDField;
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ProcessorGroup;
class ParaFIELD;
#include "ProcessorGroup.hxx"
#include "MPIProcessorGroup.hxx"
#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "DirectedBoundingBox.hxx"
#include <map>
//#define USE_DIRECTED_BB
-namespace ParaMEDMEM
+namespace MEDCoupling
{
ElementLocator::ElementLocator(const ParaFIELD& sourceField,
const ProcessorGroup& distant_group,
if (find(_distant_proc_ids.begin(), _distant_proc_ids.end(),rank)==_distant_proc_ids.end())
return;
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elems;
+ MCAuto<DataArrayInt> elems;
#ifdef USE_DIRECTED_BB
INTERP_KERNEL::DirectedBoundingBox dbb;
double* distant_bb = _domain_bounding_boxes+rank*dbb.dataSize(_local_cell_mesh_space_dim);
CommInterface comm;
DataArrayInt *globalIds=_local_para_field.returnGlobalNumbering();
const int *globalIdsC=globalIds->getConstPointer();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> candidates=_local_para_field.getSupport()->getCellMesh()->findBoundaryNodes();
+ MCAuto<DataArrayInt> candidates=_local_para_field.getSupport()->getCellMesh()->findBoundaryNodes();
for(int *iter1=candidates->getPointer();iter1!=candidates->getPointer()+candidates->getNumberOfTuples();iter1++)
(*iter1)=globalIdsC[*iter1];
std::set<int> candidatesS(candidates->begin(),candidates->end());
#include <vector>
#include <set>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ParaFIELD;
class ProcessorGroup;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
#include <map>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class BlockTopology;
#include "ExplicitMapping.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
ExplicitMapping::ExplicitMapping():
#include <map>
#include <set>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Internal class, not part of the public API.
#include <algorithm>
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
ExplicitTopology::ExplicitTopology():
#include <utility>
#include <iostream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ParaMESH;
class Topology;
\a field.
*/
- MEDField::MEDField(ParaMEDMEM::MEDCouplingFieldDouble *field):_field(field)
+ MEDField::MEDField(MEDCoupling::MEDCouplingFieldDouble *field):_field(field)
{
if(_field)
_field->incrRef();
{
public:
MEDField():_field(0) { }
- MEDField(ParaMEDMEM::MEDCouplingFieldDouble* field);
+ MEDField(MEDCoupling::MEDCouplingFieldDouble* field);
MEDField(const MEDField& field);
MEDField& operator=(const MEDField& field);
virtual ~MEDField();
- ParaMEDMEM::MEDCouplingFieldDouble *getField() const { return _field; }
- const ParaMEDMEM::MEDCouplingMesh *getMesh() const { return _field->getMesh(); }
+ MEDCoupling::MEDCouplingFieldDouble *getField() const { return _field; }
+ const MEDCoupling::MEDCouplingMesh *getMesh() const { return _field->getMesh(); }
private:
- ParaMEDMEM::MEDCouplingFieldDouble *_field;
+ MEDCoupling::MEDCouplingFieldDouble *_field;
};
}
#include "InterpKernelDEC.hxx"
#include "ElementLocator.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
The name "InterpKernelDEC" comes from the fact that this class uses exactly the same algorithms
as the sequential remapper. Both this class and the sequential
- \ref ParaMEDMEM::MEDCouplingRemapper "MEDCouplingRemapper" are built on top of the %INTERP_KERNEL
+ \ref MEDCoupling::MEDCouplingRemapper "MEDCouplingRemapper" are built on top of the %INTERP_KERNEL
algorithms (notably the computation of the intersection volumes).
Among the important properties inherited from the parent abstract class \ref DisjointDEC-det "DisjointDEC",
\f]
\section InterpKernelDEC-options Options
- On top of the usual \ref ParaMEDMEM::DECOptions "DEC options", the options supported by %InterpKernelDEC objects are
+ On top of the usual \ref MEDCoupling::DECOptions "DEC options", the options supported by %InterpKernelDEC objects are
related to the underlying \ref InterpKerIntersectors "intersector class".
All the options available in the intersector objects are
available for the %InterpKernelDEC object. The various options available for intersectors can
#include "MxN_Mapping.hxx"
#include "InterpolationOptions.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class InterpolationMatrix;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/**!
\param target_group processor group containing the distant processors
\param method interpolation method
*/
- InterpolationMatrix::InterpolationMatrix(const ParaMEDMEM::ParaFIELD *source_field,
+ InterpolationMatrix::InterpolationMatrix(const MEDCoupling::ParaFIELD *source_field,
const ProcessorGroup& source_group,
const ProcessorGroup& target_group,
const DECOptions& dec_options,
NatureOfField nature=elementLocator.getLocalNature();
switch(nature)
{
- case ConservativeVolumic:
+ case IntensiveMaximum:
computeConservVolDenoW(elementLocator);
break;
- case Integral:
+ case ExtensiveMaximum:
{
if(!elementLocator.isM1DCorr())
computeIntegralDenoW(elementLocator);
computeGlobConstraintDenoW(elementLocator);
break;
}
- case IntegralGlobConstraint:
+ case ExtensiveConservation:
computeGlobConstraintDenoW(elementLocator);
break;
- case RevIntegral:
+ case IntensiveConservation:
{
if(!elementLocator.isM1DCorr())
computeRevIntegralDenoW(elementLocator);
NatureOfField nature=elementLocator.getLocalNature();
switch(nature)
{
- case ConservativeVolumic:
+ case IntensiveMaximum:
computeConservVolDenoL(elementLocator);
break;
- case Integral:
+ case ExtensiveMaximum:
{
if(!elementLocator.isM1DCorr())
computeIntegralDenoL(elementLocator);
computeConservVolDenoL(elementLocator);
break;
}
- case IntegralGlobConstraint:
- //this is not a bug doing like ConservativeVolumic
+ case ExtensiveConservation:
+ //this is not a bug doing like IntensiveMaximum
computeConservVolDenoL(elementLocator);
break;
- case RevIntegral:
+ case IntensiveConservation:
{
if(!elementLocator.isM1DCorr())
computeRevIntegralDenoL(elementLocator);
#include "InterpolationOptions.hxx"
#include "DECOptions.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ElementLocator;
{
public:
- InterpolationMatrix(const ParaMEDMEM::ParaFIELD *source_field,
+ InterpolationMatrix(const MEDCoupling::ParaFIELD *source_field,
const ProcessorGroup& source_group,
const ProcessorGroup& target_group,
const DECOptions& dec_opt,
private:
bool isSurfaceComputationNeeded(const std::string& method) const;
private:
- const ParaMEDMEM::ParaFIELD *_source_field;
+ const MEDCoupling::ParaFIELD *_source_field;
std::vector<int> _row_offsets;
std::map<std::pair<int,int>, int > _col_offsets;
MEDCouplingPointSet *_source_support;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
LinearTimeInterpolator::LinearTimeInterpolator( double InterpPrecision, int nStepBefore,
#include <map>
#include <iostream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DEC;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/**!
\anchor MPIAccess-det
{
//initialization
MPI_Init(&argc, &argv);
- ParaMEDMEM::CommInterface comm_interface;
+ MEDCoupling::CommInterface comm_interface;
//setting up a processor group with proc 0
set<int> procs;
procs.insert(0);
- ParaMEDMEM::ProcessorGroup group(procs, comm_interface);
+ MEDCoupling::ProcessorGroup group(procs, comm_interface);
- ParaMEDMEM::MPIAccess mpi_access(group);
+ MEDCoupling::MPIAccess mpi_access(group);
//cleanup
MPI_Finalize();
source = aMPIStatus.MPI_SOURCE ;
MPITag = aMPIStatus.MPI_TAG ;
int MethodId = (MPITag % MODULO_TAG) ;
- myDatatype = datatype( (ParaMEDMEM::_MessageIdent) MethodId ) ;
+ myDatatype = datatype( (MEDCoupling::_MessageIdent) MethodId ) ;
_comm_interface.getCount(&aMPIStatus, myDatatype, &outcount ) ;
if ( _trace )
cout << "MPIAccess::Probe" << _my_rank << " FromSource " << FromSource
source = aMPIStatus.MPI_SOURCE ;
MPITag = aMPIStatus.MPI_TAG ;
int MethodId = (MPITag % MODULO_TAG) ;
- myDataType = datatype( (ParaMEDMEM::_MessageIdent) MethodId ) ;
+ myDataType = datatype( (MEDCoupling::_MessageIdent) MethodId ) ;
_comm_interface.getCount(&aMPIStatus, myDataType, &outcount ) ;
if ( _trace )
cout << "MPIAccess::IProbe" << _my_rank << " FromSource " << FromSource
#include <vector>
#include <iostream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef struct
{
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
procs.insert(i) ;
}
MPIProcessorGroup *mpilg = static_cast<MPIProcessorGroup *>(const_cast<ProcessorGroup *>(&source_group));
- _MPI_union_group = new ParaMEDMEM::MPIProcessorGroup( union_group->getCommInterface(),procs,mpilg->getWorldComm());
+ _MPI_union_group = new MEDCoupling::MPIProcessorGroup( union_group->getCommInterface(),procs,mpilg->getWorldComm());
delete union_group ;
_my_rank = _MPI_union_group->myRank() ;
_group_size = _MPI_union_group->size() ;
#include <map>
#include <iostream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*
* Internal class, not part of the public API.
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
\anchor MPIProcessorGroup-det
}
- MPIProcessorGroup *MPIProcessorGroup::deepCpy() const
+ MPIProcessorGroup *MPIProcessorGroup::deepCopy() const
{
return new MPIProcessorGroup(*this);
}
#include <set>
#include <mpi.h>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class CommInterface;
MPIProcessorGroup(const CommInterface& interface,int pstart, int pend, const MPI_Comm& world_comm=MPI_COMM_WORLD);
MPIProcessorGroup(const MPIProcessorGroup& other);
virtual ~MPIProcessorGroup();
- virtual MPIProcessorGroup *deepCpy() const;
+ virtual MPIProcessorGroup *deepCopy() const;
virtual ProcessorGroup* fuse (const ProcessorGroup&) const;
void intersect (ProcessorGroup&) { }
int myRank() const;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
MxN_Mapping::MxN_Mapping(const ProcessorGroup& source_group, const ProcessorGroup& target_group,const DECOptions& dec_options)
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ProcessorGroup;
#include <fvm_locator.h>
}
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
if (_source_group->containsMyRank())
{
MEDMEM::MESH* mesh = _local_field->getField()->getSupport()->getMesh();
- fvm_nodal_t* source_nodal = ParaMEDMEM::medmemMeshToFVMMesh(mesh);
+ fvm_nodal_t* source_nodal = MEDCoupling::medmemMeshToFVMMesh(mesh);
int target_size = _target_group->size() ;
int start_rank= _source_group->size();
{
MEDMEM::MESH* mesh = _local_field->getField()->getSupport()->getMesh();
- fvm_nodal_t* target_nodal = ParaMEDMEM::medmemMeshToFVMMesh(mesh);
+ fvm_nodal_t* target_nodal = MEDCoupling::medmemMeshToFVMMesh(mesh);
int source_size = _source_group->size();
int start_rank= 0 ;
const MPI_Comm* comm = (dynamic_cast<const MPIProcessorGroup*> (_union_group))->getComm();
typedef enum {NN} InterpolationMethod;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class NonCoincidentDEC : public DEC
{
#include "OverlapElementLocator.hxx"
#include "OverlapInterpolationMatrix.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
\anchor OverlapDEC-det
Here the pair (0,2) does not appear because the bounding box of fieldtemplateA of proc#2 does
not intersect that of fieldtemplate B on proc#0.
- Stage performed by ParaMEDMEM::OverlapElementLocator::computeBoundingBoxes.
+ Stage performed by MEDCoupling::OverlapElementLocator::computeBoundingBoxes.
\subsection ParaMEDMEMOverlapDECAlgoStep2 Step 2 : Computation of local TODO list
keep track of the ids sent to proc \#m for te matrix-vector computation.
This is incarnated by OverlapMapping::keepTracksOfSourceIds in proc k.
- This step is performed in ParaMEDMEM::OverlapElementLocator::exchangeMeshes method.
+ This step is performed in MEDCoupling::OverlapElementLocator::exchangeMeshes method.
\subsection ParaMEDMEMOverlapDECAlgoStep4 Step 4 : Computation of the interpolation matrix
the \b local TODO list per proc is expected to
be as well balanced as possible.
- The interpolation is performed as the \ref ParaMEDMEM::MEDCouplingRemapper "remapper" does.
+ The interpolation is performed as the \ref MEDCoupling::MEDCouplingRemapper "remapper" does.
This operation is performed by OverlapInterpolationMatrix::addContribution method.
is equal to k.
After this step, the matrix repartition is the following after a call to
- ParaMEDMEM::OverlapMapping::prepare :
+ MEDCoupling::OverlapMapping::prepare :
- proc\#0 : (0,0),(1,0),(2,0)
- proc\#1 : (0,1),(2,1)
"prepare". This is an example of item 0 in \ref ParaMEDMEMOverlapDECAlgoStep2 "Step2".
Tuple (0,1) computed on proc 1 is stored in proc 1 too. This is an example of item 1 in \ref ParaMEDMEMOverlapDECAlgoStep2 "Step2".
- In the end ParaMEDMEM::OverlapMapping::_proc_ids_to_send_vector_st will contain :
+ In the end MEDCoupling::OverlapMapping::_proc_ids_to_send_vector_st will contain :
- Proc\#0 : 0,1
- Proc\#1 : 0,2
- Proc\#2 : 0,1,2
- In the end ParaMEDMEM::OverlapMapping::_proc_ids_to_recv_vector_st will contain :
+ In the end MEDCoupling::OverlapMapping::_proc_ids_to_recv_vector_st will contain :
- Proc\#0 : 0,1,2
- Proc\#1 : 0,2
- Proc\#2 : 1,2
- The method in charge to perform this is : ParaMEDMEM::OverlapMapping::prepare.
+ The method in charge to perform this is : MEDCoupling::OverlapMapping::prepare.
*/
OverlapDEC::OverlapDEC(const std::set<int>& procIds, const MPI_Comm& world_comm):
_load_balancing_algo(1),
_default_field_value(0.0),
_comm(MPI_COMM_NULL)
{
- ParaMEDMEM::CommInterface comm;
+ MEDCoupling::CommInterface comm;
int *ranks_world=new int[procIds.size()]; // ranks of sources and targets in world_comm
std::copy(procIds.begin(),procIds.end(),ranks_world);
MPI_Group group,world_group;
delete _locator;
if (_comm != MPI_COMM_NULL)
{
- ParaMEDMEM::CommInterface comm;
+ MEDCoupling::CommInterface comm;
comm.commFree(&_comm);
}
}
#include <mpi.h>
#include <string>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class OverlapInterpolationMatrix;
class OverlapElementLocator;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
const int OverlapElementLocator::START_TAG_MESH_XCH = 1140;
#include "MEDCouplingNatureOfField.hxx"
#include "MEDCouplingPointSet.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <mpi.h>
#include <vector>
//#define DEC_DEBUG
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ParaFIELD;
class ProcessorGroup;
void sendMesh(int procId, const MEDCouplingPointSet *mesh, const DataArrayInt *idsToSend) const;
void receiveMesh(int procId, MEDCouplingPointSet* &mesh, DataArrayInt *&ids) const;
private:
- typedef MEDCouplingAutoRefCountObjectPtr< MEDCouplingPointSet > AutoMCPointSet;
- typedef MEDCouplingAutoRefCountObjectPtr< DataArrayInt > AutoDAInt;
+ typedef MCAuto< MEDCouplingPointSet > AutoMCPointSet;
+ typedef MCAuto< DataArrayInt > AutoDAInt;
typedef std::pair<int,bool> Proc_SrcOrTgt; // a key indicating a proc ID and whether the data is for source mesh/field or target mesh/field
static const int START_TAG_MESH_XCH;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
OverlapInterpolationMatrix::OverlapInterpolationMatrix(ParaFIELD *source_field,
ParaFIELD *target_field,
void OverlapInterpolationMatrix::computeSurfacesAndDeno()
{
- if(_target_field->getField()->getNature()==ConservativeVolumic)
+ if(_target_field->getField()->getNature()==IntensiveMaximum)
_mapping.computeDenoConservativeVolumic(_target_field->getField()->getNumberOfTuplesExpected());
else
- throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only ConservativeVolumic!");
+ throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only IntensiveMaximum!");
// {
-// if(_target_field->getField()->getNature()==RevIntegral)
+// if(_target_field->getField()->getNature()==IntensiveConservation)
// {
-// MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f;
+// MCAuto<MEDCouplingFieldDouble> f;
// int orient = getOrientation(); // From InterpolationOptions inheritance
// if(orient == 2) // absolute areas
// f = _target_support->getMeasureField(true);
// _mapping.computeDenoRevIntegral(*f->getArray());
// }
// else
-// throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only ConservativeVolumic and RevIntegral defined!");
+// throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only IntensiveMaximum and IntensiveConservation defined!");
// }
}
#include "InterpolationOptions.hxx"
#include "DECOptions.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ParaFIELD;
class MEDCouplingPointSet;
#include "MPIProcessorGroup.hxx"
#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "InterpKernelAutoPtr.hxx"
#include <numeric>
#include <algorithm>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
OverlapMapping::OverlapMapping(const ProcessorGroup& group, const OverlapElementLocator & loc):
_group(group),_locator(loc)
}
///*!
-// * Compute denominators for IntegralGlobConstraint interp.
+// * Compute denominators for ExtensiveConservation interp.
// * TO BE REVISED: needs another communication since some bits are held non locally
// */
//void OverlapMapping::computeDenoGlobConstraint()
{
const std::vector< SparseDoubleVec >& mat=_the_matrix_st[i];
int curSrcId=_the_matrix_st_source_proc_id[i];
- map < int, MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator isItem1 = _sent_trg_ids.find(curSrcId);
+ map < int, MCAuto<DataArrayInt> >::const_iterator isItem1 = _sent_trg_ids.find(curSrcId);
int rowId=0;
if(isItem1==_sent_trg_ids.end() || curSrcId==myProcId) // Local computation: simple, because rowId of mat are directly target cell ids.
{
int rowId=0;
const std::vector< SparseDoubleVec >& mat=_the_matrix_st[i];
int curSrcId=_the_matrix_st_source_proc_id[i];
- map < int, MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator isItem1 = _sent_trg_ids.find(curSrcId);
+ map < int, MCAuto<DataArrayInt> >::const_iterator isItem1 = _sent_trg_ids.find(curSrcId);
std::vector< SparseDoubleVec >& denoM=_the_deno_st[i];
denoM.resize(mat.size());
if(isItem1==_sent_trg_ids.end() || curSrcId==myProcId)//item1 of step2 main algo. Simple, because rowId of mat are directly target ids.
else
if(find(_proc_ids_to_send_vector_st.begin(),_proc_ids_to_send_vector_st.end(),procID)!=_proc_ids_to_send_vector_st.end())
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> vals;
+ MCAuto<DataArrayDouble> vals;
if(_locator.isInMyTodoList(myProcID, procID))
{
map<int, vector<int> >::const_iterator isItem11 = _src_ids_zip_comp.find(procID);
}
else
{
- map < int, MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator isItem11 = _sent_src_ids.find( procID );
+ map < int, MCAuto<DataArrayInt> >::const_iterator isItem11 = _sent_src_ids.find( procID );
if (isItem11 == _sent_src_ids.end())
throw INTERP_KERNEL::Exception("OverlapMapping::multiply(): internal error: SEND: unexpected end iterator in _sent_src_ids!");
vals=fieldInput->getArray()->selectByTupleId(*(*isItem11).second);
int newId=0;
for(vector<int>::const_iterator it=vec.begin();it!=vec.end();it++,newId++)
revert_zip[*it]=newId;
- map < int, MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator isItem24 = _sent_trg_ids.find(srcProcID);
+ map < int, MCAuto<DataArrayInt> >::const_iterator isItem24 = _sent_trg_ids.find(srcProcID);
if (isItem24 == _sent_trg_ids.end())
throw INTERP_KERNEL::Exception("OverlapMapping::multiply(): internal error: MULTIPLY: unexpected end iterator in _sent_trg_ids!");
const DataArrayInt *tgrIdsDA = (*isItem24).second;
#ifndef __OVERLAPMAPPING_HXX__
#define __OVERLAPMAPPING_HXX__
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "OverlapElementLocator.hxx"
#include <vector>
#include <map>
//#define DEC_DEBUG
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ProcessorGroup;
class DataArrayInt;
* gives an old2new map for the local part of the source mesh that has been sent to proc#i, just based on the
* bounding box computation (this is potentially a larger set than what is finally in the interp matrix).
* Second member gives proc ID. */
- map < int, MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _sent_src_ids;
+ map < int, MCAuto<DataArrayInt> > _sent_src_ids;
//! See _sent_src_ids. Same for target mesh.
- map < int, MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _sent_trg_ids;
+ map < int, MCAuto<DataArrayInt> > _sent_trg_ids;
/**! Vector of matrixes (partial interpolation ratios), result of the LOCAL interpolator run.
* Indexing shared with _source_proc_id_st, and _target_proc_id_st. */
#include <numeric>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
\anchor ParaFIELD-det
#include "MEDCouplingRefCountObject.hxx"
#include "ComponentTopology.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayInt;
class ParaMESH;
ParaFIELD(MEDCouplingFieldDouble* field, ParaMESH *sup, const ProcessorGroup& group);
virtual ~ParaFIELD();
- void synchronizeTarget( ParaMEDMEM::ParaFIELD* source_field);
- void synchronizeSource( ParaMEDMEM::ParaFIELD* target_field);
+ void synchronizeTarget( MEDCoupling::ParaFIELD* source_field);
+ void synchronizeSource( MEDCoupling::ParaFIELD* target_field);
MEDCouplingFieldDouble* getField() const { return _field; }
void setOwnSupport(bool v) const { _own_support=v; }
DataArrayInt* returnCumulativeGlobalNumbering() const;
private:
MEDCouplingFieldDouble* _field;
- ParaMEDMEM::ComponentTopology _component_topology;
+ MEDCoupling::ComponentTopology _component_topology;
Topology* _topology;
mutable bool _own_support;
ParaMESH* _support;
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
ParaGRID::ParaGRID(MEDCouplingCMesh* global_grid, Topology* topology) throw(INTERP_KERNEL::Exception) :
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class Topology;
class BlockTopology;
private:
MEDCouplingCMesh* _grid;
// structured grid topology
- ParaMEDMEM::BlockTopology* _block_topology;
+ MEDCoupling::BlockTopology* _block_topology;
// stores the x,y,z axes on the global grid
std::vector<std::vector<double> > _global_axis;
//id of the local grid
//inclusion for the namespaces
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
ParaMESH::ParaMESH( MEDCouplingPointSet *subdomain_mesh, MEDCouplingPointSet *subdomain_face,
DataArrayInt *CorrespElt_local2global, DataArrayInt *CorrespFace_local2global,
#include <string>
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class Topology;
class BlockTopology;
int _my_domain_id;
//global topology of the cells
- ParaMEDMEM::BlockTopology* _block_topology;
+ MEDCoupling::BlockTopology* _block_topology;
Topology* _explicit_topology;
// pointers to global numberings
DataArrayInt* _node_global;
#include "ProcessorGroup.hxx"
#include "InterpolationUtils.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
ProcessorGroup::ProcessorGroup (const CommInterface& interface, int start, int end):_comm_interface(interface)
{
#include <set>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
* Abstract class defining a group of processors (computation nodes) in a parallel run of a code.
_comm_interface(other.getCommInterface()),_proc_ids(other._proc_ids) { }
ProcessorGroup (const CommInterface& interface, int start, int end);
virtual ~ProcessorGroup() { }
- virtual ProcessorGroup *deepCpy() const = 0;
+ virtual ProcessorGroup *deepCopy() const = 0;
virtual ProcessorGroup* fuse (const ProcessorGroup&) const = 0;
virtual void intersect (ProcessorGroup&) = 0;
bool contains(int rank) const { return _proc_ids.find(rank)!=_proc_ids.end(); }
using namespace std;
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
#include "BlockTopology.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DEC;
class BlockTopology;
#include "TimeInterpolator.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
TimeInterpolator::TimeInterpolator( double InterpPrecision, int nStepBefore, int nStepAfter )
{
#include <map>
#include <iostream>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
/*!
#include "Topology.hxx"
-namespace ParaMEDMEM
+namespace MEDCoupling
{
Topology::Topology()
{
#ifndef __TOPOLOGY_HXX__
#define __TOPOLOGY_HXX__
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class ProcessorGroup;
void testBasicMPI2_1();
};
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPI2ParaMEDMEMTest::testBasicMPI2_1()
{
MPI_Comm gcom;
std::string service = "SERVICE";
std::ostringstream meshfilename, meshname;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::MEDCouplingUMesh *mesh;
- ParaMEDMEM::ParaFIELD *parafield=0;
- ParaMEDMEM::CommInterface *interface;
- ParaMEDMEM::MPIProcessorGroup *source, *target;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::MEDCouplingUMesh *mesh;
+ MEDCoupling::ParaFIELD *parafield=0;
+ MEDCoupling::CommInterface *interface;
+ MEDCoupling::MPIProcessorGroup *source, *target;
MPI_Comm_size( MPI_COMM_WORLD, &lsize );
MPI_Comm_rank( MPI_COMM_WORLD, &lrank );
CPPUNIT_ASSERT(false);
return;
}
- interface = new ParaMEDMEM::CommInterface;
- source = new ParaMEDMEM::MPIProcessorGroup(*interface,0,lsize-1,gcom);
- target = new ParaMEDMEM::MPIProcessorGroup(*interface,lsize,gsize-1,gcom);
+ interface = new MEDCoupling::CommInterface;
+ source = new MEDCoupling::MPIProcessorGroup(*interface,0,lsize-1,gcom);
+ target = new MEDCoupling::MPIProcessorGroup(*interface,lsize,gsize-1,gcom);
const double sourceCoordsAll[2][8]={{0.4,0.5,0.4,1.5,1.6,1.5,1.6,0.5},
{0.3,-0.5,1.6,-0.5,1.6,-1.5,0.3,-1.5}};
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*source,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *value=parafield->getField()->getArray()->getPointer();
value[0]=34+13*((double)grank);
- ParaMEDMEM::InterpKernelDEC dec(*source,*target);
- parafield->getField()->setNature(ConservativeVolumic);
+ MEDCoupling::InterpKernelDEC dec(*source,*target);
+ parafield->getField()->setNature(IntensiveMaximum);
dec.setMethod("P0");
void testBasicMPI2_1();
};
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPI2ParaMEDMEMTest::testBasicMPI2_1()
{
MPI_Comm gcom;
std::string service = "SERVICE";
std::ostringstream meshfilename, meshname;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaFIELD *parafield=0;
- ParaMEDMEM::CommInterface* interface;
- ParaMEDMEM::MPIProcessorGroup* source, *target;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaFIELD *parafield=0;
+ MEDCoupling::CommInterface* interface;
+ MEDCoupling::MPIProcessorGroup* source, *target;
MPI_Comm_size( MPI_COMM_WORLD, &lsize );
MPI_Comm_rank( MPI_COMM_WORLD, &lrank );
return;
}
- interface = new ParaMEDMEM::CommInterface;
- source = new ParaMEDMEM::MPIProcessorGroup(*interface,0,gsize-lsize-1,gcom);
- target = new ParaMEDMEM::MPIProcessorGroup(*interface,gsize-lsize,gsize-1,gcom);
+ interface = new MEDCoupling::CommInterface;
+ source = new MEDCoupling::MPIProcessorGroup(*interface,0,gsize-lsize-1,gcom);
+ target = new MEDCoupling::MPIProcessorGroup(*interface,gsize-lsize,gsize-1,gcom);
const double targetCoordsAll[3][16]={{0.7,1.45,0.7,1.65,0.9,1.65,0.9,1.45, 1.1,1.4,1.1,1.6,1.3,1.6,1.3,1.4},
{0.7,-0.6,0.7,0.7,0.9,0.7,0.9,-0.6, 1.1,-0.7,1.1,0.6,1.3,0.6,1.3,-0.7},
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target,"target mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- ParaMEDMEM::InterpKernelDEC dec(*source,*target);
- parafield->getField()->setNature(ConservativeVolumic);
+ MEDCoupling::InterpKernelDEC dec(*source,*target);
+ parafield->getField()->setNature(IntensiveMaximum);
dec.setMethod("P0");
dec.attachLocalField(parafield);
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/*
* Check methods defined in BlockTopology.hxx
#include <set>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void ParaMEDMEMTest::testFabienAPI1()
{
int procs_target_c[1]={1};
std::set<int> procs_target(procs_target_c,procs_target_c+1);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
MPI_Barrier(MPI_COMM_WORLD);
double targetCoords[8]={ 0.,0., 1., 0., 0., 1., 1., 1. };
CommInterface comm;
//
- ParaMEDMEM::InterpKernelDEC *dec=new ParaMEDMEM::InterpKernelDEC(procs_source,procs_target);
+ MEDCoupling::InterpKernelDEC *dec=new MEDCoupling::InterpKernelDEC(procs_source,procs_target);
if(dec->isInSourceSide())
{
mesh=MEDCouplingUMesh::New();
mesh->allocateCells(1);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getSourceGrp(),"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
double *vals=parafield->getField()->getArray()->getPointer();
vals[0]=7.;
}
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+3);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getTargetGrp(),"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
dec->attachLocalField(parafield);
dec->synchronize();
int procs_target_c[1]={1};
std::set<int> procs_target(procs_target_c,procs_target_c+1);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
MPI_Barrier(MPI_COMM_WORLD);
double targetCoords[8]={ 0.,0., 1., 0., 0., 1., 1., 1. };
CommInterface comm;
//
- ParaMEDMEM::InterpKernelDEC *dec=new ParaMEDMEM::InterpKernelDEC(procs_source,procs_target);
+ MEDCoupling::InterpKernelDEC *dec=new MEDCoupling::InterpKernelDEC(procs_source,procs_target);
if(dec->isInSourceSide())
{
mesh=MEDCouplingUMesh::New();
mesh->allocateCells(1);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getSourceGrp(),"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
double *vals=parafield->getField()->getArray()->getPointer();
vals[0]=7.;
}
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+3);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*dec->getTargetGrp(),"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
dec->attachLocalField(parafield);
dec->synchronize();
#include <math.h>
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace ICoCo;
void afficheGauthier1(const ParaFIELD& field, const double *vals, int lgth)
MEDCouplingUMesh *init_quadGauthier1(int is_master)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_quad",2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::New());
+ MCAuto<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_quad",2));
+ MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
if(is_master)
{
const double dataCoo[24]={0,0,0,1,0,0,0,0,1,1,0,1,0,1,0,1,1,0,0,1,1,1,1,1};
MEDCouplingUMesh *init_triangleGauthier1(int is_master)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_triangle",2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::New());
+ MCAuto<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_triangle",2));
+ MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
if(is_master)
{
const double dataCoo[24]={0,0,0,1,0,0,0,0,1,1,0,1,0,1,0,1,1,0,0,1,1,1,1,1};
for (int rec=0;rec<2;rec++)
{
InterpKernelDEC dec_emetteur(emetteur_group, recepteur_group);
- ParaMEDMEM::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
- ParaMEDMEM::ParaMESH *paramesh(0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh;
+ MEDCoupling::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
+ MEDCoupling::ParaMESH *paramesh(0);
+ MCAuto<MEDCouplingUMesh> mesh;
dec_emetteur.setOrientation(2);
if (send==0)
{
{
mesh=init_triangleGauthier1(is_master);
}
- paramesh=new ParaMEDMEM::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"emetteur mesh");
- ParaMEDMEM::ComponentTopology comptopo;
- champ_emetteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
- champ_emetteur->getField()->setNature(ConservativeVolumic);
+ paramesh=new MEDCoupling::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"emetteur mesh");
+ MEDCoupling::ComponentTopology comptopo;
+ champ_emetteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+ champ_emetteur->getField()->setNature(IntensiveMaximum);
champ_emetteur->setOwnSupport(true);
if (rec==0)
{
{
mesh=init_quadGauthier1(is_master);
}
- paramesh=new ParaMEDMEM::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"recepteur mesh");
- champ_recepteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
- champ_recepteur->getField()->setNature(ConservativeVolumic);
+ paramesh=new MEDCoupling::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"recepteur mesh");
+ champ_recepteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+ champ_recepteur->getField()->setNature(IntensiveMaximum);
champ_recepteur->setOwnSupport(true);
if (cas=="emetteur")
{
MPIProcessorGroup entree_chaude_group(comm,entree_chaude_ids);
MPIProcessorGroup Genepi_group(comm,Genepi_ids);
- ParaMEDMEM::ParaFIELD *vitesse(0);
+ MEDCoupling::ParaFIELD *vitesse(0);
InterpKernelDEC dec_vit_in_chaude(entree_chaude_group, Genepi_group);
if ( entree_chaude_group.containsMyRank())
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh(MEDCouplingUMesh::New("mesh",2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(DataArrayDouble::New()); arr->alloc(63,3);
+ MCAuto<MEDCouplingUMesh> mesh(MEDCouplingUMesh::New("mesh",2));
+ MCAuto<DataArrayDouble> arr(DataArrayDouble::New()); arr->alloc(63,3);
const double cooData[189]={0.,0.,0.,0.5,0.,0.,0.5,0.05,0.,0.,0.1,0.,0.5,0.1,0.,0.5,0.15,0.,0.,0.2,0.,0.5,0.2,0.,0.5,0.25,0.,0.,0.3,0.,0.5,0.3,0.,0.5,0.35,0.,0.,0.4,0.,0.5,0.4,0.,0.5,0.45,0.,0.,0.5,0.,0.5,0.5,0.,0.5,0.55,0.,0.,0.6,0.,0.5,0.6,0.,0.5,0.65,0.,0.,0.7,0.,0.5,0.7,0.,0.5,0.75,0.,0.,0.8,0.,0.5,0.8,0.,0.5,0.85,0.,0.,0.9,0.,0.5,0.9,0.,0.5,0.95,0.,1.,0.,0.,1.,0.1,0.,1.,0.2,0.,1.,0.3,0.,1.,0.4,0.,1.,0.5,0.,1.,0.6,0.,1.,0.7,0.,1.,0.8,0.,1.,0.9,0.,1.,0.05,0.,1.,0.15,0.,1.,0.25,0.,1.,0.35,0.,1.,0.45,0.,1.,0.55,0.,1.,0.65,0.,1.,0.75,0.,1.,0.85,0.,1.,0.95,0.,1.,1.,0.,0.,1.,0.,0.5,1.,0.,0.,0.05,0.,0.,0.15,0.,0.,0.25,0.,0.,0.35,0.,0.,0.45,0.,0.,0.55,0.,0.,0.65,0.,0.,0.75,0.,0.,0.85,0.,0.,0.95,0.};
std::copy(cooData,cooData+189,arr->getPointer());
mesh->setCoords(arr);
const int conn[240]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,2,1,31,5,4,32,8,7,33,11,10,34,14,13,35,17,16,36,20,19,37,23,22,38,26,25,39,29,28,30,40,2,31,41,5,32,42,8,33,43,11,34,44,14,35,45,17,36,46,20,37,47,23,38,48,26,39,49,29,31,2,40,32,5,41,33,8,42,34,11,43,35,14,44,36,17,45,37,20,46,38,23,47,39,26,48,50,29,49,3,2,4,6,5,7,9,8,10,12,11,13,15,14,16,18,17,19,21,20,22,24,23,25,27,26,28,51,29,52,31,4,2,32,7,5,33,10,8,34,13,11,35,16,14,36,19,17,37,22,20,38,25,23,39,28,26,50,52,29,0,2,53,3,5,54,6,8,55,9,11,56,12,14,57,15,17,58,18,20,59,21,23,60,24,26,61,27,29,62,3,53,2,6,54,5,9,55,8,12,56,11,15,57,14,18,58,17,21,59,20,24,60,23,27,61,26,51,62,29};
for(int i=0;i<80;i++)
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,conn+3*i);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f(MEDCouplingFieldDouble::New(ON_NODES,ONE_TIME));
+ MCAuto<MEDCouplingFieldDouble> f(MEDCouplingFieldDouble::New(ON_NODES,ONE_TIME));
const double valsOfField[189]={0.,0.,0.,0.,0.,0.,0.,0.,0.05,0.,0.,0.1,0.,0.,0.1,0.,0.,0.15,0.,0.,0.2,0.,0.,0.2,0.,0.,0.25,0.,0.,0.3,0.,0.,0.3,0.,0.,0.35,0.,0.,0.4,0.,0.,0.4,0.,0.,0.45,0.,0.,0.5,0.,0.,0.5,0.,0.,0.55,0.,0.,0.6,0.,0.,0.6,0.,0.,0.65,0.,0.,0.7,0.,0.,0.7,0.,0.,0.75,0.,0.,0.8,0.,0.,0.8,0.,0.,0.85,0.,0.,0.9,0.,0.,0.9,0.,0.,0.95,0.,0.,0.,0.,0.,0.1,0.,0.,0.2,0.,0.,0.3,0.,0.,0.4,0.,0.,0.5,0.,0.,0.6,0.,0.,0.7,0.,0.,0.8,0.,0.,0.9,0.,0.,0.05,0.,0.,0.15,0.,0.,0.25,0.,0.,0.35,0.,0.,0.45,0.,0.,0.55,0.,0.,0.65,0.,0.,0.75,0.,0.,0.85,0.,0.,0.95,0.,0.,1.,0.,0.,1.,0.,0.,1.,0.,0.,0.05,0.,0.,0.15,0.,0.,0.25,0.,0.,0.35,0.,0.,0.45,0.,0.,0.55,0.,0.,0.65,0.,0.,0.75,0.,0.,0.85,0.,0.,0.95};
f->setMesh(mesh); f->setName("VITESSE_P1_OUT");
arr=DataArrayDouble::New(); arr->alloc(63,3);
std::copy(valsOfField,valsOfField+189,arr->getPointer());
- f->setArray(arr); f->setNature(ConservativeVolumic);
- ParaMEDMEM::ParaMESH *paramesh(new ParaMEDMEM::ParaMESH(mesh,entree_chaude_group,"emetteur mesh"));
- vitesse=new ParaMEDMEM::ParaFIELD(f,paramesh,entree_chaude_group);
+ f->setArray(arr); f->setNature(IntensiveMaximum);
+ MEDCoupling::ParaMESH *paramesh(new MEDCoupling::ParaMESH(mesh,entree_chaude_group,"emetteur mesh"));
+ vitesse=new MEDCoupling::ParaFIELD(f,paramesh,entree_chaude_group);
vitesse->setOwnSupport(true);
dec_vit_in_chaude.setMethod("P1");
}
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh(MEDCouplingUMesh::New("mesh",2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr(DataArrayDouble::New()); arr->alloc(22,3);
+ MCAuto<MEDCouplingUMesh> mesh(MEDCouplingUMesh::New("mesh",2));
+ MCAuto<DataArrayDouble> arr(DataArrayDouble::New()); arr->alloc(22,3);
const double cooData[66]={0,0,0,1,0,0,0,0.1,0,1,0.1,0,0,0.2,0,1,0.2,0,0,0.3,0,1,0.3,0,0,0.4,0,1,0.4,0,0,0.5,0,1,0.5,0,0,0.6,0,1,0.6,0,0,0.7,0,1,0.7,0,0,0.8,0,1,0.8,0,0,0.9,0,1,0.9,0,0,1,0,1,1,0};
std::copy(cooData,cooData+66,arr->getPointer());
mesh->setCoords(arr);
const int conn[40]={0,1,3,2,2,3,5,4,4,5,7,6,6,7,9,8,8,9,11,10,10,11,13,12,12,13,15,14,14,15,17,16,16,17,19,18,18,19,21,20};
for(int i=0;i<10;i++)
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn+4*i);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f(MEDCouplingFieldDouble::New(type==0?ON_CELLS:ON_NODES,ONE_TIME));
+ MCAuto<MEDCouplingFieldDouble> f(MEDCouplingFieldDouble::New(type==0?ON_CELLS:ON_NODES,ONE_TIME));
f->setMesh(mesh); f->setName("vitesse_in_chaude");
arr=DataArrayDouble::New(); arr->alloc(f->getNumberOfTuplesExpected()*3); arr->fillWithZero(); arr->rearrange(3);
- f->setArray(arr); f->setNature(ConservativeVolumic);
- ParaMEDMEM::ParaMESH *paramesh(new ParaMEDMEM::ParaMESH(mesh,Genepi_group,"recepteur mesh"));
- vitesse=new ParaMEDMEM::ParaFIELD(f,paramesh,Genepi_group);
+ f->setArray(arr); f->setNature(IntensiveMaximum);
+ MEDCoupling::ParaMESH *paramesh(new MEDCoupling::ParaMESH(mesh,Genepi_group,"recepteur mesh"));
+ vitesse=new MEDCoupling::ParaFIELD(f,paramesh,Genepi_group);
vitesse->setOwnSupport(true);
dec_vit_in_chaude.setMethod(f->getDiscretization()->getRepr());
}
std::vector<InterpKernelDEC> decu(1);
decu[0]=InterpKernelDEC(emetteur_group,recepteur_group);
InterpKernelDEC& dec_emetteur=decu[0];
- ParaMEDMEM::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
- ParaMEDMEM::ParaMESH *paramesh(0);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh;
+ MEDCoupling::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
+ MEDCoupling::ParaMESH *paramesh(0);
+ MCAuto<MEDCouplingUMesh> mesh;
dec_emetteur.setOrientation(2);
if (send==0)
{
{
mesh=init_triangleGauthier1(is_master);
}
- paramesh=new ParaMEDMEM::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"emetteur mesh");
- ParaMEDMEM::ComponentTopology comptopo;
- champ_emetteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
- champ_emetteur->getField()->setNature(ConservativeVolumic);
+ paramesh=new MEDCoupling::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"emetteur mesh");
+ MEDCoupling::ComponentTopology comptopo;
+ champ_emetteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+ champ_emetteur->getField()->setNature(IntensiveMaximum);
champ_emetteur->setOwnSupport(true);
if (rec==0)
{
{
mesh=init_quadGauthier1(is_master);
}
- paramesh=new ParaMEDMEM::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"recepteur mesh");
- champ_recepteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
- champ_recepteur->getField()->setNature(ConservativeVolumic);
+ paramesh=new MEDCoupling::ParaMESH(mesh,recepteur_group.containsMyRank()?recepteur_group:emetteur_group,"recepteur mesh");
+ champ_recepteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+ champ_recepteur->getField()->setNature(IntensiveMaximum);
champ_recepteur->setOwnSupport(true);
if (cas=="emetteur")
{
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD* parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD* parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh,comptopo);
double *value=parafield->getField()->getArray()->getPointer();
std::copy(sourceVals,sourceVals+19,value);
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
}
else if(rank==2)
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
}
}
//test 1 - primaire -> secondaire
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
dec.setIntersectionType(INTERP_KERNEL::PointLocator);
- parafield->getField()->setNature(ConservativeVolumic);//very important
+ parafield->getField()->setNature(IntensiveMaximum);//very important
if (source_group->containsMyRank())
{
dec.setMethod("P1");
#include <assert.h>
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace ICoCo;
typedef enum {sync_and,sync_or} synctype;
MEDCouplingUMesh *init_quad()
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_quad",2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::New());
+ MCAuto<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_quad",2));
+ MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
const double dataCoo[24]={0.,0.,0.,1.,0.,0.,0.,0.,1.,1.,0.,1.,0.,1e-05,0.,1.,1e-05,0.,0.,1e-05,1.,1.,1e-05,1.};
coo->alloc(8,3);
std::copy(dataCoo,dataCoo+24,coo->getPointer());
MEDCouplingUMesh *init_triangle()
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_triangle",2));
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coo(DataArrayDouble::New());
+ MCAuto<MEDCouplingUMesh> m(MEDCouplingUMesh::New("champ_triangle",2));
+ MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
const double dataCoo[24]={0.,0.,0.,1.,0.,0.,0.,0.,1.,1.,0.,1.,0.,1e-05,0.,1.,1e-05,0.,0.,1e-05,1.,1.,1e-05,1.};
coo->alloc(8,3);
std::copy(dataCoo,dataCoo+24,coo->getPointer());
InterpKernelDEC dec_emetteur(emetteur_group,recepteur_group);
dec_emetteur.setOrientation(2);
- ParaMEDMEM::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
- ParaMEDMEM::ParaMESH *paramesh(0);
+ MEDCoupling::ParaFIELD *champ_emetteur(0),*champ_recepteur(0);
+ MEDCoupling::ParaMESH *paramesh(0);
if (cas=="emetteur")
{
- MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingUMesh> mesh_emetteur(init_triangle());
- paramesh=new ParaMEDMEM::ParaMESH(mesh_emetteur,emetteur_group,"emetteur mesh");
- ParaMEDMEM::ComponentTopology comptopo;
- champ_emetteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
- champ_emetteur->getField()->setNature(ConservativeVolumic);
+ MCAuto<MEDCoupling::MEDCouplingUMesh> mesh_emetteur(init_triangle());
+ paramesh=new MEDCoupling::ParaMESH(mesh_emetteur,emetteur_group,"emetteur mesh");
+ MEDCoupling::ComponentTopology comptopo;
+ champ_emetteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+ champ_emetteur->getField()->setNature(IntensiveMaximum);
champ_emetteur->setOwnSupport(true);
champ_emetteur->getField()->getArray()->fillWithValue(1.);
}
else
{
- MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::MEDCouplingUMesh> mesh_recepteur(init_quad());
- paramesh=new ParaMEDMEM::ParaMESH(mesh_recepteur,recepteur_group,"recepteur mesh");
- ParaMEDMEM::ComponentTopology comptopo;
- champ_recepteur=new ParaMEDMEM::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
- champ_recepteur->getField()->setNature(ConservativeVolumic);
+ MCAuto<MEDCoupling::MEDCouplingUMesh> mesh_recepteur(init_quad());
+ paramesh=new MEDCoupling::ParaMESH(mesh_recepteur,recepteur_group,"recepteur mesh");
+ MEDCoupling::ComponentTopology comptopo;
+ champ_recepteur=new MEDCoupling::ParaFIELD(ON_CELLS,ONE_TIME,paramesh,comptopo);
+ champ_recepteur->getField()->setNature(IntensiveMaximum);
champ_recepteur->setOwnSupport(true);
}
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void ParaMEDMEMTest::testInterpKernelDEC_2D()
{
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
if(rank==0)
{
valueP0[0]=7.; valueP0[1]=8.;
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
}
// test 1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
if(rank==0)
{
valueP0[0]=7.; valueP0[1]=8.;
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
}
// test 1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
ICoCo::MEDField* icocofield ;
string filename_xml1 = "square1_split";
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
- mesh = MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
ostringstream filename;
filename<<"./sourcesquareb_"<<source_group->myRank()+1;
aRemover.Register(filename.str().c_str());
- //MEDLoader::WriteField("./sourcesquareb",parafield->getField());
+ //WriteField("./sourcesquareb",parafield->getField());
dec.recvData();
cout <<"writing"<<endl;
ParaMEDLoader::WriteParaMesh("./sourcesquare",paramesh);
if (source_group->myRank()==0)
aRemover.Register("./sourcesquare");
- //MEDLoader::WriteField("./sourcesquare",parafield->getField());
+ //WriteField("./sourcesquare",parafield->getField());
filename<<"./sourcesquare_"<<source_group->myRank()+1;
dec.recvData();
ParaMEDLoader::WriteParaMesh("./targetsquareb",paramesh);
- //MEDLoader::WriteField("./targetsquareb",parafield->getField());
+ //WriteField("./targetsquareb",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
ostringstream filename;
aRemover.Register(filename.str().c_str());
dec.sendData();
ParaMEDLoader::WriteParaMesh("./targetsquare",paramesh);
- //MEDLoader::WriteField("./targetsquare",parafield->getField());
+ //WriteField("./targetsquare",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::MEDCouplingFieldDouble* mcfield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::MEDCouplingFieldDouble* mcfield;
string filename_xml1 = "square1_split";
string filename_xml2 = "square2_split";
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
- ParaMEDMEM::ComponentTopology comptopo;
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
mcfield = MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
array->alloc(mcfield->getNumberOfTuples(),1);
mcfield->setArray(array);
array->decrRef();
- mcfield->setNature(ConservativeVolumic);
+ mcfield->setNature(IntensiveMaximum);
}
else
{
string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
- mesh = MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
- ParaMEDMEM::ComponentTopology comptopo;
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
mcfield = MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
array->alloc(mcfield->getNumberOfTuples(),1);
mcfield->setArray(array);
array->decrRef();
- mcfield->setNature(ConservativeVolumic);
+ mcfield->setNature(IntensiveMaximum);
}
else
{
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
ICoCo::MEDField* icocofield ;
char * tmp_dir_c = getenv("TMP");
ostringstream meshname ;
meshname<< "Mesh_3_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
std::string fName = INTERP_TEST::getResourceFile(strstream.str());
ostringstream meshname ;
meshname<< "Mesh_6";
- mesh = MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
ostringstream filename;
filename<<"./sourcesquareb_"<<source_group->myRank()+1;
aRemover.Register(filename.str().c_str());
- //MEDLoader::WriteField("./sourcesquareb",parafield->getField());
+ //WriteField("./sourcesquareb",parafield->getField());
dec.recvData();
cout <<"writing"<<endl;
ParaMEDLoader::WriteParaMesh("./sourcesquare",paramesh);
if (source_group->myRank()==0)
aRemover.Register("./sourcesquare");
- //MEDLoader::WriteField("./sourcesquare",parafield->getField());
+ //WriteField("./sourcesquare",parafield->getField());
filename<<"./sourcesquare_"<<source_group->myRank()+1;
dec.recvData();
ParaMEDLoader::WriteParaMesh("./targetsquareb",paramesh);
- //MEDLoader::WriteField("./targetsquareb",parafield->getField());
+ //WriteField("./targetsquareb",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
ostringstream filename;
aRemover.Register(filename.str().c_str());
dec.sendData();
ParaMEDLoader::WriteParaMesh("./targetsquare",paramesh);
- //MEDLoader::WriteField("./targetsquare",parafield->getField());
+ //WriteField("./targetsquare",parafield->getField());
if (target_group->myRank()==0)
aRemover.Register("./targetsquareb");
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD* parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD* parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *value=parafield->getField()->getArray()->getPointer();
value[0]=34+13*((double)rank);
mesh->setCoords(myCoords);
myCoords->decrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
}
//test 1 - Conservative volumic
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
- parafield->getField()->setNature(ConservativeVolumic);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveMaximum);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[0],res[0],1e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
- //test 2 - Integral
- ParaMEDMEM::InterpKernelDEC dec2(*source_group,*target_group);
- parafield->getField()->setNature(Integral);
+ //test 2 - ExtensiveMaximum
+ MEDCoupling::InterpKernelDEC dec2(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveMaximum);
if (source_group->containsMyRank())
{
dec2.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[0],res[0],1e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
- //test 3 - Integral with global constraint
- ParaMEDMEM::InterpKernelDEC dec3(*source_group,*target_group);
- parafield->getField()->setNature(IntegralGlobConstraint);
+ //test 3 - ExtensiveMaximum with global constraint
+ MEDCoupling::InterpKernelDEC dec3(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveConservation);
if (source_group->containsMyRank())
{
dec3.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[0],res[0],1e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
- //test 4 - RevIntegral
- ParaMEDMEM::InterpKernelDEC dec4(*source_group,*target_group);
- parafield->getField()->setNature(RevIntegral);
+ //test 4 - IntensiveConservation
+ MEDCoupling::InterpKernelDEC dec4(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveConservation);
if (source_group->containsMyRank())
{
dec4.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[1],res[1],1e-13);
}
//test 5 - Conservative volumic reversed
- ParaMEDMEM::InterpKernelDEC dec5(*source_group,*target_group);
- parafield->getField()->setNature(ConservativeVolumic);
+ MEDCoupling::InterpKernelDEC dec5(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveMaximum);
if (source_group->containsMyRank())
{
dec5.setMethod("P0");
res[1]=toSet[1];
dec5.sendData();
}
- //test 6 - Integral reversed
- ParaMEDMEM::InterpKernelDEC dec6(*source_group,*target_group);
- parafield->getField()->setNature(Integral);
+ //test 6 - ExtensiveMaximum reversed
+ MEDCoupling::InterpKernelDEC dec6(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveMaximum);
if (source_group->containsMyRank())
{
dec6.setMethod("P0");
res[1]=toSet[1];
dec6.sendData();
}
- //test 7 - Integral with global constraint reversed
- ParaMEDMEM::InterpKernelDEC dec7(*source_group,*target_group);
- parafield->getField()->setNature(IntegralGlobConstraint);
+ //test 7 - ExtensiveMaximum with global constraint reversed
+ MEDCoupling::InterpKernelDEC dec7(*source_group,*target_group);
+ parafield->getField()->setNature(ExtensiveConservation);
if (source_group->containsMyRank())
{
dec7.setMethod("P0");
res[1]=toSet[1];
dec7.sendData();
}
- //test 8 - Integral with RevIntegral reversed
- ParaMEDMEM::InterpKernelDEC dec8(*source_group,*target_group);
- parafield->getField()->setNature(RevIntegral);
+ //test 8 - ExtensiveMaximum with IntensiveConservation reversed
+ MEDCoupling::InterpKernelDEC dec8(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveConservation);
if (source_group->containsMyRank())
{
dec8.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0,*parafieldP1=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0,*parafieldP1=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
}
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP1 = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
double *valueP1=parafieldP1->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
- parafieldP1->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
+ parafieldP1->getField()->setNature(IntensiveMaximum);
if(rank==0)
{
valueP0[0]=31.;
paramesh->setNodeGlobal(da);
da->decrRef();
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
parafieldP1 = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
- parafieldP1->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
+ parafieldP1->getField()->setNature(IntensiveMaximum);
}
// test 1 - P0 P1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
for (int i=nproc_source;i<size; i++)
procs_target.insert(i);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn+7);
mesh->finishInsertingCells();
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
double *vals=parafield->getField()->getArray()->getPointer();
if(rank==0)
{ vals[0]=7.; vals[1]=8.; }
else
{
mesh=MEDCouplingUMesh::New("an example of -1 D mesh",-1);
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*target_group,"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
}
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if(source_group->containsMyRank())
{
dec.setMethod("P0");
CPPUNIT_ASSERT_DOUBLES_EQUAL(9.125,res[0],1e-12);
dec.sendData();
}
- ParaMEDMEM::InterpKernelDEC dec2(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec2(*source_group,*target_group);
dec2.setMethod("P0");
- parafield->getField()->setNature(IntegralGlobConstraint);
+ parafield->getField()->setNature(ExtensiveConservation);
if(source_group->containsMyRank())
{
double *vals=parafield->getField()->getArray()->getPointer();
dec2.sendData();
}
//
- ParaMEDMEM::InterpKernelDEC dec3(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec3(*source_group,*target_group);
dec3.setMethod("P0");
- parafield->getField()->setNature(Integral);
+ parafield->getField()->setNature(ExtensiveMaximum);
if(source_group->containsMyRank())
{
double *vals=parafield->getField()->getArray()->getPointer();
dec3.sendData();
}
//
- ParaMEDMEM::InterpKernelDEC dec4(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec4(*source_group,*target_group);
dec4.setMethod("P0");
- parafield->getField()->setNature(RevIntegral);
+ parafield->getField()->setNature(IntensiveConservation);
if(source_group->containsMyRank())
{
double *vals=parafield->getField()->getArray()->getPointer();
procs_source.insert(0);
procs_target.insert(1);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafield=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafield=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
MPI_Barrier(MPI_COMM_WORLD);
double targetCoords[8]={ 0.,0., 1., 0., 0., 1., 1., 1. };
ProcessorGroup* target_group=0;
ProcessorGroup* source_group=0;
//
- ParaMEDMEM::InterpKernelDEC *dec=0;
+ MEDCoupling::InterpKernelDEC *dec=0;
if(rank==0 || rank==1)
{
- target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target,partialComm);
- source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source,partialComm);
+ target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target,partialComm);
+ source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source,partialComm);
if(source_group->containsMyRank())
{
mesh=MEDCouplingUMesh::New();
mesh->allocateCells(1);
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,targetConn);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);
double *vals=parafield->getField()->getArray()->getPointer();
vals[0]=7.;
- dec=new ParaMEDMEM::InterpKernelDEC(*source_group,*target_group);
+ dec=new MEDCoupling::InterpKernelDEC(*source_group,*target_group);
dec->attachLocalField(parafield);
dec->synchronize();
dec->sendData();
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn);
mesh->insertNextCell(INTERP_KERNEL::NORM_TRI3,3,targetConn+3);
mesh->finishInsertingCells();
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
paramesh=new ParaMESH(mesh,*target_group,"target mesh");
parafield=new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);
- dec=new ParaMEDMEM::InterpKernelDEC(*source_group,*target_group);
+ parafield->getField()->setNature(IntensiveMaximum);
+ dec=new MEDCoupling::InterpKernelDEC(*source_group,*target_group);
dec->attachLocalField(parafield);
dec->synchronize();
dec->recvData();
procs_target.insert(i);
self_procs.insert(rank);
//
- ParaMEDMEM::MEDCouplingUMesh *mesh=0;
- ParaMEDMEM::ParaMESH *paramesh=0;
- ParaMEDMEM::ParaFIELD *parafieldP0=0;
+ MEDCoupling::MEDCouplingUMesh *mesh=0;
+ MEDCoupling::ParaMESH *paramesh=0;
+ MEDCoupling::ParaFIELD *parafieldP0=0;
//
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
//
- ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//
MPI_Barrier(MPI_COMM_WORLD);
if(source_group->containsMyRank())
myCoords->decrRef();
//
paramesh=new ParaMESH(mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
double *valueP0=parafieldP0->getField()->getArray()->getPointer();
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
valueP0[0]=7.; valueP0[1]=8.;
}
else
myCoords->decrRef();
paramesh=new ParaMESH(mesh,*target_group,targetMeshName);
}
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafieldP0 = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafieldP0->getField()->setNature(ConservativeVolumic);
+ parafieldP0->getField()->setNature(IntensiveMaximum);
}
// test 1
- ParaMEDMEM::InterpKernelDEC dec(*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec(*source_group,*target_group);
if (source_group->containsMyRank())
{
dec.setMethod("P0");
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
ICoCo::MEDField* icocofield ;
ostringstream meshname ;
meshname<< "Mesh_2_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+ MEDCoupling::ComponentTopology comptopo;
if(srcM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);//InvertIntegral);//ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);//InvertIntegral);//IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
ostringstream meshname ;
meshname<< "Mesh_3_"<<rank-nproc_source+1;
- mesh = MEDLoader::ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
+ mesh = ReadUMeshFromFile(fName.c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- // ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ // MEDCoupling::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+ MEDCoupling::ComponentTopology comptopo;
if(targetM=="P0")
{
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
- parafield->getField()->setNature(ConservativeVolumic);//InvertIntegral);//ConservativeVolumic);
+ parafield->getField()->setNature(IntensiveMaximum);//InvertIntegral);//IntensiveMaximum);
}
else
parafield = new ParaFIELD(ON_NODES,NO_TIME,paramesh, comptopo);
using namespace std;
using namespace INTERP_KERNEL;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/*
* Check methods defined in MPPIProcessorGroup.hxx
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace MEDMEM;
/*
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
- ParaMEDMEM::ParaMESH* source_mesh=0;
- ParaMEDMEM::ParaMESH* target_mesh=0;
- ParaMEDMEM::ParaSUPPORT* parasupport=0;
+ MEDCoupling::ParaMESH* source_mesh=0;
+ MEDCoupling::ParaMESH* target_mesh=0;
+ MEDCoupling::ParaSUPPORT* parasupport=0;
//loading the geometry for the source group
- ParaMEDMEM::NonCoincidentDEC dec (*source_group,*target_group);
+ MEDCoupling::NonCoincidentDEC dec (*source_group,*target_group);
MEDMEM::MESH* mesh;
MEDMEM::SUPPORT* support;
MEDMEM::FIELD<double>* field;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
string filename_xml1 = getResourceFile(filename1);
string filename_xml2 = getResourceFile(filename2);
paramesh=new ParaMESH (*mesh,*source_group,"source mesh");
parasupport=new UnstructuredParaSUPPORT( support,*source_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(parasupport, comptopo);
paramesh=new ParaMESH (*mesh,*target_group,"target mesh");
parasupport=new UnstructuredParaSUPPORT(support,*target_group);
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(parasupport, comptopo);
using namespace std;
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDLoader.hxx"
#include "MEDLoaderBase.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingRemapper.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
-typedef MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> MUMesh;
-typedef MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> MFDouble;
-typedef MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> DADouble;
+typedef MCAuto<MEDCouplingUMesh> MUMesh;
+typedef MCAuto<MEDCouplingFieldDouble> MFDouble;
+typedef MCAuto<DataArrayDouble> DADouble;
//void ParaMEDMEMTest::testOverlapDEC_LMEC_seq()
//{
// string tgt_mesh_nam(rep + string("T_SC_Trio_dst.med"));
//// string src_mesh_nam(rep + string("h_TH_Trio_src.med"));
//// string tgt_mesh_nam(rep + string("h_TH_Trio_dst.med"));
-// MUMesh src_mesh=MEDLoader::ReadUMeshFromFile(src_mesh_nam,"SupportOf_",0);
-// MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_T_SC_Trio",0);
-//// MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_h_TH_Trio",0);
+// MUMesh src_mesh=ReadUMeshFromFile(src_mesh_nam,"SupportOf_",0);
+// MUMesh tgt_mesh=ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_T_SC_Trio",0);
+//// MUMesh tgt_mesh=ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_h_TH_Trio",0);
//
// MFDouble srcField = MEDCouplingFieldDouble::New(ON_CELLS, ONE_TIME);
// srcField->setMesh(src_mesh);
// DataArrayDouble * dad = DataArrayDouble::New(); dad->alloc(src_mesh->getNumberOfCells(),1);
// dad->fillWithValue(1.0);
// srcField->setArray(dad);
-// srcField->setNature(ConservativeVolumic);
+// srcField->setNature(IntensiveMaximum);
//
// MEDCouplingRemapper remap;
// remap.setOrientation(2); // always consider surface intersections as absolute areas.
// MFDouble tgtField = remap.transferField(srcField, 1.0e+300);
// tgtField->setName("result");
// string out_nam(rep + string("adrien.med"));
-// MEDLoader::WriteField(out_nam,tgtField, true);
+// WriteField(out_nam,tgtField, true);
// cout << "wrote: " << out_nam << "\n";
// double integ1 = 0.0, integ2 = 0.0;
// srcField->integral(true, &integ1);
//
//void ParaMEDMEMTest::testOverlapDEC_LMEC_para()
//{
-// using namespace ParaMEDMEM;
+// using namespace MEDCoupling;
//
// int size;
// int rank;
// {
// // string src_mesh_nam(rep + string("h_TH_Trio_src.med"));
// // string tgt_mesh_nam(rep + string("h_TH_Trio_dst.med"));
-// MUMesh src_mesh=MEDLoader::ReadUMeshFromFile(src_mesh_nam,"SupportOf_",0);
-// MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_T_SC_Trio",0);
-// // MUMesh tgt_mesh=MEDLoader::ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_h_TH_Trio",0);
+// MUMesh src_mesh=ReadUMeshFromFile(src_mesh_nam,"SupportOf_",0);
+// MUMesh tgt_mesh=ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_T_SC_Trio",0);
+// // MUMesh tgt_mesh=ReadUMeshFromFile(tgt_mesh_nam,"SupportOf_h_TH_Trio",0);
//
// // **** SOURCE
// srcField = MEDCouplingFieldDouble::New(ON_CELLS, ONE_TIME);
// DataArrayDouble * dad = DataArrayDouble::New(); dad->alloc(src_mesh->getNumberOfCells(),1);
// dad->fillWithValue(1.0);
// srcField->setArray(dad);
-// srcField->setNature(ConservativeVolumic);
+// srcField->setNature(IntensiveMaximum);
//
// ComponentTopology comptopo;
// parameshS = new ParaMESH(src_mesh,*dec.getGroup(),"source mesh");
// parafieldS = new ParaFIELD(ON_CELLS,ONE_TIME,parameshS,comptopo);
-// parafieldS->getField()->setNature(ConservativeVolumic);//IntegralGlobConstraint
+// parafieldS->getField()->setNature(IntensiveMaximum);//ExtensiveConservation
// parafieldS->getField()->setArray(dad);
//
// // **** TARGET
// parameshT=new ParaMESH(tgt_mesh,*dec.getGroup(),"target mesh");
// parafieldT=new ParaFIELD(ON_CELLS,ONE_TIME,parameshT,comptopo);
-// parafieldT->getField()->setNature(ConservativeVolumic);//IntegralGlobConstraint
+// parafieldT->getField()->setNature(IntensiveMaximum);//ExtensiveConservation
// parafieldT->getField()->getArray()->fillWithValue(1.0e300);
//// valsT[0]=7.;
// }
// tgtField->integral(true, &integ2);
// tgtField->setName("result");
// string out_nam(rep + string("adrien_para.med"));
-// MEDLoader::WriteField(out_nam,tgtField, true);
+// WriteField(out_nam,tgtField, true);
// cout << "wrote: " << out_nam << "\n";
// CPPUNIT_ASSERT_DOUBLES_EQUAL(integ1,integ2,1e-8);
// }
if(rank==0)
{
const double tr1[] = {1.5, 0.0};
- MEDCouplingUMesh *meshS_1 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCpy());
+ MEDCouplingUMesh *meshS_1 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_1->translate(tr1);
const double tr2[] = {3.0, 0.0};
- MEDCouplingUMesh *meshS_2 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCpy());
+ MEDCouplingUMesh *meshS_2 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_2->translate(tr2);
std::vector<const MEDCouplingUMesh*> vec;
//
const double tr3[] = {0.0, -1.5};
- MEDCouplingUMesh *meshT_3 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCpy());
+ MEDCouplingUMesh *meshT_3 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_3->translate(tr3);
vec.clear();
vec.push_back(meshT_0);vec.push_back(meshT_3);
if(rank==1)
{
const double tr3[] = {0.0, -1.5};
- MEDCouplingUMesh *meshS_3 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCpy());
+ MEDCouplingUMesh *meshS_3 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_3->translate(tr3);
const double tr4[] = {1.5, -1.5};
- MEDCouplingUMesh *meshS_4 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCpy());
+ MEDCouplingUMesh *meshS_4 = static_cast<MEDCouplingUMesh*>(meshS_0->deepCopy());
meshS_4->translate(tr4);
std::vector<const MEDCouplingUMesh*> vec;
//
const double tr5[] = {1.5, 0.0};
- MEDCouplingUMesh *meshT_1 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCpy());
+ MEDCouplingUMesh *meshT_1 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_1->translate(tr5);
const double tr6[] = {3.0, 0.0};
- MEDCouplingUMesh *meshT_2 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCpy());
+ MEDCouplingUMesh *meshT_2 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_2->translate(tr6);
const double tr7[] = {1.5, -1.5};
- MEDCouplingUMesh *meshT_4 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCpy());
+ MEDCouplingUMesh *meshT_4 = static_cast<MEDCouplingUMesh*>(meshT_0->deepCopy());
meshT_4->translate(tr7);
vec.clear();
OverlapDEC dec(procs);
MEDCouplingFieldDouble * mcfieldS=0, *mcfieldT=0;
- prepareData1(rank, ConservativeVolumic, mcfieldS, mcfieldT);
+ prepareData1(rank, IntensiveMaximum, mcfieldS, mcfieldT);
// See comment in the caller:
dec.setBoundingBoxAdjustmentAbs(bbAdj);
ParaMESH* parameshS=0, *parameshT=0;
ParaFIELD* parafieldS=0, *parafieldT=0;
- prepareData2(rank, grp, ConservativeVolumic, meshS, meshT, parameshS, parameshT, parafieldS, parafieldT);
+ prepareData2(rank, grp, IntensiveMaximum, meshS, meshT, parameshS, parameshT, parafieldS, parafieldT);
dec.attachSourceLocalField(parafieldS);
dec.attachTargetLocalField(parafieldT);
ParaFIELD* parafieldS=0, *parafieldT=0;
// As before, except than one of the source cell is removed, and that the field now has 2 components
- prepareData2(rank, grp, ConservativeVolumic, meshS, meshT, parameshS, parameshT, parafieldS, parafieldT,
+ prepareData2(rank, grp, IntensiveMaximum, meshS, meshT, parameshS, parameshT, parafieldS, parafieldT,
true, 2);
// if (rank == 1)
// {
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
/*
* Check methods defined in StructuredCoincidentDEC.hxx
return;
}
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::MPIProcessorGroup self_group (interface,rank,rank);
- ParaMEDMEM::MPIProcessorGroup target_group(interface,3,size-1);
- ParaMEDMEM::MPIProcessorGroup source_group (interface,0,2);
+ MEDCoupling::MPIProcessorGroup self_group (interface,rank,rank);
+ MEDCoupling::MPIProcessorGroup target_group(interface,3,size-1);
+ MEDCoupling::MPIProcessorGroup source_group (interface,0,2);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
string filename_xml1 = INTERP_TEST::getResourceFile("square1_split");
string filename_2 = INTERP_TEST::getResourceFile("square1.med");
//loading the geometry for the source group
- ParaMEDMEM::StructuredCoincidentDEC dec(source_group, target_group);
+ MEDCoupling::StructuredCoincidentDEC dec(source_group, target_group);
MPI_Barrier(MPI_COMM_WORLD);
if (source_group.containsMyRank()) {
ostringstream meshname;
meshname<< "Mesh_2_"<< rank+1;
- mesh=MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
paramesh=new ParaMESH (mesh,source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo(6);
+ MEDCoupling::ComponentTopology comptopo(6);
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
int nb_local=mesh->getNumberOfCells();
if (target_group.containsMyRank()) {
string meshname2("Mesh_2");
- mesh = MEDLoader::ReadUMeshFromFile(filename_2.c_str(),meshname2.c_str(),0);
+ mesh = ReadUMeshFromFile(filename_2.c_str(),meshname2.c_str(),0);
paramesh=new ParaMESH (mesh,self_group,"target mesh");
- ParaMEDMEM::ComponentTopology comptopo(6, &target_group);
+ MEDCoupling::ComponentTopology comptopo(6, &target_group);
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessDECTest::test_AllToAllDECSynchronousPointToPoint() {
test_AllToAllDEC( false ) ;
test_AllToAllDEC( true ) ;
}
-static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) {
+static void chksts( int sts , int myrank , MEDCoupling::MPIAccess mpi_access ) {
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
debugStream << "test_AllToAllDEC" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
std::set<int> sourceprocs;
std::set<int> targetprocs;
int i ;
targetprocs.insert(i);
}
- ParaMEDMEM::MPIProcessorGroup* sourcegroup = new ParaMEDMEM::MPIProcessorGroup(interface,sourceprocs) ;
- ParaMEDMEM::MPIProcessorGroup* targetgroup = new ParaMEDMEM::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessDECTest::test_AllToAllTimeDECSynchronousPointToPoint() {
test_AllToAllTimeDEC( false ) ;
test_AllToAllTimeDEC( true ) ;
}
-static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access ) {
+static void chksts( int sts , int myrank , MEDCoupling::MPIAccess * mpi_access ) {
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
debugStream << "test_AllToAllTimeDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
std::set<int> sourceprocs;
std::set<int> targetprocs;
int i ;
targetprocs.insert(i);
}
- ParaMEDMEM::MPIProcessorGroup* sourcegroup = new ParaMEDMEM::MPIProcessorGroup(interface,sourceprocs) ;
- ParaMEDMEM::MPIProcessorGroup* targetgroup = new ParaMEDMEM::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
// LinearTimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0.5 ) ;
MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessDECTest::test_AllToAllvDECSynchronousPointToPoint() {
test_AllToAllvDEC( false ) ;
test_AllToAllvDEC( true ) ;
}
-static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess mpi_access ) {
+static void chksts( int sts , int myrank , MEDCoupling::MPIAccess mpi_access ) {
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
debugStream << "test_AllToAllvDEC" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
std::set<int> sourceprocs;
std::set<int> targetprocs;
int i ;
targetprocs.insert(i);
}
- ParaMEDMEM::MPIProcessorGroup* sourcegroup = new ParaMEDMEM::MPIProcessorGroup(interface,sourceprocs) ;
- ParaMEDMEM::MPIProcessorGroup* targetgroup = new ParaMEDMEM::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
Asynchronous ) ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessDECTest::test_AllToAllvTimeDECSynchronousNative() {
test_AllToAllvTimeDEC( false , true ) ;
test_AllToAllvTimeDEC( true , false ) ;
}
-static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access ) {
+static void chksts( int sts , int myrank , MEDCoupling::MPIAccess * mpi_access ) {
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
debugStream << "test_AllToAllvTimeDEC" << myrank << " Asynchronous " << Asynchronous
<< " UseMPI_Alltoallv " << UseMPI_Alltoallv << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
std::set<int> sourceprocs;
std::set<int> targetprocs;
int i ;
targetprocs.insert(i);
}
- ParaMEDMEM::MPIProcessorGroup* sourcegroup = new ParaMEDMEM::MPIProcessorGroup(interface,sourceprocs) ;
- ParaMEDMEM::MPIProcessorGroup* targetgroup = new ParaMEDMEM::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
// TimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0.5 ) ;
MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessDECTest::test_AllToAllvTimeDoubleDECSynchronousPointToPoint() {
test_AllToAllvTimeDoubleDEC( false ) ;
test_AllToAllvTimeDoubleDEC( true ) ;
}
-static void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access ) {
+static void chksts( int sts , int myrank , MEDCoupling::MPIAccess * mpi_access ) {
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " Asynchronous " << Asynchronous << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
std::set<int> sourceprocs;
std::set<int> targetprocs;
int i ;
targetprocs.insert(i);
}
- ParaMEDMEM::MPIProcessorGroup* sourcegroup = new ParaMEDMEM::MPIProcessorGroup(interface,sourceprocs) ;
- ParaMEDMEM::MPIProcessorGroup* targetgroup = new ParaMEDMEM::MPIProcessorGroup(interface,targetprocs) ;
+ MEDCoupling::MPIProcessorGroup* sourcegroup = new MEDCoupling::MPIProcessorGroup(interface,sourceprocs) ;
+ MEDCoupling::MPIProcessorGroup* targetgroup = new MEDCoupling::MPIProcessorGroup(interface,targetprocs) ;
// TimeInterpolator * aLinearInterpDEC = new LinearTimeInterpolator( 0 ) ;
MPIAccessDEC * MyMPIAccessDEC = new MPIAccessDEC( *sourcegroup , *targetgroup ,
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_Cancel() {
debugStream << "test_MPI_Access_Cancel" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 2 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_Cyclic_ISend_IRecv() {
debugStream << "test_MPI_Access_Cyclic_ISend_IRecv" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
#define maxsend 100
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_Cyclic_Send_Recv() {
debugStream << "test_MPI_Access_Cyclic_Send_Recv" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 3 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_IProbe() {
debugStream << "test_MPI_Access_IProbe" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 2 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_ISendRecv() {
debugStream << "test_MPI_Access_ISendRecv" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 2 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_ISend_IRecv() {
debugStream << "test_MPI_Access_ISend_IRecv" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
#define maxreq 100
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() {
debugStream << "test_MPI_Access_ISend_IRecv_BottleNeck" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
#define maxreq 10000
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() {
debugStream << "test_MPI_Access_ISend_IRecv_Length" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
#define maxreq 10
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() {
debugStream << "test_MPI_Access_ISend_IRecv_Length_1" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
#define maxreq 10
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_Probe() {
debugStream << "test_MPI_Access_Probe" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 2 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_SendRecv() {
debugStream << "MPIAccessTest::test_MPI_Access_SendRecv" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 2 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_Send_Recv() {
debugStream << "test_MPI_Access_Send_Recv" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 2 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_Send_Recv_Length() {
debugStream << "test_MPI_Access_Send_Recv_Length" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
if ( myrank >= 2 ) {
mpi_access.barrier() ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void MPIAccessTest::test_MPI_Access_Time() {
debugStream << "test_MPI_Access_Time" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess mpi_access( group ) ;
+ MEDCoupling::MPIAccess mpi_access( group ) ;
#define maxreq 10
int sendbuf[maxreq] ;
int recvbuf[maxreq] ;
int i = 0 ;
- ParaMEDMEM::TimeMessage aSendTimeMsg[maxreq] ;
- ParaMEDMEM::TimeMessage aRecvTimeMsg[maxreq] ;
+ MEDCoupling::TimeMessage aSendTimeMsg[maxreq] ;
+ MEDCoupling::TimeMessage aRecvTimeMsg[maxreq] ;
double t ;
double dt = 1. ;
double maxt = 10. ;
#define ENABLE_FORCED_FAILURES
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
-void chksts( int sts , int myrank , ParaMEDMEM::MPIAccess * mpi_access ) {
+void chksts( int sts , int myrank , MEDCoupling::MPIAccess * mpi_access ) {
char msgerr[MPI_MAX_ERROR_STRING] ;
int lenerr ;
if ( sts != MPI_SUCCESS ) {
debugStream << "test_MPI_Access_Time_0 rank" << myrank << endl ;
- ParaMEDMEM::CommInterface interface ;
+ MEDCoupling::CommInterface interface ;
- ParaMEDMEM::MPIProcessorGroup* group = new ParaMEDMEM::MPIProcessorGroup(interface) ;
+ MEDCoupling::MPIProcessorGroup* group = new MEDCoupling::MPIProcessorGroup(interface) ;
- ParaMEDMEM::MPIAccess * mpi_access = new ParaMEDMEM::MPIAccess( group ) ;
+ MEDCoupling::MPIAccess * mpi_access = new MEDCoupling::MPIAccess( group ) ;
if ( myrank >= 2 ) {
debugStream << "test_MPI_Access_Time_0 rank" << myrank << " --> mpi_access->barrier" << endl ;
int sts ;
int sendbuf[maxreq] ;
int recvbuf[maxreq] ;
- ParaMEDMEM::TimeMessage aSendTimeMsg[maxreq] ;
+ MEDCoupling::TimeMessage aSendTimeMsg[maxreq] ;
int lasttime = -1 ;
- ParaMEDMEM::TimeMessage RecvTimeMessages[maxreq+1] ;
- ParaMEDMEM::TimeMessage *aRecvTimeMsg = &RecvTimeMessages[1] ;
+ MEDCoupling::TimeMessage RecvTimeMessages[maxreq+1] ;
+ MEDCoupling::TimeMessage *aRecvTimeMsg = &RecvTimeMessages[1] ;
// mpi_access->Trace() ;
int istep = 0 ;
for ( t = 0 ; t < maxt ; t = t+dt[myrank] ) {
#endif
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
void testInterpKernelDEC_2D(const string& filename1, const string& meshname1,
const string& filename2, const string& meshname2,
procs_target.insert(i);
self_procs.insert(rank);
- ParaMEDMEM::CommInterface interface;
+ MEDCoupling::CommInterface interface;
- ParaMEDMEM::ProcessorGroup* self_group = new ParaMEDMEM::MPIProcessorGroup(interface,self_procs);
- ParaMEDMEM::ProcessorGroup* target_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_target);
- ParaMEDMEM::ProcessorGroup* source_group = new ParaMEDMEM::MPIProcessorGroup(interface,procs_source);
+ MEDCoupling::ProcessorGroup* self_group = new MEDCoupling::MPIProcessorGroup(interface,self_procs);
+ MEDCoupling::ProcessorGroup* target_group = new MEDCoupling::MPIProcessorGroup(interface,procs_target);
+ MEDCoupling::ProcessorGroup* source_group = new MEDCoupling::MPIProcessorGroup(interface,procs_source);
//loading the geometry for the source group
- ParaMEDMEM::InterpKernelDEC dec (*source_group,*target_group);
+ MEDCoupling::InterpKernelDEC dec (*source_group,*target_group);
if(tri)
dec.setIntersectionType(INTERP_KERNEL::Triangulation);
else
dec.setIntersectionType(INTERP_KERNEL::Convex);
- ParaMEDMEM::MEDCouplingUMesh* mesh;
- ParaMEDMEM::ParaMESH* paramesh;
- ParaMEDMEM::ParaFIELD* parafield;
+ MEDCoupling::MEDCouplingUMesh* mesh;
+ MEDCoupling::ParaMESH* paramesh;
+ MEDCoupling::ParaFIELD* parafield;
ICoCo::MEDField* icocofield ;
// To remove tmp files from disk
meshname<< meshname1<<"_"<< rank+1;
get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
- mesh=MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh=ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
if( rank == 0 )
cout << "IO : Telapse = " << telps << " TuserCPU = " << tcpu_u << " TsysCPU = " << tcpu_s << " TCPU = " << tcpu << endl;
paramesh=new ParaMESH (mesh,*source_group,"source mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS, NO_TIME, paramesh, comptopo);
int nb_local=mesh->getNumberOfCells();
meshname<< meshname2<<"_"<<rank-nproc_source+1;
get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
- mesh = MEDLoader::ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
+ mesh = ReadUMeshFromFile(strstream.str().c_str(),meshname.str().c_str(),0);
get_time( &telps, &tcpu_u, &tcpu_s, &tcpu );
mesh->incrRef();
paramesh=new ParaMESH (mesh,*target_group,"target mesh");
- ParaMEDMEM::ComponentTopology comptopo;
+ MEDCoupling::ComponentTopology comptopo;
parafield = new ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo);
int nb_local=mesh->getNumberOfCells();
#include <mpi.h>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace ICoCo;
enum mpi_constants { mpi_comm_world, mpi_comm_self, mpi_double, mpi_int };
};
#endif
-%extend ParaMEDMEM::ParaMESH
+%extend MEDCoupling::ParaMESH
{
PyObject *getGlobalNumberingCell2() const
{
def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
import _ParaMEDMEM
return _ParaMEDMEM.DataArrayDoubleTuple____idiv___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoublenew(cls,*args):
+def MEDCouplingFieldDoublenew(cls,*args):
import _ParaMEDMEM
return _ParaMEDMEM.MEDCouplingFieldDouble____new___(cls,args)
-def ParaMEDMEMMEDCouplingFieldDoubleIadd(self,*args):
+def MEDCouplingFieldDoubleIadd(self,*args):
import _ParaMEDMEM
return _ParaMEDMEM.MEDCouplingFieldDouble____iadd___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIsub(self,*args):
+def MEDCouplingFieldDoubleIsub(self,*args):
import _ParaMEDMEM
return _ParaMEDMEM.MEDCouplingFieldDouble____isub___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleImul(self,*args):
+def MEDCouplingFieldDoubleImul(self,*args):
import _ParaMEDMEM
return _ParaMEDMEM.MEDCouplingFieldDouble____imul___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIdiv(self,*args):
+def MEDCouplingFieldDoubleIdiv(self,*args):
import _ParaMEDMEM
return _ParaMEDMEM.MEDCouplingFieldDouble____idiv___(self, self, *args)
-def ParaMEDMEMMEDCouplingFieldDoubleIpow(self,*args):
+def MEDCouplingFieldDoubleIpow(self,*args):
import _ParaMEDMEM
return _ParaMEDMEM.MEDCouplingFieldDouble____ipow___(self, self, *args)
def ParaMEDMEMDataArrayIntnew(cls,*args):
if source_group.containsMyRank():
filename = filename_xml1 + str(rank+1) + ".med"
meshname = "Mesh_2_" + str(rank+1)
- mesh=MEDLoader.ReadUMeshFromFile(filename,meshname,0)
+ mesh=ReadUMeshFromFile(filename,meshname,0)
paramesh=ParaMESH(mesh,source_group,"source mesh")
comptopo = ComponentTopology()
parafield = ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo)
- parafield.getField().setNature(ConservativeVolumic)
+ parafield.getField().setNature(IntensiveMaximum)
nb_local=mesh.getNumberOfCells()
value = [1.0]*nb_local
parafield.getField().setValues(value)
else:
filename = filename_xml2 + str(rank - nproc_source + 1) + ".med"
meshname = "Mesh_3_" + str(rank - nproc_source + 1)
- mesh=MEDLoader.ReadUMeshFromFile(filename,meshname,0)
+ mesh=ReadUMeshFromFile(filename,meshname,0)
paramesh=ParaMESH(mesh,target_group,"target mesh")
comptopo = ComponentTopology()
parafield = ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo)
- parafield.getField().setNature(ConservativeVolumic)
+ parafield.getField().setNature(IntensiveMaximum)
nb_local=mesh.getNumberOfCells()
value = [0.0]*nb_local
parafield.getField().setValues(value)
if source_group.containsMyRank():
filename = filename_xml1 + str(rank+1) + ".med"
meshname = "Mesh_2_" + str(rank+1)
- mesh=MEDLoader.ReadUMeshFromFile(filename,meshname,0)
+ mesh=ReadUMeshFromFile(filename,meshname,0)
paramesh=ParaMESH(mesh,source_group,"source mesh")
comptopo=ComponentTopology(6)
parafield=ParaFIELD(ON_CELLS,NO_TIME,paramesh,comptopo)
- parafield.getField().setNature(ConservativeVolumic)
+ parafield.getField().setNature(IntensiveMaximum)
nb_local=mesh.getNumberOfCells()
global_numbering=paramesh.getGlobalNumberingCell2()
value = []
if target_group.containsMyRank():
meshname2 = "Mesh_2"
- mesh=MEDLoader.ReadUMeshFromFile(filename_2, meshname2,0)
+ mesh=ReadUMeshFromFile(filename_2, meshname2,0)
paramesh=ParaMESH(mesh, self_group, "target mesh")
comptopo=ComponentTopology(6,target_group)
parafield=ParaFIELD(ON_CELLS,NO_TIME,paramesh, comptopo)
- parafield.getField().setNature(ConservativeVolumic)
+ parafield.getField().setNature(IntensiveMaximum)
nb_local=mesh.getNumberOfCells()
value = [0.0]*(nb_local*comptopo.nbLocalComponents())
parafield.getField().setValues(value)
#include "RENUMBER_BOOSTRenumbering.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/bandwidth.hpp>
-void BOOSTRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm)
+void BOOSTRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm)
{
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayInt> out0(ParaMEDMEM::DataArrayInt::New()),out1(ParaMEDMEM::DataArrayInt::New());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> out0(MEDCoupling::DataArrayInt::New()),out1(MEDCoupling::DataArrayInt::New());
out0->alloc(nbCell,1); out1->alloc(nbCell,1);
out0->fillWithZero(); out1->fillWithZero();
//
class RENUMBER_EXPORT BOOSTRenumbering:public Renumbering
{
public:
- void renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm);
+ void renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm);
};
#endif /*BOOSTRENUMBERING_HXX_*/
}
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "RENUMBER_METISRenumbering.hxx"
-void METISRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm)
+void METISRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm)
{
- ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr<ParaMEDMEM::DataArrayInt> out0(ParaMEDMEM::DataArrayInt::New()),out1(ParaMEDMEM::DataArrayInt::New());
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayInt> out0(MEDCoupling::DataArrayInt::New()),out1(MEDCoupling::DataArrayInt::New());
out0->alloc(nbCell,1); out1->alloc(nbCell,1);
out0->fillWithZero(); out1->fillWithZero();
int num_flag=1;
class RENUMBER_EXPORT METISRenumbering:public Renumbering
{
public:
- virtual void renumber(const int *graph, const int *index_graph, int nb_cell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm);
+ virtual void renumber(const int *graph, const int *index_graph, int nb_cell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm);
};
#endif /*METISRENUMBERING_HXX_*/
#include "RENUMBERDefines.hxx"
#include <vector>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
class DataArrayInt;
}
class RENUMBER_EXPORT Renumbering
{
public:
- virtual void renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm) = 0;
+ virtual void renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm) = 0;
virtual ~Renumbering() { }
};
#include <iostream>
using namespace std;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace MED_RENUMBER;
int main(int argc, char** argv)
}
// Reading file structure
cout << "Reading : " << flush;
- MEDCouplingAutoRefCountObjectPtr<MEDFileData> fd(MEDFileData::New(filename_in));
+ MCAuto<MEDFileData> fd(MEDFileData::New(filename_in));
MEDFileMesh *m=fd->getMeshes()->getMeshWithName(meshname);
MEDFileUMesh *mc=dynamic_cast<MEDFileUMesh *>(m);
if(!mc)
t_read_st=clock();
cout << (t_read_st-t_begin)/(double) CLOCKS_PER_SEC << "s" << endl << flush;
// Reading mesh
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> workMesh=mc->getMeshAtLevel(0);
+ MCAuto<MEDCouplingUMesh> workMesh=mc->getMeshAtLevel(0);
std::vector<int> code=workMesh->getDistributionOfTypes();
cout << "Building the graph : " << flush;
DataArrayInt *neighb=0,*neighbI=0;
workMesh->computeNeighborsOfCells(neighb,neighbI);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> neighbSafe(neighb),neighbISafe(neighbI),ipermSafe,permSafe;
+ MCAuto<DataArrayInt> neighbSafe(neighb),neighbISafe(neighbI),ipermSafe,permSafe;
const int *graph=neighbSafe->begin();
const int *graph_index=neighbISafe->begin();
// Compute permutation iperm->new2old perm->old2new
const DataArrayInt *famField=mc->getFamilyFieldAtLevel(0);
if(famField)
{
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> famField2=famField->renumber(perm->begin());
+ MCAuto<DataArrayInt> famField2=famField->renumber(perm->begin());
mc->setFamilyFieldArr(0,famField2);
}
mc->write(filename_out,2);
%include "MEDRenumberCommon.i"
%pythoncode %{
-def ParaMEDMEMDataArrayDoublenew(cls,*args):
+def MEDCouplingDataArrayDoublenew(cls,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDouble____new___(cls,args)
-def ParaMEDMEMDataArrayDoubleIadd(self,*args):
+def MEDCouplingDataArrayDoubleIadd(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDouble____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIsub(self,*args):
+def MEDCouplingDataArrayDoubleIsub(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDouble____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleImul(self,*args):
+def MEDCouplingDataArrayDoubleImul(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDouble____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleIdiv(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDouble____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleIpow(self,*args):
+def MEDCouplingDataArrayDoubleIpow(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDouble____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayIntnew(cls,*args):
+def MEDCouplingDataArrayIntnew(cls,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayInt____new___(cls,args)
-def ParaMEDMEMDataArrayIntIadd(self,*args):
+def MEDCouplingDataArrayIntIadd(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayInt____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntIsub(self,*args):
+def MEDCouplingDataArrayIntIsub(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayInt____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntImul(self,*args):
+def MEDCouplingDataArrayIntImul(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayInt____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntIdiv(self,*args):
+def MEDCouplingDataArrayIntIdiv(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayInt____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntImod(self,*args):
+def MEDCouplingDataArrayIntImod(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayInt____imod___(self, self, *args)
-def ParaMEDMEMDataArrayIntIpow(self,*args):
+def MEDCouplingDataArrayIntIpow(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayInt____ipow___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIadd(self,*args):
+def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDoubleTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIsub(self,*args):
+def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDoubleTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleImul(self,*args):
+def MEDCouplingDataArrayDoubleTupleImul(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDoubleTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayDoubleTupleIdiv(self,*args):
+def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayDoubleTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIadd(self,*args):
+def MEDCouplingDataArrayIntTupleIadd(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayIntTuple____iadd___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIsub(self,*args):
+def MEDCouplingDataArrayIntTupleIsub(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayIntTuple____isub___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImul(self,*args):
+def MEDCouplingDataArrayIntTupleImul(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayIntTuple____imul___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleIdiv(self,*args):
+def MEDCouplingDataArrayIntTupleIdiv(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayIntTuple____idiv___(self, self, *args)
-def ParaMEDMEMDataArrayIntTupleImod(self,*args):
+def MEDCouplingDataArrayIntTupleImod(self,*args):
import _MEDRenumber
return _MEDRenumber.DataArrayIntTuple____imod___(self, self, *args)
%}
%pythoncode %{
InterpKernelException.__reduce__=INTERPKERNELExceptionReduce
-DataArrayDouble.__new__=classmethod(ParaMEDMEMDataArrayDoublenew)
-DataArrayDouble.__iadd__=ParaMEDMEMDataArrayDoubleIadd
-DataArrayDouble.__isub__=ParaMEDMEMDataArrayDoubleIsub
-DataArrayDouble.__imul__=ParaMEDMEMDataArrayDoubleImul
-DataArrayDouble.__idiv__=ParaMEDMEMDataArrayDoubleIdiv
-DataArrayDouble.__ipow__=ParaMEDMEMDataArrayDoubleIpow
+DataArrayDouble.__new__=classmethod(MEDCouplingDataArrayDoublenew)
+DataArrayDouble.__iadd__=MEDCouplingDataArrayDoubleIadd
+DataArrayDouble.__isub__=MEDCouplingDataArrayDoubleIsub
+DataArrayDouble.__imul__=MEDCouplingDataArrayDoubleImul
+DataArrayDouble.__idiv__=MEDCouplingDataArrayDoubleIdiv
+DataArrayDouble.__ipow__=MEDCouplingDataArrayDoubleIpow
-DataArrayInt.__new__=classmethod(ParaMEDMEMDataArrayIntnew)
-DataArrayInt.__iadd__=ParaMEDMEMDataArrayIntIadd
-DataArrayInt.__isub__=ParaMEDMEMDataArrayIntIsub
-DataArrayInt.__imul__=ParaMEDMEMDataArrayIntImul
-DataArrayInt.__idiv__=ParaMEDMEMDataArrayIntIdiv
-DataArrayInt.__imod__=ParaMEDMEMDataArrayIntImod
-DataArrayInt.__ipow__=ParaMEDMEMDataArrayIntIpow
+DataArrayInt.__new__=classmethod(MEDCouplingDataArrayIntnew)
+DataArrayInt.__iadd__=MEDCouplingDataArrayIntIadd
+DataArrayInt.__isub__=MEDCouplingDataArrayIntIsub
+DataArrayInt.__imul__=MEDCouplingDataArrayIntImul
+DataArrayInt.__idiv__=MEDCouplingDataArrayIntIdiv
+DataArrayInt.__imod__=MEDCouplingDataArrayIntImod
+DataArrayInt.__ipow__=MEDCouplingDataArrayIntIpow
-DataArrayDoubleTuple.__iadd__=ParaMEDMEMDataArrayDoubleTupleIadd
-DataArrayDoubleTuple.__isub__=ParaMEDMEMDataArrayDoubleTupleIsub
-DataArrayDoubleTuple.__imul__=ParaMEDMEMDataArrayDoubleTupleImul
-DataArrayDoubleTuple.__idiv__=ParaMEDMEMDataArrayDoubleTupleIdiv
+DataArrayDoubleTuple.__iadd__=MEDCouplingDataArrayDoubleTupleIadd
+DataArrayDoubleTuple.__isub__=MEDCouplingDataArrayDoubleTupleIsub
+DataArrayDoubleTuple.__imul__=MEDCouplingDataArrayDoubleTupleImul
+DataArrayDoubleTuple.__idiv__=MEDCouplingDataArrayDoubleTupleIdiv
-DataArrayIntTuple.__iadd__=ParaMEDMEMDataArrayIntTupleIadd
-DataArrayIntTuple.__isub__=ParaMEDMEMDataArrayIntTupleIsub
-DataArrayIntTuple.__imul__=ParaMEDMEMDataArrayIntTupleImul
-DataArrayIntTuple.__idiv__=ParaMEDMEMDataArrayIntTupleIdiv
-DataArrayIntTuple.__imod__=ParaMEDMEMDataArrayIntTupleImod
+DataArrayIntTuple.__iadd__=MEDCouplingDataArrayIntTupleIadd
+DataArrayIntTuple.__isub__=MEDCouplingDataArrayIntTupleIsub
+DataArrayIntTuple.__imul__=MEDCouplingDataArrayIntTupleImul
+DataArrayIntTuple.__idiv__=MEDCouplingDataArrayIntTupleIdiv
+DataArrayIntTuple.__imod__=MEDCouplingDataArrayIntTupleImod
del INTERPKERNELExceptionReduce
-del ParaMEDMEMDataArrayDoublenew
-del ParaMEDMEMDataArrayDoubleIadd
-del ParaMEDMEMDataArrayDoubleIsub
-del ParaMEDMEMDataArrayDoubleImul
-del ParaMEDMEMDataArrayDoubleIdiv
-del ParaMEDMEMDataArrayIntnew
-del ParaMEDMEMDataArrayIntIadd
-del ParaMEDMEMDataArrayIntIsub
-del ParaMEDMEMDataArrayIntImul
-del ParaMEDMEMDataArrayIntIdiv
-del ParaMEDMEMDataArrayIntImod
-del ParaMEDMEMDataArrayDoubleTupleIadd
-del ParaMEDMEMDataArrayDoubleTupleIsub
-del ParaMEDMEMDataArrayDoubleTupleImul
-del ParaMEDMEMDataArrayDoubleTupleIdiv
-del ParaMEDMEMDataArrayIntTupleIadd
-del ParaMEDMEMDataArrayIntTupleIsub
-del ParaMEDMEMDataArrayIntTupleImul
-del ParaMEDMEMDataArrayIntTupleIdiv
-del ParaMEDMEMDataArrayIntTupleImod
+del MEDCouplingDataArrayDoublenew
+del MEDCouplingDataArrayDoubleIadd
+del MEDCouplingDataArrayDoubleIsub
+del MEDCouplingDataArrayDoubleImul
+del MEDCouplingDataArrayDoubleIdiv
+del MEDCouplingDataArrayIntnew
+del MEDCouplingDataArrayIntIadd
+del MEDCouplingDataArrayIntIsub
+del MEDCouplingDataArrayIntImul
+del MEDCouplingDataArrayIntIdiv
+del MEDCouplingDataArrayIntImod
+del MEDCouplingDataArrayDoubleTupleIadd
+del MEDCouplingDataArrayDoubleTupleIsub
+del MEDCouplingDataArrayDoubleTupleImul
+del MEDCouplingDataArrayDoubleTupleIdiv
+del MEDCouplingDataArrayIntTupleIadd
+del MEDCouplingDataArrayIntTupleIsub
+del MEDCouplingDataArrayIntTupleImul
+del MEDCouplingDataArrayIntTupleIdiv
+del MEDCouplingDataArrayIntTupleImod
%}
%{
#include "MEDCouplingMemArray.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
#include "MEDCouplingDataArrayTypemaps.i"
#include "RenumberingFactory.hxx"
#include "RENUMBER_Renumbering.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
using namespace INTERP_KERNEL;
using namespace MED_RENUMBER;
%}
public:
%extend
{
- virtual PyObject *renumber(const ParaMEDMEM::DataArrayInt *graph, const ParaMEDMEM::DataArrayInt *index_graph) throw(INTERP_KERNEL::Exception)
+ virtual PyObject *renumber(const MEDCoupling::DataArrayInt *graph, const MEDCoupling::DataArrayInt *index_graph) throw(INTERP_KERNEL::Exception)
{
if(!graph || !index_graph)
throw INTERP_KERNEL::Exception("wrap of Renumbering::renumber : One of the input arrays is NULL !");
if(!graph->isAllocated() || !index_graph->isAllocated())
throw INTERP_KERNEL::Exception("wrap of Renumbering::renumber : One of the input arrays is not allocated !");
- ParaMEDMEM::DataArrayInt *out0(0),*out1(0);
+ MEDCoupling::DataArrayInt *out0(0),*out1(0);
self->renumber(graph->begin(),index_graph->begin(),index_graph->getNumberOfTuples()-1,out0,out1);
PyObject *ret=PyTuple_New(2);
- PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(out0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
- PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(out1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(out0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(out1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return ret;
}
}
--- /dev/null
+import os
+rep=("namespace ParaMEDMEM","namespace MEDCoupling")
+rep=("ParaMEDMEM::","MEDCoupling::")
+#rep=("ParaMEDMEMImpl::","MEDCouplingImpl::")
+
+#rep=("_ParaMEDMEM__","_MEDCoupling__")
+#rep=("ParaMEDMEM_","MEDCoupling_")
+#rep=("ParaMEDMEMData","MEDCouplingData")
+
+#rep=("ParaMEDMEM_1","MEDCoupling_1")
+
+def rep0(fi,rep):
+ f=file(fi) ; lines=f.readlines() ; del f
+ lines2=[line.replace(*rep) for line in lines]
+ if lines2!=lines:
+ f=file(fi,"w") ; f.writelines(lines2) ; f.flush()
+ return 1
+ else:
+ return 0
+
+def rep1(dirname,rep):
+ i=0
+ for fi in os.listdir(dirname):
+ fi2=os.path.join(dirname,fi)
+ if not os.path.isfile(fi2):
+ continue
+ i+=rep0(fi2,rep)
+ return i
+
+dirs=["MEDCoupling","MEDCoupling/Test","MEDLoader","MEDLoader/Swig","MEDLoader/Test","MEDPartitioner","MEDPartitioner/Test","MEDPartitioner_Swig","RENUMBER","RENUMBER_Swig","INTERP_KERNELTest","ParaMEDMEM","ParaMEDLoader","ParaMEDMEMTest","ParaMEDMEM_Swig","doc/user/doxygen/fakesources","doc/user/doxygen/doxy2swig","doc/user/doxygen/doxfiles","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba/Client","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba/Test","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalc/cmp","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator/Swig","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator/Test","/home/H87074/salome/DEV/modules/src/PARAVIS/src/Plugins/MEDReader/IO"]
+dirname=dirs[-1]
+i=0
+print rep1(dirname,rep)
+"""for r,dirs,fis in os.walk(dirname):
+ for fi in fis:
+ if os.path.splitext(fi)[1] not in [".dox",".doxy"]:
+ continue
+ i+=rep0(os.path.join(r,fi),rep)
+
+print i"""
===============
+ move up in all classes deepCpy(), shallowCpy(), clone()
-Namespace changes
+Namespace changes [DONE]
=================
+ MEDCoupling for all
+ MEDLoader static methods moved at namespace level
DataArrayInt
------------
+ isIdentity2 / isIota
selectByTupleId2 / selectByTupleIdSlice
BuildOld2NewArrayFromSurjectiveFormat2 / ConvertIndexArrayToO2N
getIdsEqualList / findIdsEqualList
getIdsNotEqualList / findIdsNotEqualList
getIdsEqualTuple / findIdsEqualTuple
- locateValue(int) / findIdsFirstEqual
- locateValue(vec) / findIdsFirstEqualList
- search / findIdsSequence
+ locateValue / findIdFirstEqual
+ locateTuple / findIdFirstEqualTuple
+ search / findIdSequence
getIdsInRange / findIdsInRange
getIdsNotInRange / findIdsNotInRange
getIdsStrictlyNegative / findIdsStricltyNegative
from optparse import OptionParser
import os
-DEFAULT_EXT = ['.hxx', '.cxx', '.txx', '.py', '.i', '.dox', '.rst', '.h', '.hh', '.hpp', '.c', '.cpp', ]
+DEFAULT_EXT = ['.hxx', '.cxx', '.txx', '.py', '.i', '.dox', '.rst', '.h', '.hh', '.hpp', '.c', '.cpp']
## The API changes:
REPLACEMENTS = [("RevIntegral", "IntensiveConservation"),
("IntegralGlobConstraint", "ExtensiveConservation"),
("Integral", "ExtensiveMaximum"),
("MEDCouplingAutoRefCountObjectPtr", "MCAuto"),
- ("deepCpy", "deepCopy")
+ ("deepCpy", "deepCopy"),
+ ("performCpy", "performCopyOrIncrRef"),
+ ("MEDCouplingExtrudedMesh", "MEDCouplingMappedExtrudedMesh"),
+ ("getBarycenterAndOwner", "computeCellCenterOfMass"),
+ ("checkCoherency", "checkConsistencyLight"),
+ ("checkCoherency1", "checkConsistency"),
+ ("mergeNodes2", "mergeNodesCenter"),
+ ("renumberNodes2", "renumberNodesCenter"),
+ ("buildPartOfMySelf2", "buildPartOfMySelfSlice"),
+ ("buildPartOfMySelfKeepCoords2", "buildPartOfMySelfKeepCoordsSlice"),
+ ("deepCpyConnectivityOnly", "deepCopyConnectivityOnly"),
+ ("checkCoherencyOfConnectivity", "checkConsistencyOfConnectivity"),
+ ("getMeshLength", "getNodalConnectivityArrayLen"),
+ ("AreCellsEqual0", "AreCellsEqualPolicy0"),
+ ("AreCellsEqual1", "AreCellsEqualPolicy1"),
+ ("AreCellsEqual2", "AreCellsEqualPolicy2"),
+ ("AreCellsEqual7", "AreCellsEqualPolicy7"),
+ ("AreCellsEqual3", "AreCellsEqualPolicy2NoType"),
+ ("areCellsIncludedIn2", "areCellsIncludedInPolicy7"),
+ ("setPartOfMySelf2", "setPartOfMySelfSlice"),
+ ("ExtractFromIndexedArrays2", "ExtractFromIndexedArraysSlice"),
+ ("SetPartOfIndexedArrays2", "SetPartOfIndexedArraysSlice"),
+ ("SetPartOfIndexedArraysSameIdx2", "SetPartOfIndexedArraysSameIdxSlice"),
+ ("deepCpyConnectivityOnly", "deepCopyConnectivityOnly"),
+ ("setContigPartOfSelectedValues2", "setContigPartOfSelectedValuesSlice"),
+ ("selectByTupleId2", "selectByTupleIdSafeSlice"),
+ ("GetAxTypeRepr", "GetAxisTypeRepr"),
+ ("cpyFrom", "deepCopyFrom"),
+ ("selectByTupleId2", "selectByTupleIdSlice"),
+ ("BuildOld2NewArrayFromSurjectiveFormat2", "ConvertIndexArrayToO2N"),
+ ("getIdsEqual", "findIdsEqual"),
+ ("getIdsNotEqual", "findIdsNotEqual"),
+ ("getIdsEqualList", "findIdsEqualList"),
+ ("getIdsNotEqualList", "findIdsNotEqualList"),
+ ("getIdsEqualTuple", "findIdsEqualTuple"),
+ ("getIdsInRange", "findIdsInRange"),
+ ("getIdsNotInRange", "findIdsNotInRange"),
+ ("getIdsStrictlyNegative", "findIdsStricltyNegative"),
+ ("searchRangesInListOfIds", "findIdsRangesInListOfIds"),
+ ("computeOffsets2", "computeOffsetsFull"),
+ ("applyFunc2", "applyFuncCompo"),
+ ("applyFunc3", "applyFuncNamedCompo"),
+ ("getIdsInRange", "findIdsInRange"),
+ ("fillFromAnalytic2", "fillFromAnalyticCompo"),
+ ("fillFromAnalytic3", "fillFromAnalyticNamedCompo"),
+ ("applyFunc2", "applyFuncCompo"),
+ ("applyFunc3", "applyFuncNamedCompo"),
+ ("mergeNodes2", "mergeNodesCenter"),
+ ("setAxType", "setAxisType"),
+ ("getAxType", "getAxisType"),
+ ("isIdentity2", "isIota"),
+ ("SWIGTYPE_p_MEDCoupling__MEDCouplingExtrudedMesh", "SWIGTYPE_p_MEDCoupling__MEDCouplingMappedExtrudedMesh"),
+ ("MEDCouplingExtrudedMesh____new___", "MEDCouplingMappedExtrudedMesh____new___"),
+ ("locateValue", "findIdFirstEqual"),
+ ("locateTuple", "findIdFirstEqualTuple"),
+ ("MEDCoupling_DataArrayByte_locateTuple", "MEDCoupling_DataArrayByte_findIdFirstEqualTuple"),
+ ("MEDCoupling_DataArrayAsciiChar_locateTuple", "MEDCoupling_DataArrayAsciiChar_findIdFirstEqualTuple"),
+ #("substr", "subArray"), # conflicts with regular C++ substr, to be handled manually
+ #("search", "findIdSequence"), # idem
]
__myName = os.path.abspath(__file__)
print "!!! Skipping script %s !!!" % __myName
continue
ok = False
- for e in ext:
- if fileName[-len(e):] == e:
- ok = True
- break
+ if fileName[-28:] != "MEDCouplingNatureOfFieldEnum":
+ for e in ext:
+ if fileName[-len(e):] == e:
+ ok = True
+ break
+ else:
+ ok = True
if not ok: continue # skip file
if not quiet: print "Handling %s ..." % fileName
for line in fileinput.input(fileName, inplace=1, backup='.bak'):
for before, after in REPLACEMENTS:
- line = re.sub("(\W|^)(%s)(\W|$)" % before, r"\1%s\3" % after, line.rstrip())
+ line = re.sub("(\W|^)(%s)(\W|$)" % before, r"\1%s\3" % after, line.rstrip('\r\n'))
print(line) # print in file
parser = OptionParser()