File vector2d.hxx#
Class for 2D vectors. Built on the Field2D class, all operators relating to vectors are here (none in Field classes). As with Field2D, Vector2D are constant in z (toroidal angle) Components are either co- or contra-variant, depending on a flag. By default they are covariant.
Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
- Author
B. Dudson, October 2007
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/.
Defines
-
BOUT_VECTOR2D_H#
Functions
-
Coordinates::FieldMetric abs(const Vector2D &v, const std::string ®ion = "RGN_ALL")
Absolute value (Modulus) of given vector
v
|v| = sqrt( v dot v )
-
inline Vector2D toFieldAligned(Vector2D v, const std::string ®ion = "RGN_ALL")#
Transform to and from field-aligned coordinates.
-
inline Vector2D emptyFrom(const Vector2D &v)#
Create new Vector2D with same attributes as the argument, but uninitialised components.
-
class Vector2D : public FieldData#
- #include <vector2d.hxx>
A vector with three components (x,y,z) which only vary in 2D (x and y). Implemented as a collection of three Field2D objects.
Public Functions
-
Vector2D(Mesh *localmesh = nullptr, bool covariant = true, CELL_LOC location = CELL_LOC::centre)#
Many-argument constructor for fully specifying the initialisation of a Vector3D.
-
~Vector2D() override#
-
void toCovariant()#
In-place conversion to covariant form.
-
void toContravariant()#
In-place conversion to contravariant form.
-
Vector2D &operator=(BoutReal val)#
Assign a BoutReal value. This sets all components to the same value
val
.Vector2D v = 0.0;
is equivalent to
Vector2D v; v.x = 0.0; v.y = 0.0; v.z = 0.0;
The only real use for this is setting vector to zero.
-
const Coordinates::FieldMetric operator*(const Vector2D &rhs) const#
Dot product.
-
inline virtual bool is3D() const override#
True if variable is 3D.
-
inline virtual int elementSize() const override#
Number of BoutReals in one element.
-
virtual void applyBoundary(bool init = false) override#
Apply boundary condition to all fields.
-
inline void applyBoundary(const char *condition)#
-
virtual void applyTDerivBoundary() override#
Public Members
-
Coordinates::FieldMetric z#
components
-
bool covariant = {true}#
true if the components are covariant (default)
Private Members
-
CELL_LOC location = {CELL_CENTRE}#
Location of the variable in the cell.
-
Vector2D(Mesh *localmesh = nullptr, bool covariant = true, CELL_LOC location = CELL_LOC::centre)#