Class MeshStd

Inheritance Relationships

Base Type

Class Documentation

class Mechatronix::MeshStd : public Mechatronix::MeshGeneric<SegmentBase>

Standard mesh.

Public Types

typedef SegmentBase SegmentClass

Public Functions

inline explicit MeshStd(string const &name)

build an empty mesh

void setup(GenericContainer const &gc)

Build the mesh reading the data from the associative array vars. The associative array is composed by the pair [string - value]. It must contains

n: the number of elements of the mesh s0: the initial coordinate of the mesh elements: vector of hash with Length: the length of the mesh elements gridSize: the size of the cells of the corresponding elements

for example a simple mesh can be constructed with the following code

GenericContainer gc;
map_type & m = gc.set_map();
m["n"]  = 1;
m["s0"] = 0;
vector_type & segments = m["segments"].set_vector();
map_type    & S0       = segments[0].set_map_real();
S0["length"]   = 10;
S0["gridSize"] = 0.1;
theMesh.setup( gc );