\( f_i = f( x (\zeta_i,\eta_i), y(\zeta_i,\eta_i)) \), \(
\sqrt{g} \)
More...
|
template<class Functor , class Geometry > |
Geometry::host_vector | dg::pullback (const Functor &f, const Geometry &g) |
| \( f_i = f( x(\zeta_i, \eta_i), y(\zeta_i, \eta_i))\)
|
|
template<class Functor1 , class Functor2 , class container , class Geometry > |
void | dg::pushForwardPerp (const Functor1 &vR, const Functor2 &vZ, container &vx, container &vy, const Geometry &g) |
| \( \bar v = J v\)
|
|
template<class Functor1 , class Functor2 , class Functor3 , class container , class Geometry > |
void | dg::pushForward (const Functor1 &vR, const Functor2 &vZ, const Functor3 &vPhi, container &vx, container &vy, container &vz, const Geometry &g) |
| \( {\bar v} = J v\)
|
|
template<class FunctorRR , class FunctorRZ , class FunctorZZ , class container , class Geometry > |
void | dg::pushForwardPerp (const FunctorRR &chiRR, const FunctorRZ &chiRZ, const FunctorZZ &chiZZ, SparseTensor< container > &chi, const Geometry &g) |
| \( \bar \chi = J \chi J^T\)
|
|
template<class Geometry > |
Geometry::host_vector | dg::create::volume (const Geometry &g) |
| Create the volume element on the grid (including weights!!)
|
|
template<class Geometry > |
Geometry::host_vector | dg::create::inv_volume (const Geometry &g) |
| Create the inverse volume element on the grid (including weights!!)
|
|
\( f_i = f( x (\zeta_i,\eta_i), y(\zeta_i,\eta_i)) \), \(
\sqrt{g} \)
◆ inv_volume()
template<class Geometry >
Geometry::host_vector dg::create::inv_volume |
( |
const Geometry & | g | ) |
|
Create the inverse volume element on the grid (including weights!!)
This is the same as the inv_weights divided by the volume form \( \sqrt{g}\)
- Template Parameters
-
Geometry | A type that is or derives from one of the abstract geometry base classes ( aGeometry2d , aGeometry3d , aMPIGeometry2d , ...). |
- Parameters
-
- Returns
- The inverse volume form
◆ pullback()
template<class Functor , class Geometry >
Geometry::host_vector dg::pullback |
( |
const Functor & | f, |
|
|
const Geometry & | g ) |
\( f_i = f( x(\zeta_i, \eta_i), y(\zeta_i, \eta_i))\)
Pull back a function defined in physical coordinates to the curvilinear (computational) coordinate system. The pullback is equivalent to the following:
- generate the list of physical space coordinates (e.g. in 2d \( x_i = x(\zeta_i, \eta_i),\ y_i = y(\zeta_i, \eta_i)\) for all
i
) using the map member of the grid e.g. aRealGeometry2d::map()
- evaluate the given function or functor at these coordinates and store the result in the output vector (e.g. in 2d \( v_i = f(x_i,y_i)\) for all
i
)
- Note
- the grid defines what its physical coordinates are, i.e. it could be either Cartesian or Cylindrical coordinates
- Template Parameters
-
Functor | The binary (for 2d grids) or ternary (for 3d grids) function or functor with signature: real_type ( real_type x, real_type y) ; real_type ( real_type x, real_type y, real_type z) |
- Parameters
-
f | The function defined in physical coordinates |
g | a two- or three dimensional Geometry (g.map() is used to evaluate f ) |
- Note
- Template deduction for the Functor will fail if you overload functions with different dimensionality (e.g. real_type sine( real_type x) and real_type sine(real_type x, real_type y) ) You will want to rename those uniquely
- Returns
- The output vector
v
as a host vector
- See also
- If the function is defined in computational space coordinates, then use
dg::evaluate
◆ pushForward()
template<class Functor1 , class Functor2 , class Functor3 , class container , class Geometry >
void dg::pushForward |
( |
const Functor1 & | vR, |
|
|
const Functor2 & | vZ, |
|
|
const Functor3 & | vPhi, |
|
|
container & | vx, |
|
|
container & | vy, |
|
|
container & | vz, |
|
|
const Geometry & | g ) |
\( {\bar v} = J v\)
Push forward a vector from cylindrical or Cartesian to a new coordinate system. Applies the Jacobian matrix \( {\bar v} = J v\). With \( v^R = v^R(R(x,y,z), Z(x,y,z), \varphi(x,y,z))\) and analogous \( v^Z\), \( v^\varphi\), and the elements of \( J = J(x,y,z)\):
\begin{align} v^x(x,y,z) = x_R v^R + x_Z v^Z + x_\varphi v^\varphi\\
v^y(x,y,z) = y_Rv^R + y_Z v^Z + y_\varphi v^\varphi \\
v^z(x,y,z) = z_Rv^R + z_Z v^Z + z_\varphi v^\varphi
\end{align}
where \( x_R = \frac{\partial x}{\partial R}\), ...
- Template Parameters
-
Functor1 | Binary or Ternary functor |
Functor2 | Binary or Ternary functor |
Functor3 | Binary or Ternary functor |
- Template Parameters
-
Container | A data container class for which the blas1 functionality is overloaded and to which the return type of blas1::subroutine() can be converted using dg::construct . We assume that Container is copyable/assignable and has a swap member function. In connection with Geometry this is one of
|
Geometry | A type that is or derives from one of the abstract geometry base classes ( aGeometry2d , aGeometry3d , aMPIGeometry2d , ...). Geometry determines which Container type can be used. |
- Parameters
-
vR | input R-component in cartesian or cylindrical coordinates |
vZ | input Z-component in cartesian or cylindrical coordinates |
vPhi | input Z-component in cartesian or cylindrical coordinates |
vx | x-component of vector (gets properly resized) |
vy | y-component of vector (gets properly resized) |
vz | z-component of vector (gets properly resized) |
g | The geometry object |
◆ pushForwardPerp() [1/2]
template<class Functor1 , class Functor2 , class container , class Geometry >
void dg::pushForwardPerp |
( |
const Functor1 & | vR, |
|
|
const Functor2 & | vZ, |
|
|
container & | vx, |
|
|
container & | vy, |
|
|
const Geometry & | g ) |
\( \bar v = J v\)
Push forward a vector from cylindrical or Cartesian to a new coordinate system. Applies the Jacobian matrix \( {\bar v} = J v\):
\begin{align} v^x(x,y) = x_R (x,y) v^R(R(x,y), Z(x,y)) + x_Z v^Z(R(x,y), Z(x,y)) \\
v^y(x,y) = y_R (x,y) v^R(R(x,y), Z(x,y)) + y_Z v^Z(R(x,y), Z(x,y)) \end{align}
where \( x_R = \frac{\partial x}{\partial R}\), ...
- Template Parameters
-
Functor1 | Binary or Ternary functor |
Functor2 | Binary or Ternary functor |
- Template Parameters
-
Container | A data container class for which the blas1 functionality is overloaded and to which the return type of blas1::subroutine() can be converted using dg::construct . We assume that Container is copyable/assignable and has a swap member function. In connection with Geometry this is one of
|
Geometry | A type that is or derives from one of the abstract geometry base classes ( aGeometry2d , aGeometry3d , aMPIGeometry2d , ...). Geometry determines which Container type can be used. |
- Parameters
-
vR | input R-component in cylindrical coordinates |
vZ | input Z-component in cylindrical coordinates |
vx | x-component of vector (gets properly resized) |
vy | y-component of vector (gets properly resized) |
g | The geometry object |
◆ pushForwardPerp() [2/2]
template<class FunctorRR , class FunctorRZ , class FunctorZZ , class container , class Geometry >
void dg::pushForwardPerp |
( |
const FunctorRR & | chiRR, |
|
|
const FunctorRZ & | chiRZ, |
|
|
const FunctorZZ & | chiZZ, |
|
|
SparseTensor< container > & | chi, |
|
|
const Geometry & | g ) |
\( \bar \chi = J \chi J^T\)
Push forward a symmetric 2d tensor from cylindrical or Cartesian to a new coordinate system. Applies the Jacobian matrix \( \bar \chi = J \chi J^T\):
\begin{align}
\chi^{xx}(x,y) = x_R^2 \chi^{RR} + 2x_Rx_Z \chi^{RZ} + x_Z^2\chi^{ZZ} \\
\chi^{xy}(x,y) = x_Ry_R \chi^{RR} + (x_Ry_Z+y_Rx_Z) \chi^{RZ} + x_Zy_Z\chi^{ZZ} \\
\chi^{yy}(x,y) = y_R^2 \chi^{RR} + 2y_Ry_Z \chi^{RZ} + y_Z^2\chi^{ZZ} \\
\end{align}
where \( x_R = \frac{\partial x}{\partial R}\), ...
- Template Parameters
-
FunctorRR | Binary or Ternary functor |
FunctorRZ | Binary or Ternary functor |
FunctorZZ | Binary or Ternary functor |
- Template Parameters
-
Container | A data container class for which the blas1 functionality is overloaded and to which the return type of blas1::subroutine() can be converted using dg::construct . We assume that Container is copyable/assignable and has a swap member function. In connection with Geometry this is one of
|
Geometry | A type that is or derives from one of the abstract geometry base classes ( aGeometry2d , aGeometry3d , aMPIGeometry2d , ...). Geometry determines which Container type can be used. |
- Parameters
-
chiRR | input RR-component in cylindrical coordinates |
chiRZ | input RZ-component in cylindrical coordinates |
chiZZ | input ZZ-component in cylindrical coordinates |
chi | tensor (gets properly resized) |
g | The geometry object |
◆ volume()
template<class Geometry >
Geometry::host_vector dg::create::volume |
( |
const Geometry & | g | ) |
|
Create the volume element on the grid (including weights!!)
This is the same as the weights multiplied by the volume form \( \sqrt{g}\)
- Template Parameters
-
Geometry | A type that is or derives from one of the abstract geometry base classes ( aGeometry2d , aGeometry3d , aMPIGeometry2d , ...). |
- Parameters
-
- Returns
- The volume form