ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
MeshCartesianAMR.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 MESHCARTESIANAMR_H
32#define MESHCARTESIANAMR_H
33
34#include "MeshCartesian.h"
35
37{
38public:
39 MeshCartesianAMR(double lX, int numberCellsX, double lY, int numberCellsY, double lZ, int numberCellsZ,
40 std::vector<stretchZone> stretchX, std::vector<stretchZone> stretchY, std::vector<stretchZone> stretchZ,
41 int lvlMax = 0, double criteriaVar = 1.e10, bool varRho = false, bool varP = false, bool varU = false,
42 bool varAlpha = false, double xiSplit = 1., double xiJoin = 1.);
43 virtual ~MeshCartesianAMR();
44
46 const int& restartSimulation, bool /*pretraitementParallele*/, std::string ordreCalcul);
47 void initializeGeometrieAMR(TypeMeshContainer<Cell*>& cells, TypeMeshContainer<Cell*>& cellsGhost, TypeMeshContainer<CellInterface*>& cellInterfaces, const int& restartSimulation, std::string ordreCalcul);
51 const std::vector<AddPhys*>& addPhys, int& nbCellsTotalAMR, std::vector<GeometricalDomain*>& domains,
52 Eos** eos, const int& restartSimulation, std::string ordreCalcul, std::vector<GeometricalDomain*>& solidDomains);
53 virtual void procedureRaffinement(TypeMeshContainer<Cell*>* cellsLvl, TypeMeshContainer<Cell*>* cellsLvlGhost, TypeMeshContainer<CellInterface*>* cellInterfacesLvl, const int& lvl,
54 const std::vector<AddPhys*>& addPhys, int& nbCellsTotalAMR, Eos** eos);
55 virtual std::string whoAmI() const;
56
57 //Printing / Reading
58 virtual void writeHeaderPiece(std::ofstream& fileStream, TypeMeshContainer<Cell*>* cellsLvl) const;
59 virtual void getNodes(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl) const;
60 virtual void getConnectivity(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl) const;
61 virtual void getOffsets(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl) const;
62 virtual void getTypeCell(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl) const;
63 virtual void getData(TypeMeshContainer<Cell*>* cellsLvl, std::vector<double>& dataset, const int var, int phase) const;
64 virtual void setDataSet(std::vector<double>& dataset, TypeMeshContainer<Cell*>* cellsLvl, const int var, int phase) const;
65 virtual void refineCellAndCellInterfaces(Cell* cell, const std::vector<AddPhys*>& addPhys, int& nbCellsTotalAMR);
66 virtual void printDomainDecomposition(std::ofstream& fileStream);
67 virtual void readDomainDecomposition(std::ifstream& fileStream);
68
69 //Accesseurs
70 virtual int getLvlMax() const { return m_lvlMax; };
71
72 //Pour parallele
73 virtual void initializePersistentCommunications(const TypeMeshContainer<Cell*>& cells, std::string ordreCalcul);
74 virtual void finalizeParallele(const int& lvlMax);
76 TypeMeshContainer<CellInterface*>* cellInterfacesLvl, std::string ordreCalcul,
77 const std::vector<AddPhys*>& addPhys, Eos** eos, int& nbCellsTotalAMR, std::vector<GeometricalDomain*>& solidDomains, bool init = false);
78 virtual void computePotentialBalancing(TypeMeshContainer<Cell*>* cellsLvl, bool init, int lvl, bool& balance,
79 std::vector<typename decomposition::Key<3>::value_type>& indicesSendStartGlobal, std::vector<typename decomposition::Key<3>::value_type>& indicesSendEndGlobal,
80 std::vector<typename decomposition::Key<3>::value_type>& indicesReceiveStartGlobal, std::vector<typename decomposition::Key<3>::value_type>& indicesReceiveEndGlobal);
81 virtual void balance(TypeMeshContainer<Cell*>* cellsLvl, TypeMeshContainer<Cell*>* cellsLvlGhost,
82 TypeMeshContainer<CellInterface*>* cellInterfacesLvl, std::string ordreCalcul,
83 const std::vector<AddPhys*>& addPhys, Eos** eos, int& nbCellsTotalAMR,
84 std::vector<typename decomposition::Key<3>::value_type>& indicesSendStartGlobal, std::vector<typename decomposition::Key<3>::value_type>& indicesSendEndGlobal,
85 std::vector<typename decomposition::Key<3>::value_type>& indicesReceiveStartGlobal, std::vector<typename decomposition::Key<3>::value_type>& indicesReceiveEndGlobal,
86 std::vector<GeometricalDomain*>& solidDomains);
87
88private:
94
95};
96
97#endif // MESHCARTESIANAMR_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
Base class for a mesh cell.
Definition Cell.h:59
General class for Equation of State (EOS).
Definition Eos.h:54
Definition MeshCartesianAMR.h:37
virtual void getConnectivity(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const
Definition MeshCartesianAMR.cpp:703
double m_xiJoin
Value of xi to split or join the cells.
Definition MeshCartesianAMR.h:92
virtual ~MeshCartesianAMR()
Definition MeshCartesianAMR.cpp:49
double m_xiSplit
Definition MeshCartesianAMR.h:92
virtual void refineCellAndCellInterfaces(Cell *cell, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR)
Definition MeshCartesianAMR.cpp:855
virtual void procedureRaffinement(TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, const int &lvl, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR, Eos **eos)
Definition MeshCartesianAMR.cpp:543
bool m_varP
Definition MeshCartesianAMR.h:91
int m_lvlMax
Niveau maximal sur l arbre AMR (si m_lvlMax = 0, pas d AMR)
Definition MeshCartesianAMR.h:89
bool m_varU
Definition MeshCartesianAMR.h:91
bool m_varAlpha
Choice on which variation we coarsen or refine.
Definition MeshCartesianAMR.h:91
virtual void setDataSet(std::vector< double > &dataset, TypeMeshContainer< Cell * > *cellsLvl, const int var, int phase) const
Definition MeshCartesianAMR.cpp:821
virtual void getTypeCell(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const
Definition MeshCartesianAMR.cpp:762
virtual void printDomainDecomposition(std::ofstream &fileStream)
Definition MeshCartesianAMR.cpp:864
decomposition::Decomposition m_decomp
Parallel domain decomposition based on keys.
Definition MeshCartesianAMR.h:93
virtual void parallelLoadBalancingAMR(TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, std::string ordreCalcul, const std::vector< AddPhys * > &addPhys, Eos **eos, int &nbCellsTotalAMR, std::vector< GeometricalDomain * > &solidDomains, bool init=false)
Definition MeshCartesianAMR.cpp:911
virtual void balance(TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, std::string ordreCalcul, const std::vector< AddPhys * > &addPhys, Eos **eos, int &nbCellsTotalAMR, std::vector< typename decomposition::Key< 3 >::value_type > &indicesSendStartGlobal, std::vector< typename decomposition::Key< 3 >::value_type > &indicesSendEndGlobal, std::vector< typename decomposition::Key< 3 >::value_type > &indicesReceiveStartGlobal, std::vector< typename decomposition::Key< 3 >::value_type > &indicesReceiveEndGlobal, std::vector< GeometricalDomain * > &solidDomains)
Definition MeshCartesianAMR.cpp:1157
virtual void getOffsets(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const
Definition MeshCartesianAMR.cpp:745
virtual void readDomainDecomposition(std::ifstream &fileStream)
Definition MeshCartesianAMR.cpp:871
virtual void writeHeaderPiece(std::ofstream &fileStream, TypeMeshContainer< Cell * > *cellsLvl) const
Definition MeshCartesianAMR.cpp:631
virtual void procedureRaffinementInitialization(TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR, std::vector< GeometricalDomain * > &domains, Eos **eos, const int &restartSimulation, std::string ordreCalcul, std::vector< GeometricalDomain * > &solidDomains)
Definition MeshCartesianAMR.cpp:509
double m_criteriaVar
Value of criteria to not pass on the variation of a variable for coarsening or refining (put xi=1....
Definition MeshCartesianAMR.h:90
void initializeGeometrieAMR(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, const int &restartSimulation, std::string ordreCalcul)
Definition MeshCartesianAMR.cpp:64
void assignElementProperties(TypeMeshContainer< Cell * > &cells, std::vector< decomposition::Key< 3 > > &keys)
Definition MeshCartesianAMR.cpp:105
void createCellInterfacesFacesAndGhostCells(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, std::string ordreCalcul)
Definition MeshCartesianAMR.cpp:131
bool m_varRho
Definition MeshCartesianAMR.h:91
virtual int initializeGeometrie(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, const int &restartSimulation, bool, std::string ordreCalcul)
renvoi le number de dimensions (1,2 ou 3)
Definition MeshCartesianAMR.cpp:53
virtual void finalizeParallele(const int &lvlMax)
Definition MeshCartesianAMR.cpp:904
virtual void getNodes(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const
Definition MeshCartesianAMR.cpp:648
virtual void getData(TypeMeshContainer< Cell * > *cellsLvl, std::vector< double > &dataset, const int var, int phase) const
Definition MeshCartesianAMR.cpp:777
virtual void computePotentialBalancing(TypeMeshContainer< Cell * > *cellsLvl, bool init, int lvl, bool &balance, std::vector< typename decomposition::Key< 3 >::value_type > &indicesSendStartGlobal, std::vector< typename decomposition::Key< 3 >::value_type > &indicesSendEndGlobal, std::vector< typename decomposition::Key< 3 >::value_type > &indicesReceiveStartGlobal, std::vector< typename decomposition::Key< 3 >::value_type > &indicesReceiveEndGlobal)
Definition MeshCartesianAMR.cpp:942
virtual int getLvlMax() const
Definition MeshCartesianAMR.h:70
virtual std::string whoAmI() const
Definition MeshCartesianAMR.cpp:622
virtual void initializePersistentCommunications(const TypeMeshContainer< Cell * > &cells, std::string ordreCalcul)
Definition MeshCartesianAMR.cpp:882
Definition MeshCartesian.h:44
Definition decomposition.hpp:43
Definition key.hpp:50
unsigned long long int value_type
Definition key.hpp:54