NAME
Fields - base class for collection of scalar fields (ie. vector
fields)
INCLUDE
include "Field.h"
SYNTAX
class Fields : public virtual HandleId
{
protected:
String fieldname;
public:
Fields (const char* fieldname = NULL);
virtual ~Fields ();
void setFieldname (const char* name);
String getFieldname () const { return fieldname; }
bool hasFieldname () const;
virtual Field* getFieldBase (int i = 1) const;
virtual void attach (Field& field, int i = 1);
virtual void redim (int nsf, const char* fieldname);
virtual bool ok () const;
virtual int getNoFields () const;
virtual int getNoValues () const;
virtual void valuePt (Ptv(NUMT)& vec, const Ptv(real)& x, real t = DUMMY);
virtual void valueFEM (Ptv(NUMT)& vec, const FiniteElement& fe,
real t = DUMMY);
virtual void valueNode (Ptv(NUMT)& vec, int node) const;
virtual void print
(Os os, const char* heading = "0rinting of Fields object") const;
virtual Grid* getGridBase();
CLASS_INFO
DEF_VIRTUAL_CAST(FieldsLattice)
DEF_VIRTUAL_CAST(FieldsFE)
DEF_VIRTUAL_CAST(FieldsWithPtValues)
DEF_VIRTUAL_CAST(FieldsScatPt)
DEF_VIRTUAL_CAST(FieldsPiWisConst)
DEF_VIRTUAL_CAST(FieldsFunc)
DEF_VIRTUAL_CAST(FieldsConst)
};
KEYWORDS
vector field, base class
DESCRIPTION
The class represents the base class for vector fields. It con
tains simply a collection of scalar fields of type Field. All
subclasses implement their own collection of their specific field
type. See class Field for documentation.
Fields and its subclasses are not limited to vector fields. Since
subclasses implement the vector field in terms of a vector of
pointers to fields (actually handles, Handle(Field)), it is
straightforward to represent tensor fields. In 3D, a typical ten
sor field requires six scalar fields.
MEMBER FUNCTIONS
Many member functions are described in class Fields.
getFieldBase - returns a Field base class pointer for component
number i in the vector field. Used when reading/writing vector
fields from/to SimRes files.
attach - attaches a scalar field ascomponent number i in the vec
tor field.
redim - redimensions the number of scalar fields that make up the
vector field.
getNoFields - returns the number of scalar fields that make up
the vector field.
getNoValues - returns the total number of degrees of freedom in
the vector field. For example, for a 3D velocity field, repre
sented in terms of trilinear finite elements with X nodes, the
getNoValues function should return 3*X.
getGridBase - enables access to the (common) underlying grid for
the field components. NOTE: This function will return a NULL
pointer in many subclasses of Fields. It is, at present, only
used for some special vector field classes.
SEE ALSO
class Field
DEVELOPED BY
SINTEF Applied Mathematics, Oslo, Norway, and University of Oslo,
Dept. of Mathematics, Norway
AUTHOR
Hans Petter Langtangen, SINTEF/UiO