oomph::StrainEnergyFunction Class Referenceabstract

#include <constitutive_laws.h>

+ Inheritance diagram for oomph::StrainEnergyFunction:

Public Member Functions

 StrainEnergyFunction ()
 Constructor takes no arguments. More...
 
virtual ~StrainEnergyFunction ()
 Empty virtual destructor. More...
 
virtual double W (const DenseMatrix< double > &gamma)
 Return the strain energy in terms of the strain tensor. More...
 
virtual double W (const Vector< double > &I)
 Return the strain energy in terms of the strain invariants. More...
 
virtual void derivative (const DenseMatrix< double > &gamma, DenseMatrix< double > &dWdgamma)
 
virtual void derivatives (Vector< double > &I, Vector< double > &dWdI)
 
virtual bool requires_incompressibility_constraint ()=0
 

Detailed Description

Base class for strain energy functions to be used in solid mechanics computations.

Constructor & Destructor Documentation

◆ StrainEnergyFunction()

oomph::StrainEnergyFunction::StrainEnergyFunction ( )
inline

Constructor takes no arguments.

51 {}

◆ ~StrainEnergyFunction()

virtual oomph::StrainEnergyFunction::~StrainEnergyFunction ( )
inlinevirtual

Empty virtual destructor.

54 {}

Member Function Documentation

◆ derivative()

virtual void oomph::StrainEnergyFunction::derivative ( const DenseMatrix< double > &  gamma,
DenseMatrix< double > &  dWdgamma 
)
inlinevirtual

Return the derivatives of the strain energy function with respect to the components of the strain tensor (default is to use finite differences).

91  {
92  throw OomphLibError(
93  "Sorry, the FD setup of dW/dgamma hasn't been implemented yet",
96  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ derivatives()

virtual void oomph::StrainEnergyFunction::derivatives ( Vector< double > &  I,
Vector< double > &  dWdI 
)
inlinevirtual

Return the derivatives of the strain energy function with respect to the strain invariants. Default version is to use finite differences

Reimplemented in oomph::GeneralisedMooneyRivlin, and oomph::MooneyRivlin.

103  {
104  // Calculate the derivatives of the strain-energy-function wrt the strain
105  // invariants
106  double FD_Jstep = 1.0e-8; // Usual comments about global stuff
107  double energy = W(I);
108 
109  // Loop over the strain invariants
110  for (unsigned i = 0; i < 3; i++)
111  {
112  // Store old value
113  double I_prev = I[i];
114  // Increase ith strain invariant
115  I[i] += FD_Jstep;
116  // Get the new value of the strain energy
117  double energy_new = W(I);
118  // Calculate the value of the derivative
119  dWdI[i] = (energy_new - energy) / FD_Jstep;
120  // Reset value of ith strain invariant
121  I[i] = I_prev;
122  }
123  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
virtual double W(const DenseMatrix< double > &gamma)
Return the strain energy in terms of the strain tensor.
Definition: constitutive_laws.h:58
#define I
Definition: main.h:127

References i, I, and W().

Referenced by oomph::IsotropicStrainEnergyFunctionConstitutiveLaw::calculate_second_piola_kirchhoff_stress().

◆ requires_incompressibility_constraint()

virtual bool oomph::StrainEnergyFunction::requires_incompressibility_constraint ( )
pure virtual

Pure virtual function in which the user must declare if the constitutive equation requires an incompressible formulation in which the volume constraint is enforced explicitly. Used as a sanity check in PARANOID mode.

Implemented in oomph::GeneralisedMooneyRivlin, and oomph::MooneyRivlin.

Referenced by oomph::IsotropicStrainEnergyFunctionConstitutiveLaw::requires_incompressibility_constraint().

◆ W() [1/2]

virtual double oomph::StrainEnergyFunction::W ( const DenseMatrix< double > &  gamma)
inlinevirtual

Return the strain energy in terms of the strain tensor.

Reimplemented in oomph::GeneralisedMooneyRivlin, and oomph::MooneyRivlin.

59  {
60  std::string error_message =
61  "The strain-energy function as a function of the strain-tensor,\n";
62  error_message +=
63  "gamma, is not implemented for this strain energy function.\n";
64 
65  throw OomphLibError(
67  return 0.0;
68  }
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Global_string_for_annotation::string().

Referenced by derivatives(), oomph::MooneyRivlin::W(), and oomph::GeneralisedMooneyRivlin::W().

◆ W() [2/2]

virtual double oomph::StrainEnergyFunction::W ( const Vector< double > &  I)
inlinevirtual

Return the strain energy in terms of the strain invariants.

Reimplemented in oomph::GeneralisedMooneyRivlin, and oomph::MooneyRivlin.

73  {
74  std::string error_message =
75  "The strain-energy function as a function of the strain\n ";
76  error_message +=
77  "invariants, I1, I2, I3, is not implemented for this strain\n ";
78  error_message += "energy function\n";
79 
80  throw OomphLibError(
82  return 0.0;
83  }

References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Global_string_for_annotation::string().


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