A sampledSurface from a triSurface. It samples on the points/triangles of the triSurface. It either samples cells or (non-coupled) boundary faces. More...


Public Types | |
| enum | samplingSource { cells , insideCells , boundaryFaces } |
| Types of communications. More... | |
Public Types inherited from MeshedSurface< face > | |
| typedef face | FaceType |
| Face type used. More... | |
Public Types inherited from PrimitivePatch< FaceList, PointField > | |
| enum | surfaceTopo { MANIFOLD , OPEN , ILLEGAL } |
| Enumeration defining the surface type. Used in check routines. More... | |
| typedef FaceList | FaceListType |
| typedef std::remove_reference< FaceList >::type::value_type | FaceType |
| typedef PointField | PointFieldType |
| typedef std::remove_reference< PointField >::type::value_type | PointType |
Public Member Functions | |
| TypeName ("triSurface") | |
| Runtime type information. More... | |
| triSurface (const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource) | |
| Construct from components. More... | |
| triSurface (const word &name, const polyMesh &mesh, const dictionary &dict) | |
| Construct from dictionary. More... | |
| triSurface (const word &name, const polyMesh &mesh, const Foam::triSurface &surface, const word &sampleSourceName) | |
| Construct from triSurface. More... | |
| virtual | ~triSurface () |
| Destructor. More... | |
| virtual bool | needsUpdate () const |
| Does the surface need an update? More... | |
| virtual bool | update () |
| Update the surface as required. More... | |
| virtual const pointField & | points () const |
| Points of surface. More... | |
| virtual const faceList & | faces () const |
| Faces of surface. More... | |
| FOR_ALL_FIELD_TYPES (DEFINE_SAMPLE) | |
| FOR_ALL_FIELD_TYPES (DEFINE_INTERPOLATE) | |
| virtual void | movePoints () |
| Update for mesh point-motion. More... | |
| virtual void | topoChange (const polyTopoChangeMap &) |
| Update topology using the given map. More... | |
| virtual void | mapMesh (const polyMeshMap &) |
| Update from another mesh using the given map. More... | |
| virtual void | distribute (const polyDistributionMap &) |
| Redistribute or update using the given distribution map. More... | |
| virtual void | print (Ostream &) const |
| Write. More... | |
| template<class Type > | |
| Foam::tmp< Foam::Field< Type > > | sampleField (const VolField< Type > &vField) const |
| template<class Type > | |
| Foam::tmp< Foam::Field< Type > > | interpolateField (const interpolation< Type > &interpolator) const |
Public Member Functions inherited from sampledSurface | |
| TypeName ("sampledSurface") | |
| Runtime type information. More... | |
| declareRunTimeSelectionTable (autoPtr, sampledSurface, word,(const word &name, const polyMesh &mesh, const dictionary &dict),(name, mesh, dict)) | |
| Declare run-time constructor selection table. More... | |
| sampledSurface (const word &name, const polyMesh &, const bool interpolate=false) | |
| Construct from name, mesh. More... | |
| sampledSurface (const word &name, const polyMesh &, const dictionary &) | |
| Construct from dictionary. More... | |
| autoPtr< sampledSurface > | clone () const |
| Clone. More... | |
| virtual | ~sampledSurface () |
| Destructor. More... | |
| const polyMesh & | mesh () const |
| Access to the underlying mesh. More... | |
| const word & | name () const |
| Name of surface. More... | |
| bool | interpolate () const |
| Interpolation requested for surface. More... | |
| virtual wordList | fields () const |
| Return the list of fields required. More... | |
| virtual const vectorField & | Sf () const |
| Return face area vectors. More... | |
| virtual const scalarField & | magSf () const |
| Return face area magnitudes. More... | |
| virtual const vectorField & | Cf () const |
| Return face centres as vectorField. More... | |
| scalar | area () const |
| The total surface area. More... | |
| template<class Type > | |
| Type | integrate (const Field< Type > &) const |
| Integration of a field across the surface. More... | |
| template<class Type > | |
| Type | integrate (const tmp< Field< Type >> &) const |
| Integration of a field across the surface. More... | |
| template<class Type > | |
| Type | average (const Field< Type > &) const |
| Area-averaged value of a field across the surface. More... | |
| tmp< Field< scalar > > | project (const Field< scalar > &) const |
| Project field onto surface. More... | |
| tmp< Field< scalar > > | project (const Field< vector > &) const |
| Project field onto surface. More... | |
| tmp< Field< vector > > | project (const Field< sphericalTensor > &) const |
| Project field onto surface. More... | |
| tmp< Field< vector > > | project (const Field< symmTensor > &) const |
| Project field onto surface. More... | |
| tmp< Field< vector > > | project (const Field< tensor > &) const |
| Project field onto surface. More... | |
| template<class Type > | |
| Type | average (const tmp< Field< Type >> &) const |
| Area-averaged value of a field across the surface. More... | |
| FOR_ALL_FIELD_TYPES (DEFINE_SAMPLE) | |
| FOR_ALL_FIELD_TYPES (DEFINE_INTERPOLATE) | |
| virtual void | rename (const word &newName) |
| Rename. More... | |
| template<class ReturnType , class Type > | |
| Foam::tmp< Foam::Field< ReturnType > > | project (const tmp< Field< Type >> &field) const |
Public Member Functions inherited from MeshedSurface< face > | |
| MeshedSurface () | |
| Construct null. More... | |
| MeshedSurface (pointField &&, List< face > &&, surfZoneList &&) | |
| Construct by transferring components (points, faces, zones). More... | |
| MeshedSurface (pointField &&, List< face > &&, const labelUList &zoneSizes=labelUList(), const UList< word > &zoneNames=UList< word >()) | |
| Construct by transferring components (points, faces). More... | |
| MeshedSurface (const MeshedSurface &) | |
| Copy constructor. More... | |
| MeshedSurface (const UnsortedMeshedSurface< face > &) | |
| Construct from a UnsortedMeshedSurface. More... | |
| MeshedSurface (const polyBoundaryMesh &, const bool globalPoints=false) | |
| Construct from a boundary mesh with local points/faces. More... | |
| MeshedSurface (const surfMesh &) | |
| Construct from a surfMesh. More... | |
| MeshedSurface (UnsortedMeshedSurface< face > &&) | |
| Construct by transferring the contents from a UnsortedMeshedSurface. More... | |
| MeshedSurface (MeshedSurface< face > &&) | |
| Construct by transferring the contents from a MeshedSurface. More... | |
| MeshedSurface (const fileName &) | |
| Construct from file name (uses extension to determine type) More... | |
| MeshedSurface (const fileName &, const word &ext) | |
| Construct from file name (uses extension to determine type) More... | |
| MeshedSurface (const Time &, const word &surfName="") | |
| Construct from database. More... | |
| MeshedSurface (const MeshedSurface< face > &surf) | |
| ClassName ("MeshedSurface") | |
| Runtime type information. More... | |
| bool | isTri () |
| Specialisation for holding triangulated information. More... | |
| declareRunTimeSelectionTable (autoPtr, MeshedSurface, fileExtension,(const fileName &name),(name)) | |
| virtual | ~MeshedSurface () |
| Destructor. More... | |
| declareMemberFunctionSelectionTable (void, UnsortedMeshedSurface, write, fileExtension,(const fileName &name, const MeshedSurface< face > &surf),(name, surf)) | |
| virtual void | write (const fileName &name) const |
| Generic write routine. Chooses writer based on extension. More... | |
| void | write (const Time &, const word &surfName="") const |
| Write to database. More... | |
| label | size () const |
| The surface size is the number of faces. More... | |
| const List< face > & | faces () const |
| Return const access to the faces. More... | |
| const List< surfZone > & | surfZones () const |
| Const access to the surface zones. More... | |
| List< surfZone > & | surfZones () |
| Non-const access to the surface zones. More... | |
| virtual void | addZones (const UList< surfZone > &, const bool cullEmpty=false) |
| Add surface zones. More... | |
| virtual void | addZones (const labelUList &sizes, const UList< word > &names, const bool cullEmpty=false) |
| Add surface zones. More... | |
| virtual void | addZones (const labelUList &sizes, const bool cullEmpty=false) |
| Add surface zones. More... | |
| virtual void | removeZones () |
| Remove surface zones. More... | |
| virtual void | clear () |
| Clear all storage. More... | |
| virtual void | setPoints (const pointField &) |
| Reset the points. More... | |
| virtual void | scalePoints (const scalar) |
| Scale points. A non-positive factor is ignored. More... | |
| virtual void | reset (pointField &&points, List< face > &&faces, surfZoneList &&zones) |
| Reset primitive data (points, faces and zones) More... | |
| virtual void | reset (List< point > &&points, List< face > &&faces, surfZoneList &&zones) |
| Reset primitive data (points, faces and zones) More... | |
| virtual void | cleanup (const bool verbose) |
| Remove invalid faces. More... | |
| virtual bool | stitchFaces (const scalar tol=small, const bool verbose=false) |
| virtual bool | checkFaces (const bool verbose=false) |
| virtual label | triangulate () |
| Triangulate in-place, returning the number of triangles added. More... | |
| virtual label | triangulate (List< label > &faceMap) |
| Triangulate in-place, returning the number of triangles added. More... | |
| label | triangulate () |
| Specialisation for holding triangulated information. More... | |
| label | triangulate (List< label > &faceMap) |
| Specialisation for holding triangulated information. More... | |
| MeshedSurface | subsetMesh (const labelHashSet &include, labelList &pointMap, labelList &faceMap) const |
| Return new surface. More... | |
| MeshedSurface | subsetMesh (const labelHashSet &include) const |
| Return new surface. More... | |
| void | transfer (MeshedSurface< face > &) |
| Transfer the contents of the argument and annul the argument. More... | |
| void | transfer (UnsortedMeshedSurface< face > &) |
| Transfer the contents of the argument and annul the argument. More... | |
| bool | read (const fileName &, const word &ext) |
| Read from file. Chooses reader based on explicit extension. More... | |
| virtual bool | read (const fileName &) |
| Read from file. Chooses reader based on detected extension. More... | |
| void | writeStats (Ostream &os) const |
| void | operator= (const MeshedSurface< face > &) |
| operator MeshedSurfaceProxy< face > () const | |
| Conversion operator to MeshedSurfaceProxy. More... | |
Public Member Functions inherited from PrimitivePatch< FaceList, PointField > | |
| PrimitivePatch (const FaceList &faces, const Field< PointType > &points) | |
| Construct from components. More... | |
| PrimitivePatch (FaceList &&faces, Field< PointType > &&points) | |
| Move constructor from components. More... | |
| PrimitivePatch (FaceList &faces, Field< PointType > &points, const bool reuse) | |
| Construct from components, reuse storage. More... | |
| PrimitivePatch (const PrimitivePatch< FaceList, PointField > &) | |
| Copy constructor. More... | |
| PrimitivePatch (PrimitivePatch< FaceList, PointField > &&) | |
| Move constructor. More... | |
| autoPtr< PrimitivePatch< FaceList, PointField > > | clone () const |
| Construct and return a clone. More... | |
| ~PrimitivePatch () | |
| Destructor. More... | |
| const Field< PointType > & | points () const |
| Return reference to global points. More... | |
| label | nPoints () const |
| Return number of points supporting patch faces. More... | |
| label | nEdges () const |
| Return number of edges in patch. More... | |
| const edgeList & | edges () const |
| Return list of edges, address into LOCAL point list. More... | |
| label | nInternalEdges () const |
| Number of internal edges. More... | |
| bool | isInternalEdge (const label edgeI) const |
| Is internal edge? More... | |
| const labelList & | boundaryPoints () const |
| Return list of boundary points,. More... | |
| const labelListList & | faceFaces () const |
| Return face-face addressing. More... | |
| const labelListList & | edgeFaces () const |
| Return edge-face addressing. More... | |
| const labelListList & | faceEdges () const |
| Return face-edge addressing. More... | |
| const labelListList & | pointEdges () const |
| Return point-edge addressing. More... | |
| const labelListList & | pointFaces () const |
| Return point-face addressing. More... | |
| const List< FaceType > & | localFaces () const |
| Return patch faces addressing into local point list. More... | |
| const labelList & | meshPoints () const |
| Return labelList of mesh points in patch. They are constructed. More... | |
| const Map< label > & | meshPointMap () const |
| Mesh point map. Given the global point index find its. More... | |
| const Field< PointType > & | localPoints () const |
| Return pointField of points in patch. More... | |
| const labelList & | localPointOrder () const |
| Return orders the local points for most efficient search. More... | |
| label | whichPoint (const label gp) const |
| Given a global point index, return the local point index. More... | |
| label | whichEdge (const edge &) const |
| Given an edge in local point labels, return its. More... | |
| labelList | meshEdges (const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const |
| Return labels of patch edges in the global edge list using. More... | |
| labelList | meshEdges (const edgeList &allEdges, const labelListList &pointEdges) const |
| Return labels of patch edges in the global edge list using. More... | |
| const Field< PointType > & | faceCentres () const |
| Return face centres for patch. More... | |
| const Field< PointType > & | faceAreas () const |
| Return face areas for patch. More... | |
| const Field< PointType > & | faceNormals () const |
| Return face normals for patch. More... | |
| const Field< PointType > & | pointNormals () const |
| Return point normals for patch. More... | |
| template<class ToPatch > | |
| List< objectHit > | projectPoints (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::algorithm::fullRay, const intersection::direction=intersection::direction::vector) const |
| Project vertices of patch onto another patch. More... | |
| template<class ToPatch > | |
| List< objectHit > | projectFaceCentres (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::algorithm::fullRay, const intersection::direction=intersection::direction::vector) const |
| Project vertices of patch onto another patch. More... | |
| const labelListList & | edgeLoops () const |
| Return list of closed loops of boundary vertices. More... | |
| surfaceTopo | surfaceType () const |
| Calculate surface type formed by patch. More... | |
| bool | checkTopology (const bool report=false, labelHashSet *setPtr=nullptr) const |
| Check surface formed by patch for manifoldness (see above). More... | |
| bool | checkPointManifold (const bool report=false, labelHashSet *setPtr=nullptr) const |
| Checks primitivePatch for faces sharing point but not edge. More... | |
| void | clearOut () |
| void | clearGeom () |
| void | clearTopology () |
| void | clearPatchMeshAddr () |
| void | operator= (const PrimitivePatch< FaceList, PointField > &) |
| Assignment operator. More... | |
| void | operator= (PrimitivePatch< FaceList, PointField > &&) |
| Move assignment operator. More... | |
| template<class ToPatch > | |
| Foam::List< Foam::objectHit > | projectPoints (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const |
| template<class ToPatch > | |
| Foam::List< Foam::objectHit > | projectFaceCentres (const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const |
Static Public Attributes | |
| static const NamedEnum< samplingSource, 3 > | samplingSourceNames_ |
| Names of communication types. More... | |
Static Public Attributes inherited from surfaceFormatsCore | |
| static word | nativeExt |
| The file extension corresponding to 'native' surface format. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from sampledSurface | |
| static autoPtr< sampledSurface > | New (const word &name, const polyMesh &, const dictionary &) |
| Return a reference to the selected surface. More... | |
Static Public Member Functions inherited from MeshedSurface< face > | |
| static bool | isTri () |
| Face storage only handles triangulated faces. More... | |
| static bool | canRead (const fileName &, const bool verbose=false) |
| Can we read this file format? More... | |
| static bool | canReadType (const word &ext, const bool verbose=false) |
| Can we read this file format? More... | |
| static bool | canWriteType (const word &ext, const bool verbose=false) |
| Can we write this file format? More... | |
| static wordHashSet | readTypes () |
| static wordHashSet | writeTypes () |
| static autoPtr< MeshedSurface > | New (const fileName &, const word &ext) |
| Select constructed from filename (explicit extension) More... | |
| static autoPtr< MeshedSurface > | New (const fileName &) |
| Select constructed from filename (implicit extension) More... | |
| static void | write (const fileName &, const MeshedSurface< face > &) |
| Write to file. More... | |
Static Public Member Functions inherited from surfaceFormatsCore | |
| static bool | checkSupport (const wordHashSet &available, const word &ext, const bool verbose, const word &functionName) |
| ... More... | |
Protected Member Functions inherited from sampledSurface | |
| virtual void | clearGeom () const |
Protected Member Functions inherited from MeshedSurface< face > | |
| void | transcribe (MeshedSurface< face > &) |
| Transfer points/zones and transcribe face -> triFace. More... | |
| void | transcribe (MeshedSurface< face > &surf) |
| void | transcribe (MeshedSurface< face > &surf) |
| void | checkZones () |
| Basic sanity check on zones. More... | |
| pointField & | storedPoints () |
| Non-const access to global points. More... | |
| List< face > & | storedFaces () |
| Non-const access to the faces. More... | |
| surfZoneList & | storedZones () |
| Non-const access to the zones. More... | |
| void | sortFacesAndStore (List< face > &&unsortedFaces, List< label > &&zoneIds, const bool sorted) |
| Sort faces by zones and store sorted faces. More... | |
| virtual void | remapFaces (const labelUList &faceMap) |
| Set new zones from faceMap. More... | |
Static Protected Member Functions inherited from surfaceFormatsCore | |
| template<class Container > | |
| static List< surfZone > | oneZone (const Container &container, const word &name="zone0") |
| Return a list with a single entry,. More... | |
| static string | getLineNoComment (IFstream &) |
| Read non-comment line. More... | |
A sampledSurface from a triSurface. It samples on the points/triangles of the triSurface. It either samples cells or (non-coupled) boundary faces.
There are 6 possible modes:
Since it finds a nearest per triangle each triangle is guaranteed to be on one processor only. So after stitching (by sampledSurfaces) the original surface should be complete.
Example:
{
type triSurface;
surface "surface.stl";
source cells;
interpolate yes;
}
| Property | Description | Required | Default value |
|---|---|---|---|
surface | the surface file (within constant/triSurface) | yes | |
source | see above | yes | no |
interpolate | see above | no | no |
Definition at line 126 of file sampledTriSurface.H.
| enum samplingSource |
Types of communications.
| Enumerator | |
|---|---|
| cells | |
| insideCells | |
| boundaryFaces | |
Definition at line 136 of file sampledTriSurface.H.
| triSurface | ( | const word & | name, |
| const polyMesh & | mesh, | ||
| const word & | surfaceName, | ||
| const samplingSource | sampleSource | ||
| ) |
Construct from components.
Definition at line 148 of file sampledTriSurface.C.
| triSurface | ( | const word & | name, |
| const polyMesh & | mesh, | ||
| const dictionary & | dict | ||
| ) |
Construct from dictionary.
Definition at line 177 of file sampledTriSurface.C.
| triSurface | ( | const word & | name, |
| const polyMesh & | mesh, | ||
| const Foam::triSurface & | surface, | ||
| const word & | sampleSourceName | ||
| ) |
Construct from triSurface.
Definition at line 205 of file sampledTriSurface.C.
|
virtual |
Destructor.
Definition at line 237 of file sampledTriSurface.C.
| TypeName | ( | "triSurface" | ) |
Runtime type information.
|
virtual |
Does the surface need an update?
Implements sampledSurface.
Definition at line 243 of file sampledTriSurface.C.
|
virtual |
Update the surface as required.
Do nothing (and return false) if no update was needed
Implements sampledSurface.
Definition at line 249 of file sampledTriSurface.C.
References indexedOctree< Type >::bb(), cells, primitiveMesh::cells(), meshSearch::cellTree(), List< T >::clear(), treeBoundBox::contains(), PointHit< Point >::distance(), Foam::endl(), f(), Foam::faceMap(), Foam::facePlanes, polyMesh::faces(), indexedOctree< Type >::findInside(), UList< T >::first(), forAll, Foam::Info, sampledSurface::interpolate(), globalIndex::isLocal(), Foam::labelMax, Pstream::listCombineGather(), Pstream::listCombineScatter(), Foam::magSqr(), mesh, OFstream::name(), meshSearch::New(), newPointi, Foam::pointInCellFacePlanes(), points, Foam::Pout, PointHit< Point >::rawPoint(), s(), Foam::second(), List< T >::setSize(), indexedOctree< Type >::shapes(), List< T >::size(), Foam::sqr(), Foam::dimensions::time, globalIndex::toGlobal(), globalIndex::toLocal(), triFace::triFaceFace(), and OBJstream::write().

|
inlinevirtual |
Points of surface.
Implements sampledSurface.
Definition at line 237 of file sampledTriSurface.H.
References PrimitivePatch<::Foam::List< Face >, pointField >::points().

|
inlinevirtual |
Faces of surface.
Implements sampledSurface.
Definition at line 243 of file sampledTriSurface.H.
References MeshedSurface< Face >::faces().

| FOR_ALL_FIELD_TYPES | ( | DEFINE_SAMPLE | ) |
| FOR_ALL_FIELD_TYPES | ( | DEFINE_INTERPOLATE | ) |
|
virtual |
Update for mesh point-motion.
Implements sampledSurface.
Definition at line 660 of file sampledTriSurface.C.
References MeshedSurface< Face >::clear(), and sampledSurface::clearGeom().

|
virtual |
Update topology using the given map.
Implements sampledSurface.
Definition at line 673 of file sampledTriSurface.C.
|
virtual |
Update from another mesh using the given map.
Implements sampledSurface.
Definition at line 679 of file sampledTriSurface.C.
|
virtual |
Redistribute or update using the given distribution map.
Implements sampledSurface.
Definition at line 685 of file sampledTriSurface.C.
|
virtual |
Write.
Reimplemented from sampledSurface.
Definition at line 691 of file sampledTriSurface.C.
References Foam::name(), and points.

| Foam::tmp<Foam::Field<Type> > sampleField | ( | const VolField< Type > & | vField | ) | const |
Definition at line 33 of file sampledTriSurfaceTemplates.C.
References polyMesh::boundary(), GeometricField< Type, GeoMesh, PrimitiveField >::boundaryField(), triSurface::cells, forAll, triSurface::insideCells, sampledSurface::mesh(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), patchi, tmp< T >::ref(), UPtrList< T >::size(), List< T >::size(), and Foam::Zero.

| Foam::tmp<Foam::Field<Type> > interpolateField | ( | const interpolation< Type > & | interpolator | ) | const |
Definition at line 89 of file sampledTriSurfaceTemplates.C.
References cells, forAll, mesh, and tmp< T >::ref().

|
static |
Names of communication types.
Definition at line 144 of file sampledTriSurface.H.