Diffpack Documentation
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Search
Indicators Class Reference
on/off indicators for a set of items (nodes/elements).
More...
#include <Indicators.h>
Inheritance diagram for Indicators::
List of all members.
Detailed Description
on/off indicators for a set of items (nodes/elements).
NAME: Indicators - on/off indicators for a set of items (nodes/elements)
DESCRIPTION:
The class enables on/off marking of the entries (items) in a set. The most popular use in Diffpack is for marking boundary nodes in finite element meshes. Each boundary node can then be marked with user chosen indicators. Usually, these indicators are used for setting boundary conditions or marking certain parts of the boundary for plotting. The "Indicators" class can also be used for marking elements, e.g., defining subregions of a grid in domain decomposition methods. We use 'item' as a term in the documentation of this class, and item can be a node or an element (or other quantities).
The user can define (in terms "Indicators") a set of indicators and give names to these.
Class "Indicators" is often usually used from "GridFE" objects. In that case there is no need for a programmer to operate on "Indicators" objects directly. However, if one wants to have several sets of boundary conditions (indicators) for a single "GridFE" object, e.g. when systems of PDEs are solved, one can have a vector of "Indicators" objects and set the indicators in the "Indicators" entries of this vector. Each entry can be attached to the "GridFE" object.
Constructor & Destructor Documentation
|
Indicators::Indicators (
|
)
|
|
|
|
There is one constructor without arguments. If this is used, the "redim" function must later be called. The other constructor is simply a call to the "redim" function. After the internal data structure is redimensioned, it must be filled with proper values. The functions "set" and "clear", "redefine, or "operator=" can be used for this purpose. Note that a boundary indicator at a node (or more generally for an item) is either "ON" or "OFF" ("true" or "false"). All the boundary names should also be given string values using the function "putName." |
|
Indicators::Indicators (
|
int nitems_,
|
|
int nind_ ) [inline]
|
|
|
|
See documentation of one of the overloaded constructor. |
|
Indicators::Indicators (
|
const Indicators & b )
|
|
|
|
See documentation of one of the overloaded constructor. |
|
Indicators::~Indicators (
|
) [inline]
|
|
Member Function Documentation
|
void Indicators::clear (
|
int item,
|
|
int ind )
|
|
|
|
sets the indicator for an item to "OFF" value ("false"). |
|
void Indicators::copyNames (
|
const Indicators & b )
|
|
|
|
for an already redimensioned "Indicators" object, this function initializes the names of the indicators by the names in another "Indicators" object. |
|
void Indicators::fill (
|
bool onoff ) [inline]
|
|
|
|
initializes all items and indicators with an "ON" or "OFF" value. |
|
long int Indicators::getCode (
|
int item ) const
|
|
|
|
these functions allow the information about indicators for a given item (node/element) to be condensed in a "long int" according to a particular code. If there are m indicators the code reads 2x1...xm, where x1 to xm are 0 or 1 according to whether an indicator is off or on. For example, 200101 means that there are 5 indicators and for this item the first two are off, the third and fifth are on, and the fourth is off. Some preprocessors require input files where it is difficult to assign separate numbers reflecting the indicators for each boundary node and then the condensed code can be useful. |
|
String Indicators::getName (
|
int ind ) const
|
|
|
|
returns the string containing the name of an indicator. |
|
int Indicators::getNoInds (
|
) const [inline]
|
|
|
void Indicators::grow (
|
int no_of_additional_inds )
|
|
|
|
add new indicators to this object. They are set "OFF" as default and they get the default names "boindX", where "X" is the indicator number. |
|
MatSimple(char) & Indicators::indicatorAccess (
|
) [inline]
|
|
|
static long int Indicators::intersectionCode (
|
long int code1,
|
|
long int code2 ) [static]
|
|
|
|
determines the intersection of two set of boundary indicators, represented as 2001001-type of codes (see "setCode", "getCode"). The function is typically used when assigning boundary indicators to points along a segment, where only the boundary indicators at the end points are known. Each point on the segment should have the indicators that are ON at both end points (i.e. it equals the intersection of the two codes). |
|
bool Indicators::ok (
|
) const
|
|
|
bool Indicators::on (
|
int item,
|
|
int ind ) const
|
|
|
|
returns the state ("ON"/"OFF", "true" or "false") of an indicator for an item. |
|
void Indicators::operator= (
|
const Indicators & b )
|
|
|
void Indicators::print (
|
Os os ) const
|
|
|
void Indicators::putName (
|
const String & name,
|
|
int ind )
|
|
|
|
assigns a name to an indicator. |
|
void Indicators::redefine (
|
Is is )
|
|
|
|
makes it possible to redefine the indicators, that is, define a mapping between old and new 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)
The names must be surrounded by blanks, only the two first equality signs and the parenthesis are significant in the scan process (thus the commands nbind, names, 1, 2 and 3 are never checked). Old indicator numbers must be inside parenthesis and separated by blanks. A equivalent string is
=4 =green blue red black (1 3 ()(3)(1) 2 3)
but less readable. |
|
bool Indicators::redim (
|
int nitems,
|
|
int nind )
|
|
|
void Indicators::set (
|
int item,
|
|
int ind )
|
|
|
|
sets the indicator for an item to "ON" value ("true"). |
|
void Indicators::setCode (
|
int item,
|
|
long int code )
|
|
|
static void Indicators::splitDigits (
|
long int number,
|
|
VecSimple(int) & digits ) [static]
|
|
|
|
given an integer "number", the routine extracts each digit from this integer and stores them in an int vector "digits". This is a static general purpose function that can be used in many other contexts. |
Friends And Related Function Documentation
class GridLattice [friend]
|
|
The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.