144 this->mpMeshReader =
nullptr;
148 this->mNumElements = mpMesh->GetNumElements();
151 mpIters->pNodeIter =
new NodeIterType(mpMesh->GetNodeIteratorBegin());
154 mpIters->pElemIter =
new ElemIterType(mpMesh->GetElementIteratorBegin());
157 mNodeMapCurrentIndex = 0;
158 if (mpMesh->IsMeshChanging())
160 mpNodeMap =
new NodeMap(mpMesh->GetNumAllNodes());
161 for (NodeIterType it = mpMesh->GetNodeIteratorBegin(); it != mpMesh->GetNodeIteratorEnd(); ++it)
163 mpNodeMap->SetNewIndex(it->GetIndex(), mNodeMapCurrentIndex++);
176 std::string node_file_name = this->mBaseName +
".node";
177 out_stream p_node_file = this->mpOutputFileHandler->OpenOutputFile(node_file_name);
180 unsigned num_attr = 0;
181 unsigned max_bdy_marker = 1;
182 unsigned num_nodes = this->GetNumNodes();
184 *p_node_file << num_nodes <<
"\t";
185 *p_node_file << SPACE_DIM <<
"\t";
186 *p_node_file << num_attr <<
"\t";
187 *p_node_file << max_bdy_marker <<
"\n";
188 *p_node_file << std::setprecision(6);
191 for (
unsigned item_num=0; item_num<num_nodes; item_num++)
193 std::vector<double> current_item = this->GetNextNode();
194 *p_node_file << item_num;
195 for (
unsigned i=0; i<SPACE_DIM+1; i++)
197 *p_node_file <<
"\t" << current_item[i];
199 *p_node_file <<
"\n";
201 *p_node_file << comment <<
"\n";
202 p_node_file->close();
205 std::string element_file_name = this->mBaseName +
".cell";
206 out_stream p_element_file = this->mpOutputFileHandler->OpenOutputFile(element_file_name);
209 unsigned num_elements = this->GetNumElements();
210 *p_element_file << num_elements <<
"\t";
217 if (num_elements != 0)
219 *p_element_file << num_attr <<
"\n";
223 *p_element_file << 0 <<
"\n";
227 for (
unsigned item_num=0; item_num<num_elements; item_num++)
233 std::vector<unsigned> node_indices = elem_data.
NodeIndices;
236 *p_element_file << item_num <<
"\t" << node_indices.size();
239 for (
unsigned i=0; i<node_indices.size(); i++)
241 *p_element_file <<
"\t" << node_indices[i];
248 *p_element_file <<
"\n";
251 *p_element_file << comment <<
"\n";
252 p_element_file->close();