File derivs.hxx#

Basic differential functions

Copyright 2010,2017 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu, D. Schwörer

Contact: Ben Dudson, bd512@york.ac.uk

This file is part of BOUT++.

BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.

Functions

Field3D DDX(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in X

\(\partial / \partial x\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric DDX(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in X

\(\partial / \partial x\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D DDY(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in Y

\(\partial / \partial y\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric DDY(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in Y

\(\partial / \partial y\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D DDZ(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in Z

\(\partial / \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric DDZ(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in Z

\(\partial / \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Vector3D DDZ(const Vector3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in Z

\(\partial / \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Vector2D DDZ(const Vector2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate first partial derivative in Z

\(\partial / \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D2DX2(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate second partial derivative in X

\(\partial^2 / \partial x^2\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D2DX2(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate second partial derivative in X

\(\partial^2 / \partial x^2\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D2DY2(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate second partial derivative in Y

\(\partial^2 / \partial y^2\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D2DY2(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate second partial derivative in Y

\(\partial^2 / \partial y^2\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D2DZ2(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate second partial derivative in Z

\(\partial^2 / \partial z^2\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D2DZ2(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate second partial derivative in Z

\(\partial^2 / \partial z^2\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D4DX4(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate forth partial derivative in X

\(\partial^4 / \partial x^4\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D4DX4(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate forth partial derivative in X

\(\partial^4 / \partial x^4\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D4DY4(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate forth partial derivative in Y

\(\partial^4 / \partial y^4\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D4DY4(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate forth partial derivative in Y

\(\partial^4 / \partial y^4\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D4DZ4(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate forth partial derivative in Z

\(\partial^4 / \partial z^4\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D4DZ4(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate forth partial derivative in Z

\(\partial^4 / \partial z^4\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D VDDX(const Field3D &v, const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

General version for 2 or 3-D objects.

For terms of form v * grad(f)

\(v \cdot \partial f / \partial x\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric VDDX(const Field2D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Special case where both arguments are 2D.

For terms of form v * grad(f)

\(v \cdot \partial f / \partial x\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D VDDY(const Field3D &v, const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

For terms of form v * grad(f)

\(v \cdot \partial f / \partial y\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric VDDY(const Field2D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

For terms of form v * grad(f)

\(v \cdot \partial f / \partial y\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D VDDZ(const Field3D &v, const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

For terms of form v * grad(f)

\(v \cdot \partial f / \partial z\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric VDDZ(const Field2D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

For terms of form v * grad(f)

\(v \cdot \partial f / \partial z\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric VDDZ(const Field3D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

For terms of form v * grad(f)

\(v \cdot \partial f / \partial z\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D FDDX(const Field3D &v, const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

for terms of form div(v * f)

\(\partial (v f) / \partial x\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric FDDX(const Field2D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

for terms of form div(v * f)

\(\partial (v f) / \partial x\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D FDDY(const Field3D &v, const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

for terms of form div(v * f)

\(\partial (v f) / \partial y\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric FDDY(const Field2D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

for terms of form div(v * f)

\(\partial (v f) / \partial y\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D FDDZ(const Field3D &v, const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

for terms of form div(v * f)

\(\partial (v f) / \partial z\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric FDDZ(const Field2D &v, const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

for terms of form div(v * f)

\(\partial (v f) / \partial z\)

Parameters:
  • v[in] The velocity field

  • f[in] The field of the advected quantity

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D2DXDY(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY", const std::string &dfdy_boundary_condition = "free_o3", const std::string &dfdy_region = "")

Calculate mixed partial derivative in x and y

\(\partial^2 / \partial x \partial y\)

Mixed derivative in X and Y

This first takes derivatives in Y, then in X.

** Communicates and applies boundary in X.

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

  • dfdy_boundary_condition[in] Boundary condition to use to set the guard cells of df/dy, before calculating the x-derivative.

  • dfdy_region[in] Region in which to calculate df/dy. If an empty string (default) then the same as the region for the calculation as a whole. If dfdy_region < region in size then this will cause errors.

Coordinates::FieldMetric D2DXDY(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY", const std::string &dfdy_boundary_condition = "free_o3", const std::string &dfdy_region = "")

Calculate mixed partial derivative in x and y

\(\partial^2 / \partial x \partial y\)

Mixed derivative in X and Y

This first takes derivatives in Y, then in X.

** Communicates and applies boundary in X.

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

  • dfdy_boundary_condition[in] Boundary condition to use to set the guard cells of df/dy, before calculating the x-derivative.

  • dfdy_region[in] Region in which to calculate df/dy. If an empty string (default) then the same as the region for the calculation as a whole. If dfdy_region < region in size then this will cause errors.

Field3D D2DXDZ(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

X-Z mixed derivative.

Calculate mixed partial derivative in x and z

\(\partial^2 / \partial x \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D2DXDZ(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate mixed partial derivative in x and z

\(\partial^2 / \partial x \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Field3D D2DYDZ(const Field3D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate mixed partial derivative in y and z

\(\partial^2 / \partial y \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY

Coordinates::FieldMetric D2DYDZ(const Field2D &f, CELL_LOC outloc = CELL_DEFAULT, const std::string &method = "DEFAULT", const std::string &region = "RGN_NOBNDRY")

Calculate mixed partial derivative in y and z

\(\partial^2 / \partial y \partial z\)

Parameters:
  • f[in] The field to be differentiated

  • outloc[in] The cell location where the result is desired. If staggered grids is not enabled then this has no effect If not given, defaults to CELL_DEFAULT

  • method[in] Differencing method to use. This overrides the default If not given, defaults to DIFF_DEFAULT

  • region[in] What region is expected to be calculated If not given, defaults to RGN_NOBNDRY