ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
MeshUnStruct.h
Go to the documentation of this file.
1//
2// ,---. ,--, .---. ,--, ,---. .-. .-.
3// | .-' .' .') / .-. ) .' .' | .-' | \| |
4// | `-. | |(_) | | |(_) | | __ | `-. | | |
5// | .-' \ \ | | | | \ \ ( _) | .-' | |\ |
6// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)|
7// /( __.' \____\ )---' )\____/ /( __.' /( (_)
8// (__) (_) (__) (__) (__)
9// Official webSite: https://code-mphi.github.io/ECOGEN/
10//
11// This file is part of ECOGEN.
12//
13// ECOGEN is the legal property of its developers, whose names
14// are listed in the copyright file included with this source
15// distribution.
16//
17// ECOGEN is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published
19// by the Free Software Foundation, either version 3 of the License,
20// or (at your option) any later version.
21//
22// ECOGEN is distributed in the hope that it will be useful,
23// but WITHOUT ANY WARRANTY; without even the implied warranty of
24// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25// GNU General Public License for more details.
26//
27// You should have received a copy of the GNU General Public License
28// along with ECOGEN (file LICENSE).
29// If not, see <http://www.gnu.org/licenses/>.
30
31#ifndef MESHUNSTRUCT_H
32#define MESHUNSTRUCT_H
33
34#include "Mesh.h"
36#include "../Order2/CellInterfaceO2NS.h"
37#include "../Order2/CellO2NS.h"
38#include "../InputOutput/IO.h"
39
40class MeshUnStruct : public Mesh
41{
42public:
43 MeshUnStruct(const std::string& meshFile, const std::string& meshExtension);
44 virtual ~MeshUnStruct();
45
46 static std::string readMeshFileExtension(const std::string& meshFile);
47
48 // --- Mesh virtual member functions ---
49 virtual void assignLimits(std::vector<BoundCond*>& boundCond);
51 const int& /*restartSimulation*/, bool pretraitementParallele = true, std::string ordreCalcul = "FIRSTORDER");
52 virtual std::string whoAmI() const { return 0; };
53
54 // --- MeshUnStruct virtual member functions ---
59 virtual void initGeometryMonoCPU(TypeMeshContainer<Cell*>& cells, TypeMeshContainer<CellInterface*>& cellInterfaces, std::string computeOrder = "FIRSTORDER") = 0;
64 virtual void initGeometryParallel(TypeMeshContainer<Cell*>& cells, TypeMeshContainer<Cell*>& cellsGhost, TypeMeshContainer<CellInterface*>& cellInterfaces, std::string computeOrder = "FIRSTORDER") = 0;
67 virtual void initCpuMeshSequential(TypeMeshContainer<Cell*>& cells, std::string &computeOrder) = 0;
68 virtual void initCpuMeshParallel(TypeMeshContainer<Cell*>& cells, std::string &computeOrder, int cpu) = 0;
69
70 // Printing / Reading
72 void writeMeshInfoData() const;
73 virtual void writeHeaderPiece(std::ofstream& fileStream, TypeMeshContainer<Cell*>* /*cellsLvl*/) const;
74 virtual void getNodes(std::vector<double>& dataset, std::vector<Cell*>* /*cellsLvl*/) const;
75 virtual void getConnectivity(std::vector<double>& dataset, std::vector<Cell*>* /*cellsLvl*/) const;
76 virtual void getOffsets(std::vector<double>& dataset, std::vector<Cell*>* /*cellsLvl*/) const;
77 virtual void getTypeCell(std::vector<double>& dataset, std::vector<Cell*>* /*cellsLvl*/) const;
78 virtual void getData(TypeMeshContainer<Cell*>* cellsLvl, std::vector<double>& dataset, const int var, int phase) const;
79 virtual void setDataSet(std::vector<double>& dataset, TypeMeshContainer<Cell*>* cellsLvl, const int var, int phase) const;
80 virtual void extractAbsVelocityMRF(TypeMeshContainer<Cell*>* cellsLvl, std::vector<double>& dataset, Source* sourceMRF) const;
81 virtual void extractReferenceLength(std::vector<Cell*>* cellsLvl, std::vector<double>& dataset) const;
82
83protected:
84 std::string m_meshFile;
85 std::string m_nameMesh;
86
95 std::vector<BoundCond*> m_bound;
96
100
102
114
115 //statistics
118};
119
120#endif // MESHUNSTRUCT_H
std::vector< Type > TypeMeshContainer
Template for the type of the mesh container (std::list for now, but may change to something else if w...
Definition Tools.h:83
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
Definition ElementNS.h:40
Definition FaceNS.h:40
Definition MeshUnStruct.h:41
int m_numberElements0D
Definition MeshUnStruct.h:103
virtual void getData(TypeMeshContainer< Cell * > *cellsLvl, std::vector< double > &dataset, const int var, int phase) const
Definition MeshUnStruct.cpp:270
int m_numberGhostCells
Number of ghost cells.
Definition MeshUnStruct.h:101
virtual void getConnectivity(std::vector< double > &dataset, std::vector< Cell * > *) const
Definition MeshUnStruct.cpp:226
virtual void assignLimits(std::vector< BoundCond * > &boundCond)
Definition MeshUnStruct.cpp:103
int m_numberElements3D
Definition MeshUnStruct.h:106
std::vector< BoundCond * > m_bound
Array of boundary conditions.
Definition MeshUnStruct.h:95
int m_numberElements1D
Definition MeshUnStruct.h:104
int m_numberInnerNodes
Number of inner nodes (except from ghosts)
Definition MeshUnStruct.h:88
virtual void initCpuMeshSequential(TypeMeshContainer< Cell * > &cells, std::string &computeOrder)=0
Initialize mesh of a single partition for restart with mesh mapping option.
FaceNS ** m_faces
Array of geometrical faces.
Definition MeshUnStruct.h:94
int m_numberElements2D
Definition MeshUnStruct.h:105
virtual ~MeshUnStruct()
Definition MeshUnStruct.cpp:82
virtual void getTypeCell(std::vector< double > &dataset, std::vector< Cell * > *) const
Definition MeshUnStruct.cpp:257
int m_numberFacesParallel
Number of faces between a compute cell and a ghost cell.
Definition MeshUnStruct.h:99
void writeMeshInfoData() const
write monocpu mesh information
Definition MeshUnStruct.cpp:147
virtual void getOffsets(std::vector< double > &dataset, std::vector< Cell * > *) const
Definition MeshUnStruct.cpp:242
int m_numberPoints
Definition MeshUnStruct.h:112
int m_numberQuadrangles
Definition MeshUnStruct.h:109
std::string m_meshFile
Name of the mesh file read.
Definition MeshUnStruct.h:84
int m_numberSegments
Definition MeshUnStruct.h:107
virtual void preProcessMeshFileForParallel()=0
split original mesh file for computation on several CPUs
ElementNS ** m_elements
Array of internal geometric elements.
Definition MeshUnStruct.h:93
int m_numberHexahedrons
Definition MeshUnStruct.h:113
int m_numberNodes
Number of nodes of the geometric domain.
Definition MeshUnStruct.h:87
double m_totalVolume
Sum of 3D element volumes.
Definition MeshUnStruct.h:117
int m_numberInnerElements
Number of elements of n dimension of internal compute.
Definition MeshUnStruct.h:90
int m_numberGhostElements
Number of ghost elements of dimension n for parallel computation.
Definition MeshUnStruct.h:91
int m_numberBoundFaces
Number of faces between a compute cell and a boundary.
Definition MeshUnStruct.h:98
std::string m_nameMesh
Name of the mesh file without extension.
Definition MeshUnStruct.h:85
int m_numberPyramids
Definition MeshUnStruct.h:111
virtual void extractReferenceLength(std::vector< Cell * > *cellsLvl, std::vector< double > &dataset) const
Definition MeshUnStruct.cpp:377
int m_numberCommunicatingElements
Real number of communicating elements.
Definition MeshUnStruct.h:92
virtual std::string whoAmI() const
Definition MeshUnStruct.h:52
virtual void extractAbsVelocityMRF(TypeMeshContainer< Cell * > *cellsLvl, std::vector< double > &dataset, Source *sourceMRF) const
Definition MeshUnStruct.cpp:349
virtual void writeHeaderPiece(std::ofstream &fileStream, TypeMeshContainer< Cell * > *) const
Definition MeshUnStruct.cpp:207
virtual void getNodes(std::vector< double > &dataset, std::vector< Cell * > *) const
Definition MeshUnStruct.cpp:214
virtual void initGeometryMonoCPU(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< CellInterface * > &cellInterfaces, std::string computeOrder="FIRSTORDER")=0
initialize the geometry for single CPU computation
double m_totalSurface
Sum of 2D element surfaces.
Definition MeshUnStruct.h:116
Coord * m_nodes
Array of node coordinates in the geometric domain.
Definition MeshUnStruct.h:89
int m_numberInnerFaces
Number of faces between two cells of compute.
Definition MeshUnStruct.h:97
int m_numberTetrahedrons
Definition MeshUnStruct.h:110
virtual void initGeometryParallel(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, std::string computeOrder="FIRSTORDER")=0
initialize the geometry for multi CPUs computation
int m_numberTriangles
Definition MeshUnStruct.h:108
virtual int initializeGeometrie(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, const int &, bool pretraitementParallele=true, std::string ordreCalcul="FIRSTORDER")
renvoi le number de dimensions (1,2 ou 3)
Definition MeshUnStruct.cpp:127
static std::string readMeshFileExtension(const std::string &meshFile)
Definition MeshUnStruct.cpp:91
virtual void initCpuMeshParallel(TypeMeshContainer< Cell * > &cells, std::string &computeOrder, int cpu)=0
Initialize mesh of a single partition of a partionned mesh for restart with mesh mapping option.
virtual void setDataSet(std::vector< double > &dataset, TypeMeshContainer< Cell * > *cellsLvl, const int var, int phase) const
Definition MeshUnStruct.cpp:314
Abstract class for a mesh.
Definition Mesh.h:53
Abstract class for source terms.
Definition Source.h:43