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
- B. Dudson, October 2007
Contact: Ben Dudson, email@example.com
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/.
abs(const Vector2D &v, const std::string ®ion = "RGN_ALL")
Absolute value (Modulus) of given vector
|v| = sqrt( v dot v )
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.
In-place conversion to covariant form.
In-place conversion to contravariant form.
Assign a BoutReal value. This sets all components to the same value
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.
Returns true if field consists of BoutReal values.
True if variable is 3D.
Number of bytes for a single point.
Number of BoutReals (not implemented if not BoutReal)
applyBoundary(bool init = false)¶
Apply boundary condition to all fields.
applyBoundary(const std::string &condition)¶
applyBoundary(const char *condition)¶
true if the components are covariant (default)