File Adaptation.h
FileList > src > Adaptation.h
Go to the source code of this file
#include "General.h"#include "Param.h"#include "Write_txtlog.h"#include "Util_CPU.h"#include "Arrays.h"#include "Mesh.h"#include "AdaptCriteria.h"#include "Halo.h"#include "InitialConditions.h"#include "Testing.h"
Public Functions
| Type | Name |
|---|---|
| void | Adapt (Param & XParam, Forcing< float > XForcing, Model< T > & XModel) Applies adaptation (refinement/coarsening) to the mesh and updates variables. |
| void | Adaptation (Param & XParam, Forcing< float > XForcing, Model< T > & XModel) Performs mesh adaptation (refinement/coarsening) for the model. |
| void | Adaptationcleanup (Param & XParam, BlockP< T > & XBlock, AdaptP & XAdapt) Cleans up and updates block lists after adaptation. |
| int | AddBlocks (int nnewblk, Param & XParam, Model< T > & XModel) Adds new blocks to the mesh for adaptation. |
| int | CalcAvailblk (Param & XParam, BlockP< T > XBlock, AdaptP & XAdapt) Calculates the number of available blocks for refinement. |
| void | InitialAdaptation (Param & XParam, Forcing< float > & XForcing, Model< T > & XModel) Performs initial mesh adaptation and reruns initial conditions. |
| bool | checkBUQsanity (Param XParam, BlockP< T > XBlock) Checks the consistency and sanity of the block uniform quadtree mesh. |
| bool | checklevel (int ib, int levelib, int neighbourib, int levelneighbour) |
| bool | checkneighbourdistance (double dx, int ib, int levelib, T blocko, int neighbourib, int levelneighbour, T neighbourblocko, bool rightortop) Checks if the distance between a block and its neighbor is consistent with their levels. |
| int | checkneighbourrefine (int neighbourib, int levelib, int levelneighbour, bool *& refine, bool *& coarsen) |
| void | coarsen (Param XParam, BlockP< T > & XBlock, AdaptP & XAdapt, EvolvingP< T > XEvo, EvolvingP< T > & XEv) Coarsens mesh blocks and updates conserved variables. |
| void | refine (Param XParam, BlockP< T > & XBlock, AdaptP & XAdapt, EvolvingP< T > XEvo, EvolvingP< T > & XEv) Refines mesh blocks and interpolates conserved variables. |
| bool | refinesanitycheck (Param XParam, BlockP< T > XBlock, bool *& refine, bool *& coarsen) |
Public Functions Documentation
function Adapt
Applies adaptation (refinement/coarsening) to the mesh and updates variables.
Template parameters:
TData type
Parameters:
function Adaptation
Performs mesh adaptation (refinement/coarsening) for the model.
template<class T>
void Adaptation (
Param & XParam,
Forcing < float > XForcing,
Model < T > & XModel
)
Template parameters:
TData type
Parameters:
Iteratively refines or coarsens the mesh based on adaptation criteria, updating block info and variables.
function Adaptationcleanup
Cleans up and updates block lists after adaptation.
Template parameters:
TData type
Parameters:
XParamModel parametersXBlockBlock data structureXAdaptAdaptation data structure
Updates block levels, reorders active block list, and finalizes adaptation.
function AddBlocks
Adds new blocks to the mesh for adaptation.
Template parameters:
TData type
Parameters:
Returns:
New total number of blocks in memory.
function CalcAvailblk
Calculates the number of available blocks for refinement.
Template parameters:
TData type
Parameters:
XParamModel parametersXBlockBlock data structureXAdaptAdaptation data structure
Returns:
Number of available blocks for refinement.
function InitialAdaptation
Performs initial mesh adaptation and reruns initial conditions.
template<class T>
void InitialAdaptation (
Param & XParam,
Forcing < float > & XForcing,
Model < T > & XModel
)
Template parameters:
TData type
Parameters:
function checkBUQsanity
Checks the consistency and sanity of the block uniform quadtree mesh.
Template parameters:
TData type
Parameters:
XParamModel parametersXBlockBlock data structure
Returns:
True if mesh is sane, false otherwise.
function checklevel
function checkneighbourdistance
Checks if the distance between a block and its neighbor is consistent with their levels.
template<class T>
bool checkneighbourdistance (
double dx,
int ib,
int levelib,
T blocko,
int neighbourib,
int levelneighbour,
T neighbourblocko,
bool rightortop
)
Template parameters:
TData type
Parameters:
dxBase grid spacingibBlock indexlevelibBlock levelblockoBlock coordinateneighbouribNeighbor block indexlevelneighbourNeighbor block levelneighbourblockoNeighbor block coordinaterightortopTrue if neighbor is right/top, false if left/bottom
Returns:
True if distance is consistent, false otherwise.
function checkneighbourrefine
int checkneighbourrefine (
int neighbourib,
int levelib,
int levelneighbour,
bool *& refine,
bool *& coarsen
)
function coarsen
Coarsens mesh blocks and updates conserved variables.
template<class T>
void coarsen (
Param XParam,
BlockP < T > & XBlock,
AdaptP & XAdapt,
EvolvingP < T > XEvo,
EvolvingP < T > & XEv
)
Template parameters:
TData type
Parameters:
XParamModel parametersXBlockBlock data structureXAdaptAdaptation data structureXEvoOld evolving variablesXEvNew evolving variables
function refine
Refines mesh blocks and interpolates conserved variables.
template<class T>
void refine (
Param XParam,
BlockP < T > & XBlock,
AdaptP & XAdapt,
EvolvingP < T > XEvo,
EvolvingP < T > & XEv
)
Template parameters:
TData type
Parameters:
XParamModel parametersXBlockBlock data structureXAdaptAdaptation data structureXEvoOld evolving variablesXEvNew evolving variables
function refinesanitycheck
template<class T>
bool refinesanitycheck (
Param XParam,
BlockP < T > XBlock,
bool *& refine,
bool *& coarsen
)
The documentation for this class was generated from the following file src/Adaptation.h