Nektar++
|
#include <ProcessPhiFromFile.h>
Classes | |
struct | STLobject |
STL file object. More... | |
struct | triangle |
Object representing a 3D triangle. More... | |
Public Member Functions | |
ProcessPhiFromFile (FieldSharedPtr f) | |
Set up ProcessPhiFromFile object. More... | |
~ProcessPhiFromFile () override | |
Public Member Functions inherited from Nektar::FieldUtils::ProcessModule | |
ProcessModule () | |
ProcessModule (FieldSharedPtr p_f) | |
Public Member Functions inherited from Nektar::FieldUtils::Module | |
FIELD_UTILS_EXPORT | Module (FieldSharedPtr p_f) |
virtual | ~Module ()=default |
void | Process (po::variables_map &vm) |
std::string | GetModuleName () |
std::string | GetModuleDescription () |
const ConfigOption & | GetConfigOption (const std::string &key) const |
ModulePriority | GetModulePriority () |
std::vector< ModuleKey > | GetModulePrerequisites () |
FIELD_UTILS_EXPORT void | RegisterConfig (std::string key, std::string value="") |
Register a configuration option with a module. More... | |
FIELD_UTILS_EXPORT void | PrintConfig () |
Print out all configuration options for a module. More... | |
FIELD_UTILS_EXPORT void | SetDefaults () |
Sets default configuration options for those which have not been set. More... | |
FIELD_UTILS_EXPORT void | AddFile (std::string fileType, std::string fileName) |
FIELD_UTILS_EXPORT void | EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield) |
Static Public Member Functions | |
static ModuleSharedPtr | create (FieldSharedPtr f) |
Creates an instance of this class. More... | |
Static Public Attributes | |
static ModuleKey | m_className |
ModuleKey for class. More... | |
Protected Member Functions | |
void | v_Process (po::variables_map &vm) override |
std::string | v_GetModuleName () override |
std::string | v_GetModuleDescription () override |
ModulePriority | v_GetModulePriority () override |
Array< OneD, NekDouble > | ReadVector (std::ifstream &in) |
Read one 3D vector from a STL file, starting from the next line of the input 'ifstream'. Numbers in ifstream are defined as 'float'. More... | |
STLobject | ReadSTL (std::string filename) |
Read an STL binary file and returns a struct of type 'STLobject' containing the parsed data. More... | |
NekDouble | PhiFunction (double dist, double coeff) |
Smoothing function for the SPM method given a distance value and a scaling coefficient. More... | |
void | GetPhifromSession () |
Assigns to 'phi' the values indicated by 'ShapeFunction'. More... | |
void | GetPhifromSTL (const STLobject &file) |
Assigns to 'phi' the corresponding values of Phi. More... | |
bool | CheckHit (const triangle &tri, const Array< OneD, NekDouble > &Origin, const Array< OneD, NekDouble > &Dvec, double &distance, double &u, double &v) |
Checks if a ray traced from 'Origin' with direction 'Dvec' hits the triangle defined by 'tri'. Returns the distance to the plane defined by 'tri' in any case. A negative distance means that the hit happened in the direction oposite that of the ray. Approach to calculate the intersection point found in: More... | |
void | FindShortestDist (const STLobject &file, const Array< OneD, NekDouble > &x, double &dist) |
Calculates the shortest distance from a point \(x\) to the closed body contained in the STL file. More... | |
bool | IsEqual (double x, double y, double relTol) |
Returns true if \(x=y\) within the relative tolerance 'relTol' (relative to 'y') More... | |
bool | IsNegative (double x, double tol) |
Returns true if \(x<tol\). More... | |
Array< OneD, NekDouble > | Cross (const Array< OneD, NekDouble > &v0, const Array< OneD, NekDouble > &v1) |
Returns the cross product of vectors 'v0' y 'v1'. More... | |
Array< OneD, NekDouble > | Vector2edge (const Array< OneD, NekDouble > &x, const Array< OneD, NekDouble > &e1, const Array< OneD, NekDouble > &e2) |
Determines the shortest distance from a point 'x' to the segment defined by the points 'e1' and 'e2'. Note that this distance may be equal to that to one of the end points. The vector returned points towards the point 'x'. More... | |
Protected Member Functions inherited from Nektar::FieldUtils::Module | |
Module () | |
virtual void | v_Process (po::variables_map &vm) |
virtual std::string | v_GetModuleName () |
virtual std::string | v_GetModuleDescription () |
virtual ModulePriority | v_GetModulePriority () |
virtual std::vector< ModuleKey > | v_GetModulePrerequisites () |
Protected Attributes | |
Octree | m_tree |
Octree object. More... | |
Protected Attributes inherited from Nektar::FieldUtils::Module | |
std::map< std::string, ConfigOption > | m_config |
List of configuration values. More... | |
std::set< std::string > | m_allowedFiles |
List of allowed file formats. More... | |
Additional Inherited Members | |
Public Attributes inherited from Nektar::FieldUtils::Module | |
FieldSharedPtr | m_f |
Field object. More... | |
Converter for STL files.
Definition at line 48 of file ProcessPhiFromFile.h.
Nektar::FieldUtils::ProcessPhiFromFile::ProcessPhiFromFile | ( | FieldSharedPtr | f | ) |
Set up ProcessPhiFromFile object.
Definition at line 54 of file ProcessPhiFromFile.cpp.
References Nektar::FieldUtils::Module::m_config.
|
override |
Definition at line 65 of file ProcessPhiFromFile.cpp.
|
protected |
Checks if a ray traced from 'Origin' with direction 'Dvec' hits the triangle defined by 'tri'. Returns the distance to the plane defined by 'tri' in any case. A negative distance means that the hit happened in the direction oposite that of the ray. Approach to calculate the intersection point found in:
Fast, minimum storage ray/triangle intersection, Tomas Moeller, Ben Trumbore
tri | |
Origin | |
Dvec | |
distance | |
u | |
v |
Definition at line 374 of file ProcessPhiFromFile.cpp.
References Cross(), Vmath::Dot(), IsEqual(), Nektar::FieldUtils::ProcessPhiFromFile::triangle::v0, Nektar::FieldUtils::ProcessPhiFromFile::triangle::v1, Nektar::FieldUtils::ProcessPhiFromFile::triangle::v2, and Vmath::Vsub().
Referenced by FindShortestDist().
|
inlinestatic |
Creates an instance of this class.
Definition at line 52 of file ProcessPhiFromFile.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr().
|
protected |
Returns the cross product of vectors 'v0' y 'v1'.
v0 | |
v1 |
Definition at line 562 of file ProcessPhiFromFile.cpp.
Referenced by CheckHit().
|
protected |
Calculates the shortest distance from a point \(x\) to the closed body contained in the STL file.
file | |
x | |
dist |
Definition at line 426 of file ProcessPhiFromFile.cpp.
References CheckHit(), Vmath::Dot(), IsEqual(), IsNegative(), m_tree, Nektar::FieldUtils::ProcessPhiFromFile::triangle::normal, Nektar::FieldUtils::Octree::QueryDepth(), Nektar::FieldUtils::Octree::QueryNeighbours(), Nektar::FieldUtils::Octree::QueryNode(), Nektar::FieldUtils::Octree::QueryPoints(), Vmath::Smul(), tinysimd::sqrt(), Nektar::FieldUtils::ProcessPhiFromFile::STLobject::triangles, Nektar::FieldUtils::ProcessPhiFromFile::triangle::v0, Nektar::FieldUtils::ProcessPhiFromFile::triangle::v1, Nektar::FieldUtils::ProcessPhiFromFile::triangle::v2, and Vector2edge().
Referenced by GetPhifromSTL().
|
protected |
Assigns to 'phi' the values indicated by 'ShapeFunction'.
Definition at line 209 of file ProcessPhiFromFile.cpp.
References ASSERTL0, and Nektar::FieldUtils::Module::m_f.
Referenced by v_Process().
Assigns to 'phi' the corresponding values of Phi.
file |
Definition at line 263 of file ProcessPhiFromFile.cpp.
References FindShortestDist(), Nektar::FieldUtils::Module::m_config, Nektar::FieldUtils::Module::m_f, m_tree, Nektar::FieldUtils::ProcessPhiFromFile::STLobject::numTri, PhiFunction(), and Nektar::FieldUtils::ProcessPhiFromFile::STLobject::triangles.
Referenced by v_Process().
|
protected |
Returns true if \(x=y\) within the relative tolerance 'relTol' (relative to 'y')
x |
Definition at line 537 of file ProcessPhiFromFile.cpp.
Referenced by CheckHit(), and FindShortestDist().
|
protected |
Returns true if \(x<tol\).
x | |
relTol |
Definition at line 550 of file ProcessPhiFromFile.cpp.
Referenced by FindShortestDist().
|
protected |
Smoothing function for the SPM method given a distance value and a scaling coefficient.
dist | |
coeff |
Definition at line 200 of file ProcessPhiFromFile.cpp.
Referenced by GetPhifromSTL().
|
protected |
Read an STL binary file and returns a struct of type 'STLobject' containing the parsed data.
filename |
Definition at line 142 of file ProcessPhiFromFile.cpp.
References ASSERTL0, Nektar::FieldUtils::ProcessPhiFromFile::triangle::centroid, Nektar::FieldUtils::ProcessPhiFromFile::triangle::normal, Nektar::FieldUtils::ProcessPhiFromFile::STLobject::numTri, ReadVector(), Nektar::FieldUtils::ProcessPhiFromFile::STLobject::triangles, Nektar::FieldUtils::ProcessPhiFromFile::triangle::v0, Nektar::FieldUtils::ProcessPhiFromFile::triangle::v1, and Nektar::FieldUtils::ProcessPhiFromFile::triangle::v2.
Referenced by v_Process().
|
protected |
Read one 3D vector from a STL file, starting from the next line of the input 'ifstream'. Numbers in ifstream are defined as 'float'.
in |
Definition at line 116 of file ProcessPhiFromFile.cpp.
Referenced by ReadSTL().
|
inlineoverrideprotectedvirtual |
Reimplemented from Nektar::FieldUtils::Module.
Definition at line 70 of file ProcessPhiFromFile.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Nektar::FieldUtils::Module.
Definition at line 65 of file ProcessPhiFromFile.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Nektar::FieldUtils::Module.
Definition at line 75 of file ProcessPhiFromFile.h.
References Nektar::FieldUtils::eModifyExp.
|
overrideprotectedvirtual |
Reimplemented from Nektar::FieldUtils::Module.
Definition at line 72 of file ProcessPhiFromFile.cpp.
References ASSERTL0, GetPhifromSession(), GetPhifromSTL(), Nektar::FieldUtils::Module::m_config, Nektar::FieldUtils::Module::m_f, ReadSTL(), and WARNINGL0.
|
protected |
Determines the shortest distance from a point 'x' to the segment defined by the points 'e1' and 'e2'. Note that this distance may be equal to that to one of the end points. The vector returned points towards the point 'x'.
x | |
e1 | |
e2 |
Definition at line 585 of file ProcessPhiFromFile.cpp.
References Vmath::Dot(), tinysimd::sqrt(), Vmath::Svtsvtp(), and Vmath::Vsub().
Referenced by FindShortestDist().
|
static |
ModuleKey for class.
Definition at line 57 of file ProcessPhiFromFile.h.
|
protected |
Octree object.
Definition at line 103 of file ProcessPhiFromFile.h.
Referenced by FindShortestDist(), and GetPhifromSTL().