OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::WeakPeriodicBoundaryCondition Class Reference

Imposes weak periodicity on the doftype of choice. More...

#include <weakperiodicbc.h>

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

Public Member Functions

 WeakPeriodicBoundaryCondition (int n, Domain *d)
 
virtual ~WeakPeriodicBoundaryCondition ()
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
basisType giveBasisType ()
 
virtual void assemble (SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0)
 Assembles B.C. More...
 
virtual void assembleVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorm=NULL)
 Assembles B.C. More...
 
void giveInternalForcesVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorm=NULL)
 
void giveExternalForcesVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s)
 
virtual int giveNumberOfInternalDofManagers ()
 Gives the number of internal dof managers. More...
 
virtual DofManagergiveInternalDofManager (int i)
 Gives an internal dof manager from receiver. More...
 
virtual void addElementSide (int elem, int side)
 Adds element for active boundary condition. More...
 
virtual const char * giveClassName () const
 
virtual const char * giveInputRecordName () const
 
- Public Member Functions inherited from oofem::ActiveBoundaryCondition
 ActiveBoundaryCondition (int n, Domain *d)
 Constructor. More...
 
virtual ~ActiveBoundaryCondition ()
 Destructor. More...
 
virtual void giveLocationArrays (std::vector< IntArray > &rows, std::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
 Gives a list of location arrays that will be assembled. More...
 
virtual bool requiresActiveDofs ()
 Checks to see if active boundary condition requires special DOFs. More...
 
virtual bool isPrimaryDof (ActiveDof *dof)
 Checks to see if the dof is a primary DOF. More...
 
virtual double giveBcValue (Dof *dof, ValueModeType mode, TimeStep *tStep)
 Returns the prescribed value of a dof (if any). More...
 
virtual bool hasBc (Dof *dof, TimeStep *tStep)
 Returns the prescribed value of a dof (if any). More...
 
virtual int giveNumberOfMasterDofs (ActiveDof *dof)
 Allows for active boundary conditions to handle their own special DOF. More...
 
virtual DofgiveMasterDof (ActiveDof *dof, int mdof)
 Give the pointer to master dof belonging to active DOF. More...
 
virtual void computeDofTransformation (ActiveDof *dof, FloatArray &masterContribs)
 
virtual double giveUnknown (PrimaryField &field, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
 Computes the value of the dof. More...
 
virtual double giveUnknown (ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
 Computes the value of the dof. More...
 
- Public Member Functions inherited from oofem::GeneralBoundaryCondition
 GeneralBoundaryCondition (int n, Domain *d)
 Constructor. More...
 
virtual ~GeneralBoundaryCondition ()
 Destructor. More...
 
int giveSetNumber ()
 Gives the set number which boundary condition is applied to. More...
 
FunctiongiveTimeFunction ()
 
virtual bcValType giveBCValType () const
 Returns receiver load type. More...
 
virtual bool isImposed (TimeStep *tStep)
 Returns nonzero if receiver representing BC is imposed at given time, otherwise returns zero. More...
 
virtual const IntArraygiveDofIDs () const
 Array with default dofs which b.c. More...
 
virtual bcType giveType () const
 
virtual bcGeomType giveBCGeoType () const
 Returns geometry character of boundary condition. More...
 
virtual void scale (double s)
 Scales the receiver according to given value. More...
 
virtual void postInitialize ()
 Performs post initialization steps. More...
 
virtual void giveInputRecord (DynamicInputRecord &input)
 Setups the input record string of receiver. More...
 
virtual contextIOResultType saveContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Stores receiver state to output stream. More...
 
virtual contextIOResultType restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL)
 Restores the receiver state previously written in stream. More...
 
- Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
 Regular constructor, creates component with given number and belonging to given domain. More...
 
virtual ~FEMComponent ()
 Virtual destructor. More...
 
DomaingiveDomain () const
 
virtual void setDomain (Domain *d)
 Sets associated Domain. More...
 
int giveNumber () const
 
void setNumber (int num)
 Sets number of receiver. More...
 
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
 Local renumbering support. More...
 
virtual int checkConsistency ()
 Allows programmer to test some internal data, before computation begins. More...
 
virtual void printOutputAt (FILE *file, TimeStep *tStep)
 Prints output of receiver to stream, for given time step. More...
 
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging. More...
 
virtual InterfacegiveInterface (InterfaceType t)
 Interface requesting service. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

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)
 Compute exponent for term n. More...
 
void computeOrthogonalBasis ()
 Compute orthogonal polynomial basis using Gram-Smidth process. More...
 
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
 Contains prescribed gradient. More...
 
int direction
 Direction of normal. More...
 
IntArray surfaceIndexes
 Keeps info on which coordinates varies over the surface. More...
 
FloatArray smax
 
FloatArray smin
 
bool doUpdateSminmax
 
int ngp
 Number of Gausspoints used when integrating along the element edges. More...
 
int ndof
 Number of degrees of freedom (number of terms) More...
 
int posSet
 Set containing positive side. More...
 
int negSet
 Set containing negative side. More...
 
IntArray dofids
 ID of dofs on which weak periodicity is imposed. More...
 
signed int sideSign [2]
 sideSign is the sign of the normal for each side More...
 
std::vector< int > side [2]
 side[] keeps track of which side of the triangle is located along the boundary. More...
 
std::vector< int > element [2]
 
std::vector< double > directions
 Keeps track of which coordinate(s) are changing on the surface/edge. More...
 
std::unique_ptr< NodegammaDman
 
IntArray gamma_ids
 
FloatMatrix gsMatrix
 gsMatrix contains coefficients for the Gram-Schmidt polynomials More...
 
int tcount
 Number of terms in polynomial. More...
 
int ndofids
 Number of dofIDs. More...
 
bool nlgeo
 Use finite strains? More...
 

Additional Inherited Members

- Protected Attributes inherited from oofem::GeneralBoundaryCondition
int timeFunction
 Associated load time function. More...
 
bcValType valType
 Physical meaning of BC value. More...
 
IntArray dofs
 Dofs that b.c. is applied to (relevant for Dirichlet type b.c.s). More...
 
int isImposedTimeFunction
 Zero by default - the BC is than always imposed. More...
 
int set
 Set number for boundary condition to be applied to. More...
 
- Protected Attributes inherited from oofem::FEMComponent
int number
 Component number. More...
 
Domaindomain
 Link to domain object, useful for communicating with other FEM components. More...
 

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

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

Definition at line 63 of file weakperiodicbc.C.

References doUpdateSminmax, oofem::monomial, and useBasisType.

oofem::WeakPeriodicBoundaryCondition::~WeakPeriodicBoundaryCondition ( )
virtual

Definition at line 69 of file weakperiodicbc.C.

Member Function Documentation

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

Adds element for active boundary condition.

Parameters
elemElement number.
sideSide number.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 361 of file weakperiodicbc.C.

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

void oofem::WeakPeriodicBoundaryCondition::assemble ( SparseMtrx answer,
TimeStep tStep,
CharType  type,
const UnknownNumberingScheme r_s,
const UnknownNumberingScheme c_s,
double  scale = 1.0 
)
virtual
void oofem::WeakPeriodicBoundaryCondition::assembleVector ( FloatArray answer,
TimeStep tStep,
CharType  type,
ValueModeType  mode,
const UnknownNumberingScheme s,
FloatArray eNorms = NULL 
)
virtual

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.
Returns
Equivalent of the sum of the element norm (squared) of assembled vector.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 656 of file weakperiodicbc.C.

References giveExternalForcesVector(), and giveInternalForcesVector().

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

Definition at line 881 of file weakperiodicbc.C.

Referenced by computeBaseFunctionValue1D().

double oofem::WeakPeriodicBoundaryCondition::computeBaseFunctionValue1D ( int  baseID,
double  coordinate 
)
private
double oofem::WeakPeriodicBoundaryCondition::computeBaseFunctionValue2D ( int  baseID,
FloatArray  coordinate 
)
private
void oofem::WeakPeriodicBoundaryCondition::computeOrthogonalBasis ( )
private
double oofem::WeakPeriodicBoundaryCondition::factorial ( int  n)
private

Definition at line 872 of file weakperiodicbc.C.

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 890 of file weakperiodicbc.C.

Referenced by computeBaseFunctionValue2D(), and computeProjectionCoefficient().

basisType oofem::WeakPeriodicBoundaryCondition::giveBasisType ( )
inline

Definition at line 166 of file weakperiodicbc.h.

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

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

Implements oofem::FEMComponent.

Definition at line 189 of file weakperiodicbc.h.

void oofem::WeakPeriodicBoundaryCondition::giveEdgeNormal ( FloatArray answer,
int  element,
int  side 
)
private
virtual const char* oofem::WeakPeriodicBoundaryCondition::giveInputRecordName ( ) const
inlinevirtual
Returns
Input record name of the receiver.

Implements oofem::FEMComponent.

Definition at line 190 of file weakperiodicbc.h.

References _IFT_WeakPeriodicBoundaryCondition_Name.

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

Gives an internal dof manager from receiver.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 863 of file weakperiodicbc.C.

References gammaDman.

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

int oofem::WeakPeriodicBoundaryCondition::giveNumberOfInternalDofManagers ( )
virtual

Gives the number of internal dof managers.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 858 of file weakperiodicbc.C.

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

IRResultType oofem::WeakPeriodicBoundaryCondition::initializeFrom ( InputRecord ir)
virtual

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.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
Returns
IRResultType
Todo:
Carl, remove this line and use elementsidespositive/negative instead.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 74 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_ngp, _IFT_WeakPeriodicBoundaryCondition_nlgeo, _IFT_WeakPeriodicBoundaryCondition_order, oofem::IntArray::at(), bcID, oofem::IntArray::clear(), dofids, oofem::FEMComponent::domain, element, oofem::IntArray::followedBy(), g, gamma_ids, gammaDman, oofem::Domain::giveNextFreeDofID(), oofem::FEMComponent::giveNumber(), oofem::Domain::giveNumberOfSpatialDimensions(), oofem::IntArray::giveSize(), oofem::ActiveBoundaryCondition::initializeFrom(), IR_GIVE_OPTIONAL_FIELD, oofem::IRRT_BAD_FORMAT, oofem::IRRT_OK, oofem::monomial, ndof, ndofids, negSet, ngp, nlgeo, OOFEM_WARNING, orderOfPolygon, posSet, oofem::FloatArray::resize(), side, tcount, useBasisType, and oofem::FloatArray::zero().

Member Data Documentation

int oofem::WeakPeriodicBoundaryCondition::bcID
private

Definition at line 80 of file weakperiodicbc.h.

Referenced by initializeFrom().

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().

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.

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(), and initializeFrom().

bool oofem::WeakPeriodicBoundaryCondition::doUpdateSminmax
private

Definition at line 93 of file weakperiodicbc.h.

Referenced by updateSminmax(), and WeakPeriodicBoundaryCondition().

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

Contains prescribed gradient.

Definition at line 84 of file weakperiodicbc.h.

Referenced by giveExternalForcesVector(), and initializeFrom().

IntArray oofem::WeakPeriodicBoundaryCondition::gamma_ids
private
std :: unique_ptr< Node > oofem::WeakPeriodicBoundaryCondition::gammaDman
private
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().

int oofem::WeakPeriodicBoundaryCondition::ndof
private
int oofem::WeakPeriodicBoundaryCondition::ndofids
private

Number of dofIDs.

Definition at line 155 of file weakperiodicbc.h.

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

int oofem::WeakPeriodicBoundaryCondition::negSet
private

Set containing negative side.

Definition at line 105 of file weakperiodicbc.h.

Referenced by initializeFrom(), and updateSminmax().

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().

bool oofem::WeakPeriodicBoundaryCondition::nlgeo
private

Use finite strains?

Definition at line 158 of file weakperiodicbc.h.

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

int oofem::WeakPeriodicBoundaryCondition::orderOfPolygon
private
int oofem::WeakPeriodicBoundaryCondition::posSet
private

Set containing positive side.

Definition at line 102 of file weakperiodicbc.h.

Referenced by initializeFrom(), and updateSminmax().

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(), giveExternalForcesVector(), giveInternalForcesVector(), initializeFrom(), updateDirection(), and updateSminmax().

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().

FloatArray oofem::WeakPeriodicBoundaryCondition::smax
private

Definition at line 92 of file weakperiodicbc.h.

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

FloatArray oofem::WeakPeriodicBoundaryCondition::smin
private

Definition at line 92 of file weakperiodicbc.h.

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

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().

int oofem::WeakPeriodicBoundaryCondition::tcount
private

Number of terms in polynomial.

Definition at line 152 of file weakperiodicbc.h.

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

basisType oofem::WeakPeriodicBoundaryCondition::useBasisType
private

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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:43 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011