|
A cuboid box consists of periodic boundaries that can be strain/stress controlled and achieve different deformation modes. User needs to define target stress/strainrate matrix, gain_factor and a boolean parameter isStrainRateControlled to True/False to activate/deactivate strainrate control. More...
#include <StressStrainControlBoundary.h>
Public Member Functions | |
StressStrainControlBoundary () | |
default constructor. More... | |
StressStrainControlBoundary (const StressStrainControlBoundary &b)=default | |
copy constructor. More... | |
virtual | ~StressStrainControlBoundary ()=default |
destructor. More... | |
void | read (std::istream &is) override |
Reads the object's id_ from given istream. More... | |
void | write (std::ostream &os) const override |
Adds object's id_ to given ostream. More... | |
std::string | getName () const override |
Sets the name of the boundary. More... | |
StressStrainControlBoundary * | copy () const override |
Used to create a copy of the object. More... | |
void | checkBoundaryAfterParticlesMove (ParticleHandler &particleHandler) override |
Virtual function that does things to particles, each timestep after particles have moved. More... | |
void | set (const Matrix3D &stressGoal, const Matrix3D &strainRate, const Matrix3D &gainFactor, bool isStrainRateControlled) |
Sets all boundary inputs at once and determines which deformation mode it is, then combine the right boundaries to assemble the cuboid box/domain. More... | |
void | setStrainRate (const Matrix3D &strainRate) |
void | createPeriodicParticles (ParticleHandler &particleHandler) override |
Create the periodic particles after read in from a restart file to attain right information. More... | |
void | checkPeriodicLeesEdwardsBoundariesAfterParticlesMove (ParticleHandler &particleHandler) |
Call the boundary and update them based on the new domain size after the stress-control movement. More... | |
void | determineLengthAndCentre () |
Determine the length in x,y,z and center location of domain. More... | |
void | activateStrainRateControl (const ParticleHandler &particleHandler) |
Activate the strainrate control for particle movement based on user's boolean input. More... | |
void | computeStrainRate () |
Compute the change of strainrate tensor based on the stress difference and then update the tensor. More... | |
void | determineStressControlledShearBoundaries () |
Determines stress-controlled shear Lees-Edwards boundary in x-y direction and normal periodic in z direction. More... | |
void | updateDomainSize () |
Update the domain to new sizes. More... | |
Matrix3D | getStrainRate () const |
Accesses the strainrate tensor. More... | |
Matrix3D | getStressGoal () const |
Accesses the target stress tensor. More... | |
Matrix3D | getGainFactor () const |
Accesses the gainFactor. More... | |
Mdouble | computeStressError () |
double | getIntegratedShift () const |
Public Member Functions inherited from BaseBoundary | |
BaseBoundary () | |
default constructor. More... | |
BaseBoundary (const BaseBoundary &b) | |
copy constructor More... | |
~BaseBoundary () override | |
destructor More... | |
virtual void | createPeriodicParticle (BaseParticle *p UNUSED, ParticleHandler &pH UNUSED) |
Creates a periodic particle in case of periodic boundaries in serial build. More... | |
virtual void | createPeriodicParticles (ParticleHandler &pH UNUSED) |
Creates periodic copies of given particle in case of periodic boundaries. More... | |
virtual void | checkBoundaryBeforeTimeStep (DPMBase *md) |
Virtual function that does things before each time step. More... | |
virtual void | actionsBeforeTimeLoop () |
Virtual function that does something after DPMBase::setupInitialConditions but before the first time step. More... | |
virtual void | modifyGhostAfterCreation (BaseParticle *particle, int i) |
virtual void | writeVTK (std::fstream &file) |
void | setHandler (BoundaryHandler *handler) |
Sets the boundary's BoundaryHandler. More... | |
BoundaryHandler * | getHandler () const |
Returns the boundary's BoundaryHandler. More... | |
Public Member Functions inherited from BaseObject | |
BaseObject ()=default | |
Default constructor. More... | |
BaseObject (const BaseObject &p)=default | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject ()=default |
virtual destructor More... | |
virtual void | moveInHandler (unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (unsigned long id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
void | setGroupId (unsigned groupId) |
unsigned | getGroupId () const |
Private Attributes | |
Matrix3D | stressGoal_ |
Stores the stress value the boundary should attain. More... | |
Matrix3D | strainRate_ |
Matrix3D | gainFactor_ |
bool | isStrainRateControlled_ |
The boolean input, true means switch on the strain rate control for particles affine movements. More... | |
Mdouble | integratedShift_ |
Shift integrated for all the time when using Lees-Edwards Boundary. More... | |
std::vector< LeesEdwardsBoundary > | leesEdwardsBoundaries_ |
std::vector< PeriodicBoundary > | periodicBoundaries_ |
A cuboid box consists of periodic boundaries that can be strain/stress controlled and achieve different deformation modes. User needs to define target stress/strainrate matrix, gain_factor and a boolean parameter isStrainRateControlled to True/False to activate/deactivate strainrate control.
Inherits from BaseObject, combining the PeriodicBoundary and LeesEdwardsBoundary. This boundary takes matrices inputs from user and determine which boundaries should be combined together and therefore achieve different deformation mode: e.g. triaxial, bi-aixial, uni-axial and simple shear. The Lees-Edwards boundary is only activated when there is a target shear stress/strainrate set in the matrix. Note that the same component can only be set in either target stress matrix or strainrate matrix, i.e. if the target shear stress XY is set to a constant, the strainrate_XY has to be set to 0, or just leave it free, it is by default set to 0. Note also there are 9 components in the stress/strainrate tensor but we only support the following components due to the boundary inheritance: XX, YY, ZZ, XY
StressStrainControlBoundary::StressStrainControlBoundary | ( | ) |
default constructor.
constructor, set all the parameters that boundary needs as inputs to zero.
References DEBUG, gainFactor_, integratedShift_, isStrainRateControlled_, logger, Matrix3D::setZero(), strainRate_, and stressGoal_.
Referenced by copy().
|
default |
copy constructor.
|
virtualdefault |
destructor.
void StressStrainControlBoundary::activateStrainRateControl | ( | const ParticleHandler & | particleHandler | ) |
Activate the strainrate control for particle movement based on user's boolean input.
This function activate the strain rate control based on user inputs, it takes only the strainRate_ tensor and move particles based on this tensor, also move boundaries based on the new domain size.
References determineStressControlledShearBoundaries(), BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTimeStep(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMax(), DPMBase::getZMin(), isStrainRateControlled_, periodicBoundaries_, strainRate_, stressGoal_, updateDomainSize(), Vec3D::X, Matrix3D::XX, Matrix3D::XY, Vec3D::Y, Matrix3D::YY, Vec3D::Z, and Matrix3D::ZZ.
Referenced by checkBoundaryAfterParticlesMove().
|
overridevirtual |
Virtual function that does things to particles, each timestep after particles have moved.
This is where the stress-strain control is implemented and the boundary will be checked at each time step to make sure the target stress/strain rate are achieved.
Reimplemented from BaseBoundary.
References activateStrainRateControl(), checkPeriodicLeesEdwardsBoundariesAfterParticlesMove(), computeStrainRate(), determineLengthAndCentre(), BaseBoundary::getHandler(), logger, stressGoal_, Matrix3D::XX, Matrix3D::XY, Matrix3D::YY, and Matrix3D::ZZ.
void StressStrainControlBoundary::checkPeriodicLeesEdwardsBoundariesAfterParticlesMove | ( | ParticleHandler & | particleHandler | ) |
Call the boundary and update them based on the new domain size after the stress-control movement.
This function checks the boundaries after the particles are moved, to serve the stress-control for the following steps.
References leesEdwardsBoundaries_, and periodicBoundaries_.
Referenced by checkBoundaryAfterParticlesMove().
void StressStrainControlBoundary::computeStrainRate | ( | ) |
Compute the change of strainrate tensor based on the stress difference and then update the tensor.
This function is used to compute the new strain rate tensor based on the stress differences between the actual and user set target values.
References gainFactor_, BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTotalStress(), strainRate_, stressGoal_, Matrix3D::XX, Matrix3D::XY, Matrix3D::YY, and Matrix3D::ZZ.
Referenced by checkBoundaryAfterParticlesMove().
Mdouble StressStrainControlBoundary::computeStressError | ( | ) |
|
overridevirtual |
Used to create a copy of the object.
Copy method; creates a copy on the boundary and returns its pointer.
Implements BaseBoundary.
References StressStrainControlBoundary().
|
override |
Create the periodic particles after read in from a restart file to attain right information.
This function is used to create ghost particles such that the stress are calculated correctly after restart from another configuration.
References leesEdwardsBoundaries_, and periodicBoundaries_.
void StressStrainControlBoundary::determineLengthAndCentre | ( | ) |
Determine the length in x,y,z and center location of domain.
This function determines both the length in x,y,z direction and center location of the domain.
Referenced by checkBoundaryAfterParticlesMove().
void StressStrainControlBoundary::determineStressControlledShearBoundaries | ( | ) |
Determines stress-controlled shear Lees-Edwards boundary in x-y direction and normal periodic in z direction.
This function determines the boundary for stress-controlled shear situation. In this case, the Lees-Edwards boundary in x-y directions and normal periodic boundary in z direction are combined together as a cuboid shear box.
References BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTimeStep(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMax(), DPMBase::getZMin(), integratedShift_, isStrainRateControlled_, leesEdwardsBoundaries_, periodicBoundaries_, strainRate_, UNUSED, and Matrix3D::XY.
Referenced by activateStrainRateControl().
|
inline |
|
inline |
References integratedShift_.
|
overridevirtual |
Sets the name of the boundary.
Returns the name of the object class.
Implements BaseObject.
|
inline |
Accesses the strainrate tensor.
References strainRate_.
Referenced by ShearStage::actionsAfterTimeStep(), ShearStage::printTime(), and ShearStage::ShearStage().
|
inline |
|
overridevirtual |
Reads the object's id_ from given istream.
Reads the boundary properties from an istream.
[in] | is | the istream. |
Implements BaseBoundary.
References gainFactor_, integratedShift_, isStrainRateControlled_, BaseBoundary::read(), set(), strainRate_, and stressGoal_.
void StressStrainControlBoundary::set | ( | const Matrix3D & | stressGoal, |
const Matrix3D & | strainRate, | ||
const Matrix3D & | gainFactor, | ||
bool | isStrainRateControlled | ||
) |
Sets all boundary inputs at once and determines which deformation mode it is, then combine the right boundaries to assemble the cuboid box/domain.
This function sets the inputs for the whole StressStrainControlBoundary based on the user inputs.
[in] | stressGoal | The target stress tensor that needs to achieve at the end of the deformation. |
[in] | strainRate | The target strain rate tensor, cannot be set non-zero with target Stress, i.e. stressGoal.XX != 0, then strainRate.XX = 0. |
[in] | gainFactor | The incremental factor for the stress control, usually a very small value ~ 0.0001. |
[in] | isStrainRateControlled | The boolean key to determine whether particles are moved by strain rate affine movement (true) or dragged by boundary itself (false). |
References gainFactor_, BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMax(), DPMBase::getZMin(), INFO, integratedShift_, isStrainRateControlled_, leesEdwardsBoundaries_, logger, periodicBoundaries_, LeesEdwardsBoundary::set(), PeriodicBoundary::set(), BaseBoundary::setHandler(), strainRate_, stressGoal_, UNUSED, Matrix3D::XX, Matrix3D::XY, Matrix3D::XZ, Matrix3D::YY, Matrix3D::YZ, Matrix3D::ZX, Matrix3D::ZY, and Matrix3D::ZZ.
Referenced by ShearStage::actionsAfterTimeStep(), read(), StressStrainControl::setupInitialConditions(), and ShearStage::ShearStage().
void StressStrainControlBoundary::setStrainRate | ( | const Matrix3D & | strainRate | ) |
References strainRate_.
void StressStrainControlBoundary::updateDomainSize | ( | ) |
Update the domain to new sizes.
This function is used to update the domain size based on the strainRate tensor, note that the system is symmetric and therefore we have to update boundary in both Min and Max.
References BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTimeStep(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMax(), DPMBase::getZMin(), DPMBase::setXMax(), DPMBase::setXMin(), DPMBase::setYMax(), DPMBase::setYMin(), DPMBase::setZMax(), DPMBase::setZMin(), strainRate_, Vec3D::X, Matrix3D::XX, Vec3D::Y, Matrix3D::YY, Vec3D::Z, and Matrix3D::ZZ.
Referenced by activateStrainRateControl().
|
overridevirtual |
Adds object's id_ to given ostream.
Writes boundary's properties to an ostream.
[in] | os | the ostream. |
Implements BaseBoundary.
References gainFactor_, integratedShift_, isStrainRateControlled_, strainRate_, stressGoal_, and BaseBoundary::write().
|
private |
Referenced by computeStrainRate(), getGainFactor(), read(), set(), StressStrainControlBoundary(), and write().
|
private |
Shift integrated for all the time when using Lees-Edwards Boundary.
Referenced by determineStressControlledShearBoundaries(), getIntegratedShift(), read(), set(), StressStrainControlBoundary(), and write().
|
private |
The boolean input, true means switch on the strain rate control for particles affine movements.
Referenced by activateStrainRateControl(), determineStressControlledShearBoundaries(), read(), set(), StressStrainControlBoundary(), and write().
|
private |
Store boundaries into a vector for the pushback. Note, there is always either 0 LeesEdwardsBoundary (XY) and 3 PeriodicBoundary (XYZ), or 1 LeesEdwardsBoundary (XY) and 1 PeriodicBoundary (Z).
Referenced by checkPeriodicLeesEdwardsBoundariesAfterParticlesMove(), createPeriodicParticles(), determineStressControlledShearBoundaries(), and set().
|
private |
|
private |
|
private |
Stores the stress value the boundary should attain.
Unused if the all stressGoal values are set to zero.
Referenced by activateStrainRateControl(), checkBoundaryAfterParticlesMove(), computeStrainRate(), computeStressError(), getStressGoal(), read(), set(), StressStrainControlBoundary(), and write().