dynLattice
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
MilneDeviceModule Class Reference

Module implementing Milne's device predictor-corrector method. More...

#include "MilneDeviceModule.h"

Inheritance diagram for MilneDeviceModule:
Inheritance graph
[legend]
Collaboration diagram for MilneDeviceModule:
Collaboration graph
[legend]

Public Member Functions

 MilneDeviceModule (const String &name="MilneDevice")
 Constructor.
 
virtual void solve (const Properties &info, const Properties &globdat) override
 Solve using Milne's device predictor-corrector method.
 
virtual ~MilneDeviceModule ()
 Destructor.
 
- Public Member Functions inherited from ExplicitModule
virtual Status init (const Properties &conf, const Properties &props, const Properties &globdat) override
 Initialize the module.
 
virtual void shutdown (const Properties &globdat) override
 Shutdown the module.
 
virtual void configure (const Properties &props, const Properties &globdat) override
 Configure the module from properties.
 
virtual void getConfig (const Properties &props, const Properties &globdat) const override
 Get current module configuration.
 
virtual void advance (const Properties &globdat) override
 Advance to next time step.
 
virtual void cancel (const Properties &globdat) override
 Cancel current solution attempt.
 
virtual bool commit (const Properties &globdat) override
 Compute next step size and commit solution.
 
virtual void setPrecision (double eps) override
 Set convergence precision.
 
virtual double getPrecision () const override
 Get current convergence precision.
 

Static Public Member Functions

static Ref< Module > makeNew (const String &name, const Properties &conf, const Properties &props, const Properties &globdat)
 Factory method for creating new MilneDeviceModule instances.
 
static void declare ()
 Register MilneDeviceModule type with ModuleFactory.
 

Static Public Attributes

Property identifiers
static const char * TYPE_NAME = "MilneDevice"
 Module type name.
 
- Static Public Attributes inherited from ExplicitModule
static const char * TYPE_NAME = "Explicit"
 Module type name.
 
static const char * STEP_COUNT = "stepCount"
 Step count property.
 
static const char * SO3_DOFS = "dofs_SO3"
 SO(3) DOF types property.
 
static const char * LEN_SCALE = "lengthScale"
 Length scale property.
 
static const char * MASS_MATRIX = "explicitMass"
 globdat key of the published mass matrix
 

Protected Member Functions

Vector updForce (const Vector &fint, const Vector &fext, const Properties &globdat)
 Update forces for corrector step.
 
- Protected Member Functions inherited from ExplicitModule
 ExplicitModule (const String &name="")
 Protected constructor.
 
virtual ~ExplicitModule ()
 Protected destructor.
 
void updateMass_ (const Properties &globdat)
 Update mass matrix.
 
void invalidate_ ()
 invalidate_ current state
 
void evalCommittedForce_ (const Properties &globdat)
 Evaluate the internal force at the committed state.
 
void publishCommittedForce_ (const Properties &globdat)
 Publish the internal force of the committed state in globdat Not compatible with TangentOutputModule. With a consistent mass a reference to the mass matrix of the finished step is published as well (MASS_MATRIX), so that output modules can evaluate the gyroscopic force on demand (GET_GYRO_VECTOR); the solver itself does not use it.
 
void dropCommittedForce_ (const Properties &globdat)
 Remove the published forces again (they are no longer valid)
 
void updRotMask_ ()
 Rebuild the rotational DOF mask from rdofs_.
 
void ABupdate (const Vector &delta_y, const Vector &f_cur, const Vector &f_old) const
 Adams-Bashforth 2-step update.
 
void ABupdate (const Vector &delta_y, const Vector &f_cur) const
 Adams-Bashforth 1-step update (explicit Euler)
 
void updateVec (const Vector &y_new, const Vector &y_old, const Vector &delta_y, const bool rot=false)
 Update displacement vectors with optional SO(3) handling.
 
void getAcce (const Vector &a, const Ref< Constraints > &cons, const Vector &fres, const Properties &globdat)
 Get acceleration and return resulting force vector.
 
Vector getForce (const Vector &fint, const Vector &fext, const Properties &globdat)
 Get force vector.
 
double getQuality (const Vector &y_pre, const Vector &y_cor)
 Get solution quality measure.
 

Additional Inherited Members

- Public Types inherited from ExplicitModule
enum  MassMode { LUMPED , CONSISTENT }
 Mass matrix formulation modes. More...
 
- Protected Attributes inherited from ExplicitModule
bool valid_
 State validity flag.
 
bool fintCacheValid_
 True between commit and the next state change.
 
Vector fintCache_
 Internal force (without gyroscopic term) at the committed state.
 
Vector fintCacheDisp_
 Displacements the cached force belongs to.
 
double dtime_
 Current time step size.
 
double prec_
 Precision tolerance.
 
double minDtime_
 Minimum time step size.
 
double maxDtime_
 Maximum time step size.
 
double saftey_
 Safety factor for step size control.
 
double incrFact_
 Step size increase factor.
 
double decrFact_
 Step size decrease factor.
 
MassMode mode_
 Mass matrix mode.
 
idx_t order_
 Integration order.
 
double lenScale_
 Characteristic length scale.
 
Ref< Function > updCond_
 Update condition function.
 
Vector massInv_
 Inverse mass matrix.
 
IdxVector dofsSO3_
 SO(3) DOF type indices.
 
IdxMatrix rdofs_
 Rotational DOF mapping.
 
BoolVector isRotDof_
 Mask of rotational DOFs (rebuilt with rdofs_)
 
Ref< Model > model_
 Root of the model tree.
 
Ref< DofSpace > dofs_
 Degree of freedom space.
 
Ref< Constraints > cons_
 Constraint manager.
 
Ref< Solver > solver_
 Linear solver.
 

Detailed Description

This module implements Milne's device, a predictor-corrector scheme that combines Adams-Bashforth predictor steps with Adams-Moulton corrector steps for explicit time integration. The method proceeds in three phases:

  1. Predictor step: Uses Adams-Bashforth method to predict state at next time
  2. Corrector step: Uses Adams-Moulton method to correct the prediction
  3. Step size adaptation: Evaluates solution quality for potential step size control

The predictor-corrector approach provides better stability and accuracy compared to simple explicit methods while maintaining computational efficiency. The module supports both first-order (Euler implicit) and second-order (trapezoidal rule) Adams-Moulton correctors.

See also
Milne (1926)

Constructor & Destructor Documentation

◆ MilneDeviceModule()

MilneDeviceModule::MilneDeviceModule ( const String &  name = "MilneDevice")
explicit
Parameters
[in]nameModule name (default: "MilneDevice")

◆ ~MilneDeviceModule()

MilneDeviceModule::~MilneDeviceModule ( )
virtual

Member Function Documentation

◆ declare()

void MilneDeviceModule::declare ( )
static

◆ makeNew()

Ref< Module > MilneDeviceModule::makeNew ( const String &  name,
const Properties &  conf,
const Properties &  props,
const Properties &  globdat 
)
static
Parameters
[in]nameModule name
[out]confActually used configuration properties (output)
[in]propsUser-specified module properties
[in]globdatGlobal data container
Returns
Reference to new MilneDeviceModule instance

◆ solve()

void MilneDeviceModule::solve ( const Properties &  info,
const Properties &  globdat 
)
overridevirtual
Parameters
[out]infoSolver information (output)
[in]globdatGlobal data container

Performs one time step using predictor-corrector algorithm:

  1. Predict velocities and displacements using Adams-Bashforth
  2. Correct using Adams-Moulton with updated forces
  3. Evaluate solution quality for step size adaptation

Implements ExplicitModule.

◆ updForce()

Vector MilneDeviceModule::updForce ( const Vector &  fint,
const Vector &  fext,
const Properties &  globdat 
)
protected
Parameters
[in,out]fintInternal force vector, modified in place
[in]fextExternal force vector
[in]globdatGlobal data container
Returns
Resulting force vector (external - internal)

In the corrector step, only internal forces change due to updated displacement field, so external forces remain constant

Member Data Documentation

◆ TYPE_NAME

const char * MilneDeviceModule::TYPE_NAME = "MilneDevice"
static