fix move/mesh file command
Warning
GPU support for this command has not been tested and may not work as expected.Syntax
fix ID group-ID move/mesh mesh mesh-ID style args keyword values ...
ID is documented in fix command, group-ID is ignored
move/mesh = style name of this fix command
mesh = obligatory keyword
mesh-ID = ID for the fix mesh that the fix move/mesh is applied to
style = file, more options see fix move/mesh
file args = filename time_offset time center_of_rotation cx cy cz filename = name of file containing the movement data one or more keyword/value pairs can be appended
keyword = time_offset or center_of_rotation or use_local_frame_displacement or use_local_frame_rotation or reset_motion_timer
time_offset time = optional keyword time = offset of movement center_of_rotation cx cy cz = optional keyword cx, cy, cz = center of rotation of movement use_local_frame_displacement value = 'yes' or 'no' yes = Use local frame of reference for displacement vector no = Use global frame of reference for displacement vector use_local_frame_rotation value = 'yes' or 'no' yes = Use local frame of reference for rotation axis no = Use global frame of reference for rotation axis reset_motion_timer value 'yes' or 'no' yes = force the motion to start at 0 and not the current simulation time no = start the motion at the current simulation time
Examples
fix move all move/mesh mesh cad1 file move.csv
fix move all move/mesh mesh cad1 file move.csv time_offset 0.1 center_of_rotation 1.0 0. 0.
Description
Perform updates of position and velocity based on movement data read from a file for mesh elements which are part of the fix_mesh_surface with ID mesh-ID using the specified settings or formulas. The fix group is ignored for this command.
The file that contains the movement data should have the following format:
# All lines starting with a '#' are considered as comments and are ignored
# tend, dx, dy, dz, dPhi, axisX, axisY, axisZ
1.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
2.0, 0.0, 0.0, 0.0, 90.0, 0.0, 0.0, 1.0
The file needs to have exactly 8 columns. The first column contains the end time of the movement of the current line. Columns 2-4 contain the linear movement in the specified time interval. Column 5 contains the rotation angle (in degrees) and columns 6-8 the corresponding rotation axis.
In the above example a mesh will move linearly for time 0 <= t <= 1 by (2, 0, 0) and it will not rotate during this time. During time 1 <= t <= 2, the mesh will not move linearly, instead it will be rotated around the z-axis by 90 degrees. It should be noted that the center of rotation is integrated as well. In this case, should it start with (0, 0, 0) at time 0, then at time t = 1 the center of rotation will be located at (2, 0, 0). After reaching the end time specified in the last line the movement will start again from the beginning, creating a “periodic” movement.
If the time_offset keyword is used to specify a certain offset the mesh will be moved during initialization to reach the position it will have at that offset. During the simulation the movement will then continue.
Taking again the above example with a time_offset of 1.0, the mesh would be moved initially by (2, 0, 0) and from time 0 <= t <= 1 the mesh would be rotated.
In order to specify a different initial center of rotation the center_of_rotation keyword can be used. This allows to specify a point that is different from the origin. Note, this point will also be moved if a time_offset is used.
In general all vectors are with respect to the global coordinate system. In case use_local_frame_displacement is set the displacement vector will be with respect to the local reference frame, which rotates with the object. This local frame of reference is equal to the global one initially. Note that using a time offset will move the local reference frame during the initial positioning. The use_local_frame_rotation option is identical to the one for the displacement, except that it applies the coordinate transformation to the rotation axis.
The keyword reset_motion_timer allows to start the trajectory from the beginning of the file, even if the simulation time is not zero. This might be useful if the motion is invoked after loading a restart file from e.g. a filling process. If time_offset is additionally set, the motion will start from the specified time_offset as absolute time value.
Superposition of multiple fix move/mesh commands:
It is possible to superpose multiple fix move/mesh commands. In this case, the reference frame for the second move command moves along as the mesh is moved by the first move command etc. E.g. for style rotate, the origin of the rotation axis would be in local reference frame.
Example: A mesh should rotate around a central axis and additionally revolve around its center of mass. The first move command should be the rotation around the central axis, the second move command the revolution around the center of mass of the mesh.
Restart, fix_modify, output, run start/stop
This fix writes the original coordinates of moving elements to binary restart files, so that the motion can be continuous in a restarted simulation. See the read_restart command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion.
None of the fix_modify options are relevant to this fix.
No parameter of this fix can be used with the start/stop keywords of the run command.
Restrictions
If multiple fix move/mesh movements are superposed onto one mesh, they have to be deleted in reverse order of their creation Mesh elements may not be deleted in case due to leaving the simulation box for a fixed boundary. In this case, an error is generated. See boundary command for details.
Default
time_offset = 0, cx = cy = cz = 0, reset_motion_timer = false