63 cout <<
"Outputstl: Writing file..." << endl;
70 m_mshFile << std::scientific << setprecision(8);
74 for (it =
m_mesh->m_composite.begin(); it !=
m_mesh->m_composite.end();
77 if (it->second->m_tag !=
"F")
82 m_mshFile <<
"solid comp:" << it->second->m_id << endl;
84 vector<ElementSharedPtr> el = it->second->m_items;
86 for (
int i = 0; i < el.size(); i++)
88 vector<NodeSharedPtr> ns = el[i]->GetVertexList();
91 tmp[0] = (ns[1]->m_y - ns[0]->m_y) * (ns[2]->m_z - ns[0]->m_z) -
92 (ns[1]->m_z - ns[0]->m_z) * (ns[2]->m_y - ns[0]->m_y);
93 tmp[1] = (ns[1]->m_z - ns[0]->m_z) * (ns[2]->m_x - ns[0]->m_x) -
94 (ns[1]->m_x - ns[0]->m_x) * (ns[2]->m_z - ns[0]->m_z);
95 tmp[2] = (ns[1]->m_x - ns[0]->m_x) * (ns[2]->m_y - ns[0]->m_y) -
96 (ns[1]->m_y - ns[0]->m_y) * (ns[2]->m_x - ns[0]->m_x);
98 NekDouble mt = tmp[0] * tmp[0] + tmp[1] * tmp[1] + tmp[2] * tmp[2];
104 m_mshFile <<
"facet normal " << tmp[0] <<
" " << tmp[1] <<
" "
107 for (
int j = 0; j < ns.size(); j++)
109 m_mshFile <<
"vertex " << ns[j]->m_x <<
" " << ns[j]->m_y <<
" "
110 << ns[j]->m_z << endl;
112 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.
pair< ModuleType, string > ModuleKey
MeshSharedPtr m_mesh
Mesh object.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
std::pair< ModuleType, std::string > ModuleKey
virtual void Process()
Write mesh to output file.
ModuleFactory & GetModuleFactory()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.