OOFEM 3.0
Loading...
Searching...
No Matches
oofem::MixedGradientPressureDirichlet Class Reference

#include <mixedgradientpressuredirichlet.h>

Inheritance diagram for oofem::MixedGradientPressureDirichlet:
Collaboration diagram for oofem::MixedGradientPressureDirichlet:

Public Member Functions

 MixedGradientPressureDirichlet (int n, Domain *d)
virtual ~MixedGradientPressureDirichlet ()
 Destructor.
int giveNumberOfInternalDofManagers () override
DofManagergiveInternalDofManager (int i) override
void initializeFrom (InputRecord &ir) override
void giveInputRecord (DynamicInputRecord &input) override
void scale (double s) override
void computeFields (FloatArray &stressDev, double &vol, TimeStep *tStep) override
void computeTangents (FloatMatrix &Ed, FloatArray &Ep, FloatArray &Cd, double &Cp, TimeStep *tStep) override
void setPrescribedPressure (double p) override
void setPrescribedDeviatoricGradientFromVoigt (const FloatArray &ddev) override
virtual void setCenterCoordinate (const FloatArray &x)
FloatArraygiveCenterCoordinate ()
 Returns the center coordinate.
void assembleVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorms=nullptr, void *lock=nullptr) override
bool requiresActiveDofs () override
bool isPrimaryDof (ActiveDof *dof) override
double giveBcValue (Dof *dof, ValueModeType mode, TimeStep *tStep) override
bool hasBc (Dof *dof, TimeStep *tStep) override
bool isDevDof (Dof *dof)
 Returns true is DOF represents one of the deviatoric parts.
int giveNumberOfMasterDofs (ActiveDof *dof) override
DofgiveMasterDof (ActiveDof *dof, int mdof) override
void computeDofTransformation (ActiveDof *dof, FloatArray &masterContribs) override
double giveUnknown (double vol, const FloatArray &dev, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
double giveUnknown (PrimaryField &field, ValueModeType mode, TimeStep *tStep, ActiveDof *dof) override
double giveUnknown (ValueModeType mode, TimeStep *tStep, ActiveDof *dof) override
const char * giveClassName () const override
const char * giveInputRecordName () const override
Public Member Functions inherited from oofem::MixedGradientPressureBC
 MixedGradientPressureBC (int n, Domain *d)
virtual ~MixedGradientPressureBC ()
 Destructor.
bcType giveType () const override
 Not relevant for this boundary condition.
double domainSize ()
Public Member Functions inherited from oofem::ActiveBoundaryCondition
 ActiveBoundaryCondition (int n, Domain *d)
virtual ~ActiveBoundaryCondition ()
 Destructor.
virtual void addElementSide (int elem, int side)
virtual void assemble (SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0, void *lock=nullptr)
virtual void giveLocationArrays (std ::vector< IntArray > &rows, std ::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
Public Member Functions inherited from oofem::GeneralBoundaryCondition
 GeneralBoundaryCondition (int n, Domain *d)
virtual ~GeneralBoundaryCondition ()
 Destructor.
int giveSetNumber () const
FunctiongiveTimeFunction ()
int getIsImposedTimeFunctionNumber () const
void setIsImposedTimeFunctionNumber (int funcIndx)
virtual bcValType giveBCValType () const
virtual bool isImposed (TimeStep *tStep)
virtual const IntArraygiveDofIDs () const
virtual bcGeomType giveBCGeoType () const
virtual double giveProperty (int aProperty, TimeStep *tStep) const
void saveContext (DataStream &stream, ContextMode mode) override
void restoreContext (DataStream &stream, ContextMode mode) override
virtual void updateYourself (TimeStep *tStep)
Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
virtual ~FEMComponent ()=default
 Virtual destructor.
DomaingiveDomain () const
virtual void setDomain (Domain *d)
int giveNumber () const
void setNumber (int num)
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
virtual void initializeFrom (InputRecord &ir, int priority)
virtual void initializeFinish ()
virtual void postInitialize ()
 Performs post initialization steps. Called after all components are created and initialized.
virtual int checkConsistency ()
virtual void printOutputAt (FILE *file, TimeStep *tStep)
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging.
virtual InterfacegiveInterface (InterfaceType t)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Protected Member Functions

DofgiveVolDof ()

Protected Attributes

FloatArray devGradient
 Prescribed gradient \( d_{\mathrm{dev},ij} \) in Voigt form.
FloatArray centerCoord
 Center coordinate \( \bar{x}_i \).
double pressure
 Prescribed pressure.
std ::unique_ptr< Nodevoldman
 DOF-manager containing the unknown volumetric strain(rate).
int vol_id
std ::unique_ptr< Nodedevdman
 DOF-manager containing the known deviatoric strain(rate).
IntArray dev_id
Protected Attributes inherited from oofem::GeneralBoundaryCondition
int timeFunction
 Associated load time function.
bcValType valType
 Physical meaning of BC value.
IntArray dofs
 Dofs that b.c. is applied to (relevant for Dirichlet type b.c.s).
int isImposedTimeFunction
int set
 Set number for boundary condition to be applied to.
Protected Attributes inherited from oofem::FEMComponent
int number
 Component number.
Domaindomain
 Link to domain object, useful for communicating with other FEM components.

Detailed Description

Prescribes \( v_i = d_{ij}(x_j-\bar{x}_j) = (d_{\mathrm{dev},ij}+ \frac13 d_{\mathrm{vol}} I_{ij})(x_j+\bar{x}_j)) \) where \( d_{\mathrm{vol}} \) is unknown, loaded by a pressure. This is mixed Dirichlet boundary condition in multiscale analysis where \( d = \partial_x s\) would a macroscopic gradient at the integration point, i.e. this is a boundary condition for prolongation. It is also convenient to use when one wants to test a arbitrary specimen for shear.

Note
The 2D case assumes plane strain(rate), as is the case in _2dFlow.
It is possible to use a non-deviatoric strain rate, in which case, \( d_{\mathrm{vol}} \) obtains the value of the actual volumetric strain rate minus the volumetric part of \( d_{\mathrm{dev}} \).
This is only applicable to momentum balance equation. Both solid or fluids, incompressible or compressible, should work.
Can only be prescribed to active dofs, so they must be denoted as such in the in the input file.
See also
MixedGradientPressureNeumann
Author
Mikael Öhman

Definition at line 72 of file mixedgradientpressuredirichlet.h.

Constructor & Destructor Documentation

◆ MixedGradientPressureDirichlet()

oofem::MixedGradientPressureDirichlet::MixedGradientPressureDirichlet ( int n,
Domain * d )

Creates boundary condition with given number, belonging to given domain.

Parameters
nBoundary condition number.
dDomain to which new object will belongs.
Todo
Creating these statically in the constructor is a bad idea.. it should be part of Domain::createDofs()

Definition at line 63 of file mixedgradientpressuredirichlet.C.

References dev_id, devdman, oofem::Domain::giveNextFreeDofID(), oofem::Domain::giveNumberOfSpatialDimensions(), oofem::MixedGradientPressureBC::MixedGradientPressureBC(), vol_id, and voldman.

◆ ~MixedGradientPressureDirichlet()

oofem::MixedGradientPressureDirichlet::~MixedGradientPressureDirichlet ( )
virtual

Destructor.

Definition at line 87 of file mixedgradientpressuredirichlet.C.

Member Function Documentation

◆ assembleVector()

void oofem::MixedGradientPressureDirichlet::assembleVector ( FloatArray & answer,
TimeStep * tStep,
CharType type,
ValueModeType mode,
const UnknownNumberingScheme & s,
FloatArray * eNorms = nullptr,
void * lock = nullptr )
overridevirtual

Assembles B.C. contributions to specified vector.

Parameters
[in,out]answerVector to assemble to.
tStepActive time step.
typeType of matrix to assemble.
modeMode of value.
sNumbering scheme.
eNormsNorms for each dofid.
omp_lockoptional OMP lock to ensure correct update of answer
Returns
Equivalent of the sum of the element norm (squared) of assembled vector.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 399 of file mixedgradientpressuredirichlet.C.

References oofem::FloatArray::at(), oofem::MixedGradientPressureBC::domainSize(), oofem::Dof::giveDofID(), oofem::Dof::giveEquationNumber(), giveVolDof(), and pressure.

◆ computeDofTransformation()

◆ computeFields()

void oofem::MixedGradientPressureDirichlet::computeFields ( FloatArray & stressDev,
double & vol,
TimeStep * tStep )
overridevirtual

Computes the homogenized fields through sensitivity analysis.

Parameters
[out]stressDevComputes the homogenized deviatoric stress.
[out]volComputes the homogenized volumetric gradient.
tStepTime step for which field to obtain.

Implements oofem::MixedGradientPressureBC.

Definition at line 234 of file mixedgradientpressuredirichlet.C.

References oofem::EngngModel::assembleVector(), oofem::FloatArray::at(), oofem::FEMComponent::domain, oofem::MixedGradientPressureBC::domainSize(), oofem::FEMComponent::giveDomain(), oofem::FEMComponent::giveNumber(), oofem::EngngModel::giveNumberOfDomainEquations(), giveVolDof(), pressure, oofem::FloatArray::resize(), oofem::FloatArray::subtract(), oofem::FloatArray::times(), and oofem::FloatArray::zero().

◆ computeTangents()

void oofem::MixedGradientPressureDirichlet::computeTangents ( FloatMatrix & Ed,
FloatArray & Ep,
FloatArray & Cd,
double & Cp,
TimeStep * tStep )
overridevirtual

Computes the macroscopic tangents through sensitivity analysis.

Parameters
[out]EdTangent \( \frac{\partial \sigma_{\mathrm{dev}}}{\partial d_{\mathrm{dev}}} \).
[out]EpTangent \( \frac{\partial \sigma_{\mathrm{dev}}}{\partial p} \).
[out]CdTangent \( \frac{\partial d_{\mathrm{vol}}}{\partial d_{\mathrm{dev}}} \).
[out]CpTangent \( \frac{\partial d_{\mathrm{vol}}}{\partial p} \).
tStepTime step for the tangents.
Todo
Get this from engineering model

Implements oofem::MixedGradientPressureBC.

Definition at line 258 of file mixedgradientpressuredirichlet.C.

References oofem::EngngModel::assemble(), oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::classFactory, dev_id, devdman, devGradient, oofem::FEMComponent::domain, oofem::MixedGradientPressureBC::domainSize(), oofem::FEMComponent::giveDomain(), oofem::FloatMatrix::giveNumberOfColumns(), giveVolDof(), OOFEM_ERROR, oofem::FloatArray::resize(), oofem::FloatMatrix::resize(), oofem::ST_Petsc, oofem::FloatMatrix::subtract(), oofem::FloatArray::times(), oofem::FloatMatrix::times(), oofem::FloatArray::zero(), and oofem::FloatMatrix::zero().

◆ giveBcValue()

double oofem::MixedGradientPressureDirichlet::giveBcValue ( Dof * dof,
ValueModeType mode,
TimeStep * tStep )
overridevirtual

Returns the prescribed value of a dof (if any).

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 433 of file mixedgradientpressuredirichlet.C.

References dev_id, devGradient, oofem::Dof::giveDofID(), isDevDof(), and OOFEM_ERROR.

◆ giveCenterCoordinate()

FloatArray & oofem::MixedGradientPressureDirichlet::giveCenterCoordinate ( )
inline

Returns the center coordinate.

Definition at line 146 of file mixedgradientpressuredirichlet.h.

References centerCoord.

◆ giveClassName()

const char * oofem::MixedGradientPressureDirichlet::giveClassName ( ) const
inlineoverridevirtual
Returns
Class name of the receiver.

Implements oofem::FEMComponent.

Definition at line 170 of file mixedgradientpressuredirichlet.h.

◆ giveInputRecord()

void oofem::MixedGradientPressureDirichlet::giveInputRecord ( DynamicInputRecord & input)
overridevirtual

Setups the input record string of receiver.

Parameters
inputDynamic input record to be filled by receiver.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 465 of file mixedgradientpressuredirichlet.C.

References _IFT_MixedGradientPressure_centerCoords, _IFT_MixedGradientPressure_devGradient, _IFT_MixedGradientPressure_pressure, centerCoord, devGradient, pressure, and oofem::DynamicInputRecord::setField().

◆ giveInputRecordName()

const char * oofem::MixedGradientPressureDirichlet::giveInputRecordName ( ) const
inlineoverridevirtual
Returns
Input record name of the receiver.

Implements oofem::FEMComponent.

Definition at line 171 of file mixedgradientpressuredirichlet.h.

References _IFT_MixedGradientPressureDirichlet_Name.

◆ giveInternalDofManager()

DofManager * oofem::MixedGradientPressureDirichlet::giveInternalDofManager ( int i)
overridevirtual

Returns the volumetric DOF manager for i == 1, and the deviatoric manager for i == 2.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 104 of file mixedgradientpressuredirichlet.C.

References devdman, and voldman.

◆ giveMasterDof()

Dof * oofem::MixedGradientPressureDirichlet::giveMasterDof ( ActiveDof * dof,
int mdof )
overridevirtual

Give the pointer to master dof belonging to active DOF.

Parameters
dofActive dof belonging to receiver.
mdofLocal master dof number.
Returns
Master dof.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 123 of file mixedgradientpressuredirichlet.C.

References dev_id, devdman, isDevDof(), and voldman.

◆ giveNumberOfInternalDofManagers()

int oofem::MixedGradientPressureDirichlet::giveNumberOfInternalDofManagers ( )
overridevirtual

Returns the number of internal DOF managers (=2). This boundary condition stores its own DOF managers, one for \( d_{\mathrm{dev},ij} \) in which the DOFs are prescribed and one for \( d_{\mathrm{vol}} \) for single free volumetric strain rate.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 98 of file mixedgradientpressuredirichlet.C.

◆ giveNumberOfMasterDofs()

int oofem::MixedGradientPressureDirichlet::giveNumberOfMasterDofs ( ActiveDof * dof)
overridevirtual

Allows for active boundary conditions to handle their own special DOF.

Parameters
dofActive dof belonging to receiver.
Returns
Number of primary master DOFs.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 114 of file mixedgradientpressuredirichlet.C.

References devdman, and isDevDof().

◆ giveUnknown() [1/3]

double oofem::MixedGradientPressureDirichlet::giveUnknown ( double vol,
const FloatArray & dev,
ValueModeType mode,
TimeStep * tStep,
ActiveDof * dof )

◆ giveUnknown() [2/3]

double oofem::MixedGradientPressureDirichlet::giveUnknown ( PrimaryField & field,
ValueModeType mode,
TimeStep * tStep,
ActiveDof * dof )
overridevirtual

Computes the value of the dof.

Parameters
fieldField to take value from.
modeMode of unknown value.
tStepTime step.
dofActive dof for which to obtain the value.
Returns
Value of dof.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 375 of file mixedgradientpressuredirichlet.C.

References dev_id, devGradient, oofem::Dof::giveDofID(), giveUnknown(), giveVolDof(), and isDevDof().

◆ giveUnknown() [3/3]

double oofem::MixedGradientPressureDirichlet::giveUnknown ( ValueModeType mode,
TimeStep * tStep,
ActiveDof * dof )
overridevirtual

Computes the value of the dof.

Parameters
modeMode of unknown value.
tStepTime step.
dofActive dof for which to obtain the value.
Returns
Value of dof.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 384 of file mixedgradientpressuredirichlet.C.

References dev_id, devGradient, oofem::Dof::giveDofID(), giveUnknown(), giveVolDof(), and isDevDof().

◆ giveVolDof()

Dof * oofem::MixedGradientPressureDirichlet::giveVolDof ( )
protected

◆ hasBc()

bool oofem::MixedGradientPressureDirichlet::hasBc ( Dof * dof,
TimeStep * tStep )
overridevirtual

Returns the prescribed value of a dof (if any).

Returns
True if dof is prescribed.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 443 of file mixedgradientpressuredirichlet.C.

References isDevDof().

◆ initializeFrom()

void oofem::MixedGradientPressureDirichlet::initializeFrom ( InputRecord & ir)
overridevirtual

Initializes receiver according to object description stored in input record. The input record contains two fields;

  • devGradient #columns { d_11 d_22 ... d_21 ... } (required)
  • pressure p (required)
  • cCoords #columns x_1 x_2 ... (optional, default 0) The gradient should be deviatoric and in Voigt notation. The prescribed tensor's columns must be equal to the size of the center coordinates. The size of the center coordinates must be equal to the size of the coordinates in the applied nodes.

Reimplemented from oofem::MixedGradientPressureBC.

Definition at line 455 of file mixedgradientpressuredirichlet.C.

References _IFT_MixedGradientPressure_centerCoords, centerCoord, oofem::FEMComponent::domain, and IR_GIVE_OPTIONAL_FIELD.

◆ isDevDof()

bool oofem::MixedGradientPressureDirichlet::isDevDof ( Dof * dof)

Returns true is DOF represents one of the deviatoric parts.

Definition at line 449 of file mixedgradientpressuredirichlet.C.

References devdman, and oofem::Dof::giveDofManager().

Referenced by giveBcValue(), giveMasterDof(), giveNumberOfMasterDofs(), giveUnknown(), giveUnknown(), hasBc(), and isPrimaryDof().

◆ isPrimaryDof()

bool oofem::MixedGradientPressureDirichlet::isPrimaryDof ( ActiveDof * dof)
overridevirtual

Checks to see if the dof is a primary DOF.

Returns
True if ActiveDof is a primary DOF.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 427 of file mixedgradientpressuredirichlet.C.

References isDevDof().

◆ requiresActiveDofs()

bool oofem::MixedGradientPressureDirichlet::requiresActiveDofs ( )
inlineoverridevirtual

Checks to see if active boundary condition requires special DOFs.

Returns
True if ActiveDof should be created.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 153 of file mixedgradientpressuredirichlet.h.

◆ scale()

void oofem::MixedGradientPressureDirichlet::scale ( double s)
inlineoverridevirtual

Scales the receiver according to given value. Typically used in nondimensional analysis to scale down BCs and ICs.

Parameters
sScale factor.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 129 of file mixedgradientpressuredirichlet.h.

References devGradient, and pressure.

◆ setCenterCoordinate()

virtual void oofem::MixedGradientPressureDirichlet::setCenterCoordinate ( const FloatArray & x)
inlinevirtual

Set the center coordinate.

Parameters
xNew center coordinate.

Definition at line 144 of file mixedgradientpressuredirichlet.h.

References centerCoord.

◆ setPrescribedDeviatoricGradientFromVoigt()

void oofem::MixedGradientPressureDirichlet::setPrescribedDeviatoricGradientFromVoigt ( const FloatArray & ddev)
overridevirtual

Sets the prescribed tensor from the matrix from given Voigt notation. Assumes use of double values (gamma) for off-diagonal, usually the way for strain in Voigt form.

Parameters
ddevVector in Voigt format.

Implements oofem::MixedGradientPressureBC.

Definition at line 393 of file mixedgradientpressuredirichlet.C.

References devGradient.

◆ setPrescribedPressure()

void oofem::MixedGradientPressureDirichlet::setPrescribedPressure ( double p)
inlineoverridevirtual

Set prescribed pressure.

Parameters
pNew prescribed pressure.

Implements oofem::MixedGradientPressureBC.

Definition at line 137 of file mixedgradientpressuredirichlet.h.

References pressure.

Member Data Documentation

◆ centerCoord

FloatArray oofem::MixedGradientPressureDirichlet::centerCoord
protected

◆ dev_id

IntArray oofem::MixedGradientPressureDirichlet::dev_id
protected

◆ devdman

std :: unique_ptr< Node > oofem::MixedGradientPressureDirichlet::devdman
protected

◆ devGradient

FloatArray oofem::MixedGradientPressureDirichlet::devGradient
protected

Prescribed gradient \( d_{\mathrm{dev},ij} \) in Voigt form.

Definition at line 76 of file mixedgradientpressuredirichlet.h.

Referenced by computeTangents(), giveBcValue(), giveInputRecord(), giveUnknown(), giveUnknown(), scale(), and setPrescribedDeviatoricGradientFromVoigt().

◆ pressure

double oofem::MixedGradientPressureDirichlet::pressure
protected

Prescribed pressure.

Definition at line 82 of file mixedgradientpressuredirichlet.h.

Referenced by assembleVector(), computeFields(), giveInputRecord(), scale(), and setPrescribedPressure().

◆ vol_id

int oofem::MixedGradientPressureDirichlet::vol_id
protected

Definition at line 86 of file mixedgradientpressuredirichlet.h.

Referenced by MixedGradientPressureDirichlet().

◆ voldman

std :: unique_ptr< Node > oofem::MixedGradientPressureDirichlet::voldman
protected

DOF-manager containing the unknown volumetric strain(rate).

Definition at line 85 of file mixedgradientpressuredirichlet.h.

Referenced by giveInternalDofManager(), giveMasterDof(), giveVolDof(), and MixedGradientPressureDirichlet().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011