Model.morphshrinkmvols#
- Model.morphshrinkmvols(ccollection, buffer, iface, itermax, uvec, vec)#
Performs one or more iterations of shrinking to the selected morph volumes with the objective of meeting the target buffer percentage regardless of the shape of the mesh.
Two methods are supported: implicit and explicit; and can be set with the
iface. Explicit is the older, slower method which uses externally calculated sensitivities for the interior nodes, and implicit is the newer, faster method which uses internally calculated sensitivities for the interior nodes. After using the intrinsic method, this function should be called withiface = 6to clear the memory allocated for quicker iterations.To perform iterations one at a time, call this function with
itermax=-1for the first iteration and then decrement the value for each subsequent iteration (i.e. -1 first, then -2, -3, etc.). This enables proper convergence while retaining the option to abort the process at any time.Assigning a vector and setting the
uvecflag will restrict the movements of the nodes which define the morph volumes so that they can only move in the direction of the vector. This will apply to all the nodes of the morph volumes.- Parameters:
ccollection (Collection) – The collection containing the entities.
buffer (double) – Percentage buffer zone target.
iface (int) –
0 - extrinsic mode + do not allow inner faces to move.
1 - extrinsic mode + allow inner faces to move.
3 - extrinsic mode + grow faces to full height.
4 - intrinsic mode + do not allow inner faces to move.
5 - intrinsic mode + allow inner faces to move.
6 - intrinsic mode, clear memory allocated (no shrinking is performed).
itermax (int) –
> 0 - The maximum number of iterations allowed
< 0 - One iteration is performed
uvec (int) –
0 - Allow morph volume nodes to move in all directions.
1 - Limit morph volume nodes to move only along vector.
vec (hwTriple) – Vector constraining the movement of morph volume nodes.
Examples#
Shrink all the morph volumes in the model while allow internal face movement and not restrict the movement of the corner nodes for four iterations#import hm import hm.entities as ent model = hm.Model() model.morphshrinkmvols( ccollection=hm.Collection(model, ent.Morphvolume), buffer=10.0, iface=1, itermax=4, uvec=0, vec=[1.0, 0.0, 0.0], )
Shrink all the morph volumes in the model, allow internal face movement and not restrict the movement of the corner nodes, for four consecutive iterations#import hm import hm.entities as ent model = hm.Model() model.morphshrinkmvols( ccollection=hm.Collection(model, ent.Morphvolume), buffer=10.0, iface=1, itermax=0, uvec=0, vec=[1.0, 0.0, 0.0], ) model.morphshrinkmvols( ccollection=hm.Collection(model, ent.Morphvolume), buffer=10.0, iface=1, itermax=-1, uvec=0, vec=[1.0, 0.0, 0.0], ) model.morphshrinkmvols( ccollection=hm.Collection(model, ent.Morphvolume), buffer=10.0, iface=1, itermax=-2, uvec=0, vec=[1.0, 0.0, 0.0], ) model.morphshrinkmvols( ccollection=hm.Collection(model, ent.Morphvolume), buffer=10.0, iface=1, itermax=-3, uvec=0, vec=[1.0, 0.0, 0.0], )