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

Public Methods | |
| FieldPiWisConst () | |
| FieldPiWisConst (const GridFE &grid, bool elementsRsubdomains, const char *fieldname) | |
| FieldPiWisConst (const GridFE &grid, const Vec(NUMT) &subdomain_values, const char *fieldname) | |
| ~FieldPiWisConst () | |
| bool | update () |
| bool | redim (const GridFE &grid, bool elementsRsubdomains, const char *fieldname) |
| bool | redim (const GridFE &grid, const Vec(NUMT) &subdomain_values, const char *fieldname) |
| const GridFE& | grid () const |
| GridFE& | grid () |
| bool | piecewiseConstOverElms () const |
| const Vec(NUMT)& | values () const |
| Vec(NUMT)& | values () |
| void | setValueElm (int e, NUMT value) |
| void | setSubDomainValue (int material, NUMT value) |
| void | setMaterialValue (int material, NUMT value) |
| void | fill (const Vec(NUMT) &values) |
| void | operator= (const FieldPiWisConst &f) |
| void | operator= (const FieldFE &f) |
| void | fill (const FieldsFEatItgPt &f, int component) |
| virtual bool | ok () const |
| virtual void | minmax (NUMT &min, NUMT &max, GridWithPts *grid=NULL) const |
| void | point (Ptv(real) &pt, int element) |
| void | point (Ptv(real) &pt, int element) const |
| NUMT | valueElm (int e) const |
| virtual NUMT | valuePt (const Ptv(real) &x, real t=DUMMY) |
| virtual NUMT | valueFEM (const FiniteElement &fe, real t=DUMMY) |
| virtual Ptv(NUMT) | derivativePt (const Ptv(real) &x, real t=DUMMY) |
| void | derivativeElm (Ptv(NUMT) &der, int e) |
| virtual void | derivativeFEM (Ptv(NUMT) &d, const FiniteElement &fe, real t=DUMMY) |
| virtual void | hessianPt (Ptv(NUMT) &, const Ptv(real) &, real=DUMMY) |
| virtual void | hessianFEM (Ptv(NUMT) &, const FiniteElement &, real=DUMMY) |
| 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) |
| 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 (FieldPiWisConst) |
| COPY_CONSTRUCTOR (FieldPiWisConst) | |
| virtual void | print (Os os) const |
| void | scan (Is is) |
NAME: FieldPiWisConst - piecewise const scalar field over materials or elements
DESCRIPTION:
The "FieldPiWisConst" class represents a piecewise constant scalar field over non-overlapping subdomains of a finite element grid. The subdomains are defined in terms of the ""material"" concept in class "GridFE". (This is different from the ""subdomain"" concept in class "GridFE"; the latter can represent non-overlapping subdomains for domain decomposition methods and parallel algorithms, whereas the former reflects distinct physical materials of the domain, with possibly different physical (material) properties.) There are two different representations: 1) the field is constant on each subdomain, where the subdomains are defined in a finite element grid, 2) the field is constant on each finite element (ie., the finite elements constitute the subdomains). The choice between these two definitions of ""subdomain"" is given as a parameter to the constructor.
It may seem strange that "FieldPiWisConst" is derived from class "FieldWithPtValues". This derivation is motivated by some field generators (such as stochastic field generators) where one wants to hide the details of a scattered point collection, a complicated finite element field or a piecewise constant field. The ""point"" associated with a field value in "FieldPiWisConst" is meant to be the centroid of the domain over which the field is constant. When the elements are the subdomains, this point is easy to compute since "GridFE" supports a function for calculating the centroid. For subdomain consisting of a set of elements, there is no implementation of the ""point"" concept in the present version of the class. However, in this latter case, there is seldom useful to regard "FieldPiWisConst" as a field with point values.
|
|
There is one constructor taking a finite element grid as parameter. In addition, a boolean variable indicates whether the elements are the subdomain or if the subdomain definitions in the grid should be used. |
|
|
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. |
|
|
|
|
|
Reimplemented from Field. |
|
|
evaluates the derivative of the field at a point in space and time. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
The version that takes a "Vec(NUMT)" fill all subdomain values. If the elements are the subdomains and one sends an "ArrayGen(real)" as argument, one can use this function for initializing a "FieldPiWisConst" with values obtained from the cells in a finite difference grid ("GridLattice"). The element and cell numbering will correspond to each other if the numering conventions of "PreproBox" (for example) is followed when constructing the finite element grid. If the grid was initialized by a "scanLattice" function, or set equal to a "GridLattice", the element numering will automatically coincide. Observe that the length and dimension sizes of the "ArrayGen(real)" argument is different from the standard "FieldLattice" point values array (in the latter field class, the point array reflects values at the nodes in the grid rather than in the cells). The version of the function taking a FieldsFEatItgPt initializes a "FieldPiWisConst" object at each element as the average of the field values of "FieldsFEatItgPt" (in the same element). If "FieldsFEatItgPt" contains only one field value per element (at the centroid), the data in "FieldsFEatItgPt" are just copied into the present "FieldPiWisConst" object. |
|
|
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 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 associated grid. |
|
|
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. |
|
|
a special scan function used for reading the field from a SimRes file. (See classes "SimResFile" and "FieldReader"). Reimplemented from Field. |
|
|
finds the minimum and maximum values of the field. Most of the subclass fields have an internal grid and will find the extreme values over this grid. The "minmax" function has an optional argument "grid" that can be supplied. This grid is not used if the field has an internal grid. However, some fields, like "FieldFunc", do not have internal grids and in that case the "grid" argument is required in order to compute the extreme values. Reimplemented from Field. |
|
|
multiplies the field values by a number. Reimplemented from Field. |
|
|
returns true if the object is initialized, for the base class "Field" it just writes an error messages such that if a derived class fails to define an "ok" function, an error message will be written. Reimplemented from Field. |
|
|
|
|
|
|
|
|
returns a true value if the elements are the subdomains (otherwise it returns a false value). |
|
|
|
|
|
|
|
|
prints the field. Most subclass implementations involve printing the field values and the grid. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
each constructor is a simple call to the associated "redim" function. In other words, we refer to constructing and initializing the class for more information on the actions of the "redim" functions. |
|
|
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. |
|
|
|
|
|
same as "setSubDomainValue", just another function name for making some codes easier to read. |
|
|
sets the field value for the given subdomain (to be used when the elements are not the subdomains, and the subdomain reflects a material). |
|
|
sets the value of the field in an element. Requires that the elements are the subdomains. |
|
|
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 internal data structure in accordance with the attached grid. useful in adaptive grid methods where the size of the grid may vary during a simulation. The boolean return value reflects whether new memory was allocated or not. |
|
|
|
|
|
evaluates the field at a point in space and time, but the argument is a "FiniteElement" object which means that the evaluation process in a finite element context will be very efficient (since "FiniteElement" knows the element number and the local coordinates of the spatial point). The function is virtual and offers a unified interface to the evaluation of all types of fields in a finite element based simulator. Reimplemented from Field. |
|
|
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. |
|
|
evaluates the field at a point in space and time. The time argument can be omitted, the default value is then "DUMMY". Generally, we suggest to use "DUMMY" to check if fields are stationary. Reimplemented from Field. |
|
|
See documentation of one of the overloaded functions. |
|
|
gives access to a vector with all the subdomain field values. The length of the vector depends on the type of field, that is, piecewise constants over each element or over subdomains. You can use "value().size()", or better, "piecewiseConstOverElms" to test for the field type. |
|
|
Reimplemented from FieldWithPtValues. |
|
|
Reimplemented from FieldWithPtValues. |
|
|
|