Study Module¶
- class ammorph.study.Study(x0=None, copy=True, partition=None)¶
Study class to handle mesh morphing. This class is the starting point to define a mesh morphing problem.
- Parameters
x0 (array_like, optional) – Array dtype float64 with shape (number_of_nodes, 3) where the first column contains x coordinates, second column the y coordinates and the last column the z coordinates.
copy (bool) – flag if x0 should be copied into the study object. default is True. Otherwise x0 is stored by reference.
partition (array_like, optional) – Studies that have many boundary nodes often cannot be performed without a division into smaller problems. The partition paramter allows to pass mesh partionning information for this purpose. The argument is an array of dtype int32 with the length that is equal to the number of nodes in x0. The coordinates of this array contain the partition number that is assigned to the corresponding node. Example: np.array([0, 1, 1, 0], dtype=np.int) assigns partition 0 to nodes 0 and 3 and partition 1 to nodes 1 and 2.
- add_stage(stage, partitioned=False)¶
Add a stage to the study.
- Parameters
stage ({ ammorph.stage.Stage, ammorph.stage.CompositeStage }) – stage object that is added.
partitioned (bool) – Flag that determines if this stage shall be performed in partitioned mode or not. Default: False
- property csys¶
Returns a sympy.CoordSys3D object for a Euclidean Coordinate System that is used as reference system. A reference to this object is often needed for the instantiation of DeformationHandlers that need information about a reference system they can relate their local coordinate system to.
- Returns
csys – The reference coordinate system object.
- Return type
CoordSys3D
- morph(p_args, p_vals, x_out)¶
Run the study.
- Parameters
p_args ({ tuple, list }) – list with sympy symbols or ammorph.Paramter objects that define the order and meaning of p_vals argument.
p_vals (array_like) – array of dtype float that define the values of the parameters specified in p_args.
x_out (array_like) – array of dtype float64 to write the result of the morphin process.
- property no_of_nodes¶
Returns the number of nodes in the study.
- Returns
no_of_nodes – The number of nodes.
- Return type
int
- set_x0(x0, copy=True)¶
Sets new reference coordinates to the study.
- Parameters
x0 (array_like, optional) – Array dtype float64 with shape (number_of_nodes, 3) where the first column contains x coordinates, second column the y coordinates and the last column the z coordinates.
copy (bool) – flag if x0 should be copied into the study object. default is True. Otherwise x0 is stored by reference.