Itasca C++ Interface
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
models::ConstitutiveModel Class Referenceabstract

The base class for constitutive model plug-ins. More...

#include <conmodel.h>

Public Member Functions

virtual string getName () const =0
 Must be unique, used to identify model in save/restore, on command line, filename.
 
virtual string getPluginName () const
 There should be no reason for an implementation to override the default behavior of this function.
 
virtual string getFullName () const =0
 The full name of the model.
 
virtual bool isNull () const
 Returns true if this model represents a NULL material. Only the NULL model should return true.
 
virtual bool isModelAdvanced () const
 
virtual bool isKGEv () const
 Return TRUE if the model can input (bulk,shear) or (young,poisson).
 
virtual bool isOriented () const
 Return TRUE if the model can input (dip, dip-direction) or (norm).
 
virtual bool isCreep () const
 
virtual bool isLiquefaction () const
 Return TRUE if the model should be considered "Liquefaction" model.
 
virtual unsigned getMinorVersion () const
 Returns minor version of base implementation, override for actual model.
 
virtual string getProperties () const =0
 Returns a string containing the names of model properties.
 
virtual string getStates () const =0
 Returns a string containing state names.
 
virtual base::Property getProperty (uint32 index) const =0
 Return the value of the property of that index (base 1).
 
virtual void setProperty (uint32, const base::Property &, uint32=0)
 Sets the value of the property with index i (base 1).
 
virtual bool isPropertyReadOnly (uint32) const
 
virtual bool isPropertyAdvanced (uint32) const
 
virtual void save (std::ostream &o) const
 
virtual void restore (std::istream &i, uint32 restoreVersion)
 Allows data other than properties to be restored efficiently.
 
virtual ConstitutiveModelclone () const =0
 Returns an instance this class.
 
virtual double getConfinedModulus () const =0
 Return estimate of maximum confined modulus.
 
virtual double getShearModulus () const =0
 Return estimate of tangent shear-modulus.
 
virtual double getBulkModulus () const =0
 Return estimate of tangent bulk-modulus.
 
virtual void copy (const ConstitutiveModel *mod)
 Copy property values and state from another constitutive model.
 
virtual bool performMixing () const
 Set true if an alternative mixing technqiue rather than the default one in the code is used.
.
 
virtual void mixStrain (uint32, State *, SymTensor *, double *)
 User defined strain mixing technique.
.
 
virtual void run (uint32 d, State *s)
 Calculate stress increment given a strain increment.
 
virtual void mixStress (uint32, State *, SymTensor *, double *)
 User defined stress mixing technique.
.
 
virtual void initialize (uint32 d, State *)
 Initializes the constitutive model in preparation for calls to run().
 
virtual double getStrengthStressRatio (const SymTensor &) const
 Returns the ratio of the stress tensor to the current yield strength.
 
virtual void scaleProperties (const double &, const std::vector< uint32 > &)
 Scales failure property indices v by the factor f.
 
virtual bool supportsHystereticDamping () const
 Returns true if hysteretic damping is supported by run(). See State::hysteretic_damping_.
 
virtual bool supportsStrengthStressRatio () const
 Returns true if strength-stress ratio calculations are supported via getStrengthStressRatio().
 
virtual bool supportsPropertyScaling () const
 Returns true if property scaling is supported for factor-of-safety calculations via scaleProperties().
 
virtual bool supportsSmallStrainEffect () const
 
virtual bool supportsPlaneStress () const
 Returns true if 2D plane-stress is supported by run().
 
virtual bool supportsUniaxial () const
 Returns true if 1D uniaxial is supported by run().
 
virtual bool supportsPlasticStrain () const
 Returns true if palstic strain calculation is supported.
 
virtual void destroy ()
 There should be no reason for an implementation to change the default behavior of this function.
 
 ConstitutiveModel (unsigned short option=0)
 The constitutive model constructor. The model is invald, and canFail is set to true.
 
virtual ~ConstitutiveModel ()
 The constitutive model destructor.
 
void * operator new (size_t size, const char *file, unsigned line)
 
void * operator new (size_t size)
 
void operator delete (void *v)
 
bool isValid (uint32 d) const
 Indicates whether initializion is necessary - by dimension.
 
void setValid (uint32 d)
 Sets the current valid state to dimension dim.
 
bool canFail () const
 
void setIfCanFail (bool b)
 Specifies whether or not "failure" is being allowed for this instanced of the constitutive model.
 
std::vector< unsigned short > gEOB () const
 Used by Itasa only.
 
void sEOB (const std::vector< unsigned short > &reply)
 Used by Itasa only.
 
bool cEOB () const
 Used by Itasa only.
 

Static Public Member Functions

static uint32 getLibraryMinorVersion ()
 Returns the minor version number of the constitutive model library.
 

Static Public Attributes

static void *(* conModelMemoryAlloc )(size_t s) = nullptr
 
static void *(* conModelMemoryAllocDebug )(size_t s, const char *file, uint32 line) = nullptr
 
static void(* conModelMemoryFree )(void *v) = nullptr
 
static constexpr uint32 shear_now = 0x001
 
static constexpr uint32 tension_now = 0x002
 
static constexpr uint32 shear_past = 0x004
 
static constexpr uint32 tension_past = 0x008
 
static constexpr uint32 joint_shear_now = 0x010
 
static constexpr uint32 joint_tension_now = 0x020
 
static constexpr uint32 joint_shear_past = 0x040
 
static constexpr uint32 joint_tension_past = 0x080
 
static constexpr uint32 volume_now = 0x100
 
static constexpr uint32 volume_past = 0x200
 
static constexpr double pi = 3.14159265358979323846264338327950
 
static constexpr double degrad = 0.01745329251994329576923690768488
 
static constexpr double d1d3 = 0.33333333333333333333333333333333
 
static constexpr double d2d3 = 0.66666666666666666666666666666667
 
static constexpr double d4d3 = 1.33333333333333333333333333333333
 
static constexpr double rt6 = 2.44948974278317809819728407470589
 

Detailed Description

The base class for constitutive model plug-ins.

All constitutive models (null, elastic, mohr-coulomb, etc) are derived from this class.
Any custom constitutive model provided as a plug-in must be derived from this class.
Pure virtual method must be provided by the user - some utility functions are provided.

Note
The file name of the DLL produced must be model|name|###|.dll (in release) and model|name|###|_debug.dll (in debug).
Where |name| is the string returned by getName(), and |###| is the Major version number (3 digits, right justified, filled with zeros).
For instance modelelastic001.dll and modelelastic001_debug.dll

Member Function Documentation

◆ canFail()

bool models::ConstitutiveModel::canFail ( ) const
inline

Indicates whether failure should be allowed.
Constitutive models should honor this state, and not allow failure if it returns true.

◆ clone()

virtual ConstitutiveModel * models::ConstitutiveModel::clone ( ) const
pure virtual

Returns an instance this class.

A new object, of the same class as the current object, must be created, and a pointer to it of type ConstitutiveModel returned. This function is called whenever FLAC3D installs the model in a zone.

◆ copy()

void models::ConstitutiveModel::copy ( const ConstitutiveModel * mod)
virtual

Copy property values and state from another constitutive model.

This member function should first call the base class copy function, and then copy all essential data from the model object pointed to by cm (assumed to be of the same derived class as the current model).
It is not necessary to copy data members that are recomputed when the initialize() function is called.
Use dynamic cast<MyModel *>(cm) to upcast cm.

◆ getBulkModulus()

virtual double models::ConstitutiveModel::getBulkModulus ( ) const
pure virtual

Return estimate of tangent bulk-modulus.

This is used by FLAC3D zone relaxation to query the current elastic bulk modulus of a zone.

◆ getConfinedModulus()

virtual double models::ConstitutiveModel::getConfinedModulus ( ) const
pure virtual

Return estimate of maximum confined modulus.

The model object must return a value for its best estimate of the maximum confined modulus.
This is used by the code to compute the stable timestep or adjust inertial mass.
For an isotropic elastic model, the confined modulus is K + 4G/3.

◆ getFullName()

virtual string models::ConstitutiveModel::getFullName ( ) const
pure virtual

The full name of the model.

Returns a string containing the name of the constitutive model that is to be used on printout
(e.g., resulting from the LIST zone command).
The name may or may not be the same as that given by the getName() member function,
but note that the code may truncate long strings on printout.
An example of a valid string is "Linearly elastic".

◆ getLibraryMinorVersion()

uint32 models::ConstitutiveModel::getLibraryMinorVersion ( )
static

Returns the minor version number of the constitutive model library.

This indicates the minor version of the constitutive model library routines.
This will be updated to indicate bug fixes, and minor changes that do not affect binary compatibility.

◆ getMinorVersion()

uint32 models::ConstitutiveModel::getMinorVersion ( ) const
virtual

Returns minor version of base implementation, override for actual model.

The version number of the constitutive model should be returned.
This may be used to deal with the case of restoring files containing objects of earlier versions of the model, which perhaps omit certain variables.

◆ getName()

virtual string models::ConstitutiveModel::getName ( ) const
pure virtual

Must be unique, used to identify model in save/restore, on command line, filename.

Returns a string containing the name of the constitutive model as the user will refer to it with the MODEL command.
For example, "elastic" would be a valid string in C++.
This must be a unique name, and is used for synchronizing Save/Restore.
This name is also used in the file name of the DLL.

◆ getProperties()

virtual string models::ConstitutiveModel::getProperties ( ) const
pure virtual

Returns a string containing the names of model properties.

The following string is a valid example: "shear, bulk".
The given names will be those recognized by the PROPERTY command.
Property names are delimited by commas, synonyms of the same property may be provided within one entry, separated by spaces.

◆ getProperty()

virtual base::Property models::ConstitutiveModel::getProperty ( uint32 index) const
pure virtual

Return the value of the property of that index (base 1).

A value should be returned for the model property of sequence number n
(previously defined by a getProperties() call, with n=1 denoting the first property). Return real/0.0 if property doesn't exist.

Note
Property indices start with 1!

◆ getShearModulus()

virtual double models::ConstitutiveModel::getShearModulus ( ) const
pure virtual

Return estimate of tangent shear-modulus.

The model object must return a value for its best estimate of the current tangent shear-modulus.
This is used by the code to determine coefficients for quiet boundaries in dynamic mode.

◆ getStates()

virtual string models::ConstitutiveModel::getStates ( ) const
pure virtual

Returns a string containing state names.

The names are used on printout and in plotting to identify user-defined internal states of the model (e.g., plastic flow).
The following string is a valid example: "yielding, tension".
See the variable State::state_.
State names are delimited by commas

◆ getStrengthStressRatio()

virtual double models::ConstitutiveModel::getStrengthStressRatio ( const SymTensor & ) const
inlinevirtual

Returns the ratio of the stress tensor to the current yield strength.

Returns the ratio of the passed stress tensor to the yield strength of the zone properties.
Implementing this function is optional.
By convention, 10.0 is the maximum value returned.

◆ initialize()

virtual void models::ConstitutiveModel::initialize ( uint32 d,
State *  )
inlinevirtual

Initializes the constitutive model in preparation for calls to run().

This function is called once for each model object (i.e., for each full zone) when the SOLVE/Step/CYCLE command is given when the large-strain update is performed, and at the beginning of the run() method if isValid() returns false.
The model object may perform initialization of its property or state variables, or it may do nothing.
The dimensionality (e.g., this is 3 for FLAC3D ) is given as dim, and structure s contains current information for the zone containing the model object.
Note that strains may be undefined when initialize() is called.
The average stress components for the full zone are available in the state structure; they should not be changed by the initialize() member function.
The base class implementation calls setValid(dim).

◆ isCreep()

virtual bool models::ConstitutiveModel::isCreep ( ) const
inlinevirtual

Return TRUE if the model should be considered "creep", in that it contains time dependent material behavior.

◆ isModelAdvanced()

virtual bool models::ConstitutiveModel::isModelAdvanced ( ) const
inlinevirtual

Return TRUE if the model should be considered an "advanced" model. From v9.1, all models are considered standard
so this should be returned FALSE always.

◆ isPropertyAdvanced()

virtual bool models::ConstitutiveModel::isPropertyAdvanced ( uint32 ) const
inlinevirtual

Return TRUE if this property should be considered "Advanced". It should have a default value and should not be necessary to specify for simpler applications of the model.

◆ isPropertyReadOnly()

virtual bool models::ConstitutiveModel::isPropertyReadOnly ( uint32 ) const
inlinevirtual

Return TRUE if property index i should be considered read only, and not allowed to be set by the user. Note that a setProperty() called directly will still be allowed (and should be skipped for this property) , just that the places in the code (Property command, FISH, etc) will check this first.

◆ run()

virtual void models::ConstitutiveModel::run ( uint32 d,
State * s )
inlinevirtual

Calculate stress increment given a strain increment.

This function is called for each tetra in each zone at each cycle from within FLAC3Ds zone scan.
The model must update the stress tensor from strain increments.
The structure State s contains the current stress components and the computed strain increment components for the zone being processed.
dim will be either 2 or 3, depending on the dimension of the calling program. The stress components already contain the rotation-correction terms when run() is called.
The base class implementation will call initialize() if isValid() returns false.

◆ save()

void models::ConstitutiveModel::save ( std::ostream & o) const
virtual

Allows data other than properties to be saved efficiently. Note that you are responsible for adding data to allow multiple version compatibility yourself. Also note that you should use BINARY output (os.write, is.read) not formatted IO <<.

◆ scaleProperties()

virtual void models::ConstitutiveModel::scaleProperties ( const double & ,
const std::vector< uint32 > &  )
inlinevirtual

Scales failure property indices v by the factor f.

This function is used to set scaled properties for the Safety Factor calculation. Implementing this function is optional.

  • f is the factor to scale. Some properties may not scale linearly.
  • v is the list of properties (by index) that are requested to be scaled.

◆ setProperty()

virtual void models::ConstitutiveModel::setProperty ( uint32 ,
const base::Property & ,
uint32 = 0 )
inlinevirtual

Sets the value of the property with index i (base 1).

The value of val supplied by the call comes from a command of the form PROP name=val; the supplied value of n is the sequence number (starting with 1) of the property name previously specified by means of a getProperties() call.
The model object is required to store the supplied value in an appropriate private member variable.
The third argument, restoreVersion, is currently only used to distinguish between calls made while processing data files versus values set during a restore of a save file. It will be zero for command processing, and 1 in a restore. The base class implementation calls setValid(0), invalidating the object.

◆ supportsSmallStrainEffect()

virtual bool models::ConstitutiveModel::supportsSmallStrainEffect ( ) const
inlinevirtual

Returns true if small strain effect is supported by run(). Currently this has not yet been implemented.


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