Newer
Older
/***************************************************************************
-------------------
begin : Feb 22, 2014
copyright : (C) 2014 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/* See Copyright Notice in tnl/Copyright */
/***
* Authors:
* Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz
* Zabka Vitezslav, zabkav@gmail.com
*/
#include <iomanip>
using GlobalIndexType = typename Mesh::GlobalIndexType;
using PointType = typename Mesh::PointType;
using Cell = typename Mesh::Cell;
static constexpr int meshDimension = Mesh::getMeshDimension();
public:
static void writeMesh( const Mesh& mesh, std::ostream& str )
str << std::setprecision( 6 );
str << std::fixed;
const GlobalIndexType numberOfVertices = mesh.template getEntitiesCount< typename Mesh::Vertex >();
str << numberOfVertices << std::endl;
for( GlobalIndexType i = 0; i < numberOfVertices; i++ )
const PointType& point = mesh.template getEntity< typename Mesh::Vertex >( i ).getPoint();
str << " ";
for( int d = 0; d < meshDimension; d++ )
const GlobalIndexType numberOfCells = mesh.template getEntitiesCount< typename Mesh::Cell >();
str << numberOfCells << std::endl;
for( GlobalIndexType cellIdx = 0; cellIdx < numberOfCells; cellIdx++ )
const Cell& cell = mesh.template getEntity< typename Mesh::Cell >( cellIdx );
str << " 1";
for( int cellVertexIdx = 0;
cellVertexIdx++ )
str << " " << cell.getVertexIndex( cellVertexIdx );
str << "\n";