Loading...
Searching...
No Matches

N-D material point method solver for snow. More...

#include <Core/Solver/Particle/MPM/SnowMPMSolver.hpp>

Inheritance diagram for CubbyFlow::SnowMPMSolver< N >:

Classes

class  Builder
 Front-end to create SnowMPMSolver objects step by step. More...
 
struct  LinearSystem
 
struct  LinearSystemBLAS
 

Public Types

using Base = std::conditional_t< N==2, ParticleSystemSolver2, ParticleSystemSolver3 >
 
using MatrixType = Matrix< double, N, N >
 
using VectorType = Vector< double, N >
 
using SizeType = Vector< size_t, N >
 

Public Member Functions

 SnowMPMSolver (const SizeType &resolution=SizeType::MakeConstant(32), const VectorType &gridSpacing=VectorType::MakeConstant(1.0), const VectorType &gridOrigin=VectorType{}, double radius=1e-3, double mass=1e-3)
 Constructs an empty snow MPM solver.
 
std::shared_ptr< MPMSystemData< N > > GetMPMSystemData () const
 Returns the owned MPM particle and grid state.
 
double GetTimeStepLimitScale () const
 Returns the scale applied to adaptive time-step limits.
 
void SetTimeStepLimitScale (double newScale)
 Sets the adaptive time-step scale in (0, 1].
 
bool GetIsUsingSemiImplicit () const
 Returns whether the elastic grid update is semi-implicit.
 
void SetIsUsingSemiImplicit (bool isUsing)
 Enables or disables the semi-implicit elastic grid update.
 
unsigned int GetMaxNumberOfIterations () const
 Returns the maximum conjugate-residual iteration count.
 
void SetMaxNumberOfIterations (unsigned int maxNumberOfIterations)
 
double GetTolerance () const
 Returns the relative conjugate-residual tolerance.
 
void SetTolerance (double tolerance)
 Sets the positive finite tolerance relative to the initial residual.
 
unsigned int GetLastNumberOfIterations () const
 Returns the iteration count from the last semi-implicit solve.
 
double GetLastResidual () const
 Returns the relative residual from the last semi-implicit solve.
 
int GetClosedDomainBoundaryFlag () const
 Returns the closed domain boundary flag.
 
void SetClosedDomainBoundaryFlag (int flag)
 Sets the closed domain boundary flag.
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns a builder for SnowMPMSolver.
 

Protected Member Functions

void OnInitialize () override
 Initializes particle-grid state before the first adaptive step query.
 
unsigned int GetNumberOfSubTimeSteps (double timeIntervalInSeconds) const override
 Returns the number of adaptive sub-time-steps.
 
void AccumulateForces (double timeStepInSeconds) override
 Snow forces are integrated on the background grid.
 
void OnBeginAdvanceTimeStep (double timeStepInSeconds) override
 Advances particle-grid snow state before base particle integration.
 
void OnEndAdvanceTimeStep (double timeStepInSeconds) override
 Projects particles back into selected closed domain boundaries.
 

Detailed Description

template<size_t N>
class CubbyFlow::SnowMPMSolver< N >

N-D material point method solver for snow.

Uses fixed-corotated elastoplastic snow response with the existing MPM particle-grid transfers and particle-solver collision lifecycle. When semi-implicit integration is enabled, failures are reported before particle state is advanced.

Exceptions
std::runtime_errorIf the semi-implicit linear solve does not converge or produces a non-finite result.
std::invalid_argumentIf the constitutive state or its stress differential is invalid or non-finite.

Member Typedef Documentation

◆ Base

template<size_t N>
using CubbyFlow::SnowMPMSolver< N >::Base = std::conditional_t<N == 2, ParticleSystemSolver2, ParticleSystemSolver3>

◆ MatrixType

template<size_t N>
using CubbyFlow::SnowMPMSolver< N >::MatrixType = Matrix<double, N, N>

◆ SizeType

template<size_t N>
using CubbyFlow::SnowMPMSolver< N >::SizeType = Vector<size_t, N>

◆ VectorType

template<size_t N>
using CubbyFlow::SnowMPMSolver< N >::VectorType = Vector<double, N>

Constructor & Destructor Documentation

◆ SnowMPMSolver()

template<size_t N>
CubbyFlow::SnowMPMSolver< N >::SnowMPMSolver ( const SizeType resolution = SizeType::MakeConstant(32),
const VectorType gridSpacing = VectorType::MakeConstant(1.0),
const VectorType gridOrigin = VectorType{},
double  radius = 1e-3,
double  mass = 1e-3 
)
explicit

Constructs an empty snow MPM solver.

Member Function Documentation

◆ AccumulateForces()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::AccumulateForces ( double  timeStepInSeconds)
overrideprotected

Snow forces are integrated on the background grid.

◆ GetBuilder()

template<size_t N>
SnowMPMSolver< N >::Builder CubbyFlow::SnowMPMSolver< N >::GetBuilder ( )
static

Returns a builder for SnowMPMSolver.

◆ GetClosedDomainBoundaryFlag()

template<size_t N>
int CubbyFlow::SnowMPMSolver< N >::GetClosedDomainBoundaryFlag ( ) const

Returns the closed domain boundary flag.

◆ GetIsUsingSemiImplicit()

template<size_t N>
bool CubbyFlow::SnowMPMSolver< N >::GetIsUsingSemiImplicit ( ) const

Returns whether the elastic grid update is semi-implicit.

◆ GetLastNumberOfIterations()

template<size_t N>
unsigned int CubbyFlow::SnowMPMSolver< N >::GetLastNumberOfIterations ( ) const

Returns the iteration count from the last semi-implicit solve.

◆ GetLastResidual()

template<size_t N>
double CubbyFlow::SnowMPMSolver< N >::GetLastResidual ( ) const

Returns the relative residual from the last semi-implicit solve.

◆ GetMaxNumberOfIterations()

template<size_t N>
unsigned int CubbyFlow::SnowMPMSolver< N >::GetMaxNumberOfIterations ( ) const

Returns the maximum conjugate-residual iteration count.

◆ GetMPMSystemData()

template<size_t N>
std::shared_ptr< MPMSystemData< N > > CubbyFlow::SnowMPMSolver< N >::GetMPMSystemData ( ) const

Returns the owned MPM particle and grid state.

◆ GetNumberOfSubTimeSteps()

template<size_t N>
unsigned int CubbyFlow::SnowMPMSolver< N >::GetNumberOfSubTimeSteps ( double  timeIntervalInSeconds) const
overrideprotected

Returns the number of adaptive sub-time-steps.

◆ GetTimeStepLimitScale()

template<size_t N>
double CubbyFlow::SnowMPMSolver< N >::GetTimeStepLimitScale ( ) const

Returns the scale applied to adaptive time-step limits.

◆ GetTolerance()

template<size_t N>
double CubbyFlow::SnowMPMSolver< N >::GetTolerance ( ) const

Returns the relative conjugate-residual tolerance.

◆ OnBeginAdvanceTimeStep()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::OnBeginAdvanceTimeStep ( double  timeStepInSeconds)
overrideprotected

Advances particle-grid snow state before base particle integration.

◆ OnEndAdvanceTimeStep()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::OnEndAdvanceTimeStep ( double  timeStepInSeconds)
overrideprotected

Projects particles back into selected closed domain boundaries.

◆ OnInitialize()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::OnInitialize ( )
overrideprotected

Initializes particle-grid state before the first adaptive step query.

◆ SetClosedDomainBoundaryFlag()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::SetClosedDomainBoundaryFlag ( int  flag)

Sets the closed domain boundary flag.

◆ SetIsUsingSemiImplicit()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::SetIsUsingSemiImplicit ( bool  isUsing)

Enables or disables the semi-implicit elastic grid update.

◆ SetMaxNumberOfIterations()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::SetMaxNumberOfIterations ( unsigned int  maxNumberOfIterations)

Sets the maximum conjugate-residual iteration count. Zero permits only an already-converged solve; any nonzero residual makes the update fail.

◆ SetTimeStepLimitScale()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::SetTimeStepLimitScale ( double  newScale)

Sets the adaptive time-step scale in (0, 1].

◆ SetTolerance()

template<size_t N>
void CubbyFlow::SnowMPMSolver< N >::SetTolerance ( double  tolerance)

Sets the positive finite tolerance relative to the initial residual.


The documentation for this class was generated from the following files: