myField.setTime(Time) ;
// Value :
- int NumberOfValue = mySupport->getNumberOfElements(MED_ALL_ELEMENTS);
+ int NumberOfValue = mySupport->getNumberOfElements(MEDMEM_ALL_ELEMENTS);
for(int i=1; i<=NumberOfValue; i++) // i^th element
for (int j=1; j<=NumberOfCompoennts; j++) { // j^th component
double myValue = (i+j) * 0.1 ;
time = 3.435678
myField.setTime(time)
-numberOfValue = mySupport.getNumberOfElements(MED_ALL_ELEMENTS)
+numberOfValue = mySupport.getNumberOfElements(MEDMEM_ALL_ELEMENTS)
for i in range(numberOfValue):
ip1 = i+1
" (and order number " << OrderNumber << ")" << endl ;
// How many Value :
- int NumberOfValue = mySupport->getNumberOfElements(MED_ALL_ELEMENTS);
+ int NumberOfValue = mySupport->getNumberOfElements(MEDMEM_ALL_ELEMENTS);
// Value
const double * Value = myField.getValue();
for(int i=0; i<NumberOfValue; i++) {
print "Iteration ",iterationNumber," at time ",time,\
" (and order number ",orderNumber,")"
-numberOfValue = mySupport.getNumberOfElements(MED_ALL_ELEMENTS)
+numberOfValue = mySupport.getNumberOfElements(MEDMEM_ALL_ELEMENTS)
value = myField.getValue()
for i in range(numberOfValue):
\cite{RefManualMedMemory}). The entries of the enum are quite
self-explanatory~:
\begin{itemize}
-\item \verb+MED_NONE+
-\item \verb+MED_POINT1+
-\item \verb+MED_SEG2+
-\item \verb+MED_SEG3+
-\item \verb+MED_TRIA3+
-\item \verb+MED_QUAD4+
-\item \verb+MED_TRIA6+
-\item \verb+MED_QUAD8+
-\item \verb+MED_TETRA4+
-\item \verb+MED_PYRA5+
-\item \verb+MED_PENTA6+
-\item \verb+MED_HEXA8+
-\item \verb+MED_TETRA10+
-\item \verb+MED_PYRA13+
-\item \verb+MED_PENTA15+
-\item \verb+MED_HEXA20+
-\item \verb+MED_POLYGON+
-\item \verb+MED_POLYHEDRA+
-\item \verb+MED_ALL_ELEMENTS+
+\item \verb+MEDMEM_NONE+
+\item \verb+MEDMEM_POINT1+
+\item \verb+MEDMEM_SEG2+
+\item \verb+MEDMEM_SEG3+
+\item \verb+MEDMEM_TRIA3+
+\item \verb+MEDMEM_QUAD4+
+\item \verb+MEDMEM_TRIA6+
+\item \verb+MEDMEM_QUAD8+
+\item \verb+MEDMEM_TETRA4+
+\item \verb+MEDMEM_PYRA5+
+\item \verb+MEDMEM_PENTA6+
+\item \verb+MEDMEM_HEXA8+
+\item \verb+MEDMEM_TETRA10+
+\item \verb+MEDMEM_PYRA13+
+\item \verb+MEDMEM_PENTA15+
+\item \verb+MEDMEM_HEXA20+
+\item \verb+MEDMEM_POLYGON+
+\item \verb+MEDMEM_POLYHEDRA+
+\item \verb+MEDMEM_ALL_ELEMENTS+
\end{itemize}
\item
an enum which contains the different mesh entities, \verb+medEntityMesh+, the
\textbf{C++ Example~:}
-\verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MED_TRIA3);+
+\verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MEDMEM_TRIA3);+
\verb+int NumberOfFace = myMesh.getNumberOfElements(MED_FACE,MED_ALL_ELEMENT);+
\textbf{C++ Example~:}
\begin{verbatim}
-int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MED_TETRA4);
+int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MEDMEM_TETRA4);
const int * TetrahedronConnectivity =
myMesh.getConnectivity(MED_FULL_ENTERLACE,
MED_NODAL,
MED_CELL,
- MED_TETRA4);
+ MEDMEM_TETRA4);
\end{verbatim}
\verb+TetrahedronConnectivity+ contain nodal connectivity
of tetrahedron in mesh. It is arranged in full enterlace mode and
its size is \verb+NumberOfTetrahedron x 4+.
-If you want to get connectivity of all elements (with \verb+Type=MED_ALL_ELEMENTS+),
+If you want to get connectivity of all elements (with \verb+Type=MEDMEM_ALL_ELEMENTS+),
you must use the index array (return by \method{getConnectivityIndex})
to get connectivity for each elements (see example \myref{MESHconnectivities.cxx}).
myMeshing.setCoordinates(SpaceDimension,NumberOfNodes,Coordinates,System,Mode);
myMeshing.setNumberOfTypes(2,MED_CELL);
-myMeshing.setTypes({MED_TRIA3,MED_QUAD4},MED_CELL);
-myMeshing.setNumberOfElements({3,2},MED_CELL); // 3 MED_TRIA3 and 2 MED_QUAD4
-myMeshing.setConnectivity({1,2,3,6,8,9,4,5,6},MED_CELL,MED_TRIA3);
-myMeshing.setConnectivity({1,3,4,5,4,5,7,8},MED_CELL,MED_QUAD4);
+myMeshing.setTypes({MEDMEM_TRIA3,MEDMEM_QUAD4},MED_CELL);
+myMeshing.setNumberOfElements({3,2},MED_CELL); // 3 MEDMEM_TRIA3 and 2 MEDMEM_QUAD4
+myMeshing.setConnectivity({1,2,3,6,8,9,4,5,6},MED_CELL,MEDMEM_TRIA3);
+myMeshing.setConnectivity({1,3,4,5,4,5,7,8},MED_CELL,MEDMEM_QUAD4);
\end{verbatim}
\latex latex
\backslash
-verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MED_TRIA3);+
+verb+int NumberOfTriangle = myMesh.getNumberOfElements(MED_FACE,MEDMEM_TRIA3);+
\layout Standard
\backslash
begin{verbatim}
\newline
-int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MED_TETRA4);
+int NumberOfTetrahedron = myMesh.getNumberOfElements(MED_CELL,MEDMEM_TETRA4);
\newline
int * TetrahedronConnectivity =
\newline
\newline
MED_CELL,
\newline
- MED_TETRA4);
+ MEDMEM_TETRA4);
\newline
\backslash
\latex latex
\backslash
-verb+Type=MED_ALL_ELEMENTS+
+verb+Type=MEDMEM_ALL_ELEMENTS+
\latex default
), you must use the index array (return by
\latex latex
// cell part
const int NumberOfTypes = 3 ;
- medGeometryElement Types[NumberOfTypes] = {MED_TETRA4,MED_PYRA5,MED_HEXA8} ;
+ medGeometryElement Types[NumberOfTypes] = {MEDMEM_TETRA4,MEDMEM_PYRA5,MEDMEM_HEXA8} ;
const int NumberOfElements[NumberOfTypes] = {12,2,2} ;
myMeshing->setNumberOfTypes(NumberOfTypes,MED_CELL);
2,10,6,9
};
- myMeshing->setConnectivity(MED_CELL,MED_TETRA4,ConnectivityTetra);
+ myMeshing->setConnectivity(MED_CELL,MEDMEM_TETRA4,ConnectivityTetra);
int ConnectivityPyra[2*5]=
{
15,18,17,16,19
};
- myMeshing->setConnectivity(MED_CELL,MED_PYRA5,ConnectivityPyra);
+ myMeshing->setConnectivity(MED_CELL,MEDMEM_PYRA5,ConnectivityPyra);
int ConnectivityHexa[2*8]=
{
15,16,17,18,11,12,13,14
};
- myMeshing->setConnectivity(MED_CELL,MED_HEXA8,ConnectivityHexa);
+ myMeshing->setConnectivity(MED_CELL,MEDMEM_HEXA8,ConnectivityHexa);
// face part
const int NumberOfFacesTypes = 2 ;
- medGeometryElement FacesTypes[NumberOfFacesTypes] = {MED_TRIA3,MED_QUAD4} ;
+ medGeometryElement FacesTypes[NumberOfFacesTypes] = {MEDMEM_TRIA3,MEDMEM_QUAD4} ;
const int NumberOfFacesElements[NumberOfFacesTypes] = {4,4} ;
myMeshing->setNumberOfTypes(NumberOfFacesTypes,MED_FACE);
1,3,6
};
- myMeshing->setConnectivity(MED_FACE,MED_TRIA3,ConnectivityTria);
+ myMeshing->setConnectivity(MED_FACE,MEDMEM_TRIA3,ConnectivityTria);
int ConnectivityQua[4*4]=
{
12,8,9,13
};
- myMeshing->setConnectivity(MED_FACE,MED_QUAD4,ConnectivityQua);
+ myMeshing->setConnectivity(MED_FACE,MEDMEM_QUAD4,ConnectivityQua);
// edge part
myGroup->setMesh(myMeshing);
myGroup->setEntity(MED_NODE);
myGroup->setNumberOfGeometricType(1);
- medGeometryElement myTypes[1] = {MED_NONE};
+ medGeometryElement myTypes[1] = {MEDMEM_NONE};
myGroup->setGeometricType(myTypes);
const int myNumberOfElements[1] = {4} ;
myGroup->setNumberOfElements(myNumberOfElements);
myGroup->setMesh(myMeshing);
myGroup->setEntity(MED_NODE);
myGroup->setNumberOfGeometricType(1);
- medGeometryElement myTypes[1] = {MED_NONE};
+ medGeometryElement myTypes[1] = {MEDMEM_NONE};
myGroup->setGeometricType(myTypes);
const int myNumberOfElements[1] = {3} ;
myGroup->setNumberOfElements(myNumberOfElements);
myGroup->setMesh(myMeshing);
myGroup->setEntity(MED_CELL);
myGroup->setNumberOfGeometricType(3);
- medGeometryElement myTypes[3] = {MED_TETRA4,MED_PYRA5,MED_HEXA8};
+ medGeometryElement myTypes[3] = {MEDMEM_TETRA4,MEDMEM_PYRA5,MEDMEM_HEXA8};
myGroup->setGeometricType(myTypes);
const int myNumberOfElements[3] = {4,1,2} ;
myGroup->setNumberOfElements(myNumberOfElements);
myGroup->setMesh(myMeshing);
myGroup->setEntity(MED_CELL);
myGroup->setNumberOfGeometricType(2);
- medGeometryElement myTypes[] = {MED_TETRA4,MED_PYRA5};
+ medGeometryElement myTypes[] = {MEDMEM_TETRA4,MEDMEM_PYRA5};
myGroup->setGeometricType(myTypes);
const int myNumberOfElements[] = {4,1} ;
myGroup->setNumberOfElements(myNumberOfElements);
myGroup->setMesh(myMeshing);
myGroup->setEntity(MED_FACE);
myGroup->setNumberOfGeometricType(2);
- medGeometryElement myTypes[2] = {MED_TRIA3,MED_QUAD4};
+ medGeometryElement myTypes[2] = {MEDMEM_TRIA3,MEDMEM_QUAD4};
myGroup->setGeometricType(myTypes);
const int myNumberOfElements[2] = {2,3} ;
myGroup->setNumberOfElements(myNumberOfElements);
myGroup->setMesh(myMeshing);
myGroup->setEntity(MED_FACE);
myGroup->setNumberOfGeometricType(1);
- medGeometryElement myTypes[1] = {MED_TRIA3};
+ medGeometryElement myTypes[1] = {MEDMEM_TRIA3};
myGroup->setGeometricType(myTypes);
const int myNumberOfElements[1] = {2} ;
myGroup->setNumberOfElements(myNumberOfElements);
types = []
numberOfElements = []
-types.append(MED_TETRA4)
+types.append(MEDMEM_TETRA4)
numberOfElements.append(12)
-types.append(MED_PYRA5)
+types.append(MEDMEM_PYRA5)
numberOfElements.append(2)
-types.append(MED_HEXA8)
+types.append(MEDMEM_HEXA8)
numberOfElements.append(2)
myMeshing.setNumberOfTypes(numberOfTypes,entity)
types = []
numberOfElements = []
-types.append(MED_TRIA3)
+types.append(MEDMEM_TRIA3)
numberOfElements.append(4)
-types.append(MED_QUAD4)
+types.append(MEDMEM_QUAD4)
numberOfElements.append(4)
myMeshing.setNumberOfTypes(numberOfTypes,entity)
myGroup.setEntity(MED_NODE)
myGroup.setNumberOfGeometricType(1)
-myTypes = [MED_NONE]
+myTypes = [MEDMEM_NONE]
myGroup.setGeometricType(myTypes)
myNumberOfElements = [4]
myGroup.setEntity(MED_NODE)
myGroup.setNumberOfGeometricType(1)
-myTypes = [MED_NONE]
+myTypes = [MEDMEM_NONE]
myGroup.setGeometricType(myTypes)
myNumberOfElements = [3]
myGroup.setEntity(MED_CELL)
myGroup.setNumberOfGeometricType(3)
-myTypes = [MED_TETRA4,MED_PYRA5,MED_HEXA8]
+myTypes = [MEDMEM_TETRA4,MEDMEM_PYRA5,MEDMEM_HEXA8]
myGroup.setGeometricType(myTypes)
myNumberOfElements = [4,1,2]
myGroup.setEntity(MED_CELL)
myGroup.setNumberOfGeometricType(2)
-myTypes = [MED_TETRA4,MED_PYRA5]
+myTypes = [MEDMEM_TETRA4,MEDMEM_PYRA5]
myGroup.setGeometricType(myTypes)
myNumberOfElements = [4,1]
myGroup.setEntity(MED_FACE)
myGroup.setNumberOfGeometricType(2)
-myTypes = [MED_TRIA3,MED_QUAD4]
+myTypes = [MEDMEM_TRIA3,MEDMEM_QUAD4]
myGroup.setGeometricType(myTypes)
myNumberOfElements = [2,3]
myGroup.setEntity(MED_FACE)
myGroup.setNumberOfGeometricType(1)
-myTypes = [MED_TRIA3]
+myTypes = [MEDMEM_TRIA3]
myGroup.setGeometricType(myTypes)
myNumberOfElements = [2]
# 1 scalar (vector)
supportOnNodes = SUPPORT(myMeshing,"On_All_Nodes",MED_NODE)
-numberOfNodes = supportOnNodes.getNumberOfElements(MED_ALL_ELEMENTS)
+numberOfNodes = supportOnNodes.getNumberOfElements(MEDMEM_ALL_ELEMENTS)
supportOnCells = SUPPORT(myMeshing,"On_All_Cells",MED_CELL)
-numberOfCells = supportOnCells.getNumberOfElements(MED_ALL_ELEMENTS)
+numberOfCells = supportOnCells.getNumberOfElements(MEDMEM_ALL_ELEMENTS)
fieldDoubleScalarOnNodes = FIELDDOUBLE(supportOnNodes,1)
fieldDoubleScalarOnNodes.setName("fieldScalarDoubleNode")
cout << "Show Connectivity (Descending) :" << endl ;
// this example use global access with index array
- int NumberOfElements = myMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS);
+ int NumberOfElements = myMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS);
const int * DescendingConnectivity =
- myMesh.getConnectivity(MED_DESCENDING,MED_CELL,MED_ALL_ELEMENTS);
+ myMesh.getConnectivity(MED_DESCENDING,MED_CELL,MEDMEM_ALL_ELEMENTS);
const int * DescendingConnectivityIndex =
myMesh.getConnectivityIndex(MED_DESCENDING,MED_CELL);
for (int i=0; i<NumberOfElements; i++) {
}
NumberOfConstituents =
- myMesh.getNumberOfElements(ConstituentEntity,MED_ALL_ELEMENTS);
+ myMesh.getNumberOfElements(ConstituentEntity,MEDMEM_ALL_ELEMENTS);
if (MeshDimension==1) {
MESSAGE_MED("ERROR : MeshDimension = 1 !");
cout << "Show "<< Constituent <<" Connectivity (Nodal) :" << endl ;
// this example use global access with index array
const int * ConstituentConnectivity =
- myMesh.getConnectivity(MED_NODAL,ConstituentEntity,MED_ALL_ELEMENTS);
+ myMesh.getConnectivity(MED_NODAL,ConstituentEntity,MEDMEM_ALL_ELEMENTS);
const int * ConstituentConnectivityIndex =
myMesh.getConnectivityIndex(MED_NODAL,ConstituentEntity);
for (int i=0; i<NumberOfConstituents; i++) {
# This example use global access with index array
-numberOfElements = myMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
-descendingConnectivity = myMesh.getConnectivity(MED_DESCENDING,MED_CELL,MED_ALL_ELEMENTS)
+numberOfElements = myMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS)
+descendingConnectivity = myMesh.getConnectivity(MED_DESCENDING,MED_CELL,MEDMEM_ALL_ELEMENTS)
descendingConnectivityIndex = myMesh.getConnectivityIndex(MED_DESCENDING,MED_CELL)
for i in range(numberOfElements):
constituentEntity = MED_FACE
numberOfConstituents = myMesh.getNumberOfElements(constituentEntity,
- MED_ALL_ELEMENTS)
+ MEDMEM_ALL_ELEMENTS)
reverseDescendingConnectivity = myMesh.getReverseConnectivity(
MED_DESCENDING)
reverseDescendingConnectivityIndex = myMesh.getReverseConnectivityIndex(
print "Show ",constituent," Connectivity (Nodal) :"
- constituentConnectivity = myMesh.getConnectivity(MED_NODAL,constituentEntity,MED_ALL_ELEMENTS)
+ constituentConnectivity = myMesh.getConnectivity(MED_NODAL,constituentEntity,MEDMEM_ALL_ELEMENTS)
constituentConnectivityIndex = myMesh.getConnectivityIndex(MED_NODAL,constituentEntity)
for i in range(numberOfConstituents):
available types are linear and quadratic elements (consult
\ref RefManualMedMemory). The entries of this enum are quite
self-explanatory :
- - \c MED_NONE
- - \c MED_POINT1
- - \c MED_SEG2
- - \c MED_SEG3
- - \c MED_TRIA3
- - \c MED_QUAD4
- - \c MED_TRIA6
- - \c MED_QUAD8
- - \c MED_TETRA4
- - \c MED_PYRA5
- - \c MED_PENTA6
- - \c MED_HEXA8
- - \c MED_TETRA10
- - \c MED_PYRA13
- - \c MED_PENTA15
- - \c MED_HEXA20
- - \c MED_POLYGON
- - \c MED_POLYHEDRA
- - \c MED_ALL_ELEMENTS
+ - \c MEDMEM_NONE
+ - \c MEDMEM_POINT1
+ - \c MEDMEM_SEG2
+ - \c MEDMEM_SEG3
+ - \c MEDMEM_TRIA3
+ - \c MEDMEM_QUAD4
+ - \c MEDMEM_TRIA6
+ - \c MEDMEM_QUAD8
+ - \c MEDMEM_TETRA4
+ - \c MEDMEM_PYRA5
+ - \c MEDMEM_PENTA6
+ - \c MEDMEM_HEXA8
+ - \c MEDMEM_TETRA10
+ - \c MEDMEM_PYRA13
+ - \c MEDMEM_PENTA15
+ - \c MEDMEM_HEXA20
+ - \c MEDMEM_POLYGON
+ - \c MEDMEM_POLYHEDRA
+ - \c MEDMEM_ALL_ELEMENTS
.
The connectivity of all these elements is defined in MED project Web page
http://hammi.extra.cea.fr/static/MED/web_med/logiciels/med-2.3.1/doc/ .
meshes. Class MESHING deriving from it supplies functions for creating meshes from scratch (c.f. \ref meshing).
\section mesh_connectivity Content of the connectivity array
-Underlying the unstructured meshes is the notion of connectivity. This section only covers meshes made out of standard elements, the \c MED_POLYGON and \c MED_POLYHEDRA case being detailed in section \ref polygon .
+Underlying the unstructured meshes is the notion of connectivity. This section only covers meshes made out of standard elements, the \c MEDMEM_POLYGON and \c MEDMEM_POLYHEDRA case being detailed in section \ref polygon .
\anchor medmemConnArrays
\image html connectivity_arrays_small.png "Nodal connectivity storage scheme"
- the nodal connectivity array containing the connectivity of each cell, all cells being sorted by type;
- the connectivity index array, which indicates the beginning of each cell in the connectivity array.
-The cell types are ordered by their number of nodes; MED_POLYGON and
-MED_POLYHEDRA is always the last type, if present.
+The cell types are ordered by their number of nodes; MEDMEM_POLYGON and
+MEDMEM_POLYHEDRA is always the last type, if present.
As an example, let us consider a mesh made out of a linear triangle, two linear quadrangles and a quadratic triangle (c.f. figure \ref fig_connectivity_example ).
\image html connectivity_example_small.png "Example for mesh connectivity"
The number of types is : 3
The type array writes :
-\{ \a MED_TRIA3, \a MED_QUAD4, \a MED_TRIA6 \}
+\{ \a MEDMEM_TRIA3, \a MEDMEM_QUAD4, \a MEDMEM_TRIA6 \}
The global numbering index is : \{ 1,2,4,5 \} }. Its dimension is \f$ n_{types}+1 \f$
so that elements of type \f$ type[i] \f$ are stored between element \f$ index[i] \f$ and
The following paragraphs describe the methods that must be called
when creating a mesh. An example illustrates the general procedure.
-The specific case of \c MED_POLYGON and \c MED_POLYHEDRA
+The specific case of \c MEDMEM_POLYGON and \c MEDMEM_POLYHEDRA
elements requires some methods that are described in \ref polygon.
\section outline_meshing Outline
Let us consider an example with the two tetrahedra represented on
figure \ref fig_polyhedron_connectivity , the left one
-being stored as a \c MED_TETRA4 element, the right one being stored
-as a \c MED_POLYHEDRA element.
+being stored as a \c MEDMEM_TETRA4 element, the right one being stored
+as a \c MEDMEM_POLYHEDRA element.
\anchor fig_polyhedron_connectivity
\image html polyhedron_connectivity_small.png "Example for polyhedron connectivity. Node numbers are written with a normal font, while face numbers are written in italic font."
- The connectivity table writes : {1, 2, 3, 4, 2, 5, 3, -1, 2, 4, 5, -1, 4, 3, 5, -1, 2, 3, 4}
- The index connectivity table writes : {1, 5, 20 }
-If there are two \c MED_POLYHEDRA elements that share a common face,
+If there are two \c MEDMEM_POLYHEDRA elements that share a common face,
the list of nodes is repeated twice in the polyhedron connectivity
array but with reversed order.
SUPPORT *sup=new SUPPORT(&mesh,"dummy",MED_CELL);
FIELD<double>* f=mesh.getVolume(sup);
const double *tabS=f->getValue();
- std::copy(tabS,tabS+mesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS),tab)
+ std::copy(tabS,tabS+mesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS),tab)
delete sup;
}
bool ok = true;
// source elements
- double* sVol = new double[sMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)];
+ double* sVol = new double[sMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS)];
getVolumes(sMesh, sVol);
- for(int i = 0; i < sMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS); ++i)
+ for(int i = 0; i < sMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS); ++i)
{
const double sum_row = sumRow(m, i+1);
if(!epsilonEqualRelative(sum_row, sVol[i], VOL_PREC))
}
// target elements
- double* tVol = new double[tMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)];
+ double* tVol = new double[tMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS)];
getVolumes(tMesh, tVol);
- for(int i = 0; i < tMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS); ++i)
+ for(int i = 0; i < tMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS); ++i)
{
const double sum_col = sumCol(m, i);
if(!epsilonEqualRelative(sum_col, tVol[i], VOL_PREC))
MEDMEM::SUPPORT *source_support=new SUPPORT(source_mesh,"on All support");
MEDMEM::FIELD<double> *source_field=new FIELD<double>(source_support,1);
double* value=const_cast<double*>(source_field->getValue());
- for (int i=0; i<source_support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); i++)
+ for (int i=0; i<source_support->getNumberOfElements(MED_EN::MEDMEM_ALL_ELEMENTS); i++)
value[i]=1.0;
source_support->removeReference();
MEDMEM::SUPPORT *target_support=new MEDMEM::SUPPORT(target_mesh,"on All support");
MEDMEM::FIELD<double> *target_field=new FIELD<double>(target_support,1);
double* targetvalue=const_cast<double*>(target_field->getValue());
- for (int i=0; i<target_support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); i++)
+ for (int i=0; i<target_support->getNumberOfElements(MED_EN::MEDMEM_ALL_ELEMENTS); i++)
targetvalue[i]=0.0;
target_support->removeReference();
// Ok at this point we have our mesh in MED-Memory format.
{
case 2:
nbnodes=(nbedge+1)*(nbedge+1);
- if(type==MED_EN::MED_QUAD4)
+ if(type==MED_EN::MEDMEM_QUAD4)
nbelems=(nbedge*nbedge);
else
throw MEDMEM::MEDEXCEPTION("MEDMeshMaker: type not impletmented");
break;
case 3:
nbnodes=(nbedge+1)*(nbedge+1)*(nbedge+1);
- if (type==MED_EN::MED_HEXA8)
+ if (type==MED_EN::MEDMEM_HEXA8)
nbelems= nbedge*nbedge*nbedge;
else
throw MEDMEM::MEDEXCEPTION("MEDMeshMaker: type not impletmented");
break;
}
const double *tabS = f->getValue();
- std::copy(tabS,tabS+mesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS),tab);
+ std::copy(tabS,tabS+mesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS),tab);
sup->removeReference();
f->removeReference();
}
bool ok = true;
// source elements
- double* sVol = new double[sMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)];
+ double* sVol = new double[sMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS)];
getVolumes(sMesh, sVol);
- for(int i = 0; i < sMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS); ++i)
+ for(int i = 0; i < sMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS); ++i)
{
const double sum_row = sumRow(m, i+1);
if(!epsilonEqualRelative(sum_row, fabs(sVol[i]), _precision))
}
// target elements
- double* tVol = new double[tMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)];
+ double* tVol = new double[tMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS)];
getVolumes(tMesh, tVol);
- for(int i = 0; i < tMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS); ++i)
+ for(int i = 0; i < tMesh.getNumberOfElements(MED_CELL,MEDMEM_ALL_ELEMENTS); ++i)
{
const double sum_col = sumCol(m, i);
if(!epsilonEqualRelative(sum_col,fabs(tVol[i]), _precision))
* a bbox overlapping the bboxes of the tree
*/
void PointLocatorTest::test_PointLocator() {
- MEDMEM::MESH* mesh2D= MEDMeshMaker(2,2,MED_EN::MED_QUAD4);
+ MEDMEM::MESH* mesh2D= MEDMeshMaker(2,2,MED_EN::MEDMEM_QUAD4);
MEDMEM::PointLocator pl(*mesh2D) ;
double x[2]={0.0,0.0};
std::list<int> elems = pl.locate(x);
elems.clear();
delete mesh2D;
- MEDMEM::MESH* mesh3D= MEDMeshMaker(3,2,MED_EN::MED_HEXA8);
+ MEDMEM::MESH* mesh3D= MEDMeshMaker(3,2,MED_EN::MEDMEM_HEXA8);
MEDMEM::PointLocator pl3(*mesh3D);
double xx[3]={0.0,0.0,0.0};
elems = pl3.locate(xx);
MEDMEM::SUPPORT source_support(&source_mesh,"on All support");
MEDMEM::FIELD<double> source_field(&source_support,1);
double* value=const_cast<double*>(source_field.getValue());
- for (int i=0; i<source_support.getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); i++)
+ for (int i=0; i<source_support.getNumberOfElements(MED_EN::MEDMEM_ALL_ELEMENTS); i++)
value[i]=1.0;
MEDMEM::SUPPORT target_support(&target_mesh,"on All support");
MEDMEM::FIELD<double> target_field(&target_support,1);
double* targetvalue=const_cast<double*>(target_field.getValue());
- for (int i=0; i<target_support.getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); i++)
+ for (int i=0; i<target_support.getNumberOfElements(MED_EN::MEDMEM_ALL_ELEMENTS); i++)
targetvalue[i]=0.0;
LOG(5, "Loading " << mesh1 << " from " << mesh1path);
const MESH sMesh(MED_DRIVER, dataDir+mesh1path, mesh1);
- const int numSrcElems = sMesh.getNumberOfElements(MED_CELL, MED_ALL_ELEMENTS);
+ const int numSrcElems = sMesh.getNumberOfElements(MED_CELL, MEDMEM_ALL_ELEMENTS);
LOG(1, "Source mesh has " << numSrcElems << " elements");
LOG(5, "Loading " << mesh2 << " from " << mesh2path);
const MESH tMesh(MED_DRIVER, dataDir+mesh2path, mesh2);
- const int numTargetElems = tMesh.getNumberOfElements(MED_CELL, MED_ALL_ELEMENTS);
+ const int numTargetElems = tMesh.getNumberOfElements(MED_CELL, MEDMEM_ALL_ELEMENTS);
LOG(1, "Target mesh has " << numTargetElems << " elements");
fvm_element_t fvm_type;
switch (types[itype])
{
- case MED_EN::MED_TRIA3 :
+ case MED_EN::MEDMEM_TRIA3 :
fvm_type=FVM_FACE_TRIA;
break;
- case MED_EN::MED_QUAD4 :
+ case MED_EN::MEDMEM_QUAD4 :
fvm_type=FVM_FACE_QUAD;
break;
- case MED_EN::MED_TETRA4 :
+ case MED_EN::MEDMEM_TETRA4 :
fvm_type=FVM_CELL_TETRA;
break;
- case MED_EN::MED_HEXA8 :
+ case MED_EN::MEDMEM_HEXA8 :
fvm_type=FVM_CELL_HEXA;
break;
default:
for (int i=0; i<nbelems*(types[itype]%100); i++)
conn[i]=mesh_conn[i];
//swapping trias
- if (types[itype]==MED_EN::MED_TRIA3)
+ if (types[itype]==MED_EN::MEDMEM_TRIA3)
{
for (int i=0; i<nbelems;i++)
{
}
}
//swapping tetras
- if (types[itype]==MED_EN::MED_TETRA4)
+ if (types[itype]==MED_EN::MEDMEM_TETRA4)
{
for (int i=0; i<nbelems;i++)
{
fvm_element_t fvm_type;
switch (types[itype])
{
- case MED_EN::MED_TRIA3 :
+ case MED_EN::MEDMEM_TRIA3 :
fvm_type=FVM_FACE_TRIA;
break;
- case MED_EN::MED_QUAD4 :
+ case MED_EN::MEDMEM_QUAD4 :
fvm_type=FVM_FACE_QUAD;
break;
- case MED_EN::MED_TETRA4 :
+ case MED_EN::MEDMEM_TETRA4 :
fvm_type=FVM_CELL_TETRA;
break;
- case MED_EN::MED_HEXA8 :
+ case MED_EN::MEDMEM_HEXA8 :
fvm_type=FVM_CELL_HEXA;
break;
default:
*comm,
source_size,
start_rank);
- int nbcells = mesh->getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
+ int nbcells = mesh->getNumberOfElements(MED_EN::MED_CELL,MED_EN::MEDMEM_ALL_ELEMENTS);
const MEDMEM::SUPPORT* support=_local_field->getField()->getSupport();
MEDMEM::FIELD<double>* barycenter_coords = mesh->getBarycenter(support);
const double* coords = barycenter_coords->getValue();
*/
void NonCoincidentDEC::recvData()
{
- int nbelems = _local_field->getField()->getSupport()->getMesh()->getNumberOfElements(MED_EN::MED_CELL, MED_EN::MED_ALL_ELEMENTS);
+ int nbelems = _local_field->getField()->getSupport()->getMesh()->getNumberOfElements(MED_EN::MED_CELL, MED_EN::MEDMEM_ALL_ELEMENTS);
int nbcomp = _local_field->getField()->getNumberOfComponents();
double* values = new double [nbelems*nbcomp];
fvm_locator_exchange_point_var(_locator,
parafield = new ParaFIELD(parasupport, comptopo);
- int nb_local=support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS);
+ int nb_local=support->getNumberOfElements(MED_EN::MEDMEM_ALL_ELEMENTS);
double * value= new double[nb_local];
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=1.0;
parafield = new ParaFIELD(parasupport, comptopo);
- int nb_local=support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS);
+ int nb_local=support->getNumberOfElements(MED_EN::MEDMEM_ALL_ELEMENTS);
double * value= new double[nb_local];
for(int ielem=0; ielem<nb_local;ielem++)
value[ielem]=0.0;
parafield = ParaFIELD(parasupport, comptopo)
- nb_local = support.getNumberOfElements(MED_ALL_ELEMENTS);
+ nb_local = support.getNumberOfElements(MEDMEM_ALL_ELEMENTS);
value = [1.0]*nb_local
comptopo = ComponentTopology()
parafield = ParaFIELD(parasupport, comptopo)
- nb_local = support.getNumberOfElements(MED_ALL_ELEMENTS)
+ nb_local = support.getNumberOfElements(MEDMEM_ALL_ELEMENTS)
value = [0.0]*nb_local
parafield.getField().setValue(value)
conn->calculateFullDescendingConnectivity(MED_CELL);
const int* rev_conn=mesh->getReverseConnectivity(MED_EN::MED_DESCENDING, MED_EN::MED_CELL);
const int* rev_conn_index=mesh->getReverseConnectivityIndex(MED_EN::MED_DESCENDING, MED_EN::MED_CELL);
- int nb_face= mesh->getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS);
- int nb_edge = mesh->getNumberOfElements(MED_EDGE,MED_ALL_ELEMENTS);
+ int nb_face= mesh->getNumberOfElements(MED_FACE,MEDMEM_ALL_ELEMENTS);
+ int nb_edge = mesh->getNumberOfElements(MED_EDGE,MEDMEM_ALL_ELEMENTS);
nb_cell= mesh->getNumberOfElements(MED_CELL,Type);
int nb_constituent;
field=field&(f.getValueIJ(i+1,2)==field_ini[i*2+1])
f.rmDriver(id)
-nbcell2dboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dboost=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[2,6,13,11,11,13,14,12,6,5,15,13,12,14,10,4,13,15,16,14,5,1,7,15,14,16,9,10,15,7,8,16,16,8,3,9]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
-conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_QUAD4)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MEDMEM_QUAD4)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
conn2dboost=(len(conn)==len(connectivite))
if conn2dboost:
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell2dmetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dmetis=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[12,14,10,4,2,6,13,11,11,13,14,12,16,8,3,9,5,1,7,15,15,7,8,16,14,16,9,10,6,5,15,13,13,15,16,14]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
-conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_QUAD4)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MEDMEM_QUAD4)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
conn2dmetis=(len(conn)==len(connectivite))
if conn2dmetis:
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell2dpolyboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dpolyboost=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[2,5,9,10,11,10,9,12,5,6,8,9,4,11,12,16,12,9,8,13,6,1,7,8,16,12,13,15,13,8,7,14,15,13,14,3]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
conn=m.getPolygonsConnectivity(MED_CELL)
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell2dpolymetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell2dpolymetis=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[6,1,7,8,2,5,9,10,5,6,8,9,15,13,14,3,4,11,12,16,16,12,13,15,11,10,9,12,12,9,8,13,13,8,7,14]
connectivite_index=[1,5,9,13,17,21,25,29,33,37]
conn=m.getPolygonsConnectivity(MED_CELL)
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell3dboost=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[23,13,5,18,27,22,14,26,17,6,13,23,25,16,22,27,27,22,14,26,24,15,7,20,9,23,18,1,21,27,26,10,25,16,22,27,19,8,15,24,2,17,23,9,12,25,27,21,21,27,26,10,11,24,20,3,12,25,27,21,4,19,24,11]
connectivite_index=[1,9,17,25,33,41,49,57,65]
-conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_HEXA8)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MEDMEM_HEXA8)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
conn3dboost=(len(conn)==len(connectivite))
if conn3dboost:
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dmetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell3dmetis=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[12,25,27,21,4,19,24,11,27,22,14,26,24,15,7,20,17,6,13,23,25,16,22,27,9,23,18,1,21,27,26,10,23,13,5,18,27,22,14,26,25,16,22,27,19,8,15,24,2,17,23,9,12,25,27,21,21,27,26,10,11,24,20,3]
connectivite_index=[1,9,17,25,33,41,49,57,65]
-conn=m.getConnectivity(MED_NODAL,MED_CELL,MED_HEXA8)
+conn=m.getConnectivity(MED_NODAL,MED_CELL,MEDMEM_HEXA8)
conn_index=m.getConnectivityIndex(MED_NODAL,MED_CELL);
conn3dmetis=(len(conn)==len(connectivite))
if conn3dmetis:
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dpolyboost=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell3dpolyboost=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[23,13,5,18,27,26,14,22,23,27,22,13,13,22,14,5,5,14,26,18,18,26,27,23,17,6,13,23,25,27,22,16,17,25,16,6,6,16,22,13,13,22,27,23,23,27,25,17,27,22,14,26,24,20,7,15,27,24,15,22,22,15,7,14,14,7,20,26,26,20,24,27,9,23,18,1,21,10,26,27,9,21,27,23,23,27,26,18,18,26,10,1,1,10,21,9,25,16,22,27,19,24,15,8,25,19,8,16,16,8,15,22,22,15,24,27,27,24,19,25,2,17,23,9,12,21,27,25,2,12,25,17,17,25,27,23,23,27,21,9,9,21,12,2,21,27,26,10,11,3,20,24,21,11,24,27,27,24,20,26,26,20,3,10,10,3,11,21,12,25,27,21,4,11,24,19,12,4,19,25,25,19,24,27,27,24,11,21,21,11,4,12]
connectivite_face_index=[1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193]
connectivite_index=[1,7,13,19,25,31,37,43,49]
string_to_execute="'"+dir_renumber+" "+dir_mesh+"/"+filename+" "+meshname+" "+method+" "+dir_mesh+"/out_"+filename+"'"
eval("os.system("+string_to_execute+")")
m = MESH(MED_DRIVER,dir_mesh+"/out_"+filename,meshname)
-nbcell3dpolymetis=m.getNumberOfElementsWithPoly(MED_CELL,MED_ALL_ELEMENTS)
+nbcell3dpolymetis=m.getNumberOfElementsWithPoly(MED_CELL,MEDMEM_ALL_ELEMENTS)
connectivite=[12,25,27,21,4,11,24,19,12,4,19,25,25,19,24,27,27,24,11,21,21,11,4,12,27,22,14,26,24,20,7,15,27,24,15,22,22,15,7,14,14,7,20,26,26,20,24,27,17,6,13,23,25,27,22,16,17,25,16,6,6,16,22,13,13,22,27,23,23,27,25,17,9,23,18,1,21,10,26,27,9,21,27,23,23,27,26,18,18,26,10,1,1,10,21,9,23,13,5,18,27,26,14,22,23,27,22,13,13,22,14,5,5,14,26,18,18,26,27,23,25,16,22,27,19,24,15,8,25,19,8,16,16,8,15,22,22,15,24,27,27,24,19,25,2,17,23,9,12,21,27,25,2,12,25,17,17,25,27,23,23,27,21,9,9,21,12,2,21,27,26,10,11,3,20,24,21,11,24,27,27,24,20,26,26,20,3,10,10,3,11,21]
connectivite_face_index=[1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193]
connectivite_index=[1,7,13,19,25,31,37,43,49]