62 cout <<
"Outputstl: Writing file..." << endl;
69 m_mshFile << std::scientific << setprecision(8);
71 for (
auto &it :
m_mesh->m_composite)
73 if (it.second->m_tag !=
"F")
78 m_mshFile <<
"solid comp:" << it.second->m_id << endl;
80 vector<ElementSharedPtr> el = it.second->m_items;
82 for (
int i = 0; i < el.size(); i++)
84 vector<NodeSharedPtr> ns = el[i]->GetVertexList();
87 tmp[0] = (ns[1]->m_y - ns[0]->m_y) * (ns[2]->m_z - ns[0]->m_z) -
88 (ns[1]->m_z - ns[0]->m_z) * (ns[2]->m_y - ns[0]->m_y);
89 tmp[1] = (ns[1]->m_z - ns[0]->m_z) * (ns[2]->m_x - ns[0]->m_x) -
90 (ns[1]->m_x - ns[0]->m_x) * (ns[2]->m_z - ns[0]->m_z);
91 tmp[2] = (ns[1]->m_x - ns[0]->m_x) * (ns[2]->m_y - ns[0]->m_y) -
92 (ns[1]->m_y - ns[0]->m_y) * (ns[2]->m_x - ns[0]->m_x);
94 NekDouble mt = tmp[0] * tmp[0] + tmp[1] * tmp[1] + tmp[2] * tmp[2];
100 m_mshFile <<
"facet normal " << tmp[0] <<
" " << tmp[1] <<
" " 103 for (
int j = 0; j < ns.size(); j++)
105 m_mshFile <<
"vertex " << ns[j]->m_x <<
" " << ns[j]->m_y <<
" " 106 << ns[j]->m_z << endl;
108 m_mshFile <<
"endloop" << endl <<
"endfacet" << endl;
#define ASSERTL0(condition, msg)
io::filtering_ostream m_mshFile
Output stream.
NEKMESHUTILS_EXPORT void OpenStream()
Open a file for output.
Abstract base class for output modules.
MeshSharedPtr m_mesh
Mesh object.
std::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
std::pair< ModuleType, std::string > ModuleKey
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::pair< ModuleType, std::string > ModuleKey
virtual void Process()
Write mesh to output file.
ModuleFactory & GetModuleFactory()