StGermain Component Codex
This is a list of components available in StGermain.
Location:
./StGermain/Base/Context/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
A Context encapsulates the specfic concerns of the application. A way to look at it is that it is where one places all the variables one would typically place as global or on the main in traditional computional programming. The AbstractContext is an abstract representation of this capability from the StGermain perspective.
An AbstractContext implements its five Component phases of Construct, Build, Initialise, Execute and Destroy as EntryPoints. EntryPoints are sites where where functionality can be added. Toolboxes and plugins insert algorithms or alter the control flow by these EntryPoints. An EntryPoint is implemented as a dynamically changeable array of function pointers, which get executed sequentially. Entrypoints can be coarse-grained (“the mesh”, “the solve phase”) or fine-grained (“each particle”, “updating the stress of each particle”). From an aspect oriented programming point of view, these entry points are point cuts on the context concern.
From a software architecture point of view, plugins are a flexible way of adding runtime-configurable extensions to a core application. AbstractContext is standardised interface for StGermain to manage toolboxes and plugins. It is a crucial, low-level component of the framework because it establishes and maintains interconnections between other Codes and their high-level features.
The Context is the first component to start. An AbstractContext goes through a setup phase before proceeding to its run phase. During setup, it goes through build and then initialise function calls. Each step contains entry point, and a hook is positioned there to attach each function call. Following the setup phase, AbstractContext enters the Run phase. It encapsulates timing, stepping through iterations to solve the equation, and collating and saving output.
A note on checkpoints: Checkpoints are places where states of variables are saved.
When using checkpoints, identify which variables to checkpoint and specify the frequency (the number of timesteps between checkpoint event).
You may want to restart from last checkpoint to:
modify parameters at a moment and run from there rather than re-calculating the all timesteps
save the state before a scheduled interruption, or for when time-sharing processor/memory resources where a modelling job may take weeks in total to run
save current state if you think it may be a useful point to rollback to, or to resume from after an unscheduled interruption
skip the setup process for frequently performed tasks to save time.
For more information on checkpointing, see the wiki.
Params
| Name | Type | Default | Description |
| outputEvery | Unsigned int | 1 | Specifies how often to output FrequentOutput.dat. 0 means not at all. |
| dumpEvery | Unsigned int | 10 | Specifies how often to output big data dumps (if you use gLucifer, this is when gLufier renders). 0 means not at all. |
| checkpointEvery | Unsigned int | 0 | Specifies how often to output checkpoints (if you use gLucifer, this is when gLufier renders). 0 means not at all. |
| experimentName | String | experiment | Not used by anything at present. |
| outputPath | String | ./ | Specifies the relative path to output and dump into. |
| checkpointPath | String | outputPath | Specifies the relative path to read and write checkpoint files to if checkpointReadPath or checkpointWritePath are not defined. |
| checkpointReadPath | String | checkpointPath | Specifies the relative path to read checkpoint files from when restarting. |
| checkpointWritePath | String | checkpointPath | Specifies the relative path to save checkpoint files to. |
| start | Double | Context specific | The start time of the simulation. |
| startTime | Double | Context specific | Deprecated - see "start". |
| end | Double | Context specific | The end time of the simulation. This will stop the simulation even if the desired number of timesteps have not been reached. |
| stop | Double | Context specific | Deprecated - see "end". |
| maxLoops | Double | 0 | The maximum number of timesteps to run the simulation. If this is a restart from checkpoint, the effective final timestep is the restart timestep timestep plus this value. 0 means no maximum is applied. |
| maxTimeSteps | Double | 0 | Deprecated - see maxLoops. |
| finalTimeStep | Double | 0 | The maximum number of timesteps to run the simulation. 0 means no maximum is applied. |
| restartTimeStep | Double | 0 | The timestep to enforce when loading from a checkpoint. O means ignore this parameter (use "start" time). |
| checkPointPrefixString | String | "" | Prefixes checkpoint filenames. |
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StGermain/Base/Extensibility/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
Codelets are essentially nothing more than Components that are used for encapsulating the concerns/features of a plugin into one object. The plugin registration process expects Codelet to be submitted for addition to the component factory. Codelets are assumed to be instantiated only one (i.e. are singletons) by the system.
A Codelet is an abstract class that is used in the C API and not directly in the XML model description files
Params
| Name | Type | Default | Description |
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StGermain/Base/Automation/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
CompositeVC is used as a container to combine multiple variable conditions.
Example:
Refer to ./StgFEM/Apps/StokesMomentumUzawa/lidDrivenBCs.xml
Params
| Name | Type | Default | Description |
| vcName | String | self->name |
Deprecated; should not be used.
|
| vcList | List | |
A list of other VariableCondition definitions.
|
Dependencies
| Type | Essential | Description | Name | FallbackKey |
| Stg_Component | No |
User defined data in the form of a Stg_Component.
| Data |
Back to top
Location:
./StGermain/Base/Automation/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
DynamicVC provides a mechanism to set and remove variable conditions during run-time.
It is not intended for use through XML, but instead should be instantiated and
manipulated by other components internally.
Params
| Name | Type | Default | Description |
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StgFEM/Discretisation/Utils/src/
Project Web:
http://www.stgermainproject.org/StgFEM.html
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Back to top
Location:
./StGermain/Base/Extensibility/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
LocalPlugin1 (in the unit tests)
dependenices
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StGermain/Base/Automation/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
Selects a definite set of entries from a variable to have a condition
applied.
Params
| Name | Type | Default | Description |
| indexCount | Integer | |
The number of entries in the index set.
|
| indices | List | |
A list of integers representing the indices in the set to be applied to.
|
| variables | List | |
A list of variable structures describing a Variable object to have values set and
the values to apply. Each structure has three parameters: 'name' (the name of the
Variable object), 'type' (the type of the value, either double or func) and 'value'
(for a double this is a number and for a func this is the name of the condition
function).
|
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StGermain/Base/Automation/src/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
An abstract class representing the parent of all Components
Description:
The base class for every other component class in StGermain (and super projects).
Components provide an interface for information to be read from the dictionary and
introduce 'phases' into the system, namely the construction phase, the build phase,
the initialisation phase and the execution phase.
Params
| Name | Type | Default | Description |
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StGermain/Base/Automation/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
Variable makes an association between a defined, textual name and a chunk of data in memory. This data could take the form of a basic type (such as an int or double), or an element of an array, or an entire array or struct. Variable may also index a regular series of non-contiguous locations in memory. This capability to define arbitrary data within a datastructure makes it very powerful.
For example, a Variable can refer to a series of ints in an array with an offset of 1 and a stride of 3. This terminology will be familiar to those who are accustomed with MPI. Once a Variable is defined, it is stored in the Variable Register. Like other Registers of StGermain, it can be accessed by any other Component.
The benefit of using Variable is that it provides access to data without the need for the original source code or linking to the header file. Practically everything you need to use the data is supplied by Variable: the memory location, a name for the data, its type and its size.
When specified throught the XML system, the Variable will actually allocate the memory of the underlying memory variable itself. When used in the C API, the Variable must be passed the underlying memory chunk (but the memory chunk itself need not yet be allocated until just before the Variable undergoes its build phase).
The XML implementation of Variable doesn't allow the specification of complex data types or arrays. For arrays, components such as MeshVariable should be used
Example:
Examples:
XML version / MDF (Model Description File):
Unlike the C usage, MDF automatically handles memory allocation.
Variable
Vector
Double
3
vx
vy
vz
This example create an entry in the variable register of the name "velocity",
which is a vector of 3 double components. Also, 3 more entries into the variable
register will be made, targetting the 3 vector components of "velocity",
named "vx", "vy", "vz".
C version:
Using Variable in C is different to the XML implementation because you need to
do own memory handling.
This example is based on the sourcecode in
~/code/StGermain/Base/Automation/tests/testVariable.c
/* Construct phase */
double* velocity;
Variable_NewVector("velocity",
Variable_DataType_Double,
3,
amp;aSize[1],
(void**)amp;velocity,
vr,
"vx",
"vy",
"vz");
/* Build phase*/
velocity = malloc(...);
component_Build(v);
A general form of the C version:
Variable_NewVector(name,
type,
length,
array size,
data array,
variable register,
[optional: list of names of array items]);
Params
| Name | Type | Default | Description |
| DataType | [Double,Float,Int,Char,Short] | None - not specifying causes an error | Specifies the fundamental data type of the variable. |
| Rank | [Scalar,Vector] | None - not specifying causes an error | Specifies whether the variable is of a vector not. If it is of a vector, VectorComponentCount and names is used to specify the number of vector subcomponents and the name of the variables to create for each component. |
| VectorComponentCount | UnsignedInt | 0 | The count of subcomponents inside this Variable that are also to become variables. |
| names | list | (empty) | The list of textual names for the subcomponents if this variable. A good example is a Variable named velocity which has the subcomponents vx, vy, vz. |
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StGermain/Base/Automation/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
Selects all available entries in a Variable object to have a value
applied.
Params
| Name | Type | Default | Description |
| variables | List | |
A list of variable structures describing a Variable object to have values set and
the values to apply. Each structure has three parameters: 'name' (the name of the
Variable object), 'type' (the type of the value, either double or func) and 'value'
(for a double this is a number and for a func this is the name of the condition
function).
|
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top
Location:
./StGermain/Base/Automation/src/
Project Web:
http://www.stgermainproject.org/
Copyright:
StGermain Framework. Copyright (C) 2003-2005 VPAC.
License:
The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html
Description:
Base class for any concrete variable condition. Defines the interface for
specifying boundary conditions.
Params
| Name | Type | Default | Description |
Dependencies
| Type | Essential | Description | Name | FallbackKey |
Back to top