*SetForce() - single force with user subroutine for command sets

Sets the values for a translational, rotational line of action and single component rotational force when a user-defined subroutine is used to model the force expression.

Syntax

*SetForce(force_name, USER, `expr`)

Arguments

force_name
The variable name of an existing force.
Type: Varname
USER
This argument indicates the user-written subroutine is used to model the force value.
expr
The solver expression that sets the arguments for the user-defined force.
Type: string

Example

*BeginMDL(the_model, "Example model")
*Analysis(the_analysis, "The analysis", andef)
*DefineAnalysis(andef)
*ActionReactionForce(frc_bmp, "Rebound bumper", 
                     TRANS_ROT, 
                     b_bmp_contact, 
                     b_bmp_attach, 
                     p_contact,
                     mrk_ref)
  *SetForce(frc_bmp, USER, `USER( { frc_bmp.id, %d }, 
                                  { frc_bmp.i.id, %d } , 
                                  { cr() },`
                                  { frc_bmp.j.id, %d }, 
                                  { frc_bmp.rm.id, %d }, -10)`)
  *CommandSet(the_commandset, "Simple command set", evdef, frc_0, tpl_begin, tpl_end)
  *Template(tpl_begin, "Begin template", USER, tpldef_commandset_begin)
  *Template(tpl_end, "End template", USER, tpldef_commandset_end)
  *Template(tpl_superfluous, "Should be ignored", ACF, tpldef_commandset_begin)
*EndDefine()
*DefineCommandSet(evdef, local_frc_0, local_tpl_begin, local_tpl_end)
  *Write(local_tpl_begin)
  *SetForce(frc_bmp, USER, `USER( { frc_bmp.id, %d }, 
                                  { frc_bmp.i.id, %d } , 
                                  { cr() },`
                                  { frc_bmp.j.id, %d }, 
                                  { frc_bmp.rm.id, %d }, -20)`)
  *Write(local_tpl_end)
*EndDefine()
*DefineTemplate(tpldef_commandset_begin)
{AbsToRelative(Solver_File_basename.path, Solver_File_basename.value + 
               ".adm")}
PREFERENCES/SIMFAIL=STOPCF
*EndDefine()
*DefineTemplate(tpldef_commandset_end)
STOP
*EndDefine()
*EndMDL()

Context

*BeginMdl()

*DefineAnalysis()

*DefineSystem()

Comments

The solver force entity type is dependent on the force type referred to by the *SetForce() statement.