Version: 5.1.6

MEDMEM.Extractor Class Reference

Tool taking an input field and making a field of lower dimension by cutting the given field by a plane or a line. More...

#include <MEDMEM_Extractor.hxx>

Public Member Functions

 Extractor (const FIELD< double > &inputField) throw (MEDEXCEPTION)
 Creates a tool.
FIELD< double > * extractPlane (const double *coords, const double *normal) throw (MEDEXCEPTION)
 Creates a field by cutting inputField by a plane.
FIELD< double > * extractLine (const double *coords, const double *direction) throw (MEDEXCEPTION)
 Creates a field by cutting inputField by a line.
MESHdivideEdges (const double *coords, const double *normal, std::map< int, std::set< int > > &new2oldCells)
 Makes a mesh by dividing edges of cells of the input mesh by plane in 3D or by line in 2D.
MESHtransfixFaces (const double *coords, const double *direction, std::map< int, std::set< int > > &new2oldCells)
 Makes a 1D mesh by transfixing faces of 3D cells of input mesh by the line.
FIELD< double > * makeField (const std::map< int, std::set< int > > &new2oldCells, MESH *mesh) const
 Creates a new field and fill it from the input one.
void computeDistanceOfNodes (const double *point, const double *normal)
 computes distance of each node from the plane or the line given by point and normal
void sortNodes (std::map< int, std::vector< int > > &connByNbNodes, const double *nodeCoords, const double *point, const double *normal, const std::list< int > &nbNodesPerPolygon)
 Orient elements correctly and sort nodes of polygons.

Data Fields

const FIELD< double > * _myInputField
 input field
std::vector< double_myNodeDistance
 distance of input nodes to cutting tool

Detailed Description

Tool taking an input field and making a field of lower dimension by cutting the given field by a plane or a line.

The following extractions are possible:


Constructor & Destructor Documentation

MEDMEM.Extractor::Extractor ( const FIELD< double > &  inputField  )  throw (MEDEXCEPTION)

Creates a tool.

Parameters:
inputField - input field

The input field is supposed to comply with following conditions

  • it is constant by element (i.e. has 1 gauss point),
  • it's support mesh does not contain poly elements,
  • volumic elements have planar faces,
  • surfasic elements have linear edges.

References med_opsupp_test.entity, MEDMEM.MESH.getConnectivityptr(), MEDMEM.CONNECTIVITY.getEntityDimension(), MEDMEM.MESH.getNumberOfPolygons(), MEDMEM.MESH.getNumberOfPolyhedron(), MEDMEM.MESH.getSpaceDimension(), MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_EDGE, and MED_EN.MED_NODE.


Member Function Documentation

FIELD< double > * MEDMEM.Extractor::extractPlane ( const double coords,
const double normal 
) throw (MEDEXCEPTION)

Creates a field by cutting inputField by a plane.

Parameters:
coords - give a point to pass through by the plane
normal - gives the plane normal
Return values:
FIELD<double>* - resulting field holding ownership of its support, which in its turn holds ownership of its mesh
Parameters:
coords - give a point to pass through by the plane
normal - gives the plane normal
Return values:
FIELD<double>* - resulting field holding ownership of its support, which in its turn holds ownership of its mesh

If the plane does not intersect the field, NULL is returned.

References coords, and med_test1.normal.

FIELD< double > * MEDMEM.Extractor::extractLine ( const double coords,
const double direction 
) throw (MEDEXCEPTION)

Creates a field by cutting inputField by a line.

Parameters:
coords - give a point to pass through by the line
direction - gives a vector collinear to the line
Return values:
FIELD<double>* - resulting field holding ownership of its support, which in its turn holds ownership of its mesh
Parameters:
coords - give a point to pass through by the line
direction - gives a vector collinear to the line
Return values:
FIELD<double>* - resulting field holding ownership of its support, which in its turn holds ownership of its mesh

If the line does not intersect the field, NULL is returned.

References coords, MEDMEM.SUPPORT.getMesh(), MEDMEM.SUPPORT.getNumberOfTypes(), MEDMEM.MESH.getSpaceDimension(), MEDMEM.SUPPORT.getTypes(), med_field_anal.meshDim, and medClient_test.support.

MESH * MEDMEM.Extractor::divideEdges ( const double coords,
const double normal,
std::map< int, std::set< int > > &  new2oldCells 
)

Makes a mesh by dividing edges of cells of the input mesh by plane in 3D or by line in 2D.

Parameters:
coords - give a point to pass through by the plane or the line
normal - gives the normal to plane or line
new2oldCells - output map of new cells to cut input cell

< map connectivity of all old nodes to new cell id

< cut old nodes, new nodes on edges

References MEDMEM.Extractor._myInputField, MEDMEM.Extractor._myNodeDistance, MEDMEM.Extractor.computeDistanceOfNodes(), medClient_test.connectivity, med_opsupp_test.entity, MEDMEM.MESH.getConnectivity(), MEDMEM.MESH.getConnectivityIndex(), MEDMEM.MESH.getCoordinates(), MEDMEM.MESH.getCoordinatesSystem(), MEDMEM.SUPPORT.getEntity(), MEDMEM.SUPPORT.getMesh(), MEDMEM.MESH.getName(), MEDMEM.SUPPORT.getNumber(), MEDMEM.SUPPORT.getNumberOfElements(), MEDMEM.SUPPORT.getNumberOfTypes(), MEDMEM.MESH.getSpaceDimension(), MEDMEM.FIELD_.getSupport(), MEDMEM.SUPPORT.getTypes(), medClient_test.index, MEDMEM.SUPPORT.isOnAllElements(), MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MED_EN.MED_FULL_INTERLACE, MED_EN.MED_NODAL, MED_EN.MED_POLYGON, med_field_anal.meshDim, TestMedCorba2.n, batchmode_medcorba_test.nbNodes, medClient_test.nbNodesPerCell, MEDMEM.MESHING.setConnectivity(), MEDMEM.MESHING.setCoordinates(), MEDMEM.MESHING.setMeshDimension(), MEDMEM.MESH.setName(), MEDMEM.MESHING.setNumberOfElements(), MEDMEM.MESHING.setNumberOfTypes(), MEDMEM.MESHING.setPolygonsConnectivity(), MEDMEM.MESHING.setTypes(), test_NonCoincidentDEC.size, MEDMEM.Extractor.sortNodes(), batchmode_medcorba_test.spaceDim, medClient_test.support, medClient_test.type, and medClient_test.types.

MESH * MEDMEM.Extractor::transfixFaces ( const double coords,
const double direction,
std::map< int, std::set< int > > &  new2oldCells 
)
FIELD< double > * MEDMEM.Extractor::makeField ( const std::map< int, std::set< int > > &  new2oldCells,
MESH mesh 
) const
void MEDMEM.Extractor::computeDistanceOfNodes ( const double point,
const double normal 
)
void MEDMEM.Extractor::sortNodes ( std::map< int, std::vector< int > > &  connByNbNodes,
const double nodeCoords,
const double point,
const double normal,
const std::list< int > &  nbNodesPerPolygon 
)

Orient elements correctly and sort nodes of polygons.

Parameters:
connByNbNodes - map of nb of nodes per cell to cell connectivity to rearrange
nodeCoords - coordinates of nodes of a new mesh in full interlace
point - point on plane or line
normal - normal to plane or line
nbNodesPerPolygon - index of connByNbNodes[_POLYGON] connectivity

References MEDMEM.Extractor._myInputField, testRenumbering.conn, INTERP_KERNEL.dot(), MEDMEM.SUPPORT.getMesh(), MEDMEM.MESH.getSpaceDimension(), MEDMEM.FIELD_.getSupport(), reverse(), batchmode_medcorba_test.spaceDim, and INTERP_KERNEL.swap().


Field Documentation

input field

distance of input nodes to cutting tool