35#ifndef NEKTAR_SPATIALDOMAINS_CADSYSTEM_CADSYSTEM
36#define NEKTAR_SPATIALDOMAINS_CADSYSTEM_CADSYSTEM
119 const std::string &
GetConfig(
const std::string &key)
const
131 void SetConfig(
const std::string &key,
const std::string &value)
177 return search->second;
188 return search->second;
199 return search->second;
239 int first,
int second);
267 std::stringstream ss;
270 const int maxReported = 10;
274 size_t nAdj = curve->GetAdjSurf().size();
283 if (++nBad <= maxReported)
285 auto mm = curve->GetMinMax();
287 <<
" curve " <<
id <<
", (" << mm[0] <<
", " << mm[1]
288 <<
", " << mm[2] <<
") -> (" << mm[3] <<
", " << mm[4]
289 <<
", " << mm[5] <<
"), bounded by " << nAdj <<
" surface"
290 << (nAdj == 1 ?
"" :
"s");
292 for (
auto &adj : curve->GetAdjSurf())
294 ss <<
" " << adj.first.lock()->GetId();
299 if (nBad > maxReported)
301 ss << std::endl <<
" ... and " << nBad - maxReported <<
" more.";
306 m_log(
FATAL) <<
"the CAD model is not a closed solid: " << nBad
308 <<
" curves are not bounded by exactly two surfaces, "
309 "so the surface mesher has no closed boundary to "
311 << ss.str() << std::endl;
354 m_log(
VERBOSE) <<
" - CAD extent: " << bb[1] - bb[0] <<
" x "
355 << bb[3] - bb[2] <<
" x " << bb[5] - bb[4]
356 <<
" (mesh units)" << std::endl;
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define SPATIAL_DOMAINS_EXPORT
Basic logging class for the NekMesh library.
void SetPrefix(const std::string &prefix)
Sets the prefix for this Logger that is automatically preprended to all messages.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
Base class for CAD interface system.
CADCurveSharedPtr GetCurve(int i)
Gets a curve from the map.
const std::string & GetConfig(const std::string &key) const
Gets a configuration option.
std::string GetEngine() const
Return the name of the CAD system engine (e.g. OCE).
std::vector< std::array< NekDouble, 3 > > m_voidPoints
Points contained within volume voids for tetrahedralisation.
std::map< int, CADSurfSharedPtr > m_surfs
Map of surfaces.
std::map< std::string, std::string > m_config
Configuration options which might be used per-engine, serialised in strings.
void SetVoidPoints(const std::vector< std::array< NekDouble, 3 > > &voidPts)
Sets void points for tetrahedral meshing.
std::string GetName()
Return the name of the CAD file.
int GetNumVerts() const
Gets number of vertices.
void Set2D()
Set the CAD engine up to handle 2D geometries explicitly.
std::vector< std::array< NekDouble, 3 > > GetVoidPoints()
Gets void points for tetrahedral meshing.
Logger m_log
Logger object.
std::map< int, CADVertSharedPtr > GetVerts()
Gets map of all vertices.
std::map< int, CADVertSharedPtr > m_verts
Map of vertices.
CADVertSharedPtr GetVert(int i)
Gets a vert from the map.
CADSurfSharedPtr GetSurf(int i)
Gets a surface from the map.
virtual bool LoadCAD()=0
Initialises CAD and makes surface, curve and vertex maps.
int GetNumCurve()
Get the number of curves.
bool Is2D()
Returns whether the CAD engine is set in 2D mode.
std::map< int, CADCurveSharedPtr > m_curves
Map of curves.
void Report()
Reports basic properties to screen.
std::string m_engine
Name of CAD engine.
void SetConfig(const std::string &key, const std::string &value)
Sets a configuration option key to value.
CADSystem(std::string name, std::string engine)
Default constructor.
void CheckClosed()
Fail unless every curve is bounded by exactly two surfaces.
std::string m_name
Name of CAD file.
int GetNumSurf()
Get the number of surfaces.
virtual std::array< NekDouble, 6 > GetBoundingBox()=0
Returns bounding box of the domain.
void SetLogger(Logger &log)
std::array< NekDouble, 3 > GetPeriodicTranslationVector(int first, int second)
Return the vector of translation from one curve to another to allow for periodic mesh generation in 2...
std::shared_ptr< CADCurve > CADCurveSharedPtr
std::shared_ptr< CADVert > CADVertSharedPtr
EngineFactory & GetEngineFactory()
std::shared_ptr< CADSystem > CADSystemSharedPtr
std::shared_ptr< CADSurf > CADSurfSharedPtr
LibUtilities::NekFactory< std::string, CADSystem, std::string > EngineFactory
@ FATAL
Fatal errors that trigger exceptions.
scalarT< T > log(scalarT< T > in)