35#ifndef FIELDUTILS_PROCESSPHIFROMFILE
36#define FIELDUTILS_PROCESSPHIFROMFILE
63 void v_Process(po::variables_map &vm)
override;
67 return "ProcessPhiFromFile";
72 return "Processing input STL file to calculate Phi";
118 double &u,
double &v);
123 bool IsEqual(
double x,
double y,
double relTol);
Abstract base class for processing modules.
~ProcessPhiFromFile() override
static ModuleKey m_className
ModuleKey for class.
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'....
std::string v_GetModuleName() override
void GetPhifromSession()
Assigns to 'phi' the values indicated by 'ShapeFunction'.
Octree m_tree
Octree object.
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'....
Array< OneD, NekDouble > Cross(const Array< OneD, NekDouble > &v0, const Array< OneD, NekDouble > &v1)
Returns the cross product of vectors 'v0' y 'v1'.
std::string v_GetModuleDescription() override
ProcessPhiFromFile(FieldSharedPtr f)
Set up ProcessPhiFromFile object.
STLobject ReadSTL(std::string filename)
Read an STL binary file and returns a struct of type 'STLobject' containing the parsed data.
void GetPhifromSTL(const STLobject &file)
Assigns to 'phi' the corresponding values of Phi.
static ModuleSharedPtr create(FieldSharedPtr f)
Creates an instance of this class.
void FindShortestDist(const STLobject &file, const Array< OneD, NekDouble > &x, double &dist)
Calculates the shortest distance from a point to the closed body contained in the STL file.
NekDouble PhiFunction(double dist, double coeff)
Smoothing function for the SPM method given a distance value and a scaling coefficient.
bool IsNegative(double x, double tol)
Returns true if .
void v_Process(po::variables_map &vm) override
ModulePriority v_GetModulePriority() override
bool IsEqual(double x, double y, double relTol)
Returns true if within the relative tolerance 'relTol' (relative to 'y')
Array< OneD, NekDouble > ReadVector(std::ifstream &in)
Read one 3D vector from a STL file, starting from the next line of the input 'ifstream'....
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
std::shared_ptr< Module > ModuleSharedPtr
Array< OneD, triangle > triangles
Object representing a 3D triangle.
Array< OneD, NekDouble > normal
Array< OneD, NekDouble > v1
Array< OneD, NekDouble > centroid
Array< OneD, NekDouble > v0
Array< OneD, NekDouble > v2