getEnergyTensor
Description
The input metric determines the stress-energy tensor by evaluating the field equations. This evaluation does not consider any additions from .
Method
The derivatives of the metric use finite central differencing methods on the spacetime grid.
The grid size defined in the metric must be 5 or greater in any direction for the finite difference to evaluate a derivative on the grid. If the size in a given direction is <5 then the derivative is assumed to be 0.
Syntax
[
energy
] = getEnergyTensor(
metric
,
tryGPU
,
diffOrder
)
Input Arguments
blue are required inputs.
orange are optional inputs with native default values.
metric
struct
object
Input metric tensor.
tryGPU
1x1 array
integer
Use the GPU for evaluations, input either 1 for true or 0 for false. The default value is 0.
diffOrder
1x1 array
string
Sets the order of the finite difference method. Accepts either "second" to use second-order or "fourth" to use fourth-order methods. The default value is fourth order.
Output Arguments
energy
struct
object
Returns the stress-energy tensor with the same grid and frame as the metric tensor. Note that it returns the contravariant form of the tensor, which can also be found by checking the .index
field of the struct.
Last updated