31#ifndef MESHCARTESIANAMR_H
32#define MESHCARTESIANAMR_H
45 std::vector<stretchZone> stretchX,
46 std::vector<stretchZone> stretchY,
47 std::vector<stretchZone> stretchZ,
49 double criteriaVar = 1.e10,
53 bool varAlpha =
false,
61 const int& resumeSimulation,
67 const int& resumeSimulation,
83 const std::vector<AddPhys*>& addPhys,
85 std::vector<GeometricalDomain*>& domains,
87 const int& resumeSimulation,
89 std::vector<GeometricalDomain*>& solidDomains)
override;
94 const std::vector<AddPhys*>& addPhys,
97 std::string
whoAmI()
const override;
101 size_t getNodes(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl)
const override;
102 size_t getConnectivity(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl)
const override;
103 size_t getConnectivity(std::vector<int64_t>& dataset, std::vector<Cell*>* )
const override;
104 size_t getConnectivity(std::vector<int32_t>& dataset, std::vector<Cell*>* )
const override;
105 void getOffsets(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl)
const override;
106 void getOffsets(std::vector<int64_t>& dataset, std::vector<Cell*>* )
const override;
107 void getOffsets(std::vector<int32_t>& dataset, std::vector<Cell*>* )
const override;
108 void getTypeCell(std::vector<double>& dataset, std::vector<Cell*>* cellsLvl)
const override;
109 void getTypeCell(std::vector<unsigned char>& dataset, std::vector<Cell*>* cellsLvl)
const override;
127 const std::vector<AddPhys*>& addPhys,
129 int& nbCellsTotalAMR,
130 std::vector<GeometricalDomain*>& solidDomains,
131 bool init =
false)
override;
144 const std::vector<AddPhys*>& addPhys,
146 int& nbCellsTotalAMR,
151 std::vector<GeometricalDomain*>& solidDomains);
154 template <
typename T>
size_t getConnectivity_private(std::vector<T>& dataset, std::vector<Cell*>* cellsLvl)
const;
155 template <
typename T>
void getOffsets_private(std::vector<T>& dataset, std::vector<Cell*>* cellsLvl, uint64_t maxVal)
const;
156 template <
typename T>
void getTypeCell_private(std::vector<T>& dataset, std::vector<Cell*>* cellsLvl)
const;
Base class for a mesh cell.
Definition Cell.h:59
General class for Equation of State (EOS).
Definition Eos.h:62
size_t getConnectivity(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const override
Store connectivities of mesh cells in a flat vector of double.
Definition MeshCartesianAMR.cpp:790
~MeshCartesianAMR() override
Definition MeshCartesianAMR.cpp:71
double m_xiJoin
Value of xi to split or join the cells.
Definition MeshCartesianAMR.h:162
void createGhostCell(const TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, const SimulationOrder schemeOrder, const decomposition::Key< 3 > nKey, const int neighbour, const int cell_idx)
Definition MeshCartesianAMR.cpp:172
virtual void balance(TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, SimulationOrder schemeOrder, 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:1303
void finalizeParallele(const int &lvlMax) override
Definition MeshCartesianAMR.cpp:1012
size_t getConnectivity_private(std::vector< T > &dataset, std::vector< Cell * > *cellsLvl) const
Definition MeshCartesianAMR.cpp:763
double m_xiSplit
Definition MeshCartesianAMR.h:162
void getTypeCell_private(std::vector< T > &dataset, std::vector< Cell * > *cellsLvl) const
Definition MeshCartesianAMR.cpp:856
void getData(TypeMeshContainer< Cell * > *cellsLvl, std::vector< double > &dataset, const int var, int phase) const override
Definition MeshCartesianAMR.cpp:883
void refineCellAndCellInterfaces(Cell *cell, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR) override
Definition MeshCartesianAMR.cpp:965
void getOffsets(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const override
Store offsets in connectivity array of mesh cells.
Definition MeshCartesianAMR.cpp:834
bool m_varP
Definition MeshCartesianAMR.h:161
size_t getNodes(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const override
Store coordinates of mesh nodes in a flat vector.
Definition MeshCartesianAMR.cpp:696
void initializeGeometrieAMR(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, const int &resumeSimulation, SimulationOrder schemeOrder)
Definition MeshCartesianAMR.cpp:89
int m_lvlMax
Niveau maximal sur l arbre AMR (si m_lvlMax = 0, pas d AMR).
Definition MeshCartesianAMR.h:159
bool m_varU
Definition MeshCartesianAMR.h:161
int initializeGeometrie(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, const int &resumeSimulation, bool, SimulationOrder schemeOrder) override
renvoi le number de dimensions (1,2 ou 3)
Definition MeshCartesianAMR.cpp:75
void writeHeaderPiece(std::ofstream &fileStream, TypeMeshContainer< Cell * > *cellsLvl) const override
Definition MeshCartesianAMR.cpp:677
bool m_varAlpha
Choice on which variation we coarsen or refine.
Definition MeshCartesianAMR.h:161
void initializePersistentCommunications(const TypeMeshContainer< Cell * > &cells, SimulationOrder schemeOrder) override
Definition MeshCartesianAMR.cpp:989
void parallelLoadBalancingAMR(TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, SimulationOrder schemeOrder, const std::vector< AddPhys * > &addPhys, Eos **eos, int &nbCellsTotalAMR, std::vector< GeometricalDomain * > &solidDomains, bool init=false) override
Definition MeshCartesianAMR.cpp:1016
decomposition::Decomposition m_decomp
Parallel domain decomposition based on keys.
Definition MeshCartesianAMR.h:163
void getTypeCell(std::vector< double > &dataset, std::vector< Cell * > *cellsLvl) const override
Definition MeshCartesianAMR.cpp:879
std::string whoAmI() const override
Definition MeshCartesianAMR.cpp:671
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:160
void getOffsets_private(std::vector< T > &dataset, std::vector< Cell * > *cellsLvl, uint64_t maxVal) const
Definition MeshCartesianAMR.cpp:811
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 &resumeSimulation, SimulationOrder schemeOrder, std::vector< GeometricalDomain * > &solidDomains) override
Definition MeshCartesianAMR.cpp:512
void createCellInterfacesFacesAndGhostCells(TypeMeshContainer< Cell * > &cells, TypeMeshContainer< Cell * > &cellsGhost, TypeMeshContainer< CellInterface * > &cellInterfaces, SimulationOrder schemeOrder)
Definition MeshCartesianAMR.cpp:234
void assignElementProperties(TypeMeshContainer< Cell * > &cells, std::vector< decomposition::Key< 3 > > &keys)
Definition MeshCartesianAMR.cpp:141
void procedureRaffinement(TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, const int &lvl, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR, Eos **eos) override
Definition MeshCartesianAMR.cpp:561
void setDataSet(std::vector< double > &dataset, TypeMeshContainer< Cell * > *cellsLvl, const int var, int phase) const override
Definition MeshCartesianAMR.cpp:914
bool m_varRho
Definition MeshCartesianAMR.h:161
MeshCartesianAMR(double lX, int numberCellsX, double lY, int numberCellsY, double lZ, int numberCellsZ, std::vector< stretchZone > stretchX, std::vector< stretchZone > stretchY, std::vector< stretchZone > stretchZ, int lvlMax=0, double criteriaVar=1.e10, bool varRho=false, bool varP=false, bool varU=false, bool varAlpha=false, double xiSplit=1., double xiJoin=1.)
Definition MeshCartesianAMR.cpp:39
int getLvlMax() const override
Definition MeshCartesianAMR.h:118
void getData_private(TypeMeshContainer< Cell * > *cellsLvl, std::vector< T > &dataset, const int var, int phase) const
Definition MeshCartesianAMR.cpp:898
void printDomainDecomposition(std::ofstream &fileStream) override
Definition MeshCartesianAMR.cpp:974
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:1068
void readDomainDecomposition(std::ifstream &fileStream) override
Definition MeshCartesianAMR.cpp:978
MeshCartesian(double lX, int numberCellsX, double lY, int numberCellsY, double lZ, int numberCellsZ, std::vector< stretchZone > stretchX, std::vector< stretchZone > stretchY, std::vector< stretchZone > stretchZ)
Definition MeshCartesian.cpp:36
Definition decomposition.hpp:43
unsigned long long int value_type
Definition key.hpp:46