Peano 4
Loading...
Searching...
No Matches
Context.h
Go to the documentation of this file.
1#ifndef EXASEIS_CONTEXT_HEADER
2#define EXASEIS_CONTEXT_HEADER
3
7
8template<class Shortcuts, int basisSize>
9class Context{
10 protected:
12
13 public:
14
15 Context(std::string& scenario_string, DomainInformation* info){
16 scenario = ScenarioFactory::createScenario<Shortcuts,basisSize>(scenario_string,info);
17 }
18
20 delete scenario;
21 }
22
23 virtual void initUnknownsPatch(double *luh,
26 double t,double dt)=0;
27
28 virtual void initUnknownsPointwise(const double *const x,
29 const double t,
30 const double dt,
31 double* Q){
32
33 Shortcuts s;
34 if (tarch::la::equals(t,0.0)) {
36 center[0] = x[0];
37 center[1] = x[1];
38 center[2] = x[2];
39 this->scenario->initUnknownsPointwise(x,center,t,dt,Q);
40 }
41 }
42
43
44 virtual void initPointSourceLocation(double pointSourceLocation[][3]){
45 this->scenario->initPointSourceLocation(pointSourceLocation);
46 }
47
48 virtual void setPointSourceVector(const double* const Q,
49 const double* const x,const double t,const double dt,
50 double* forceVector, int n) final {
51 this->scenario->setPointSourceVector(Q,x,t,dt,forceVector,n);
52 }
53
58
59};
60
61
62#endif
we integrate over each cell and then take the sum across each of the cells We also consider the terms that enter the f$ so we are integrating with f$ phi_k phi_k dx
virtual void initPointSourceLocation(double pointSourceLocation[][3])
Definition Context.h:44
~Context()
Definition Context.h:19
Scenario< Shortcuts, basisSize > * scenario
Definition Context.h:11
virtual void initUnknownsPatch(double *luh, const tarch::la::Vector< Dimensions, double > &center, const tarch::la::Vector< Dimensions, double > &dx, double t, double dt)=0
virtual void initUnknownsPointwise(const double *const x, const double t, const double dt, double *Q)
Definition Context.h:28
void setRefinementCriteria(exahype2::solvers::aderdg::Solver *solver, std::vector< Refinement::RefinementCriterion< Shortcuts > * > &criteria)
Definition Context.h:54
Context(std::string &scenario_string, DomainInformation *info)
Definition Context.h:15
virtual void setPointSourceVector(const double *const Q, const double *const x, const double t, const double dt, double *forceVector, int n) final
Definition Context.h:48
virtual void initUnknownsPointwise(const double *const x, const tarch::la::Vector< Dimensions, double > &center, const double t, const double dt, double *Q)=0
virtual void setPointSourceVector(const double *const Q, const double *const x, const double t, const double dt, double *forceVector, int n)
Definition Scenario.h:28
virtual void initPointSourceLocation(double pointSourceLocation[][3])
Definition Scenario.h:26
virtual void refinementCriteria(exahype2::solvers::aderdg::Solver *solver, std::vector< Refinement::RefinementCriterion< Shortcuts > * > &criteria)
Definition Scenario.h:32
examples::exahype2::elastic::VariableShortcuts s
Definition loh.cpp:10
bool equals(const Matrix< Rows, Cols, Scalar > &lhs, const Matrix< Rows, Cols, Scalar > &rhs, const Scalar &tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares to matrices on equality by means of a numerical accuracy.
Simple vector class.
Definition Vector.h:134