Nektar++
|
#include <ProcessSpherigon.h>
Public Member Functions | |
ProcessSpherigon (MeshSharedPtr m) | |
Default constructor. More... | |
virtual | ~ProcessSpherigon () |
Destructor. More... | |
virtual void | Process () |
Write mesh to output file. More... | |
Public Member Functions inherited from Nektar::Utilities::ProcessModule | |
ProcessModule () | |
ProcessModule (FieldSharedPtr p_f) | |
ProcessModule (MeshSharedPtr p_m) | |
Public Member Functions inherited from Nektar::Utilities::Module | |
Module (FieldSharedPtr p_f) | |
virtual void | Process (po::variables_map &vm)=0 |
void | RegisterConfig (string key, string value) |
Register a configuration option with a module. More... | |
void | PrintConfig () |
Print out all configuration options for a module. More... | |
void | SetDefaults () |
Sets default configuration options for those which have not been set. More... | |
bool | GetRequireEquiSpaced (void) |
void | SetRequireEquiSpaced (bool pVal) |
void | EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield) |
Module (MeshSharedPtr p_m) | |
void | RegisterConfig (string key, string value) |
void | PrintConfig () |
void | SetDefaults () |
MeshSharedPtr | GetMesh () |
virtual void | ProcessVertices () |
Extract element vertices. More... | |
virtual void | ProcessEdges (bool ReprocessEdges=true) |
Extract element edges. More... | |
virtual void | ProcessFaces (bool ReprocessFaces=true) |
Extract element faces. More... | |
virtual void | ProcessElements () |
Generate element IDs. More... | |
virtual void | ProcessComposites () |
Generate composites. More... | |
virtual void | ClearElementLinks () |
Static Public Member Functions | |
static boost::shared_ptr< Module > | create (MeshSharedPtr m) |
Creates an instance of this class. More... | |
Static Public Attributes | |
static ModuleKey | className |
Protected Member Functions | |
void | GenerateNormals (vector< ElementSharedPtr > &el, MeshSharedPtr &mesh) |
Generate a set of approximate vertex normals to a surface represented by line segments in 2D and a hybrid triangular/quadrilateral mesh in 3D. More... | |
double | CrossProdMag (Node &a, Node &b) |
Calculate the magnitude of the cross product . More... | |
void | UnitCrossProd (Node &a, Node &b, Node &c) |
double | Blend (double r) |
Calculate the blending function for spherigon implementation. More... | |
void | SuperBlend (vector< double > &r, vector< Node > &Q, Node &P, vector< double > &blend) |
Calculate the blending function for spherigon implementation. More... | |
Protected Member Functions inherited from Nektar::Utilities::Module | |
Module () | |
void | ReorderPrisms (PerMap &perFaces) |
Reorder node IDs so that prisms and tetrahedra are aligned correctly. More... | |
void | PrismLines (int prism, PerMap &perFaces, set< int > &prismsDone, vector< ElementSharedPtr > &line) |
Additional Inherited Members | |
Protected Attributes inherited from Nektar::Utilities::Module | |
FieldSharedPtr | m_f |
Field object. More... | |
map< string, ConfigOption > | m_config |
List of configuration values. More... | |
bool | m_requireEquiSpaced |
MeshSharedPtr | m_mesh |
Mesh object. More... | |
This class implements the spherigon surface smoothing technique which is documented in
"The SPHERIGON: A Simple Polygon Patch for Smoothing Quickly your Polygonal Meshes": P. Volino and N. Magnenat Thalmann, Computer Animation Proceedings (1998).
This implementation works in both a 2D manifold setting (for triangles and quadrilaterals embedded in 3-space) and in a full 3D enviroment (prisms, tetrahedra and hexahedra).
No additional information needs to be supplied directly to the module in order for it to work. However, 3D elements do rely on the mapping Mesh::spherigonSurfs to be populated by the relevant input modules.
Additionally, since the algorithm assumes normals are supplied which are perpendicular to the true surface defined at each vertex. If these are specified in Mesh::vertexNormals by the input module, better smoothing results can be obtained. Otherwise, normals are estimated by taking the average of all edge/face normals which connect to the vertex.
Definition at line 48 of file ProcessSpherigon.h.
Nektar::Utilities::ProcessSpherigon::ProcessSpherigon | ( | MeshSharedPtr | m | ) |
Default constructor.
Definition at line 91 of file ProcessSpherigon.cpp.
References Nektar::Utilities::Module::m_config.
|
virtual |
|
protected |
Calculate the blending function for spherigon implementation.
See equation (5) of the paper.
r | Barycentric coordinate. |
Definition at line 157 of file ProcessSpherigon.cpp.
|
inlinestatic |
Creates an instance of this class.
Definition at line 52 of file ProcessSpherigon.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr().
Calculate the magnitude of the cross product .
Definition at line 141 of file ProcessSpherigon.cpp.
References Nektar::NekMeshUtils::Node::m_x, Nektar::NekMeshUtils::Node::m_y, and Nektar::NekMeshUtils::Node::m_z.
Referenced by Process().
|
protected |
Generate a set of approximate vertex normals to a surface represented by line segments in 2D and a hybrid triangular/quadrilateral mesh in 3D.
This routine approximates the true vertex normals to a surface by averaging the normals of all edges/faces which connect to the vertex. It is better to use the exact surface normals which can be set in Mesh::vertexNormals, but where they are not supplied this routine calculates an approximation for the spherigon implementation.
el | Vector of elements denoting the surface mesh. |
Definition at line 229 of file ProcessSpherigon.cpp.
References Nektar::NekMeshUtils::Node::abs2(), ASSERTL0, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::LibUtilities::eTriangle, Nektar::iterator, Nektar::NekMeshUtils::Node::m_x, Nektar::NekMeshUtils::Node::m_y, Nektar::NekMeshUtils::Node::m_z, and UnitCrossProd().
Referenced by Process().
|
virtual |
Write mesh to output file.
Perform the spherigon smoothing technique on the mesh.
Implements Nektar::Utilities::Module.
Definition at line 302 of file ProcessSpherigon.cpp.
References Nektar::NekMeshUtils::Node::abs2(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), CrossProdMag(), Nektar::NekMeshUtils::Node::dot(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eNodalTriElec, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::LibUtilities::eTriangle, GenerateNormals(), Nektar::ParseUtils::GenerateSeqVector(), Nektar::ParseUtils::GenerateUnOrderedVector(), Nektar::NekMeshUtils::GetElementFactory(), Nektar::iterator, Nektar::Utilities::Module::m_config, Nektar::Utilities::Module::m_mesh, Nektar::NekMeshUtils::Node::m_x, Nektar::NekMeshUtils::Node::m_y, Nektar::NekMeshUtils::Node::m_z, SuperBlend(), and Vmath::Zero().
|
protected |
Calculate the blending function for spherigon implementation.
See equation (10) of the paper.
r | Generalised barycentric coordinates of the point P. |
Q | Vector of vertices denoting this triangle/quad. |
P | Point in the triangle to apply blending to. |
blend | The resulting blending components for each vertex. |
Definition at line 173 of file ProcessSpherigon.cpp.
References TOL_BLEND.
Referenced by Process().
Definition at line 122 of file ProcessSpherigon.cpp.
References Nektar::NekMeshUtils::Node::m_x, Nektar::NekMeshUtils::Node::m_y, and Nektar::NekMeshUtils::Node::m_z.
Referenced by GenerateNormals().
|
static |
Definition at line 56 of file ProcessSpherigon.h.