ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
MeshCartesian.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 MESHCARTESIAN_H
32#define MESHCARTESIAN_H
33
34#include "Mesh.h"
35#include "ElementCartesian.h"
36#include "FaceCartesian.h"
37#include "stretchZone.h"
38#include "../Order2/CellInterfaceO2Cartesian.h"
39#include "../Order2/CellO2Cartesian.h"
40#include "../Order2/CellO2GhostCartesian.h"
41#include "../Parallel/decomposition.hpp"
42
43class MeshCartesian : public Mesh
44{
45public:
46 MeshCartesian(double lX, int numberCellsX, double lY, int numberCellsY, double lZ, int numberCellsZ,
47 std::vector<stretchZone> stretchX, std::vector<stretchZone> stretchY, std::vector<stretchZone> stretchZ);
48 virtual ~MeshCartesian();
49
50 virtual void assignLimits(std::vector<BoundCond*>& boundCond);
51 void getIJK(const int& index, int& i, int& j, int& k) const;
52 void construitIGlobal(const int& i, const int& j, const int& k, int& index) const;
54 const int& /*restartSimulation*/, bool /*pretraitementParallele*/, std::string ordreCalcul);
55 void meshStretching();
56 void initializeGeometrieMonoCpu(TypeMeshContainer<Cell*>& cells, TypeMeshContainer<CellInterface*>& cellInterfaces, std::string ordreCalcul);
57 void initializeGeometrieParallele(TypeMeshContainer<Cell*>& cells, TypeMeshContainer<Cell*>& cellsGhost, TypeMeshContainer<CellInterface*>& cellInterfaces, std::string ordreCalcul);
58 void decoupageParallele(std::string ordreCalcul, TypeMeshContainer<Cell*>& cells);
59 virtual std::string whoAmI() const;
60 virtual void setImmersedBoundaries(TypeMeshContainer<CellInterface*>* cellInterfacesLvl, std::string ordreCalcul) const;
61
62 //Accessors
63 //---------
64 virtual int getNumberCellsY() { return m_numberCellsY; };
65 virtual int getNumberCellsZ() { return m_numberCellsZ; };
66
67 //Printing / Reading
68 //------------------
69 virtual std::string getStringExtent(bool global = false) const;
70 virtual void getCoord(std::vector<double>& dataset, Axis axis) const;
71 virtual void getData(TypeMeshContainer<Cell*>* cellsLvl, std::vector<double>& dataset, const int var, int phase) const;
72 virtual void setDataSet(std::vector<double>& dataset, TypeMeshContainer<Cell*>* cellsLvl, const int var, int phase) const;
73
74protected:
77
78 double m_lX;
79 double m_lY;
80 double m_lZ;
87 std::vector<double> m_dXi;
88 std::vector<double> m_dYj;
89 std::vector<double> m_dZk;
90 std::vector<double> m_posXi;
91 std::vector<double> m_posYj;
92 std::vector<double> m_posZk;
93 std::vector<stretchZone> m_stretchX;
94 std::vector<stretchZone> m_stretchY;
95 std::vector<stretchZone> m_stretchZ;
113};
114
115#endif // MESHCARTESIAN_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
Axis
Enumeration for the axes (X, Y and Z for the axes in the x-, y- and z-direction)
Definition Tools.h:42
Definition BoundCond.h:41
Definition MeshCartesian.h:44
int m_numberCellsZGlobal
Definition MeshCartesian.h:86
int m_numberBoundCondInit
Definition MeshCartesian.h:106
std::vector< double > m_dYj
Definition MeshCartesian.h:88
int m_numberCellsY
Definition MeshCartesian.h:82
virtual ~MeshCartesian()
Definition MeshCartesian.cpp:63
void construitIGlobal(const int &i, const int &j, const int &k, int &index) const
Definition MeshCartesian.cpp:141
BoundCond * m_limZm
Definition MeshCartesian.h:111
double m_lX
Definition MeshCartesian.h:78
void getIJK(const int &index, int &i, int &j, int &k) const
Definition MeshCartesian.cpp:130
virtual std::string getStringExtent(bool global=false) const
Definition MeshCartesian.cpp:1767
virtual void assignLimits(std::vector< BoundCond * > &boundCond)
Definition MeshCartesian.cpp:86
std::vector< double > m_posYj
Definition MeshCartesian.h:91
int m_offsetZ
Definition MeshCartesian.h:104
int m_CpuCoordX
Definition MeshCartesian.h:99
std::vector< stretchZone > m_stretchY
Definition MeshCartesian.h:94
std::vector< stretchZone > m_stretchZ
Definition MeshCartesian.h:95
BoundCond * m_limZp
Definition MeshCartesian.h:112
virtual int initializeGeometrie(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, const int &, bool, std::string ordreCalcul)
renvoi le number de dimensions (1,2 ou 3)
Definition MeshCartesian.cpp:151
BoundCond * m_limYp
Definition MeshCartesian.h:110
int m_numberCellsYGlobal
Definition MeshCartesian.h:85
std::vector< double > m_dZk
Definition MeshCartesian.h:89
virtual int getNumberCellsZ()
Definition MeshCartesian.h:65
void meshStretching()
Definition MeshCartesian.cpp:168
virtual void setDataSet(std::vector< double > &dataset, TypeMeshContainer< Cell * > *cellsLvl, const int var, int phase) const
Definition MeshCartesian.cpp:1864
TypeMeshContainer< Face * > m_faces
Vector of face objects (between two elements or at boundaries): Contains geometrical attributes.
Definition MeshCartesian.h:76
double m_lZ
Definition MeshCartesian.h:80
int m_CpuCoordY
Definition MeshCartesian.h:100
std::vector< stretchZone > m_stretchX
Definition MeshCartesian.h:93
int m_CpuCoordZ
Definition MeshCartesian.h:101
int m_numberCpuX
Definition MeshCartesian.h:96
int m_numberCellsX
Definition MeshCartesian.h:81
virtual void getData(TypeMeshContainer< Cell * > *cellsLvl, std::vector< double > &dataset, const int var, int phase) const
Definition MeshCartesian.cpp:1820
int m_numberCpuZ
Definition MeshCartesian.h:98
std::vector< double > m_posXi
Definition MeshCartesian.h:90
int m_numberCellsZ
Definition MeshCartesian.h:83
std::vector< double > m_posZk
Definition MeshCartesian.h:92
TypeMeshContainer< Element * > m_elements
Vector of element objects: Contains geometrical attributes.
Definition MeshCartesian.h:75
virtual void setImmersedBoundaries(TypeMeshContainer< CellInterface * > *cellInterfacesLvl, std::string ordreCalcul) const
Definition MeshCartesian.cpp:1630
BoundCond * m_limYm
Definition MeshCartesian.h:109
BoundCond * m_limXp
Definition MeshCartesian.h:108
int m_offsetY
Definition MeshCartesian.h:103
virtual std::string whoAmI() const
Definition MeshCartesian.cpp:1623
double m_lY
Definition MeshCartesian.h:79
int m_numberCpuY
Definition MeshCartesian.h:97
void initializeGeometrieMonoCpu(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< CellInterface * > &cellInterfaces, std::string ordreCalcul)
Definition MeshCartesian.cpp:212
void initializeGeometrieParallele(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, std::string ordreCalcul)
Definition MeshCartesian.cpp:562
int m_offsetX
Definition MeshCartesian.h:102
void decoupageParallele(std::string ordreCalcul, TypeMeshContainer< Cell * > &cells)
Definition MeshCartesian.cpp:1063
int m_numberCellsXGlobal
Definition MeshCartesian.h:84
virtual void getCoord(std::vector< double > &dataset, Axis axis) const
Definition MeshCartesian.cpp:1791
BoundCond * m_limXm
Definition MeshCartesian.h:107
std::vector< double > m_dXi
Definition MeshCartesian.h:87
virtual int getNumberCellsY()
Definition MeshCartesian.h:64
Abstract class for a mesh.
Definition Mesh.h:53