3//This term is not present in the Zenodo repository at https://zenodo.org/records/6386282
4//however it is present in Leo's "phd" tag at https://gitlab.lrz.de/ExaHyPE-Seismic/ExaSeis/-/blob/leo/phd/Applications/DynamicRupture/PMLSlipWeakening/PMLSlipWeakening.cpp?ref_type=tags#L468
5// We are working on the assumption that it should be in there.
15 context->riemannSolver(
29#define _CUSTOM_COORDINATES
33#include "../ExaSeis_core/Curvilinear/ContextDynamicRupture.h"
34#include "../ExaSeis_core/Numerics/riemannsolverPMLDynamicRupture.h"
36#include "peano4/datamanagement/CellMarker.h"
41ContextDynamicRupture<{{NAMESPACE | join("::")}}::VariableShortcuts{{SOLVER_NAME}},
42 {{NAMESPACE | join("::")}}::{{CLASSNAME}}::Order + 1,
43 {{NAMESPACE | join("::")}}::{{CLASSNAME}}::NumberOfUnknowns,
44 {{NAMESPACE | join("::")}}::{{CLASSNAME}}::NumberOfAuxiliaryVariables,
45 {{SOLUTION_STORAGE_PRECISION}}>* {{NAMESPACE | join("::")}}::{{CLASSNAME}}::context;
47tarch::la::Vector<DIMENSIONS,double> {{NAMESPACE | join("::")}}::{{CLASSNAME}}::invertProjection(const tarch::la::Vector<DIMENSIONS,double> coordinates){
49 if(peano4::datamanagement::CellMarker::isContained(
50 coordinates, DomainOffset+0.5*DomainSize, DomainSize, 0.
52 double fixedCoords[3];
53 fixedCoords[toolbox::curvi::Coordinate::X] = coordinates[0];
54 fixedCoords[toolbox::curvi::Coordinate::Y] = coordinates[1];
55 fixedCoords[toolbox::curvi::Coordinate::Z] = coordinates[2];
57 tarch::la::Vector<DIMENSIONS,double> result;
58 toolbox::curvi::Interface* curviInterface = context->getInterface();
59 result[0] = curviInterface->invertProjection(toolbox::curvi::Coordinate::X, fixedCoords);
60 result[1] = curviInterface->invertProjection(toolbox::curvi::Coordinate::Y, fixedCoords);
61 result[2] = curviInterface->invertProjection(toolbox::curvi::Coordinate::Z, fixedCoords);
72 double QuadraturePoints1d[Order+1];
74 tarch::la::Vector<DIMENSIONS,double> invertProjection(const tarch::la::Vector<DIMENSIONS,double> coordinates);
77 static ContextDynamicRupture<VariableShortcutsElasticSolver, Order + 1, NumberOfUnknowns, NumberOfAuxiliaryVariables, {{SOLUTION_STORAGE_PRECISION}}>* context;
79 static constexpr int pml_cell_width = 1;
80 static constexpr double pml_alpha_const = 1.5;
81 static constexpr double pml_alpha_scalar = 0.0;
82 static constexpr double pml_rel_error = 0.001;
83 static constexpr int pml_power = 1;
89 kernels::{{SOLVER_NAME}}::Quadrature<{{SOLUTION_STORAGE_PRECISION}}>::nodes,
94 std::string topography_string = \"""" + scenario_string +
""".yaml";
96 //setting coarsestMeshLevel and maxAdaptiveMeshLevel
97 double maxDSize = std::numeric_limits<double>::min();
98 double minDSize = std::numeric_limits<double>::max();
99 tarch::la::Vector<DIMENSIONS, double> sizes = DomainSize;
101 for(int i=0; i<DIMENSIONS; i++){
102 if(sizes[i]>maxDSize){
105 if(sizes[i]<minDSize){
112 //finding coarsest possible Mesh level
113 while(maxDSize>MaxAdmissibleCellH){
118 double realCoarsestMeshSize = maxDSize;
119 double coarsestMeshLevel = depth;
122 while(minDSize>MinAdmissibleCellH){
127 logTraceOutWith1Argument("Freesurface set at ", std::to_string(_TOP * 2));
129 context = new ContextDynamicRupture<VariableShortcutsElasticSolver, Order + 1, NumberOfUnknowns, NumberOfAuxiliaryVariables, {{SOLUTION_STORAGE_PRECISION}}>(
132 realCoarsestMeshSize,
134 DomainOffset, DomainSize,
135 kernels::ElasticSolver::Quadrature<{{SOLUTION_STORAGE_PRECISION}}>::nodes,
136 kernels::ElasticSolver::DGMatrices<{{SOLUTION_STORAGE_PRECISION}}>::dudx
139 std::cout << "PML is using " << pml_cell_width << " elements" << std::endl;
140 std::cout << "Freesurface set at " << _TOP * 2 << std::endl;
145 if (_solverState==SolverState::GridInitialisation) {
146 std::string filename_rupture_model = \"""" + scenario_string +
"""_fault.yaml";
147 context->initRuptureModel(filename_rupture_model);
finish_time_step_implementation(scenario_string)
init_grid_step_implementation(scenario_string)
abstractUserDefinitions()