#include <FieldFE.h>
Inheritance diagram for FieldFE::

Public Methods | |
| FieldFE () | |
| FieldFE (const GridFE &grid, const char *fieldname) | |
| FieldFE (const GridFE &grid, const Vec(NUMT) &coefficients, const char *fieldname) | |
| FieldFE (const BasisFuncGrid &bfnodes_grid, const char *fieldname) | |
| FieldFE (const BasisFuncGrid &bfnodes_grid, const Vec(NUMT) &coefficients, const char *fieldname) | |
| ~FieldFE () | |
| bool | update () |
| bool | compatible (const GridFE &g) |
| bool | updateNodalNumbering () |
| bool | redim (const FieldFE &f, const char *fieldname) |
| bool | redim (const GridFE &grid, const char *fieldname) |
| bool | redim (const BasisFuncGrid &bfnodes_grid, const char *fieldname) |
| bool | redim (const GridFE &grid, const Vec(NUMT) &coefficients, const char *fieldname) |
| bool | redim (const BasisFuncGrid &bfnodes_grid, const Vec(NUMT) &coefficients, const char *fieldname) |
| GridFE& | grid () |
| const GridFE& | grid () const |
| BasisFuncGrid& | grid4basisFunc () |
| const BasisFuncGrid& | grid4basisFunc () const |
| Vec(NUMT)& | values () |
| const Vec(NUMT)& | values () const |
| void | localValues (VecSimple(NUMT) &local_values, int elm_no) const |
| void | fill (const Vector(NUMT) &new_values) |
| int | getNoNodes () const |
| bool | valueNodeRepresentation () const |
| bool | simpleTopology () const |
| bool | isLattice (int nsd) const |
| const ArrayGen(NUMT)& | latticeIndex () const |
| ArrayGen(NUMT)& | latticeIndex () |
| void | exchangeValues (FieldFE &f) |
| virtual bool | ok () const |
| bool | empty () const |
| virtual void | minmax (NUMT &min, NUMT &max, GridWithPts *grid=NULL) const |
| NUMT | valueElm (int elm_no, const Ptv(real) &local_pt, real t=DUMMY) |
| NUMT | valueElm (int elm_no, const Ptv(real) &local_pt, real t=DUMMY) const |
| virtual NUMT | valueFEM (const FiniteElement &fe, real t=DUMMY) |
| virtual NUMT | valuePt (const Ptv(real) &x, real t=DUMMY) |
| NUMT | valuePt (int &element, Ptv(real) &loc_pt, const Ptv(real) &x, real t=DUMMY) |
| NUMT& | valueNode (int node, real t=DUMMY) |
| virtual NUMT | valueNode (int node, real t=DUMMY) const |
| virtual Ptv(NUMT) | derivativePt (const Ptv(real) &x, real t=DUMMY) |
| Ptv(NUMT) | derivativePt (const Ptv(real) &x, real t=DUMMY) const |
| virtual void | derivativeNode (Ptv(NUMT) &gradient, int node, real t=DUMMY) |
| virtual void | derivativeFEM (Ptv(NUMT) &gradient, const FiniteElement &fe, real t=DUMMY) |
| void | derivativeFEM (Ptv(NUMT) &gradient, const FiniteElement &fe, real t=DUMMY) const |
| void | derivativeElm (Ptv(NUMT) &gradient, int elm_no, const Ptv(real) &local_pt, real t=DUMMY) |
| void | derivativeElm (Ptv(NUMT) &gradient, int elm_no, const Ptv(real) &local_pt, real t=DUMMY) const |
| virtual void | hessianPt (Ptv(NUMT) &, const Ptv(real) &x, real=DUMMY) |
| virtual void | hessianFEM (Ptv(NUMT) &, const FiniteElement &fe, real=DUMMY) |
| void | hessianElm (Ptv(NUMT) &, int, const Ptv(real) &, real=DUMMY) |
| void | interpolate (const FieldFE &fefield) |
| void | interpolate (const FieldLattice &fdfield) |
| void | operator= (const FieldFE &fefield) |
| void | operator= (const FieldLattice &fdfield) |
| void | operator= (const FieldFunc &func) |
| void | fill (const FieldFunc &func, real time) |
| virtual void | fill (NUMT value) |
| virtual void | add (NUMT value) |
| virtual void | mult (NUMT value) |
| virtual void | apply (Func(NUMT) f) |
| virtual void | add (Field &field, int power, NUMT front_factor) |
| void | add (const FieldFE &f) |
| virtual Field& | scale () |
| virtual Field& | unscale () |
| virtual void | unloadData (Os os) const |
| virtual void | loadData (Is is) |
| virtual void | attach (Grid &grid) |
| virtual Grid* | getGridBase () |
| virtual int | getNoPoints () const |
| virtual int | getNoValues () const |
| virtual NUMT& | valuePoint (int point_no) |
| virtual NUMT | valuePoint (int point_no) const |
| virtual Ptv(real) | getPt (int point_no) const |
| virtual GridWithPts& | getGridWithPts () |
| virtual const GridWithPts& | getGridWithPts () const |
| virtual Vec(NUMT)& | valuesVec () |
| virtual const Vec(NUMT)& | valuesVec () const |
| CLASS_INFO | VIRTUAL_CAST (FieldFE) |
| COPY_CONSTRUCTOR (FieldFE) | |
| virtual void | print (Os os) const |
| void | scan (Is is) |
Protected Methods | |
| void | precompute4interpolation (const FiniteElement &fe) |
| bool | reallocate (const GridFE &grid, const Vec(NUMT) *coeff, const BasisFuncGrid *sfg, const char *fieldname) |
Protected Attributes | |
| Handle(GridFE) | mesh |
| Handle(Vec(NUMT)) | nodal_values |
| Handle(FiniteElement) | globfe |
| Handle(BasisFuncGrid) | bfnodes |
| Handle(ArrayGen(NUMT)) | lattice_indexing |
| bool | internal_basis_func_grid |
| int | init4e |
| Vec(NUMT) | loc_nodal_values |
| bool | different_bfgrid |
| bool | different_geomgrid |
| int | nbf |
| int | ncalls_valuePt |
| bool | renumbered |
| Handle(MxMapping) | map |
NAME: FieldFE - finite element scalar field
DESCRIPTION:
The class implements a scalar field defined in terms of a finite element grid and assocated finite element interpolation functions. That is, the field consists of a "GridFE" object and the coefficients in the finite element expansion. The class is fundamental when coding simulators based on finite elements in Diffpack.
|
|
One can call the constructor without arguments and afterwards initialize the object by calling a relevant "redim" function. As usual in Diffpack, ""initialization"" here refers to allocating dynamic memory and not to filling the nodal values. If the grid consists of isoparametric elements only, one can use the constructors that take a "GridFE" object. If the vector of nodal values is available (for example, if several fields shall share the same vector) it can be given as an optional argument to the constructor. For element meshes containing non-isoparametric elements, one must use the constructor (or "redim" function) that takes a "BasisFuncGrid" as argument. Each constructor has a corresponding "redim" function. |
|
|
See documentation of one of the overloaded constructor. |
|
|
See documentation of one of the overloaded constructor. |
|
|
See documentation of one of the overloaded constructor. |
|
|
See documentation of one of the overloaded constructor. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See documentation of one of the overloaded functions. Reimplemented from Field. |
|
|
adds a constant field to the field. An overloaded version takes a "Field" "f", an integer power "i" and a factor "c" as arguments. The formula "c*f^i" is added to the object field. Reimplemented from Field. |
|
|
applies a function, like "sin(x)", to the field. Reimplemented from Field. |
|
|
attaches a grid to the field. Used by the "FieldReader" and "SimResFile" classes when reading fields from files. Specific versions of the function are implemented in the subclasses. Reimplemented from Field. |
|
|
checks if this field is compatible with the grid given as argument, that is, if this field''s grid is exactly the same as the argument grid and if this field''s nodal array has the same size as the number of nodes in the argument grid. |
|
|
See documentation of one of the overloaded functions. |
|
|
as "derivativeFEM" but other arguments are offered (the element number and the local point in that element). |
|
|
See documentation of one of the overloaded functions. |
|
|
as "valueFEM", but the gradient is computed. Reimplemented from Field. |
|
|
the counterpart to "valueNode", but when the elements have discontinuous derivatives at the element boundaries, this function is not very useful. It is included just to give the user an error message about what should be done to compute the derivative at a node. The discontinuous derivative field should first be computed and then smoothed and represented as a new "FieldFE" object which can be evaluated at a node by calling "valueNode". Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
as "valuePt" but the function computes the derivative. Reimplemented from Field. |
|
|
returns true if the object has not allocated the internal data structures. In contrast to "ok", no error messages are issued. Hence the function is convenient in tests where one wants to call a "redim" function if the field is empty. |
|
|
|
|
|
See documentation of one of the overloaded functions. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
there are several versions of this function. The one that takes a sclar as argument fills the entire field with this value. The version that takes a vector fills the nodal values vector with values given by the vector argument. The final version taking a "FieldFunc" is the same as the "operator=" that also takes such an argument, but a time parameter can be given. This is useful when the explicit function changes with time. The "operator=" function goes through all nodes and calls the explicit function with a "DUMMY" argument for the time variable (since "operator=" can only take one argument). "fill" is intended for the situations where one needs two arguements, which is the general case. It is a good habit to use the "fill" function instead of the fancy assignment syntax when filling finite element fields with explicit function values. This makes the extension to time dependent functions easier. |
|
|
returns a "Grid" base class pointer to the grid associated with the field. Since many field types do not have an associated grid, the function is not meaningful for all fields. The "getGridBase" function is used by the "SimResFile" and "FileReader" classes. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. Reimplemented from FieldWithPtValues. |
|
|
gives access to the grid object associated with the "FieldWithPtValues" object. The corresponding base class for grid with discrete points is "GridWithPts". Reimplemented from FieldWithPtValues. |
|
|
returns the number of basis function nodes. Same as "getNoPoints". |
|
|
returns the number of points in the grid. Reimplemented from FieldWithPtValues. |
|
|
returns the number of field values (usually equal to the number of points).`\footnote{`In a "GridLattice" grid one can think of a finite difference field defined at the cell centers. Then the number of grid points does not coincide with the number of field values. However, the field is typically characterized as being defined at a finite number of spatial points.`}` Reimplemented from FieldWithPtValues. |
|
|
returns the coordinate of a point. The point is given by its point number in the grid. Reimplemented from FieldWithPtValues. |
|
|
See documentation of one of the overloaded functions. |
|
|
returns access to the underlying finite element grid. |
|
|
See documentation of one of the overloaded functions. |
|
|
returns access to the information on basis function nodes. In case of isoparametric elements one can use "grid" instead, but a call to "grid4basisFunc" is more general since it can handle the case where nodes defining the geometry and the basis functions differ. The "BasisFuncGrid" object is convenient when working with mixed finite elements. |
|
|
evaluates the hessian (2nd derivatives) of the field at a local point in a given element. |
|
|
Reimplemented from Field. |
|
|
evaluates the hessian (2nd derivatives) of the field at a point in space and time, i.e. f,xx for nsd=1, {f,xx f,yy f,xy} for nsd=2 and {f,xx f,yy f,zz f,xy f,xz f,yz} for nsd=3. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
given another field on an arbitrary grid, this function computes the nodal values of the ""this"" grid by standard interpolation (the function "valuePt" is used). Note that ""this"" refers to the "f" field in the call "f.interpolate(g)". The "interpolate" function requires the ""this"" field to be initialized with a grid. If you have an empty field (without an associated grid) and want to initialize it with another field, use the "operator=" functions. The function "operator=" is intended for setting two fields equal to each other, where also the grids are identical. The function "interpolate" can set two fields equal to each other where the grids differ. Of course, "operator=" is much more efficient than "interpolate" (since it avoids the use of "valuePt" and instead can only copy array entries). |
|
|
returns "true" if the underlying finite element mesh is a regular lattice with uniform spacing. Then it is possible to use `$(i,j)$` or `$(i,j,k)$` indexing of nodes by calling "latticeIndex". The function takes and "int nsd" argument. The reason for this is that if the grid is a lattice, the user must know the number of space dimensions in order to index the nodal values vector (which in that case is an "ArrayGen(real)" object) correctly. The argument checks that the user knows enough to use the lattice grid facility. |
|
|
See documentation of one of the overloaded functions. |
|
|
returns access to an "ArrayGen(real)" array containing the nodal values. This enables ""finite difference"" indexing of the nodes in a finite element grid. There is no extra storage associated with this functionality ("values" and "latticeIndex" return access to the same physical array). Always call "isLattice" prior to "latticeIndex" to ensure that the finite element grid really is a lattice. If "isLattice" returns "false", "latticeIndex" will return reference to a "NULL" pointer. For efficiency reasons, there is no warning message in this case. |
|
|
a special scan function used for reading the field from a SimRes file. (See classes "SimResFile" and "FieldReader"). Reimplemented from Field. |
|
|
extracts the nodal values (for instance returned by "values()") that are associated with an element "elm_no". For isoparametric elements, "local_values(i)" is then the field value at local node "i" in element "elm_no". Another way of extracting this value is "f.values( (f.grid4basisFunc().loc2glob(elm_no,i))") for a "FieldFE f". (However, it is usually more efficient first to extract "local_values" and then index this short vector.) |
|
|
finds the minimum and maximum nodal values in the field. Reimplemented from Field. |
|
|
multiplies the field values by a number. Reimplemented from Field. |
|
|
returns a true value if the object is in an ok state, that is, if all the internal data structures are allocated. Otherwise, it gives some error messages. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
the version that takes a "FieldFE" object copies the values for the supplied field into this field. If this field does not have a mesh attached, the mesh of the supplied field is first attached to this field. It is required that the grids and the basis function grids are the same in order to use this function. The version that takes a "FieldLattice" enables to convert a finite difference field to a finite element field. Each cell in the difference grid becomes a "ElmTensorProd1" element. The version that takes a "FieldFunc" fills the nodal values by evaluating an explicit function (either a standard function or a C++ functor is offered by class "FieldFunc"). |
|
|
|
|
|
prints the field. Most subclass implementations involve printing the field values and the grid. Reimplemented from Field. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scale the field values and the space(-time) domain. That is, the original values of the field are overwritten by the new, scaled values. To retrieve the original values, call "unscale". Both "scale" and "unscale" tests a variable first to determine if the field is already scaled or unscaled (calling e.g. "scale" twice then results in no action of the second call). Reimplemented from Field. |
|
|
|
|
|
returns "true" if the elements are isoparametric, or for non-isoparametric cases, it returns "true" if the elements use corner nodes. Otherwise it returns "false". |
|
|
a special print function that is used for dumping the field to a SimRes file. (See classes "SimResFile" and "FieldWriter"). Reimplemented from Field. |
|
|
the inverse action of "scale". Reimplemented from Field. |
|
|
redimensions the nodal values array (and the internal "BasisFuncGrid" object if that object was created by this field
|
|
|
updates the numbering of the field values to reflect any renumbering that has been done for the underlying grid. If the grid has not been renumbered, no action is taken. The return value tells whether any changes have been done to the field value array. The class remembers the state of the situation, resulting in a warning of the function is called several times for the same data set. This state is reset if the field is redimensioned (even if the field maintains the same size as before the call to a "redim" function). |
|
|
See documentation of one of the overloaded functions. |
|
|
interpolates the field value at a local point in an element. |
|
|
interpolates the field value at a local point in an element. ("valueFEM" is the recommended function, "valueElm" is only included for backward compatibility). Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. Reimplemented from Field. |
|
|
gives access to the finite element field at a node. Notice that this function can also be used on the left hand side of an equality operator (for assigning nodal values in a field). For isoparametric elements one can also call "values" and then invoke the "operator()" function of the returned "Vec(NUMT)" object. Note that "valueNode" is not inline because it needs to check if there are more than one field degree of freedom at each node. Therefore, "valueNode(i)" is very much less efficient than "values( (i)",) but the latter may be wrong if one works with certain types of non-isoparametric elements (more than one unknown per node). |
|
|
Most elements have basis functions that are either 0 or 1 at the nodes and these element fields are well represented by the nodal value. The valueNode representation is then more efficient than the general representation. |
|
|
See documentation of one of the overloaded functions. Reimplemented from FieldWithPtValues. |
|
|
returns access to the field value at a spatial point. The point is given by its point number. (If the point is known by its coordinates and not the point number, one can use the "valuePt" function, see class "Field"). Reimplemented from FieldWithPtValues. |
|
|
See documentation of one of the overloaded functions. |
|
|
computes the value of the finite element field at a spatial point. The time variable has no effect in the current implementation. There are two overloaded versions of valuePt. In fact "GridFE" functions search for the point and in "FieldFE" we only carry out the interpolation. Using "+verbose n" on the command line, where "n" is an integer greater than zero, most search algorithms will give messages to the standard output if the search was unsuccessful. This is an important feature if you experience strange numerical results in a code that calls "valuePt". See the function "GridFE findElmAndLocPt" for more information about the search algorithms. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
returns access to the vector "Vec(NUMT)" (that is, "Vec(real)" or "Vec(Complex)") of the degrees of freedom in the field. For isoparametric elements this vector contains the nodal values of the field. For example, if one wants to print the nodal values, one can then say
field.values().print(cout,"nodal values of field")
|
|
|
Reimplemented from FieldWithPtValues. |
|
|
Reimplemented from FieldWithPtValues. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|