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

Public Methods | |
| virtual int | getNoSpaceDim () const |
| int | getNoPhysicalSpaceDim () const |
| int | getNoNodes () const |
| int | getNoElms () const |
| int | getNoBoInds () const |
| bool | allElmsOfSameType () const |
| bool | hasUniformMesh () const |
| void | setUniformMesh () |
| void | setNonUniformMesh () |
| int | getNoMaterials () const |
| GridFE () | |
| GridFE (const GridFE &grid) | |
| bool | redim (int nsd, int nno, int nel, int maxnne, int nbind, int nne, bool onemat=true, bool keep_associated_bfg=false) |
| ~GridFE () | |
| bool | ok () const |
| void | operator= (const GridFE &grid) |
| virtual bool | notEqual (const GridFE &grid, int check_level=2, bool silent=false) |
| int | getNoNodesInElm (int e) const |
| int | getMaxNoNodesInElm () const |
| int | getMaterialType (int e) const |
| bool | oneMaterialType () |
| String | getElmType (int e) const |
| void | getElmCoor (Mat(real) &elmcoor, int elm_no) const |
| real | getCoor (int node, int dir) const |
| Ptv(real) | getCoor (int node) const |
| void | getCoor (Ptv(real) &point, int node) const |
| virtual void | getMinMaxCoord (Ptv(real) &mincoord, Ptv(real) &maxcoord) const |
| Ptv(real) | getLocalCoor (int elm_no, int local_node) const |
| Ptv(real) | getLocalCentroid (int elm_no) |
| Ptv(real) | getGlobalCentroid (int elm_no) |
| Ptv(real) | getGlobalCentroid (int elm_no) const |
| Ptv(real) | getGlobalMeanCentroid (int elm_no) |
| int | loc2glob (int e, int local_node) const |
| String | getBoIndName (int indno) const |
| bool | boSide (int elm_no, int side, int indno, const ElmDef &elm) const |
| bool | boNode (int node, int indno) const |
| bool | boNode (int node) const |
| bool | boNodesInElm (int elm_no, int indno) const |
| bool | boNodesInElm (int elm_no) const |
| bool | boInd (int ind) const |
| const Indicators& | boundaryData () const |
| Indicators& | boundaryData () |
| void | attach (const Indicators &boinds) |
| void | redefineBoInds (Is is) |
| void | addBoIndNodes (Is is, bool add=ON) |
| void | addMaterial (Is is) |
| int | addMaterial (int material_number, const MatSimple(real) &polygon) |
| int | insidePolygon (const MatSimple(real) &polygon, const Ptv(real) &globpt) |
| void | scanLattice (Is is) |
| void | operator= (const GridLattice &lattice) |
| virtual bool | isLattice () const |
| virtual bool | isReallyLattice () const |
| const GridLattice& | getLattice () const |
| void | refineIfBox (const Ptv(int) &refinement_factor) |
| void | move (const FieldsFE &displacement, real scale_factor=1.0) |
| void | move (FieldsFunc &func, real time=DUMMY) |
| void | move (const Mat(real) &new_coor) |
| void | move (const Vec(real) &new_coor, int dir) |
| void | move (const GridFE &grid) |
| virtual void | startIterator () |
| virtual bool | nextPt (Ptv(real) &x) |
| bool | nextPt (Ptv(real) &x, int &node) |
| virtual int | getNoPoints () const |
| int | isNode (const Ptv(real) &point) |
| virtual int | nearestPoint (const Ptv(real) &point, real &distance, bool &exact) |
| bool | isNodeInElm (int node, int e) |
| void | boundingBox (int e, Ptv(real) &min, Ptv(real) &max) |
| void | findElmAndLocPt (const Ptv(real) &glob_pt, int &element, Ptv(real) &loc_pt, int *n_Newton_iter=NULL, real *Newton_error=NULL) |
| void | findElmAndLocPt (const Ptv(real) &glob_pt, int &element, Ptv(real) &loc_pt, int &node, bool force_element_search=false, int *n_Newton_iter=NULL, real *Newton_error=NULL) |
| void | findElmAndLocPtFE (const Ptv(real) &glob_pt, int &element, Ptv(real) &loc_pt, int *n_Newton_iter, real *Newton_error) |
| void | findElmAndLocPtLatt (const Ptv(real) &glob_pt, int &element, Ptv(real) &loc_pt, int *n_Newton_iter, real *Newton_error) |
| virtual void | print (Os os) const |
| virtual void | scan (Is is) |
| virtual void | scale () |
| virtual void | unscale () |
| void | attachScale (const SpaceTimeScale &scale) |
| real | calcTolerance (real div_factor=100.0) const |
| void | setMaterialType (int e, int material_number) |
| void | setElmType (int e, const String &type) |
| void | setElmType (const String &from, const String &to) |
| void | setElmType (const String &name) |
| void | setNoNodesInElm (int e, int nnodes) |
| void | fillCoor (real value) |
| void | setNoPhysicalSpaceDim (int nsd_phys) |
| void | putCoor (real value, int node, int dir) |
| void | putCoor (const Ptv(real) &point, int node) |
| void | putLoc2Glob (int global_node, int e, int local_node) |
| void | setBoInd (int node, int indno) |
| void | clearBoInd (int node, int indno) |
| void | clearBoInds () |
| void | putBoIndName (const String &name, int indno) |
| int | searchPoint (const Ptv(real) &point) |
| void | updateElmConnect (int nodeno, int newnodeno) |
| virtual void | newNodalNumbering (VecSimpleH(int) &old2new) |
| virtual void | getNodalMapping (VecSimpleH(int) &old2new, bool &identity) |
| virtual void | isToBeChanged () |
| virtual void | flipAroundSymmetryPlane (int dir, real plane) |
| void | nodeCouplings (int node, VecSimple(int) &couplings) |
| virtual void | constraintCouplings (VecSimplest(SetDistinct(int)) &, int=0) |
| virtual int | getNoConstraints () const |
| virtual int | calcBandwidth () const |
| virtual int | getGridLevelNo () |
| virtual GridFE& | getStartGrid () |
| virtual void | modify4constraints (DegFreeFE &, Matrix(NUMT) &, Vector(NUMT) &) |
| virtual void | modifyField4constraints (FieldFE &) |
Public Attributes | |
| GridFEInfo | additional_info |
| BasisFuncGrid* | associated_bfg |
| Handle(Indicators) | elmind |
Static Public Attributes | |
| bool | smart_pt_search |
Protected Methods | |
| void | printAscii (Os os) const |
| void | scanAscii (Is is) |
| void | printBinary (Os os) const |
| void | scanBinary (Is is) |
Protected Attributes | |
| MatSimple(int) | nodel |
| MatSimple(real) | coor |
| Handle(Indicators) | bind |
| int | nne |
| VecSimple(int) | nne_all |
| int | maxnne |
| String | elm_tp |
| VecSimple(String) | elm_tp_all |
| bool | onemat |
| VecSimple(int) | material_type |
| int | nsd |
| int | nsd_phys |
| int | nno |
| int | nel |
| Handle(VecSimpleH(int)) | nodal_map |
| bool | uniform_mesh |
| bool | same_elm_tp |
| Handle(GridLattice) | lattice_data |
| HandleElmDefs | elmdef |
| int | current_node |
| Mat(real) | elmcoor_ |
Friends | |
| class | FieldFE |
| class | BasisFuncGrid |
| class | FieldPiWisConst |
| class | MathLinkInterface |
| class | GridFEInfo |
| class | GridFEAdB |
| class | MLGridFEAdB |
| class | GridDynFE |
| class | PreproBox |
| class | PreproBoxDKT |
| class | PreproGeomPack |
| class | ManipGridDynFE |
| Os& | operator<< (Os &os, const GridFE &mesh) |
| Is& | operator>> (Is &is, GridFE &mesh) |
NAME: GridFE - finite element grid
DESCRIPTION:
The class represents a finite element grid with information on nodal coordinates, the element topology and the nodes that are marked with boundary indicators.
Class "GridFE" objects are usually declared as empty objects and filled by preprocessor classes. Finite element computations require (normally) access to the read-only functions in class "GridFE". For preprocessor programmers and for educational purposes direct use of the assignment functions in the "GridFE" class is necessary. See the EXAMPLES section below for how to manually fill a "GridFE" object with grid data.
|
|
There is an empty constructor (that does not allocate memory for the internal data structure) and a constructor that takes some parameters like the number of nodes and elements and allocates the memory for the internal data structure. When using the constructor without arguments, allocation of memory must be performed later by the "redim" function. Notice that the "redim" function only allocates memory; the coordinates, the element connectivity, the element types and so must be initialized afterwards. To fill the data structures, one can use the many member functions, like e.g. "putCoor" (see the EXAMPLES section below for instructions), or one can use "scan" to read a file in a certain Diffpack-specifc format. Examples on this format can be obtained by creating a simple grid, using a simple preprocessor and, write the grid to file with the "print" function and then look at the file. Another way of creating a grid is to use the "scanLattice" function that reads a compact string having "GridLattic scan(Is)" syntax for specification of a rectangular or box-shaped grid. There is also an "operator=" "(const GridLattice" function available that can be used to initialize the finite element grid if one has a uniform finite difference at hand (remember that the "GridLattice" object sent to "operator=" must be handled by a handle such that it is not deleted
A finite element grid consists of nodes and elements. The number of space dimensions, elements and nodes are given by the functions "getNoSpaceDim", "getNoNodes" and "getNoElms". The "getNoPysicalSpaceDim" returns the number of dimensions of the space in which the grid is embedded. This usually coincides with dimension of the grid itself (i.e. the value of "getNoSpaceDim"), but if one has a curved surface with a 2D grid embedded in 3D space, "getNoSpaceDim" returns 2 whereas "getNoPhysicalSpaceDim" returns 3. The number of nodes in an element is returned by "getNoNodesInElm". The coordinates of the nodes can be read and set using the member functions "getCoor" and "putCoor". Notice that there are several overloaded versions of these functions. The applications of the functions will determine which version that may be most convenient to use. If an existing grid is to be deformed, use the "move" functions rather than the "putCoor" functions. The "move" functions are safer. For example, if a node is moved by "putCoor" and this makes an initially uniform mesh non-uniform, one must also call the "setNonUniformMesh" function. If not, class "FiniteElement" will find out that the grid is uniform and apply particularly efficient techniques when computing finite element data. These data will be completely wrong if the mesh is non-uniform. If "NUMT" is "Complex", the "move" function corresponding to a displacement field will only use the real part of that field for moving the nodal points. Given a local node number in an element, "loc2glob" returns the corresponding global number of that node. To set a new value of the global node number one may use the function "putLoc2Glob". The function "getCentroid" returns the local element coordinates of the centroid of an element (this function isonvenient in combination with class piecewise constant fields of type "FieldPiWisConst"). It may be convenient to mark some nodes in a grid where boundary conditions are to be applied, or the marking may have applications when plotting the grid. The "GridFE" class therefore supports marking of nodes: a node can be marked with a so called boundary indicator. Using class "Indicators" (its use and presence are transparent to users of class "GridFE") one can define a set of boundary indicators. Each indicator is given a name by using the "putBoIndName" function (the names can be arbitrary). Then the member function "setBoInd" can be used to set a boundary indicator in "ON" mode at a particular node. To turn on the "OFF" mode, call "clearBoInd". To test whether a node is marked with a particular boundary indicator, one can call "boNode" which returns "true" if the node is marked, that is, if the particular boundary indicator is in "ON" mode. The function "boNodes" returns "true" if any node in an element is marked with a particular boundary indicator. The "boInd" function can be used to check if a particular indicator is on in any node. For example, if an application does not allow the use of a particular boundary condition, it is easy to check if the user has set an indicator for this condition by using "boInd". Normally, the "GridFE" object allocates an internal "Indicators" object for keeping track of boundary indicators. The programmer can at any time replace this object by another one using the "attach" function. For example, if several simulators share the same grid, but need different boundary indicators, the programmer can have a vector of "Indicators" objects and attach these to the grid object as necessary. See the FAQ for an example. The domain can be partitioned into materials, which are identified as distinct (non-overlapping) subdomains. These might, for example, correspond to different physical media (different materials in heat transfer and elasticity). Each element can hence be given a material number. To get and set the material number of an element the member functions "getMaterialType" and "setMaterialType" are used. If there is only one material it is not necessary to set the subdomain type and the internal data structure of class "GridFE" can be made simpler. The function "oneMaterialType" is used to see if only one material type is used. The "redim" function requires an argument to indicate whether there are multiple materials. Even if the grid is initialized as one material, one can easily add new material subdomains using the "addMaterial" functions. It is emphasized that material and subdomain are two different concepts in class "GridFE". While material refer to non-overlapping parts of the domain, with different physical materials, the subdomain concept applies to possibly overlapping subdomains, which are useful for domain decomposition methods and parallel computing. Subdomains are represented by the "elmind" indicators, whereas materials are represented by the "material_type" array. The rule of thumb is that one element can belong to several subdomains, but only one material. In "GridFE" one associates an element geometry type with each element. The element geometry type is determined from the functions that are used in the mapping from the local element coordinate system onto the physical coordinate system. The functions "setElmType" and "getElmType" are used to set and read the geometry type. The variable in this context is a string that coincides with the name of the element. This name is identical to the classname of a subclass in the "ElmDef" hierarchy. In Diffpack the definitions of various finite elements are given as objects in the "ElmDef" hiearchy. Examples of classes derived from "ElmDef" are listed next. "ElmTensorProd1": Multi-dimensional tensor product elements, where the underlying one-dimensional basis functions are linear (the last number, "1", indicates first order). The classname must be supplied by the number of space dimensions in order to specify the element completely. "ElmTensorProd2": As "ElmTensorProd1", but the underlying one-dimensional basis functions are quadratic. "ElmTensorProd": As "ElmTensorProd1" and "ElmTensorProd2", but the order of the underlying one-dimensional basis function is a required parameter for the object (in addition to the number of space dimension). "ElmB2n1D": Element of box shape, with 2 nodes, in 1D. This is the same element as "ElmTensorProd1" in 1D or "ElmTensorProd" in 1D with linear underlying one-dimensional basis functions. However, the implementation is much more efficient; in 1D cases "ElmTensorProd" sets up a lot of loops of unit length, while "ElmB2n1D" computes the two basis functions straightforwardly. In CPU intensive applications one should therefore avoid the general, but sometimes very convenient, "ElmTensorProd" family of elements and instead use the specialized implementations such as "ElmB2n1D". "ElmB4n2D": Another specialization of "ElmTensorProd" or "ElmTensorProd1": Element of box shape, with 4 nodes, in 2D - that is, the standard bilinear quadrilateral element. The implementation of "ElmB4n2D" is much more efficient than the general class "ElmTensorProd" (or "ElmTensorProd1"), see the comments under the "ElmB2n1D" element. "ElmB9n2D": Another specialization of "ElmTensorProd" or "ElmTensorProd2": Element of box shape, with 9 nodes, in 2D. "ElmB8n2D": Eight node, quadrilateral element (as "ElmB9n2D", but without the internal node). "ElmB8n3D": A specialization of "ElmTensorProd" and "ElmTensorProd1" in 3D: The standard 8 node trilinear brick element. Again this implementation is more efficient than the "ElmTensorProd" code, see comments under "ElmB2n1D". "ElmT3n2D": Element of triangular shape, with 3 nodes, in 2D. "ElmT4n3D": The standard tetrahedra (linear) element with 4 nodes in 3D. For example, if the element is of bilinear type, "getElmType" will return ""ElmB4n2D"" (or the equivalent ""ElmTensorProd"", depending on what was set using the "setElmType" function or specified in the file or set by a preprocessor). Consult the "ElmDef" hierarchy to see what types of elements that are supported. In many cases all elements are of the same type, and "setElmType" needs to be called only once. If all elements are isoparametric, the geometry element type is sufficient in all instances for determining the type of finite element. If there are non-isoparametric elements in the mesh, class "BasisFuncGrid" defines the nodes for the trial functions and overrides many of the functions in class "GridFE". In particular, the element type is redefined in "BasisFuncGrid" if there are non-isoparametric elements. The element type in "GridFE" then reflects the type of element geometry, not the type of the basis functions used for expanding unknown fields in the PDEs. |
|
|
See documentation of one of the overloaded constructor. |
|
|
|
|
|
makes it possible to mark new nodes with one of the exisiting boundary indicators. New nodes are given as a hypercube domain, usually collapsing to a line or surface, and the function will process all nodes that are inside this domain. Here is an example of an input string to the function.
"n=2 b1=[0,0]x[1,1] b4=[1,4]x[2,2]"
"n=2 b1=B[0,0]x[1,1] b4=B[1,4]x[2,2]"
The main application of this routine is when simple indication of boundary indicators were made in the preprocessor and you want to introduce another marking of boundary nodes. For example, only the different sides of the domain were marked by the preprocessor, and the user wants to assign boundary conditions to single nodes or to parts of a side. Often the "redefineBoInds" function is called first to extend or reduce the number of indicators. The new indicators can then be filled using "addBoIndNodes." It can often be convenient to introduce an indicator that is not used in computations, but only for marking the (whole) boundary. This makes it easier to use the capital B option in front of the hypercubes (the boundary is then already marked, and "addBoIndNodes" sets correct additional markers for computational purposes). (In the input string, the first "=", the "b" and the "=" are the significant characters, strange errors may occur if these characters are missing). The final argument, "bool add", can be given "false" or "OFF" as value. In that case the indicators are turned off instead of on. Often one must make two calls to "addBoIndNodes", first turning some indicators on and then turning other indicators off at the same part of the boundary. |
|
|
See documentation of one of the overloaded functions. |
|
|
enables the user to give a hypercube and assign a material number to all the elements that have their centroid inside this hypercube. The syntax of the input string is:
"no=2 [0,2]x[-1,1]
In another version of "addMaterial" a polygon is used as input. All elements with its centroid inside the polygon is set to the given material number. The points defining the polygon is given as a "MatSimple" matrix where the first and second columns define the x and y coordinates of the polygon. The points in the polygon should be given in a counter clockwise direction and the curve has to be closed, i.e. the first and last element coincide. The routine is mainly meant for 2D grids, but works also in 3D; the polygon then defines a cylinder region. The "addMaterial" returns the number of elements which are reset in the routine. |
|
|
|
|
|
enables attachment of other "Indicators" objects for this grid, e.g., when using a single grid for solving different PDEs (each PDE problem may have its associated set of boundary indicator information stored in an "Indicators" structure). |
|
|
attach a scaling of the spatial coordinates. Reimplemented from GridWithPts. |
|
|
returns "true" if indicator "ind" is on in at least one node. |
|
|
See documentation of one of the overloaded functions. |
|
|
returns "true" if a given node is marked with a particular boundary indicator. There is an overloaded instance of this function that returns "true" if the node is marked with any boundary indicator. |
|
|
See documentation of one of the overloaded functions. |
|
|
returns "true" if any node in an element is marked with a particular boundary indicator. There is an overloaded instance of this function that returns "true" if any node in the given element is marked with any boundary indicator. |
|
|
returns "true" if ALL nodes on a particular side in an element are marked with a particular boundary indicator. The function is often used for determining whether surface integrals over an element are to be computed or not. However, the testing inside the function is quite comprehensive. If the user is willing to store extra information, one can call
grid.additional_info.initSideIndicators (grid);
|
|
|
See documentation of one of the overloaded functions. |
|
|
returns access to the "Indicators" data structure that holds the boundary indicator information. |
|
|
calculates the max and min corrdinates of a hypercube, with axis parallell to the coordinate axis, that contains the element in the interior. |
|
|
computes the bandwidth associated with the mesh (and one unknown at each node). The bandwidth to be returned is computed is the maximum difference between global node numbers in the same element, plus 1. Reimplemented in GridFEAdB. |
|
|
a function that calculates a tolerance value based on the minimum element size in the grid divided by the argument "div_factor". The default value of "div_factor" is 100. The computed tolerance is useful when deciding if two nodes are equal. |
|
|
turns off a particular boundary indicator at a node ("OFF" mode). |
|
|
|
|
|
see documentation of the function "nodeCoupling". Reimplemented in GridFEAdB. |
|
|
initializes the coordinates of all nodes (usually this function is used to set all coordinate values to zero prior to the computation of a grid). |
|
|
See documentation of one of the overloaded functions. |
|
|
given a global space point, the routine finds the element containing this point and the coordinates of the point in the local element coordinate system. This is an essential procedure for finite element interpolation at an arbitrary spatial point. The "findElmAndLocPt" function is typically used in "FieldFE valuePt." There are two versions of the function, the difference being that one of the functions checks if the point is a node and computes the node number in that case. There are two optional arguments for returning the number of Newton iterations and the final ""error"" of the inverse isoparametric mapping. The two arguments are pointers and the data are returned only if the pointers are nonzero at input. "NULL" is the default value of these pointer arguments. The "findElmAndLocPt" function calls a very efficient algorithm ("findElmAndLocPtLatt") in case of a lattice grid, and a more complicated and somewhat less efficient algorithm ("findElmAndLocPtFE") in the general case (unstructured meshes). In the version of "findElmAndLocPt" that checks if the point is a node, there is an optional argument "bool force_element_search". If "force_element_search" is "false", the function will only return the node number if the global point is a node in the grid. If the global point is not a node, it will return the element and local point information as usual. If "force_element_search" is "true", element and local point information will always be found, and if the global point is a node in the grid, the node parameter contains that node number of the grid. |
|
|
the version of "findElmAndLocPt" when the grid is a general finite element grid. |
|
|
the version of "findElmAndLocPt" when the grid is a lattice grid (localizing the point is then very efficient). |
|
|
Reimplemented from Grid. |
|
|
gets the name of a boundary indicator. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
get the coordinates of a node. There are several overloaded versions. |
|
|
gets the coordinates of all nodes in an element. |
|
|
gets the element geometry type (a string is returned containing the name of the element, where the name is the name of a subclass in the "ElmDef" hierarchy. |
|
|
See documentation of one of the overloaded functions. |
|
|
as "getLocalCentroid", the coordinates are computed with respect to the global, physical coordinate system. |
|
|
returns the mean of the nodal coordinates in an element. |
|
|
|
|
|
returns access to a "GridLattice" object contained in the "GridFE" object (if the finite element grid is regular with uniform spacing). Call "isLattice" first to ensure that the grid really is a lattice. If "isLattice" returns "false", "getLattice" returns actually a reference to a "NULL" pointer. What can you do with the "getLattice" function? If you know that your finite element grid is actually a rectangular or box shaped grid with uniform partition, you can operate on the finite element grid object as if it were a finite difference type of grid. For example, the spacing in the x-direction is easily available as "grid.getLattice().Delta(1)" if "grid" is of type "GridFE". Similarly, the number of nodes in the y-direction is available as "grid.getLattice().getDivisions(2)+1". You can easily index nodes by an integer tuple, like in finite difference methods. |
|
|
return the coordinates of the centroid of the element in the local element coordinate system. |
|
|
returns the coordinates of the local node of the element in the local element coordinate system. |
|
|
gets the material number of an element. |
|
|
gets the the maximum number of nodes in any element in the mesh. |
|
|
returns the surrounding hypercube for the grid. See the base class "Grid". Reimplemented from GridWithPts. |
|
|
|
|
|
Reimplemented in GridFEAdB. |
|
|
|
|
|
|
|
|
|
|
|
gets the number of nodes in an element. |
|
|
|
|
|
returns the number of nodes. It is fully equivalent to "getNoNodes", but it is needed since the base class "GridWithPts" specifies "getNoPoints" as a virtual function. Reimplemented from GridWithPts. |
|
|
returns the number of space dimensions associated with the grid. Reimplemented from GridWithPts. |
|
|
returns the mapping used for the grid renumbering imposed by one of the algorithms in the "RenumUnknowns" class hierarchy. If no renumbering has taken place, the returned vector is the identity mapping 1,2,...,n. The flag "identity" is true if the returned mapping is the identity, otherwise it is false. |
|
|
|
|
|
returns a true value if the grid is uniform. Our definition of uniform is given in the documentation of the "setUniformMesh" function. |
|
|
tests if a point is inside the polygon. It returns 0 if the point is outside the polygon, 1 if inside and, 2 if the point is on the border. |
|
|
returns "true" if the "GridFE" object is a regular lattice with uniform spacing and multi-linear elements (for example produced by a "PreproBox" preprocessor). A "true" value from this function makes it safe to call "getLattice" to get the corresponding "GridLattice" object that describeds the lattice. NOTE: If the user has made the grid by the "scanLattice" function or the "PreproBox" preprocessor, and later moved the coordinates using "putCoor", the grid is no longer a lattice, but "isLattice" will return "true." Never use "putCoor" for this purpose! Try to use the safer "move" functions when transforming the grid coordinates. The "move" function will ensure that "isLattice" returns "false" if a lattice grid has been deformed. Reimplemented in GridFEAdB. |
|
|
returns a true value if the point given as argument is really a node. If the grid is a lattice, a very efficient algorithm is run. In the general case, one calls "GridWithPts nearestPoint" where all nodal points are compared to the given point. If an equality (with a tolerance) is obtained, there is an exact match and "isNode" returns the number of the actual node. If the return value is 0, there is no exact match and the point is not a node. |
|
|
returns a true value if the given node is a node in the specified element. |
|
|
performs a more thorough check that the grid is really a lattice. Not yet implemented; the function now just calls "isLattice". |
|
|
indicates that the grid is to be changed and that the grid must be stored on the grid file (see class "SimResFile" or class "FieldWriter") next time a field referencing this grid is dumped to file. The function is typically used when the grid is moved or refined. Reimplemented from Grid. |
|
|
given a local node number in an element, the function returns the corresponding global number of that node. |
|
|
Reimplemented in GridFEAdB. |
|
|
Reimplemented in GridFEAdB. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
displaces the grid according to a vector field (displacement) and a scale factor. Used for moving mesh problems. Can also be used for plotting a deformed mesh in, e.g., elasticity problems. Then the scale factor should be determined from the size of the grid - "getMinMaxCoord" - and the size of the maximum nodal displacement vector. Other overloaded versions of "move" enable transformations of the grid coordinates by means of a nodal coordinate vector, another grid object and a vector field represented by explicit functions. Always use "move" and not "putCoor" to transform the coordinates of a grid after the grid is initially made - "move" is much safer. |
|
|
a local variant of "GridWithPts nearestPoint"; it just calls that function. The reason to include "nearestPoint" as a member function, is that "GridWithPts" defines the function to be virtual, but provides no default version (a general static function requiring a coordinate array for the grid points is offered and it is this function that is called from "GridFE nearestPoint"). The function returns the node number that is closest to "point". The "distance" parameter reflects the distance between the nearest node/point and the "point". The "exact" variable is true at return if "point" is a node. Reimplemented from GridWithPts. |
|
|
given an integer array "old2new", this function renumbers the nodes such that old node number "i" is assigned the number "old2new(i)". Reimplemented in GridFEAdB. |
|
|
See documentation of one of the overloaded functions. |
|
|
after having called "startIterator" one can call "nextPt" to compute the ""next"" grid point. The grid point is given and returned as an argument to the function. When "nextPt" returns "false" there are no more points in the grid. The function is useful if it is desired to find the possible values of an explicit function over the grid (loop through all grid points and compute the maximum and minimum values). Reimplemented from GridWithPts. |
|
|
this function, together with "constraintCouplings" determine the coupling of nodes in the grid, that is, they constitute the basis for computing the sparsity pattern. (Used by the "makeSparsityPattern" routines in the "DegFreeFE" file). |
|
|
determines whether two grids are equal. A safe procedure may be very time consuming as it requires comparison of all nodes in the two grids. The parameter "check_level" reflects the amount of data that is compared. The value 1 implies a test on the address of the two grid objects. Using such a criterion may result in a true return value although the two grids are physically equal (they only correspond to two copies). The default value is 2 for "check_level" which means that the number of nodes and elements are compared. A value of 3 performs a comparison of nodal coordinates (the only safe procedure). Reimplemented in GridFEAdB. |
|
|
Reimplemented in GridFEAdT. |
|
|
|
|
|
|
|
|
|
|
|
prints the grid. Reimplemented from Grid. Reimplemented in GridFEAdB. |
|
|
|
|
|
|
|
|
assigns a name to a boundary indicator. |
|
|
See documentation of one of the overloaded functions. |
|
|
assigns coordinate values to a node. This function is primarily aimed at preprocessor algorithms and should not be used in moving grid problems (in the latter case one should apply the "move" functions which are safer than "putCoor", see the comments above on deforming/moving grids). |
|
|
used for setting the global node number of a local node in an element. |
|
|
makes it possible to redefine the boundary indicators, that is, define a mapping between old and new boundary indicators. Assume that we have three boundary indicators and that we want to map these three indicators over to a new set of four indicators. The new indicator 1 consists of nodes subjected to old indicator 1 or 3, the new indicator 2 should be empty, the new indicator three is identical to old indicator three, while the new indicator four should consist of all the old indicators. Let the names of the new indicators be "green", "blue", "red" and "black." The mapping is defined by the following string which can be sent as argument to "redefine".
nbind=4, names= green blue red black 1=(1 3) 2=() 3=(3) 4=(1 2 3)
=4 =green blue red black (1 3 ()(3)(1) 2 3)
|
|
|
sets new dimensions of the internal data structure in the object. It is necessary to call "redim" if the number of nodes or elements has changed. All old values in the grid object will be erased after a call to "redim" so a complete new initialization is required. |
|
|
makes a simple refinement of the grid if it was created by a box preprocessor using multi-linear elements, or if it was made by a call to "scanLattice" or "operator=(const GridLattice &)". The new grid is made by "operator=(const GridLattice &)". This means that the element type will be, e.g., "ElmB4n2D" in 2D even if the original type was "ElmTensorProd1". The default boundary indicators should be intact (if they have been adjusted, a warning is issued and one must remember to re-adjust the indicators). Note that this function gives an error message if the grid is not a lattice (to avoid such messages, you can simply test on "isLattice" before you call "refineIfBox"). The argument to "refineIfBox" reflects the refinement factor in each space direction. For example, if the refinement factor is (2,2,2) in a 3D grid, the partition in each space direction is increased by a factor of two (the mesh size is halved). For non-trivial refinements of finite element grids, we refer to the classes "GridFEAdT" and "GridFEAdB". |
|
|
Reimplemented from GridWithPts. |
|
|
reads the grid from an input source. "scan" reads what "print" prints. Reimplemented from Grid. |
|
|
|
|