CEPS  24.01
Cardiac ElectroPhysiology Simulator
MeditGeometryWriter.hpp
Go to the documentation of this file.
1 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2  This file is part of CEPS.
3 
4  CEPS is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  CEPS is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with CEPS (see file LICENSE at root of project).
16  If not, see <https://www.gnu.org/licenses/>.
17 
18 
19  Copyright 2019-2024 Inria, Universite de Bordeaux
20 
21  Authors, in alphabetical order:
22 
23  Pierre-Elliott BECUE, Florian CARO, Yves COUDIERE(*), Andjela DAVIDOVIC,
24  Charlie DOUANLA-LONTSI, Marc FUENTES, Mehdi JUHOOR, Michael LEGUEBE(*),
25  Pauline MIGERDITICHAN, Valentin PANNETIER(*), Nejib ZEMZEMI.
26  * : currently active authors
27 
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
31 #pragma once
32 
33 
34 #include "common/CepsCommon.hpp"
35 #include "geometry/Geometry.hpp"
37 
38 // forward declaration of Geometry class
39 class Geometry;
40 
46 {
47 
48  public:
49 
51  MeditGeometryWriter(const CepsString& fileName, Geometry* geom);
52 
55 
64  void
65  write();
66 
68  void
70 
71  protected:
72 
74  void
75  writeNodes();
76 
84  void
85  writeCells();
86 
88  void
89  writeHeader();
90 
92  void
93  writeCellsOf(Mesh* mesh,CepsBool boundary=false);
94 
96  CepsUInt
97  determineCellOwner(CepsUInt* cellOffset, CepsUInt index);
98 
99  protected:
100 
103 };
104 
105 
std::basic_string< CepsChar > CepsString
C++ format string.
Definition: CepsTypes.hpp:128
bool CepsBool
Booleans.
Definition: CepsTypes.hpp:124
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
Definition: CepsTypes.hpp:109
Enables the writing of files.
Definition: FileWriter.hpp:40
Encapsulates all the geometrical data.
Definition: Geometry.hpp:50
Convert a Geometry to a mesh file readable by the Medit viewer.
CepsBool m_showGeometryPartitioning
Replaces attributes with owners rank.
void writeHeader()
Medit headers are written using this method.
void showGeometryPartitioning(CepsBool flag)
If true, cell attribute is replaced by owning process rank. (default is false)
void write()
Writes mesh.
CepsUInt determineCellOwner(CepsUInt *cellOffset, CepsUInt index)
Get index of owner of cell (owner of first node)
void writeCells()
Writes cells and boundary cells with attributes.
void writeCellsOf(Mesh *mesh, CepsBool boundary=false)
Gather and write the cells.
MeditGeometryWriter(const CepsString &fileName, Geometry *geom)
Constructor with ouput file name and linked geometry.
~MeditGeometryWriter()
Destructor.
void writeNodes()
Writes node coordinates and attribute.
Geometry * m_geom
Geometry to write.
Geometrical information of 1,2 or 3D distributed cells.
Definition: Mesh.hpp:57