5#ifndef SGRUN_MASSSTENCIL_H
6#define SGRUN_MASSSTENCIL_H
9#include "../extemp/vector.h"
10#include "../myMath/myMath.h"
11#include "../cells/celldimension.h"
16 inline void initialize(Depth &T_) {
18 for (
int d = 0; d < DimensionSparseGrid; d++) {
19 auto value = double(POW2( T_.at(d)));
20 meshwidth[d] = 1.0 / value;
24 virtual inline void applyStencilOnCell_MPI_OMP(CellDimension& cell,VectorSparseG& input, VectorSparseG& output) {
25 cout <<
" MassStencil applyStencilOnCell NOT IMPLEMENTED YET!" << endl;
28 virtual inline void applyStencilOnCell(CellDimension& cell,VectorSparseG& input, VectorSparseG& output){
29 cout <<
" MassStencil applyStencilOnCell NOT IMPLEMENTED YET!" << endl;
52 inline double returnValue(
const IndexDimension &Index,
MultiDimCompass &mc)
const {
53 double factors[DimensionSparseGrid];
54 for (
int j = 0; j < DimensionSparseGrid; ++j) {
55 double h = meshwidth[j];
56 Richtung r = mc.getRichtung(j);
57 factors[j] = (1.0 / 6.0) * h;;
59 if((!Index.isAtLeftBoundary(j)) && (!Index.isAtRightBoundary(j)))factors[j] *= 4;
62 if(r == Links && Index.isAtLeftBoundary(j)) factors[j]=1.0;
63 if (r == Rechts && Index.isAtRightBoundary(j)) factors[j]=1.0;
70 for (
int j = 0; j < DimensionSparseGrid; j++) {
136 double meshwidth[DimensionSparseGrid];