17 #ifndef AGX_SOLVEALGORITHMS_H
18 #define AGX_SOLVEALGORITHMS_H
28 # pragma warning( push )
29 # pragma warning( disable : 4251 )
117 enum Type { EMPTY, EXIT, SINGLE, GROUP, CUSTOM };
395 # pragma warning( pop )
#define AGXPHYSICS_EXPORT
Algorithm for an island without solve models.
virtual SolveAlgorithm::Task * create(bool useComplexImpactStage) override
Creates tree structure for an empty solver.
EmptySolver(Solver *solver)
Construct empty solver.
virtual ~EmptySolver()
Reference counted.
Algorithm for hybrid solve.
agx::UInt m_numRestingIterations
HybridSolver(agx::Solver *solver)
Construct a hybrid solve algorithm based on a previous solver (use same settings)
virtual SolveAlgorithm::Task * create(bool useComplexImpactStage) override
Creates tree structure of this type of solver.
agx::UInt m_numImpactIterations
agx::UInt m_numDryFrictionIterations
virtual ~HybridSolver()
Reference counted.
agx::UInt m_numPPGSIterations
Utility class used to generate jobs for ALL islands.
agx::UInt m_wrapperJobCounter
agxData::Array< agx::SolveJob > m_solveJobs
JobGenerator(agxData::Array< agx::JobGroup > &wrapperJobs, agxData::Array< agx::SolveJob > &solveJobs)
Construct generator given allocated arrays of group- and solve jobs.
agxData::Array< agx::JobGroup > m_wrapperJobs
agx::JobGroup * getNewWrapperJob(agx::Solver *solver)
Initializes, increments internal counter and returns a new group/wrapper job.
agx::SolveJob * getNewSolveJob()
Increments internal counter and returns a new solve job.
agx::UInt m_solveJobCounter
A group of jobs to be executed.
Pointer to a entity instance of type Physics.SolveGroup.
Pointer to a entity instance of type Physics.SolveIsland.
Algorithm for pure direct solve.
virtual ~PureDirectSolver()
Reference counted.
virtual SolveAlgorithm::Task * create(bool useComplexImpactStage) override
Creates tree structure of this type of solver.
PureDirectSolver(Solver *solver)
Construct pure direct solver.
Algorithm for pure iterative solve.
agx::UInt m_numPPGSIterations
virtual SolveAlgorithm::Task * create(bool useComplexImpactStage) override
Creates tree structure of this type of solver.
virtual ~PureIterativeSolver()
Reference counted.
agx::UInt m_numRestingIterations
agx::UInt m_numImpactIterations
PureIterativeSolver(Solver *solver)
Construct pure iterative solver.
Base class providing referencing counted objects.
Algorithm task either empty, single or group type.
Task(agx::SolveAlgorithm::Task::Type type)
Construct given type.
virtual agx::SolveAlgorithm::Task::Type getType(const agx::SolveAlgorithm::Task::ConditionData &conditionData) const
void addChild(agx::SolveAlgorithm::Task *child)
Add child task.
virtual agx::SolveKernel * getSolveKernel(agx::Physics::SolveGroupPtr group) const
Callback for solve algorithms task type GROUP.
agx::SolveAlgorithm::Task * getParent() const
virtual ~Task()
Reference counted object - protected virtual destructor.
agx::SolveAlgorithm::Task::SolveAlgorithmTaskContainer m_children
agx::SolveAlgorithm::Task::Type m_type
agx::Vector< agx::ref_ptr< SolveAlgorithm::Task > > SolveAlgorithmTaskContainer
Task()
Default constructor, type set to EMPTY.
virtual agx::SolveKernel * getSolveKernel(agx::Solver *solver) const
Callback for solve algorithms task type SINGLE.
virtual void customSetup(Solver *solver, JobGroup *entry, JobGroup *exit)
Type
Task type either EMPTY branch (no callback), EXIT branch (no callback, traversal of this branch will ...
agx::UInt getNumChildren() const
agx::SolveAlgorithm::Task * getChild(agx::UInt i) const
agx::SolveAlgorithm::Task * m_parent
Parent class for solve algorithms compatible with the constraint framework.
virtual void generateJobs(agx::SolveAlgorithm::Task *task, const agx::SolveAlgorithm::Task::ConditionData &conditionData, agx::JobGroup *parentJobGroup, agx::JobGroupPtrVector &dependentJobs, agx::JobGenerator &generator, agx::Physics::SolveIslandPtr island, const agx::Physics::SolveGroupData &solveGroup)
Recursive part of generateJobs.
SolveAlgorithm(Solver *solver)
Protected constructor for pure virtual object.
agx::ref_ptr< SolveAlgorithm::Task > TaskRef
virtual ~SolveAlgorithm()
Reference counted object, protected destructor.
agx::SolveAlgorithm::TaskRef m_root
void calculateNumTasks(const agx::SolveAlgorithm::Task *task, const agx::SolveAlgorithm::Task::ConditionData &conditionData, agx::UInt &numEmptyTasks, agx::UInt &numSingleTasks, agx::UInt &numGroupTasks, agx::UInt &numCustomTasks) const
After create method, this recursive method can be called to pre-calculate the number of types in the ...
agx::Solver * getSolver()
virtual agx::SolveAlgorithm::Task * instantiate()
Initializes a solve algorithm and/or returns the root task.
Type
Solve algorithm type "guessed" by findSolveAlgorithm.
@ EMPTY
Solver for islands with zero models.
@ PURE_DIRECT
Only direct constraints.
@ PURE_ITERATIVE
Only iterative constraints.
virtual agx::SolveAlgorithm::Task * create(bool useComplexImpactStage)=0
Create method called one time during first call to getOrCreateRoot.
static agx::SolveAlgorithm::Type findSolveAlgorithm(agx::Physics::SolveIslandPtr island, UInt numZones)
Static method to find the optimal solve algorithm for an island.
virtual void generateJobs(agx::JobGenerator &generator, const SolveAlgorithm::Task::ConditionData &conditionData, agx::Physics::SolveIslandPtr island, const agx::Physics::SolveGroupData &solveGroup)
Generate jobs given the tree structure built by the implemented solve algorithm.
Vector containing 'raw' data.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< SolveAlgorithm > SolveAlgorithmRef
agx::VectorPOD< agx::JobGroup * > JobGroupPtrVector
The type of tasks may depend on the data in this structure.
agx::Bool calculateResiduals
agx::Bool dryFrictionIterations