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. | |
| ~Extractor () | |
| 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. | |
Private Member Functions | |
| MESH * | 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. | |
| MESH * | transfixFaces (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. | |
Private Attributes | |
| const FIELD< double > * | _myInputField |
| input field | |
| const MESH * | _myInputMesh |
| unstructured field support mesh | |
| std::vector< double > | _myNodeDistance |
| distance of input nodes to cutting tool | |
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:
| MEDMEM.Extractor::Extractor | ( | const FIELD< double > & | inputField | ) | throw (MEDEXCEPTION) |
Creates a tool.
| inputField | - input field |
The input field is supposed to comply with following conditions
References MEDMEM.GMESH.convertInMESH(), med_opsupp_test.entity, MEDMEM.GMESH.getMeshDimension(), MEDMEM.GMESH.getNumberOfElements(), MEDMEM.GMESH.getSpaceDimension(), MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_NODE, MED_EN.MED_POLYGON, and MED_EN.MED_POLYHEDRA.
| MEDMEM.Extractor::~Extractor | ( | ) |
References MEDMEM.RCBASE.removeReference().
| FIELD< double > * MEDMEM.Extractor::extractPlane | ( | const double * | coords, |
| const double * | normal | ||
| ) | throw (MEDEXCEPTION) |
Creates a field by cutting inputField by a plane.
| coords | - give a point to pass through by the plane |
| normal | - gives the plane normal |
| FIELD<double>* | - resulting field holding ownership of its support, which in its turn holds ownership of its mesh |
| coords | - give a point to pass through by the plane |
| normal | - gives the plane normal |
| 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, med_test1.normal, and testMEDMEM.ret.
| FIELD< double > * MEDMEM.Extractor::extractLine | ( | const double * | coords, |
| const double * | direction | ||
| ) | throw (MEDEXCEPTION) |
Creates a field by cutting inputField by a line.
| coords | - give a point to pass through by the line |
| direction | - gives a vector collinear to the line |
| FIELD<double>* | - resulting field holding ownership of its support, which in its turn holds ownership of its mesh |
| coords | - give a point to pass through by the line |
| direction | - gives a vector collinear to the line |
| 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.GMESH.getSpaceDimension(), MEDMEM.SUPPORT.getTypes(), med_field_anal.meshDim, testMEDMEM.ret, and medClient_test.support.
| MESH * MEDMEM.Extractor::divideEdges | ( | const double * | coords, |
| const double * | normal, | ||
| std::map< int, std::set< int > > & | new2oldCells | ||
| ) | [private] |
Makes a mesh by dividing edges of cells of the input mesh by plane in 3D or by line in 2D.
| 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 medClient_test.connectivity, med_opsupp_test.entity, MEDMEM.MESH.getConnectivity(), MEDMEM.MESH.getConnectivityIndex(), MEDMEM.MESH.getCoordinates(), MEDMEM.MESH.getCoordinatesSystem(), MEDMEM.SUPPORT.getEntity(), MEDMEM.GMESH.getName(), MEDMEM.SUPPORT.getNumber(), MEDMEM.SUPPORT.getNumberOfElements(), MEDMEM.SUPPORT.getNumberOfTypes(), MEDMEM.GMESH.getSpaceDimension(), 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.GMESH.setName(), MEDMEM.MESHING.setNumberOfElements(), MEDMEM.MESHING.setNumberOfTypes(), MEDMEM.MESHING.setTypes(), test_NonCoincidentDEC.size, 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 | ||
| ) | [private] |
Makes a 1D mesh by transfixing faces of 3D cells of input mesh by the line.
| coords | - give a point to pass through by the line |
| direction | - direction of the line |
| new2oldCells | - output map of new cells to cut input cell |
References MEDMEM.MESH.getCoordinatesSystem(), MEDMEM.GMESH.getName(), MEDMEM.MESH.getNumberOfElements(), MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MED_EN.MED_FACE, MED_EN.MED_FULL_INTERLACE, MED_EN.MED_SEG2, batchmode_medcorba_test.nbNodes, MEDMEM.MESHING.setConnectivity(), MEDMEM.MESHING.setCoordinates(), MEDMEM.GMESH.setName(), MEDMEM.MESHING.setNumberOfElements(), MEDMEM.MESHING.setNumberOfTypes(), and MEDMEM.MESHING.setTypes().
| FIELD< double > * MEDMEM.Extractor::makeField | ( | const std::map< int, std::set< int > > & | new2oldCells, |
| MESH * | mesh | ||
| ) | const [private] |
Creates a new field and fill it from the input one.
| new2oldCells | - mapping of new to old cells |
| FIELD<double>* | - resulting field |
References MEDMEM.GMESH.getSupportOnAll(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), MED_EN.MED_CELL, med_test2.nbComp, MEDMEM.RCBASE.removeReference(), MEDMEM.FIELD_.setComponentsDescriptions(), MEDMEM.FIELD_.setComponentsNames(), MEDMEM.FIELD_.setDescription(), MEDMEM.FIELD_.setMEDComponentsUnits(), and MEDMEM.FIELD_.setName().
| void MEDMEM.Extractor::computeDistanceOfNodes | ( | const double * | point, |
| const double * | normal | ||
| ) | [private] |
computes distance of each node from the plane or the line given by point and normal
References MEDMEM.MESH.getCoordinates(), MEDMEM.MESH.getNumberOfNodes(), MEDMEM.GMESH.getSpaceDimension(), MED_EN.MED_FULL_INTERLACE, and batchmode_medcorba_test.spaceDim.
| 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 | ||
| ) | [private] |
Orient elements correctly and sort nodes of polygons.
| 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 testRenumbering.conn, INTERP_KERNEL.dot(), reverse(), batchmode_medcorba_test.spaceDim, and INTERP_KERNEL.swap().
const FIELD<double>* MEDMEM.Extractor._myInputField [private] |
input field
const MESH* MEDMEM.Extractor._myInputMesh [private] |
unstructured field support mesh
std::vector<double> MEDMEM.Extractor._myNodeDistance [private] |
distance of input nodes to cutting tool