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

#include <weakperiodicbc.h>

Inheritance diagram for oofem::WeakPeriodicBoundaryCondition:
Collaboration diagram for oofem::WeakPeriodicBoundaryCondition:

Public Member Functions

 WeakPeriodicBoundaryCondition (int n, Domain *d)
virtual ~WeakPeriodicBoundaryCondition ()
void initializeFrom (InputRecord &ir) override
void postInitialize () override
 Performs post initialization steps. Called after all components are created and initialized.
basisType giveBasisType ()
void assemble (SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0, void *lock=nullptr) override
void assembleVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorm=nullptr, void *lock=nullptr) override
void giveInternalForcesVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorm=nullptr, void *lock=nullptr)
void giveExternalForcesVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, void *lock=nullptr)
int giveNumberOfInternalDofManagers () override
 Gives the number of internal dof managers.
DofManagergiveInternalDofManager (int i) override
 Gives an internal dof manager from receiver.
void addElementSide (int elem, int side) override
const char * giveClassName () const override
const char * giveInputRecordName () const override
Public Member Functions inherited from oofem::ActiveBoundaryCondition
 ActiveBoundaryCondition (int n, Domain *d)
virtual ~ActiveBoundaryCondition ()
 Destructor.
virtual void giveLocationArrays (std ::vector< IntArray > &rows, std ::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
virtual bool requiresActiveDofs ()
virtual bool isPrimaryDof (ActiveDof *dof)
virtual double giveBcValue (Dof *dof, ValueModeType mode, TimeStep *tStep)
virtual bool hasBc (Dof *dof, TimeStep *tStep)
virtual int giveNumberOfMasterDofs (ActiveDof *dof)
virtual DofgiveMasterDof (ActiveDof *dof, int mdof)
virtual void computeDofTransformation (ActiveDof *dof, FloatArray &masterContribs)
virtual double giveUnknown (PrimaryField &field, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
virtual double giveUnknown (ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
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 bcType giveType () const
virtual bcGeomType giveBCGeoType () const
virtual void scale (double s)
virtual double giveProperty (int aProperty, TimeStep *tStep) const
void giveInputRecord (DynamicInputRecord &input) override
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 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

void computeElementTangent (FloatMatrix &answer, Element *e, int boundary, TimeStep *tStep)

Private Member Functions

void giveEdgeNormal (FloatArray &answer, int element, int side)
void updateSminmax ()
void updateDirection ()
double computeBaseFunctionValue (int baseID, FloatArray coordinate)
double computeBaseFunctionValue1D (int baseID, double coordinate)
double computeBaseFunctionValue2D (int baseID, FloatArray coordinate)
double factorial (int n)
double binomial (double n, int k)
void getExponents (int n, int &i, int &j)
void computeOrthogonalBasis ()
double computeProjectionCoefficient (int vIndex, int uIndex)
void computeDeformationGradient (FloatMatrix &answer, Element *e, FloatArray *lcoord, TimeStep *tStep)

Private Attributes

basisType useBasisType
int bcID
int orderOfPolygon
FloatArray g
int direction
IntArray surfaceIndexes
FloatArray smax
FloatArray smin
bool doUpdateSminmax
int ngp
int ndof
int posSet
int negSet
IntArray dofids
signed int sideSign [2]
std ::vector< int > side [2]
std ::vector< int > element [2]
std ::vector< double > directions
std ::unique_ptr< NodegammaDman
IntArray gamma_ids
FloatMatrix gsMatrix
int tcount
int ndofids
bool nlgeo

Additional Inherited Members

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

Imposes weak periodicity on the doftype of choice. 2D. It is required that the two edges are parallel and either horizontal or vertical.

Author
Carl Sandström

Definition at line 75 of file weakperiodicbc.h.

Constructor & Destructor Documentation

◆ WeakPeriodicBoundaryCondition()

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

◆ ~WeakPeriodicBoundaryCondition()

oofem::WeakPeriodicBoundaryCondition::~WeakPeriodicBoundaryCondition ( )
virtual

Definition at line 73 of file weakperiodicbc.C.

Member Function Documentation

◆ addElementSide()

void oofem::WeakPeriodicBoundaryCondition::addElementSide ( int elem,
int side )
overridevirtual

Adds element for active boundary condition.

Parameters
elemElement number.
sideSide number.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 358 of file weakperiodicbc.C.

References oofem::FloatArray::at(), direction, element, giveEdgeNormal(), and side.

◆ assemble()

void oofem::WeakPeriodicBoundaryCondition::assemble ( SparseMtrx & answer,
TimeStep * tStep,
CharType type,
const UnknownNumberingScheme & r_s,
const UnknownNumberingScheme & c_s,
double scale = 1.0,
void * lock = nullptr )
overridevirtual

◆ assembleVector()

void oofem::WeakPeriodicBoundaryCondition::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 659 of file weakperiodicbc.C.

References giveExternalForcesVector(), and giveInternalForcesVector().

◆ binomial()

double oofem::WeakPeriodicBoundaryCondition::binomial ( double n,
int k )
private

Definition at line 894 of file weakperiodicbc.C.

Referenced by computeBaseFunctionValue1D().

◆ computeBaseFunctionValue()

double oofem::WeakPeriodicBoundaryCondition::computeBaseFunctionValue ( int baseID,
FloatArray coordinate )
private

◆ computeBaseFunctionValue1D()

double oofem::WeakPeriodicBoundaryCondition::computeBaseFunctionValue1D ( int baseID,
double coordinate )
private

◆ computeBaseFunctionValue2D()

double oofem::WeakPeriodicBoundaryCondition::computeBaseFunctionValue2D ( int baseID,
FloatArray coordinate )
private

◆ computeDeformationGradient()

◆ computeElementTangent()

◆ computeOrthogonalBasis()

void oofem::WeakPeriodicBoundaryCondition::computeOrthogonalBasis ( )
private

Compute orthogonal polynomial basis using Gram-Smidth process

Definition at line 155 of file weakperiodicbc.C.

References oofem::FloatArray::at(), computeProjectionCoefficient(), gsMatrix, ndof, oofem::FloatArray::resize(), and oofem::FloatArray::times().

Referenced by updateSminmax().

◆ computeProjectionCoefficient()

◆ factorial()

double oofem::WeakPeriodicBoundaryCondition::factorial ( int n)
private

Definition at line 885 of file weakperiodicbc.C.

◆ getExponents()

void oofem::WeakPeriodicBoundaryCondition::getExponents ( int n,
int & i,
int & j )
private

Compute exponent for term n. Exponents i and j are x^i*y^j

Definition at line 903 of file weakperiodicbc.C.

Referenced by computeBaseFunctionValue2D(), and computeProjectionCoefficient().

◆ giveBasisType()

basisType oofem::WeakPeriodicBoundaryCondition::giveBasisType ( )
inline

Definition at line 167 of file weakperiodicbc.h.

References useBasisType.

Referenced by oofem::MatlabExportModule::doOutputSpecials().

◆ giveClassName()

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

Implements oofem::FEMComponent.

Definition at line 190 of file weakperiodicbc.h.

◆ giveEdgeNormal()

void oofem::WeakPeriodicBoundaryCondition::giveEdgeNormal ( FloatArray & answer,
int element,
int side )
private

◆ giveExternalForcesVector()

◆ giveInputRecordName()

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

Implements oofem::FEMComponent.

Definition at line 191 of file weakperiodicbc.h.

References _IFT_WeakPeriodicBoundaryCondition_Name.

◆ giveInternalDofManager()

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

Gives an internal dof manager from receiver.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 876 of file weakperiodicbc.C.

References gammaDman.

Referenced by oofem::MatlabExportModule::doOutputSpecials().

◆ giveInternalForcesVector()

◆ giveNumberOfInternalDofManagers()

int oofem::WeakPeriodicBoundaryCondition::giveNumberOfInternalDofManagers ( )
overridevirtual

Gives the number of internal dof managers.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 871 of file weakperiodicbc.C.

Referenced by oofem::MatlabExportModule::doOutputSpecials().

◆ initializeFrom()

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

Initializes receiver according to object description stored in input record. This function is called immediately after creating object using constructor. Input record can be imagined as data record in component database belonging to receiver. Receiver may use value-name extracting functions to extract particular field from record. Note that initializeFrom may be called mutiple times.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
priorityPriority of the input record. This is used to determine the order of initialization
Todo
Carl, remove this line and use elementsidespositive/negative instead.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 78 of file weakperiodicbc.C.

References _IFT_WeakPeriodicBoundaryCondition_descritizationType, _IFT_WeakPeriodicBoundaryCondition_dofids, _IFT_WeakPeriodicBoundaryCondition_elementSidesNegative, _IFT_WeakPeriodicBoundaryCondition_elementSidesNegativeSet, _IFT_WeakPeriodicBoundaryCondition_elementSidesPositive, _IFT_WeakPeriodicBoundaryCondition_elementSidesPositiveSet, _IFT_WeakPeriodicBoundaryCondition_gradient, _IFT_WeakPeriodicBoundaryCondition_nlgeo, _IFT_WeakPeriodicBoundaryCondition_order, oofem::IntArray::at(), dofids, element, g, oofem::IntArray::giveSize(), IR_GIVE_OPTIONAL_FIELD, oofem::monomial, ndofids, negSet, ngp, nlgeo, orderOfPolygon, posSet, side, and useBasisType.

◆ postInitialize()

void oofem::WeakPeriodicBoundaryCondition::postInitialize ( )
overridevirtual

Performs post initialization steps. Called after all components are created and initialized.

Reimplemented from oofem::FEMComponent.

Definition at line 126 of file weakperiodicbc.C.

References bcID, dofids, oofem::FEMComponent::domain, g, gamma_ids, gammaDman, oofem::FEMComponent::giveNumber(), ndof, ndofids, orderOfPolygon, and tcount.

◆ updateDirection()

◆ updateSminmax()

Member Data Documentation

◆ bcID

int oofem::WeakPeriodicBoundaryCondition::bcID
private

Definition at line 80 of file weakperiodicbc.h.

Referenced by postInitialize().

◆ direction

int oofem::WeakPeriodicBoundaryCondition::direction
private

Direction of normal. 1 if normal in x, 2 if y and 3 if z.

Definition at line 87 of file weakperiodicbc.h.

Referenced by addElementSide(), and updateDirection().

◆ directions

std :: vector< double > oofem::WeakPeriodicBoundaryCondition::directions
private

Keeps track of which coordinate(s) are changing on the surface/edge

Definition at line 117 of file weakperiodicbc.h.

◆ dofids

IntArray oofem::WeakPeriodicBoundaryCondition::dofids
private

ID of dofs on which weak periodicity is imposed

Definition at line 108 of file weakperiodicbc.h.

Referenced by assemble(), computeDeformationGradient(), computeElementTangent(), giveEdgeNormal(), giveInternalForcesVector(), initializeFrom(), and postInitialize().

◆ doUpdateSminmax

bool oofem::WeakPeriodicBoundaryCondition::doUpdateSminmax
private

Definition at line 93 of file weakperiodicbc.h.

Referenced by updateSminmax(), and WeakPeriodicBoundaryCondition().

◆ element

std :: vector< int > oofem::WeakPeriodicBoundaryCondition::element[2]
private

◆ g

FloatArray oofem::WeakPeriodicBoundaryCondition::g
private

Contains prescribed gradient

Definition at line 84 of file weakperiodicbc.h.

Referenced by giveExternalForcesVector(), initializeFrom(), and postInitialize().

◆ gamma_ids

IntArray oofem::WeakPeriodicBoundaryCondition::gamma_ids
private

◆ gammaDman

std :: unique_ptr< Node > oofem::WeakPeriodicBoundaryCondition::gammaDman
private

◆ gsMatrix

FloatMatrix oofem::WeakPeriodicBoundaryCondition::gsMatrix
private

gsMatrix contains coefficients for the Gram-Schmidt polynomials

Definition at line 147 of file weakperiodicbc.h.

Referenced by computeBaseFunctionValue2D(), computeOrthogonalBasis(), and computeProjectionCoefficient().

◆ ndof

int oofem::WeakPeriodicBoundaryCondition::ndof
private

◆ ndofids

int oofem::WeakPeriodicBoundaryCondition::ndofids
private

Number of dofIDs

Definition at line 155 of file weakperiodicbc.h.

Referenced by assemble(), giveInternalForcesVector(), initializeFrom(), and postInitialize().

◆ negSet

int oofem::WeakPeriodicBoundaryCondition::negSet
private

Set containing negative side

Definition at line 105 of file weakperiodicbc.h.

Referenced by initializeFrom(), and updateSminmax().

◆ ngp

int oofem::WeakPeriodicBoundaryCondition::ngp
private

Number of Gausspoints used when integrating along the element edges

Definition at line 96 of file weakperiodicbc.h.

Referenced by initializeFrom().

◆ nlgeo

bool oofem::WeakPeriodicBoundaryCondition::nlgeo
private

Use finite strains?

Definition at line 158 of file weakperiodicbc.h.

Referenced by assemble(), giveInternalForcesVector(), and initializeFrom().

◆ orderOfPolygon

int oofem::WeakPeriodicBoundaryCondition::orderOfPolygon
private

◆ posSet

int oofem::WeakPeriodicBoundaryCondition::posSet
private

Set containing positive side

Definition at line 102 of file weakperiodicbc.h.

Referenced by initializeFrom(), and updateSminmax().

◆ side

std :: vector< int > oofem::WeakPeriodicBoundaryCondition::side[2]
private

side[] keeps track of which side of the triangle is located along the boundary. element[] keeps track of what element is located along the boundary

Definition at line 114 of file weakperiodicbc.h.

Referenced by addElementSide(), assemble(), computeProjectionCoefficient(), giveEdgeNormal(), giveExternalForcesVector(), giveInternalForcesVector(), initializeFrom(), updateDirection(), and updateSminmax().

◆ sideSign

signed int oofem::WeakPeriodicBoundaryCondition::sideSign[2]
private

sideSign is the sign of the normal for each side

Definition at line 111 of file weakperiodicbc.h.

Referenced by assemble(), giveExternalForcesVector(), giveInternalForcesVector(), and updateSminmax().

◆ smax

FloatArray oofem::WeakPeriodicBoundaryCondition::smax
private

Definition at line 92 of file weakperiodicbc.h.

Referenced by computeBaseFunctionValue1D(), updateDirection(), and updateSminmax().

◆ smin

FloatArray oofem::WeakPeriodicBoundaryCondition::smin
private

Definition at line 92 of file weakperiodicbc.h.

Referenced by computeBaseFunctionValue1D(), updateDirection(), and updateSminmax().

◆ surfaceIndexes

IntArray oofem::WeakPeriodicBoundaryCondition::surfaceIndexes
private

Keeps info on which coordinates varies over the surface. Depends on number of spatial dimensions and normal direction

Definition at line 90 of file weakperiodicbc.h.

Referenced by computeBaseFunctionValue(), computeProjectionCoefficient(), updateDirection(), and updateSminmax().

◆ tcount

int oofem::WeakPeriodicBoundaryCondition::tcount
private

Number of terms in polynomial

Definition at line 152 of file weakperiodicbc.h.

Referenced by assemble(), giveInternalForcesVector(), and postInitialize().

◆ useBasisType

basisType oofem::WeakPeriodicBoundaryCondition::useBasisType
private

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