coffee.diffop.sbp package¶
Submodules¶
coffee.diffop.sbp.dissipation module¶
A module that contains dissipation operators for SBP operators.
- class coffee.diffop.sbp.dissipation.Diss(*args, **kwds)[source]¶
Bases:
objectThe parent class for SBP dissipation operators.
- name = 'Dissipation'¶
- class coffee.diffop.sbp.dissipation.Diss21_DDST(*args, **kwds)[source]¶
Bases:
DissDiagA dissipation operator.
Taken from Diener, Dorband, Schnetter and Tiglio. Due to consistence conditions on SBP dissipation operators and the derivative operators this dissipation operator can only be used with the D21 operator from the same paper. Note that D21 is unique so the operator sbp.D21_CNG is the correct operator.
- class coffee.diffop.sbp.dissipation.Diss42_DDST(*args, **kwds)[source]¶
Bases:
DissDiagA dissipation operator.
Taken from Diener, Dorband, Schnetter and Tiglio. Due to consistency conditions on SBP dissipation operators and the derivative operators this disspation operator can only be used with the sbp.D42 operator which is from the same paper.
- class coffee.diffop.sbp.dissipation.Diss43_DDST(bdy_percent)[source]¶
Bases:
DissRestFullA dissipation operator.
Compatibility considerations require that this disspation operator only used with sbp.D43_Tiglioetal.
coffee.diffop.sbp.sbp module¶
A module to manage summation by parts finite difference operators.
- coffee.diffop.sbp.sbp.BOUNDARY_TYPE_GHOST_POINTS = 1¶
Specifies that ghost points will be used for boundaries.
- coffee.diffop.sbp.sbp.BOUNDARY_TYPE_SAT = 0¶
Specifies that the simulataneous approximation term method will be used for boundaries.
- class coffee.diffop.sbp.sbp.D21_CNG(*args, **kwargs)[source]¶
Bases:
SBPAn SBP operator that is second order accurate internal and first order accurate on the boundary.
Taken from “A stable and conservative interface treatment of arbitrary spatial accuracy”, Carpenter, Nordstrom, and Gottlieb.
The inner product is the identity.
- class coffee.diffop.sbp.sbp.D42(*args, **kwargs)[source]¶
Bases:
SBPThis is an SBP operator which is fourth order accurate on the interior and second order accurate at the boundary.
This operator is the D42 operator given in the paper, “Optimized high-order derivative and dissipation operators satisfying summation by parts, and applications in three-dimensional multi-block evolutions” by Diener, Dorband, Schnetter and Tiglio.
More detail on this operator can be found on page 59, of Strand’s paper, “Summation by parts for finite difference approximations for d/dx” under the heading “Second-order accuracy at the boundary”. This paper also gives the norm used.
The norm in this case is given as be.diag([17./48,59./48,43./48,49./48]). Note the additional factors included in the code for initialisation.
- class coffee.diffop.sbp.sbp.D43_2_CNG(*args, **kwargs)[source]¶
Bases:
SBPA second derivative SBP operator with fourth order interal accuracy and third order accuracy on the boundary.
Taken from “A stable and conservative interface treatment of arbitrary spatial accuracy”, the matrix H is the identity.
- class coffee.diffop.sbp.sbp.D43_CNG(*args, **kwargs)[source]¶
Bases:
SBPAn SBP operator that is fourth order accurate in the interior and third order accurate on the boundary.
Taken from “A stable and conservative interface treatment of arbitrary spatial accuracy”, the matrix H is the identity. Note that the P[1,3] entry of the norm matrix given in the paper is wrong!
- class coffee.diffop.sbp.sbp.D43_Strand(*args, **kwargs)[source]¶
Bases:
SBPAn SBP operator that is fourth order accurate in the interior and third order accurate on the boundary.
See page 66 of Strand’s paper, “Summation by parts finite difference approximations for first derivatives”. The norm in this case is restricted full and we have h00 = 3./11.
Note the terms introduced in the initialisation code.
- class coffee.diffop.sbp.sbp.D43_Tiglioetal(*args, **kwargs)[source]¶
Bases:
SBPD43 is a finite difference operator which has the SBP property.
It is 4th order accurate in the interior and 3rd order accurate at the boundaries. It is from the paper, “Optimized high-order derivative and dissipation operators satisfying summation by parts, and applications in three-dimensional multi-block evolutions” by Diener, Dorband, Schnetter and Tiglio (DDST).
The operator corresponds to the operator with minimum error.
From Strand, page 75, we know that the norm is restricted full, as is also mentioned in DDST. It appears that, without perhaps staring at Cactus code, the values of the three parameters are not given. This is needed as the numerical values of the norm used depends on these values.
Fortunately we do have the explicit values for Q and as such can calculate the correct values for the norm from them. We only need to calculate h_00 as the norm is restricted full. Using the notation of page 62 of Strand we get, h_00 = 4.186595269326998 = x_1.
- class coffee.diffop.sbp.sbp.D65_min_err(*args, **kwargs)[source]¶
Bases:
SBPD65_min_err is a first order derivative according to Diener et al, which has minimised error. Coefficients taken from the source file of the paper in the arxive.org repository.
As above the norm is not given. We can calculate h_00 by noting that h is restricted full and that {h^(-1)q}_{00} = -1/2. The result is, to 15 decimal places, h_{00} = 4.930709842221048
- class coffee.diffop.sbp.sbp.SBP(boundary_type=0)[source]¶
Bases:
objectThe class that models summation by parts finite difference operators.
The values of g_{00} and g_{NN} given here are based on the values given in theorem 2.1 of Strand’s paper, “Summation by parts for finite difference approximations for d/dx.”
It is highly unlikely, therefore, that they will ever need to change.
- g00 = -1.0¶
- gNN = 1.0¶
- ghost_points()[source]¶
Ghost points required for the penalty boundary method.
- Returns:
The number of ghost points for each boundary.
- Return type:
two tuple of ints
- internal_points()[source]¶
Internal points required for the penalty boundary method.
- Returns:
The number of ghost points for each boundary.
- Return type:
two tuple of ints
- name = 'Dx'¶
- pbound = None¶
- penalty_boundary(dx, vector_selection)[source]¶
Returns the penalty for use with penalty boundaries.
The vector self.pbound is, in the notation of CGA, given by P^(-1)H^(-1)e_i, i=0,1 where e_0 = (1,0,…,0)^T and e_1 = (0,…,0,1)^T.
If u = (u_0, …, u_n) is the discretised function then the vector e_0 should be selected (vector_selection = 0) when the boundary value is to be applied to u_0. Similarly, the vector e_1 (vector_selection = 1) should be selected when the boundary value is to be applied to u_n.
To support the user vector_selection = “right” is aliased to vector_selection = 1 and vector_selection = “left” is aliased to vector_selection = 0
When creating an SBP operator ensure that self.pbound is set up correctly in the init() method of the operators.
We return only the portion of the array, to be applied to d/dt of u, that is non-zero. In the case of e_0 the vector should be applied as
(d/dt u)[:n] = - tau * characteristic * result of this method.
In the case of e_1 the vector should be applied as
(d/dt u)[-n:] = - tau * characteristic * result of this method.
The necessary change of orientation of the result of this method is taken care of here. For further details about the implementation of the penalty boundary method we recommend, “TIME-STABLE BOUNDARY CONDITIONS FOR FINITE-DIFFERENCE SCHEMES SOLVING HYPERBOLIC SYSTEMS: METHODOLOGY AND APPLICATION TO HIGH-ORDER COMPACT SCHEMES” by Carpenter, Gottlieb and Abarbanel. (Sorry for the caps).
Note that this method will only work for first order SBP operators, currently.