39 #include <boost/filesystem.hpp>
62 "Reads CAD geometry and will generate the mesh file.");
77 vector<string> filename;
78 filename.push_back(
m_config[
"infile"].as<string>());
79 string fn = filename[0].substr(0, filename[0].
find(
"."));
85 pSession->LoadParameter(
"MinDelta",
m_minDelta);
86 pSession->LoadParameter(
"MaxDelta",
m_maxDelta);
87 pSession->LoadParameter(
"EPS",
m_eps);
88 pSession->LoadParameter(
"Order",
m_order);
89 m_CADName = pSession->GetSolverInfo(
"CADFile");
91 if (pSession->DefinesSolverInfo(
"MeshType"))
93 if (pSession->GetSolverInfo(
"MeshType") ==
"BL")
96 pSession->LoadParameter(
"BLThick",
m_blthick);
108 if (pSession->DefinesSolverInfo(
"WriteOctree"))
110 m_writeoctree = pSession->GetSolverInfo(
"WriteOctree") ==
"TRUE";
113 vector<unsigned int> symsurfs;
114 vector<unsigned int> blsurfs;
118 sym = pSession->GetSolverInfo(
"SymPlane");
119 bl = pSession->GetSolverInfo(
"BLSurfs");
122 sort(symsurfs.begin(), symsurfs.end());
123 sort(blsurfs.begin(), blsurfs.end());
125 "No surfaces selected to make boundary layer on");
128 if (pSession->DefinesSolverInfo(
"UserDefinedSpacing"))
130 m_udsName = pSession->GetSolverInfo(
"UserDefinedSpacing");
132 "UserDefinedSpacing file does not exist");
144 cout <<
"Building mesh for: " <<
m_CADName << endl;
147 ASSERTL0(m_cad->LoadCAD(),
"Failed to load CAD");
151 cout <<
"With parameters:" << endl;
154 <<
"\tesp: " <<
m_eps << endl
155 <<
"\torder: " <<
m_order << endl;
162 cout <<
"\tWill make boundary layers on surfs: ";
163 for (
int i = 0; i < blsurfs.size(); i++)
165 cout << blsurfs[i] <<
" ";
167 cout << endl <<
"\tWith the symmetry planes: ";
168 for (
int i = 0; i < symsurfs.size(); i++)
170 cout << symsurfs[i] <<
" ";
172 cout << endl <<
"\tWith thickness " <<
m_blthick << endl;
188 m_octree->GetOctreeMesh(oct);
192 mod->RegisterConfig(
"outfile", fn +
"_oct.xml");
193 mod->ProcessVertices();
196 mod->ProcessElements();
197 mod->ProcessComposites();
220 m_surfacemesh->Mesh();
228 m_surfacemesh->Report();
231 m_mesh->m_fields.push_back(
"u");
232 m_mesh->m_fields.push_back(
"v");
233 m_mesh->m_fields.push_back(
"w");
234 m_mesh->m_fields.push_back(
"p");
236 map<int, FaceSharedPtr> surftopriface;
250 m_mesh, m_octree, m_blmesh);
266 m_surfacemesh->HOSurf();
271 cout <<
m_mesh->m_element[3].size() << endl;
#define ASSERTL0(condition, msg)
pair< ModuleType, string > ModuleKey
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
map< string, ConfigOption > m_config
List of configuration values.
MeshSharedPtr m_mesh
Mesh object.
boost::shared_ptr< SurfaceMesh > SurfaceMeshSharedPtr
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
static bool GenerateSeqVector(const char *const str, std::vector< unsigned int > &vec)
virtual void ClearElementLinks()
virtual void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
virtual void ProcessVertices()
Extract element vertices.
boost::shared_ptr< BLMesh > BLMeshSharedPtr
virtual void ProcessElements()
Generate element IDs.
boost::shared_ptr< TetMesh > TetMeshSharedPtr
virtual void ProcessComposites()
Generate composites.
boost::shared_ptr< Module > ModuleSharedPtr
boost::shared_ptr< Octree > OctreeSharedPtr
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
boost::shared_ptr< CADSystem > CADSystemSharedPtr
virtual void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
ModuleFactory & GetModuleFactory()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.