Nektar++
|
#include <ProcessSpherigon.h>
Public Member Functions | |
ProcessSpherigon (NekMeshUtils::MeshSharedPtr m) | |
Default constructor. More... | |
virtual | ~ProcessSpherigon () |
Destructor. More... | |
virtual void | Process () |
Write mesh to output file. More... | |
Public Member Functions inherited from Nektar::NekMeshUtils::ProcessModule | |
NEKMESHUTILS_EXPORT | ProcessModule (MeshSharedPtr p_m) |
Public Member Functions inherited from Nektar::NekMeshUtils::Module | |
NEKMESHUTILS_EXPORT | Module (MeshSharedPtr p_m) |
NEKMESHUTILS_EXPORT void | RegisterConfig (std::string key, std::string value) |
Register a configuration option with a module. More... | |
NEKMESHUTILS_EXPORT void | PrintConfig () |
Print out all configuration options for a module. More... | |
NEKMESHUTILS_EXPORT void | SetDefaults () |
Sets default configuration options for those which have not been set. More... | |
NEKMESHUTILS_EXPORT MeshSharedPtr | GetMesh () |
virtual NEKMESHUTILS_EXPORT void | ProcessVertices () |
Extract element vertices. More... | |
virtual NEKMESHUTILS_EXPORT void | ProcessEdges (bool ReprocessEdges=true) |
Extract element edges. More... | |
virtual NEKMESHUTILS_EXPORT void | ProcessFaces (bool ReprocessFaces=true) |
Extract element faces. More... | |
virtual NEKMESHUTILS_EXPORT void | ProcessElements () |
Generate element IDs. More... | |
virtual NEKMESHUTILS_EXPORT void | ProcessComposites () |
Generate composites. More... | |
virtual NEKMESHUTILS_EXPORT void | ClearElementLinks () |
Static Public Member Functions | |
static boost::shared_ptr< Module > | create (NekMeshUtils::MeshSharedPtr m) |
Creates an instance of this class. More... | |
Static Public Attributes | |
static NekMeshUtils::ModuleKey | className |
Protected Member Functions | |
void | GenerateNormals (std::vector< NekMeshUtils::ElementSharedPtr > &el, NekMeshUtils::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... | |
NekDouble | CrossProdMag (NekMeshUtils::Node &a, NekMeshUtils::Node &b) |
Calculate the magnitude of the cross product . More... | |
void | UnitCrossProd (NekMeshUtils::Node &a, NekMeshUtils::Node &b, NekMeshUtils::Node &c) |
NekDouble | Blend (NekDouble r) |
Calculate the blending function for spherigon implementation. More... | |
void | SuperBlend (std::vector< NekDouble > &r, std::vector< NekMeshUtils::Node > &Q, NekMeshUtils::Node &P, std::vector< NekDouble > &blend) |
Calculate the blending function for spherigon implementation. More... | |
void | FindNormalFromPlyFile (NekMeshUtils::MeshSharedPtr &plymesh, std::map< int, NekMeshUtils::NodeSharedPtr > &surfverts) |
Protected Member Functions inherited from Nektar::NekMeshUtils::Module | |
NEKMESHUTILS_EXPORT void | ReorderPrisms (PerMap &perFaces) |
Reorder node IDs so that prisms and tetrahedra are aligned correctly. More... | |
NEKMESHUTILS_EXPORT void | PrismLines (int prism, PerMap &perFaces, std::set< int > &prismsDone, std::vector< ElementSharedPtr > &line) |
Additional Inherited Members | |
Protected Attributes inherited from Nektar::NekMeshUtils::Module | |
MeshSharedPtr | m_mesh |
Mesh object. More... | |
std::map< std::string, ConfigOption > | m_config |
List of configuration values. 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 | ( | NekMeshUtils::MeshSharedPtr | m | ) |
Default constructor.
Definition at line 99 of file ProcessSpherigon.cpp.
References Nektar::NekMeshUtils::Module::m_config.
|
virtual |
|
protected |
Calculate the blending function for spherigon implementation.
See equation (5) of the paper.
r | Barycentric coordinate. |
Definition at line 165 of file ProcessSpherigon.cpp.
|
inlinestatic |
Creates an instance of this class.
Definition at line 52 of file ProcessSpherigon.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr().
|
protected |
Calculate the magnitude of the cross product .
Definition at line 149 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 |
Definition at line 224 of file ProcessSpherigon.cpp.
References ASSERTL1, Nektar::iterator, Nektar::NekMeshUtils::Module::m_mesh, and Nektar::LibUtilities::PrintProgressbar().
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 301 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::NekMeshUtils::Module.
Definition at line 376 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, FindNormalFromPlyFile(), GenerateNormals(), Nektar::ParseUtils::GenerateSeqVector(), Nektar::ParseUtils::GenerateUnOrderedVector(), Nektar::NekMeshUtils::GetElementFactory(), Nektar::iterator, Nektar::NekMeshUtils::Module::m_config, Nektar::NekMeshUtils::Module::m_mesh, Nektar::NekMeshUtils::Node::m_x, Nektar::NekMeshUtils::Node::m_y, Nektar::NekMeshUtils::Node::m_z, CG_Iterations::Mesh, class_topology::Node, class_topology::P, 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 181 of file ProcessSpherigon.cpp.
References class_topology::P, and TOL_BLEND.
Referenced by Process().
|
protected |
Definition at line 130 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.