const MEDMEM::SUPPORT *source_support=source_mesh->getSupportOnAll(MED_EN::MED_CELL);
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;
const MEDMEM::SUPPORT *target_support=target_mesh->getSupportOnAll(MED_EN::MED_CELL);
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;
// Ok at this point we have our mesh in MED-Memory format.
// Go to wrap med_source_mesh and med_target_mesh.
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#include "MEDMeshMaker.hxx"
+
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_Meshing.hxx"
MEDMEM::MESH* MEDMeshMaker(int dim, int nbedge, MED_EN::medGeometryElement type)
{
MEDMEM::MESHING* mesh=new MEDMEM::MESHING();
- mesh->setSpaceDimension(dim);
int nbnodes;
int nbelems;
switch (dim)
{
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");
conn [ielem*8+7]=ix*(nbedge+1)*(nbedge+1)+(iy+1)*(nbedge+1)+iz+1+1;
}
}
- mesh->setConnectivity(conn, MED_EN::MED_CELL,type);
+ mesh->setConnectivity(MED_EN::MED_CELL,type,conn);
delete [] conn;
- mesh->setMeshDimension(dim);
return mesh;
}
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);
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);
*/
void PointLocatorTest::test_PointLocatorInSimplex()
{
- MEDMEM::MESH* mesh2D= MEDMeshMaker(2,2,MED_EN::MED_QUAD4);
+ MEDMEM::MESH* mesh2D= MEDMeshMaker(2,2,MED_EN::MEDMEM_QUAD4);
// mesh is a quadrangle (0.0-1.0 x 0.0-1.0 )
// 3 -- 6 -- 9
// | | |
CPPUNIT_ASSERT_EQUAL(0,(int)elems.size());
delete mesh2D;
}
- MEDMEM::MESH* mesh3D= MEDMeshMaker(3,2,MED_EN::MED_HEXA8);
+ MEDMEM::MESH* mesh3D= MEDMeshMaker(3,2,MED_EN::MEDMEM_HEXA8);
// ^Z
// |
// 3 -- 6 -- 9