![]() |
Peano
|
The handling of (dynamically) adaptive meshes for finite differences. More...
Public Member Functions | |
__init__ (self, solver, interpolation, restriction) | |
Construct object. | |
get_action_set_name (self) | |
Return unique action set name. | |
get_includes (self) | |
Return include statements that you need. | |
![]() | |
get_constructor_body (self) | |
Define a tailored constructor body. | |
get_destructor_body (self) | |
get_body_of_getGridControlEvents (self) | |
user_should_modify_template (self) | |
Is the user allowed to modify the output. | |
get_body_of_operation (self, operation_name) | |
Return actual C++ code snippets to be inserted into C++ code. | |
get_attributes (self) | |
Return attributes as copied and pasted into the generated class. | |
get_clear_guard (self) | |
get_restrict_guard (self) | |
get_interpolate_guard (self) | |
switch_interpolation_scheme (self, interpolation_scheme) | |
switch_restriction_scheme (self, restriction_scheme) | |
![]() | |
get_static_initialisations (self, full_qualified_classname) | |
get_body_of_prepareTraversal (self) | |
get_body_of_unprepareTraversal (self) | |
The handling of (dynamically) adaptive meshes for finite differences.
This class just invokes interpolation operators. Please consult the documentation of the base class CellCenteredFiniteDifferences for a discussion of interpolation and restriction operators. The class documentation also explains how you switch to operators that you pass in manually.
Definition at line 11 of file DynamicAMR.py.
exahype2.solvers.rkfd.actionsets.DynamicAMR.DynamicAMR.__init__ | ( | self, | |
solver, | |||
interpolation, | |||
restriction ) |
Construct object.
:: Interpolation
Don't interpolate in initialisation. If you have a parallel run with AMR, then some boundary data has not been received yet and your face data thus is not initialised at all. Other than that, the interpolation is always on.
:: Restriction
In contrast to the interpolation, it is absolutely key that we restrict alreaday in the initialisation. If we have a cell that is adjacent to a refined cell, then this cell requires proper face data for the subsequent first time step. So we have to restrict in the initialisation even if there's no update yet - just to get the coarse representation of fine hanging faces initialised.
:: Restriction of destructed faces
A destructed face has to restrict its data: We've already restricted the cells, but now we also have to restrict the faces, as faces span time spans. The cell is only a snapshot, so we have to manually restrict.
It is important to also disable the projection in return. The projection onto the faces happens in leaveCell. However, if you have a face in-between two 3x3 patches, then you will have a destruction of the left patch (and a corresponding cell restriction), the coarse cell will then project its data onto the face, you go down on the other side and now the face will be destroyed. If you restrict now, you overwrite the projected data with some (old) data, and you will get an inconsistent face data. However, you always have to restrict both sides of persistent face when it is destroyed. If you only restricted the inner part, you'd run into situations where a 3x3 patch is coarsened, but its neighbour remains refined. That is, logically the face transitions from a persistent one to a hanging face. When yo go through the mesh next time, you'll need, on the coarse level, some valid data. So we have to restrict both sides.
There's still a inconsistency here. To have really consistent data, we'd have to average 3^{d-1} cells when we project them onto the face, such that the cell-restricted data followed by a (single cell) projection gives the same result as a projection first and then a face restriction. I neglect this fact here.
:: Interpolation throughout the grid initialisation
Throughout the grid initialisation, we cannot interpolate the halo layers reliably. If we descend into a cell and want to initialise one of its hanging faces, we cannot know, if the coarser cell on the other side has been initialised already. Therefore, we cannot initialise the halo of a hanging face.
For persistent faces, this is something we don't bother about: We create both adjacent cells of the respective face and then we will project this solution onto the faces. Problem set, as all data is properly set.
For hanging faces, we will get the projection from the adjacent real cell. But we cannot get a proper initialisation for the other half of the face data. These data however is required for some restrictions. Even if we mask out the impact of halo data on the restriction, it might, in the initialisation sweep, hold nans, and 0 * nan = nan. So we will get garbage. In later time steps, this does not hold, as we have properly initialised coarse grid data then on all sides.
To solve this issue, we initialise the hanging face data properly using the user's callbacks. These data will later be overwritten with (coarser) data which is interpolated. For the initialisation, it provides us with proper initial guesses.
Reimplemented from peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.
Definition at line 24 of file DynamicAMR.py.
References exahype2.solvers.rkfd.actionsets.DynamicAMR.DynamicAMR.__init__(), exahype2.solvers.aderdg.kernels.AMRRoutines.AMRRoutines.d, exahype2.solvers.aderdg.kernels.CellData.CellData.d, exahype2.solvers.aderdg.kernels.DGMatrices.DGMatrices.d, exahype2.solvers.aderdg.kernels.FusedSpaceTimePredictorVolumeIntegral.FusedSpaceTimePredictorVolumeIntegral.d, exahype2.solvers.aderdg.kernels.Quadrature.Quadrature.d, exahype2.solvers.fv.actionsets.HandleBoundary.HandleBoundary.d, exahype2.solvers.fv.actionsets.RollOverUpdatedFace.RollOverUpdatedFace.d, exahype2.solvers.limiting.kernels.Limiter.Limiter.d, exahype2.solvers.limiting.kernels.Quadrature.Quadrature.d, exahype2.solvers.rkfd.actionsets.HandleBoundary.HandleBoundary.d, exahype2.solvers.rkfd.actionsets.RollOverUpdatedFace.RollOverUpdatedFace.d, exahype2.tracer.DumpTracerIntoDatabase.DumpTracerIntoDatabase.d, exahype2.tracer.InsertParticlesFromFile.InsertParticlesFromFile.d, peano4.datamodel.ModelToDataRepository.ModelToDataRepository.d, peano4.output.Constants.Constants.d, peano4.output.Jinja2TemplatedHeaderFile.Jinja2TemplatedHeaderFile.d, peano4.output.Jinja2TemplatedHeaderImplementationFilePair.Jinja2TemplatedHeaderImplementationFilePair.d, peano4.output.Makefile.Makefile.d, peano4.output.Observer.Observer.d, peano4.output.TemplatedHeaderFile.TemplatedHeaderFile.d, peano4.output.TemplatedHeaderImplementationFilePair.TemplatedHeaderImplementationFilePair.d, peano4.runner.DefaultSequence.DefaultSequence.d, peano4.solversteps.StepsToStepRepository.StepsToStepRepository.d, peano4.toolbox.blockstructured.BackupPatchOverlap.BackupPatchOverlap.d, peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.d, peano4.toolbox.blockstructured.PlotPatchesInPeanoBlockFormat.PlotPatchesInPeanoBlockFormat.d, peano4.toolbox.blockstructured.PlotPatchesOverFacesInPeanoBlockFormat.PlotPatchesOverFacesInPeanoBlockFormat.d, peano4.toolbox.blockstructured.ProjectPatchOntoFaces.ProjectPatchOntoFaces.d, peano4.toolbox.CreateRegularGrid.CreateRegularGrid.d, peano4.toolbox.multigrid.cellbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.d, peano4.toolbox.multigrid.MatrixFreeJacobi.MatrixFreeJacobi.d, peano4.toolbox.multigrid.vertexbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.d, peano4.toolbox.particles.api.AbstractUpdateParticleGridAssociation.AbstractUpdateParticleGridAssociation.d, peano4.toolbox.particles.api.UpdateParallelState.UpdateParallelState.d, peano4.toolbox.particles.api.UpdateParticleGridAssociation_BucketSort.UpdateParticleGridAssociation_BucketSort.d, peano4.toolbox.particles.GatherParticlesInMemoryPool.GatherParticlesInMemoryPool.d, peano4.toolbox.particles.InsertParticlesAlongCartesianLayoutIntoUnrefinedCells.InsertParticlesAlongCartesianLayoutIntoUnrefinedCells.d, peano4.toolbox.particles.InsertParticlesByCoordinates.InsertParticlesByCoordinates.d, peano4.toolbox.particles.InsertRandomParticlesIntoUnrefinedCells.InsertRandomParticlesIntoUnrefinedCells.d, peano4.toolbox.particles.ParticleAMR.ParticleAMR.d, peano4.toolbox.particles.ParticleTreeAnalysis.ParticleTreeAnalysis.d, peano4.toolbox.particles.PlotParticlesInVTKFormat.PlotParticlesInVTKFormat.d, peano4.toolbox.particles.UpdateParticle_MultiLevelInteraction_Sets.UpdateParticle_MultiLevelInteraction_Sets.d, peano4.toolbox.particles.UpdateParticle_MultiLevelInteraction_StackOfLists.UpdateParticle_MultiLevelInteraction_StackOfLists.d, peano4.toolbox.particles.UpdateParticle_MultiLevelInteraction_StackOfLists_ContiguousParticles.UpdateParticle_MultiLevelInteraction_StackOfLists_ContiguousParticles.d, peano4.toolbox.particles.UpdateParticle_SingleLevelInteraction.UpdateParticle_SingleLevelInteraction.d, peano4.toolbox.particles.UpdateParticle_SingleLevelInteraction_ContiguousParticles.UpdateParticle_SingleLevelInteraction_ContiguousParticles.d, peano4.toolbox.PlotCellDataInPeanoBlockFormat.PlotCellDataInPeanoBlockFormat.d, peano4.toolbox.PlotGridInPeanoBlockFormat.PlotGridInPeanoBlockFormat.d, peano4.toolbox.PlotVertexDataInPeanoBlockFormat.PlotVertexDataInPeanoBlockFormat.d, swift2.actionsets.Cleanup.Cleanup.d, swift2.actionsets.DynamicMeshRefinementAnalysis.DynamicMeshRefinementAnalysis.d, swift2.actionsets.ScatterGlobalMemory.ScatterGlobalMemory.d, swift2.actionsets.UpdateParticleMarker.UpdateParticleMarker.d, swift2.api.actionsets.SynchroniseVerticesWithPreviousMeshSweep.SynchroniseVerticesWithPreviousMeshSweep.d, swift2.api.boundaryconditions.Fixed.Fixed.d, swift2.input.InsertParticlesFromHDF5File.InsertParticlesFromHDF5File.d, exahypype.kernel.d, solvers.api.actionsets.CollocatedMGSingleThreaded.UpdateSolution.UpdateSolution.d, solvers.api.actionsets.CollocatedMGSolver.InitDofs.InitDofsCollocatedMG.d, solvers.api.actionsets.CollocatedMGSolver.Prolongation.Prolongation.d, solvers.api.actionsets.CollocatedMGSolver.ResetAndUpdateResidual.ResetAndUpdateResidual.d, solvers.api.actionsets.CollocatedMGSolver.Restriction.Restriction.d, solvers.api.actionsets.CollocatedMGSolver.UpdateSolution.UpdateSolution.d, solvers.api.actionsets.CollocatedSolver.InitDofs.InitDofsCollocated.d, solvers.api.actionsets.CollocatedSolver.ResetAndUpdateResidual.ResetAndUpdateResidual.d, solvers.api.actionsets.CollocatedSolver.UpdateSolution.UpdateSolution.d, ProjectResidualsAndDiagonalOntoFacets.ProjectResidualsAndDiagonalOntoFacets.d, UpdateCell.UpdateCell.d, UpdateFacets.UpdateFacets.d, solvers.api.actionsets.DGCGCoupling.AbstractDGCGCoupling.d, solvers.api.actionsets.DGCGCoupling.AdditiveDGCGCoupling.d, solvers.api.actionsets.DGCGCoupling.MultiplicativeDGCGCoupling.d, solvers.api.actionsets.DGSolver.ProjectIntoCellAndUpdateCellSolution.ProjectIntoCellAndUpdateCellSolution.d, solvers.api.actionsets.DGSolver.ProjectIntoCellAndUpdateCellSolutionWithTasks.ProjectIntoCellAndUpdateCellSolutionWithTasks.d, solvers.api.actionsets.DGSolver.ProjectOntoFaces.ProjectOntoFaces.d, solvers.api.actionsets.DGSolver.UpdateFaceSolution.UpdateFaceSolution.d, solvers.api.actionsets.DGSolver.UpdateResidual.UpdateResidual.d, solvers.api.actionsets.DGSolver.UpdateResidualWithTasks.UpdateResidualWithTasks.d, solvers.api.actionsets.InitHigherOrderDofs.InitHigherOrderDofs.d, solvers.api.actionsets.PlotDGDataInPeanoBlockFormat.PlotDGDataInPeanoBlockFormat.d, solvers.api.actionsets.PlotDGPatchesInPeanoBlockFormat.PlotDGPatchesInPeanoBlockFormat.d, solvers.api.actionsets.PlotVertexDataInPeanoBlockFormat.PlotVertexDataInPeanoBlockFormat.d, archive_AssemblePETSCMatrix.AssemblePETSCMatrixOnCellsAndFaces.d, api.actionsets.EnumerateDoFs.EnumerateDoFs.d, api.actionsets.ImposeDirichletBoundaryConditions.ImposeDirichletBoundaryConditions.d, api.actionsets.ImposeDirichletBoundaryConditionsWithInteriorPenaltyMethod.ImposeDirichletBoundaryConditionsWithInteriorPenaltyMethod.d, api.actionsets.InitCellDoFs.InitCellDoFs.d, api.actionsets.InitFaceDoFs.InitFaceDoFs.d, api.actionsets.InitPetsc.SendDofsToVertices.d, api.actionsets.InitVertexDoFs.InitVertexDoFs.d, api.actionsets.PlotDGDataInPeanoBlockFormat.PlotDGDataInPeanoBlockFormat.d, api.actionsets.PlotExactSolution.PlotExactSolution.d, api.actionsets.ProjectPETScSolutionBackOntoMesh.ProjectPETScSolutionOnCellsBackOntoMesh.d, api.actionsets.ProjectPETScSolutionBackOntoMesh.ProjectPETScSolutionOnVerticesBackOntoMesh.d, api.solvers.CollocatedLowOrderDiscretisation.AssemblePetscMatrix.d, api.solvers.DiscontinuousGalerkinDiscretisation.AssemblePetscMatrix.d, DGCGCoupling.Test4Coupling.d, DGCGCoupling.Test5Coupling.d, DGCGCoupling.Test7Coupling.d, initCollocatedRandom.InitDofsCollocatedRandomRhs.d, initCollocatedRandom.InitCollocatedTest4.d, initCollocatedRandom.InitCollocatedTest5.d, InitDG.InitDofsDGTest1.d, InitDG.InitDofsIntermediatePhaseTest1.d, InitDG.InitDofsDGTest7.d, and test8.InitDofsTest8.d.
Referenced by exahype2.solvers.rkfd.actionsets.DynamicAMR.DynamicAMR.__init__().
exahype2.solvers.rkfd.actionsets.DynamicAMR.DynamicAMR.get_action_set_name | ( | self | ) |
Return unique action set name.
Returns a description (word) for the mapping which is also used as class name for the generated type. As a consequence, the result should be one word (if possible) and uppercase. Also, every subclass should overwrite this routine.
The generator will take the result and construct eventually classes similar to MyStep2Dummy.h and MyStep2Dummy.cpp or similar for the example below, where we return Dummy.
Reimplemented from peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.
Definition at line 426 of file DynamicAMR.py.
exahype2.solvers.rkfd.actionsets.DynamicAMR.DynamicAMR.get_includes | ( | self | ) |
Return include statements that you need.
All of these includes will eventually end up in the header of the generated C++ code.
Reimplemented from peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.
Definition at line 430 of file DynamicAMR.py.
References exahype2.solvers.rkfd.actionsets.DynamicAMR.DynamicAMR.get_includes().
Referenced by exahype2.solvers.rkfd.actionsets.DynamicAMR.DynamicAMR.get_includes().
|
protected |
Definition at line 371 of file DynamicAMR.py.
Referenced by exahype2.solvers.aderdg.actionsets.DynamicAMR.DynamicAMR.get_body_of_operation(), peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.get_body_of_operation(), and peano4.toolbox.multigrid.cellbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.get_body_of_operation().
|
protected |
Definition at line 238 of file DynamicAMR.py.
Referenced by exahype2.grid.FaceLabel.UpdateFaceLabel.get_body_of_operation(), exahype2.solvers.aderdg.actionsets.DynamicAMR.DynamicAMR.get_body_of_operation(), peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.get_body_of_operation(), and peano4.toolbox.multigrid.cellbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.get_body_of_operation().
|
protected |
|
protected |
Definition at line 397 of file DynamicAMR.py.
Referenced by exahype2.solvers.aderdg.actionsets.DynamicAMR.DynamicAMR.get_body_of_operation(), and peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.get_body_of_operation().
|
protected |
Definition at line 150 of file DynamicAMR.py.
Referenced by exahype2.grid.FaceLabel.UpdateFaceLabel.get_body_of_operation(), exahype2.solvers.aderdg.actionsets.DynamicAMR.DynamicAMR.get_body_of_operation(), peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.get_body_of_operation(), and peano4.toolbox.multigrid.cellbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.get_body_of_operation().
|
protected |
Definition at line 172 of file DynamicAMR.py.
Referenced by peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.get_body_of_operation().
|
protected |
Definition at line 126 of file DynamicAMR.py.
Referenced by exahype2.grid.FaceLabel.UpdateFaceLabel.get_body_of_operation(), exahype2.solvers.aderdg.actionsets.Correction.Correction.get_body_of_operation(), peano4.toolbox.blockstructured.DynamicAMR.DynamicAMR.get_body_of_operation(), and peano4.toolbox.multigrid.cellbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.get_body_of_operation().