OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class implementing linear constraint on selected DOFs in the form , where is i-th degree of freedom entering contraint, w_i is corresponding weight, and is given value. More...
#include <linearconstraintbc.h>
Public Member Functions | |
LinearConstraintBC (int n, Domain *d) | |
virtual | ~LinearConstraintBC () |
Destructor. More... | |
IRResultType | initializeFrom (InputRecord *ir) |
Initializes receiver according to object description stored in input record. More... | |
virtual const char * | giveInputRecordName () const |
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 *eNorms=NULL) |
Assembles B.C. 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 int | giveNumberOfInternalDofManagers () |
Gives the number of internal dof managers. More... | |
virtual DofManager * | giveInternalDofManager (int i) |
Gives an internal dof manager from 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... | |
virtual const char * | giveClassName () const |
Public Member Functions inherited from oofem::ActiveBoundaryCondition | |
ActiveBoundaryCondition (int n, Domain *d) | |
Constructor. More... | |
virtual | ~ActiveBoundaryCondition () |
Destructor. More... | |
virtual void | addElementSide (int elem, int side) |
Adds element for active boundary condition. 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 Dof * | giveMasterDof (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... | |
Function * | giveTimeFunction () |
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 IntArray & | giveDofIDs () 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... | |
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... | |
Domain * | giveDomain () 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 Interface * | giveInterface (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 | giveLocArray (const UnknownNumberingScheme &r_s, IntArray &locr, int &lambdaeq) |
Protected Attributes | |
FloatArray | weights |
IntArray | weightsTf |
double | rhs |
int | rhsTf |
IntArray | dofmans |
IntArray | dofs |
std::unique_ptr< DofManager > | md |
IntArray | lhsType |
IntArray | rhsType |
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... | |
Domain * | domain |
Link to domain object, useful for communicating with other FEM components. More... | |
Class implementing linear constraint on selected DOFs in the form , where is i-th degree of freedom entering contraint, w_i is corresponding weight, and is given value.
The weights and constant can have associated loadtime function, so they can evolve in time. By default, the Function value for all weights and constant is set to 1.0. This boundary condition is introduced as additional stationary condition in energy functional using Lagrange multiplier, which is an additional degree of freedom introduced by this boundary condition.
Definition at line 74 of file linearconstraintbc.h.
oofem::LinearConstraintBC::LinearConstraintBC | ( | int | n, |
Domain * | d | ||
) |
Definition at line 51 of file linearconstraintbc.C.
References oofem::IntArray::clear(), oofem::Domain::giveNextFreeDofID(), lhsType, md, and rhsType.
|
virtual |
Destructor.
Definition at line 62 of file linearconstraintbc.C.
|
virtual |
Assembles B.C.
contributions to specified matrix.
[in,out] | answer | Matrix to assemble to. |
tStep | Active time step. | |
tStep | Active time step. | |
type | Type of matrix to assemble. | |
r_s | Row numbering scheme. | |
c_s | Column numbering scheme. | |
scale | Scaling factor. |
Reimplemented from oofem::ActiveBoundaryCondition.
Definition at line 105 of file linearconstraintbc.C.
References oofem::SparseMtrx::assemble(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::FloatMatrix::beTranspositionOf(), oofem::IntArray::contains(), oofem::FEMComponent::domain, oofem::Domain::giveFunction(), oofem::TimeStep::giveIntrinsicTime(), giveLocArray(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::GeneralBoundaryCondition::isImposed(), lhsType, oofem::FloatMatrix::times(), weights, and weightsTf.
|
virtual |
Assembles B.C.
contributions to specified vector.
[in,out] | answer | Vector to assemble to. |
tStep | Active time step. | |
type | Type of matrix to assemble. | |
mode | Mode of value. | |
s | Numbering scheme. | |
eNorms | Norms for each dofid. |
Reimplemented from oofem::ActiveBoundaryCondition.
Definition at line 143 of file linearconstraintbc.C.
References oofem::FloatArray::assemble(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::IntArray::contains(), dofmans, dofs, oofem::FEMComponent::domain, oofem::Function::evaluateAtTime(), oofem::UnknownNumberingScheme::giveDofEquationNumber(), oofem::Domain::giveDofManager(), oofem::Domain::giveFunction(), oofem::TimeStep::giveIntrinsicTime(), giveLocArray(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::Dof::giveUnknown(), md, rhs, rhsTf, rhsType, weights, and weightsTf.
|
inlinevirtual |
Implements oofem::FEMComponent.
Definition at line 116 of file linearconstraintbc.h.
|
inlinevirtual |
Implements oofem::FEMComponent.
Definition at line 97 of file linearconstraintbc.h.
References _IFT_LinearConstraintBC_Name.
|
inlinevirtual |
Gives an internal dof manager from receiver.
Reimplemented from oofem::GeneralBoundaryCondition.
Definition at line 111 of file linearconstraintbc.h.
|
protected |
Definition at line 90 of file linearconstraintbc.C.
References oofem::IntArray::at(), dofmans, dofs, oofem::FEMComponent::domain, oofem::UnknownNumberingScheme::giveDofEquationNumber(), oofem::Domain::giveDofManager(), oofem::FloatArray::giveSize(), md, oofem::IntArray::resize(), and weights.
Referenced by assemble(), assembleVector(), and giveLocationArrays().
|
virtual |
Gives a list of location arrays that will be assembled.
This should only be used to construct zero structure in sparse matrices. The rows and columns location arrays returned in tuples (stored in vector), allowing to efficiently assemble and allocate off-diagonal blocks. The nonzero entries are assembled and allocated for entries at (rows[i], cols[i]) positions.
rows | List of location arrays for r_s. |
cols | List of location arrays for c_s. |
type | Type of matrix to assemble. |
r_s | Row numbering scheme. |
c_s | Column numbering scheme. |
Reimplemented from oofem::ActiveBoundaryCondition.
Definition at line 187 of file linearconstraintbc.C.
References oofem::IntArray::at(), and giveLocArray().
|
inlinevirtual |
Gives the number of internal dof managers.
Reimplemented from oofem::GeneralBoundaryCondition.
Definition at line 109 of file linearconstraintbc.h.
|
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.
ir | Input record to initialize from. |
Reimplemented from oofem::ActiveBoundaryCondition.
Definition at line 67 of file linearconstraintbc.C.
References _IFT_LinearConstraintBC_dofmans, _IFT_LinearConstraintBC_dofs, _IFT_LinearConstraintBC_lhstype, _IFT_LinearConstraintBC_rhs, _IFT_LinearConstraintBC_rhsfuncs, _IFT_LinearConstraintBC_rhstype, _IFT_LinearConstraintBC_weights, _IFT_LinearConstraintBC_weightsfuncs, dofmans, dofs, oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::ActiveBoundaryCondition::initializeFrom(), IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, oofem::IRRT_BAD_FORMAT, lhsType, OOFEM_WARNING, rhs, rhsTf, rhsType, weights, and weightsTf.
|
virtual |
Restores the receiver state previously written in stream.
stream | Input stream. |
mode | Determines amount of info available in stream (state, definition, ...). |
obj | Special parameter for sending extra information. |
throws | an ContextIOERR exception if error encountered. |
Reimplemented from oofem::GeneralBoundaryCondition.
Definition at line 246 of file linearconstraintbc.C.
References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, dofmans, dofs, lhsType, md, oofem::DataStream::read(), oofem::IntArray::restoreYourself(), oofem::FloatArray::restoreYourself(), rhs, rhsTf, rhsType, THROW_CIOERR, weights, and weightsTf.
|
virtual |
Stores receiver state to output stream.
stream | Output stream. |
mode | Determines amount of info required in stream (state, definition, ...). |
obj | Special parameter, used only to send particular integration point to material class version of this method. |
throws | an ContextIOERR exception if error encountered. |
Reimplemented from oofem::GeneralBoundaryCondition.
Definition at line 207 of file linearconstraintbc.C.
References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, dofmans, dofs, lhsType, md, rhs, rhsTf, rhsType, oofem::IntArray::storeYourself(), oofem::FloatArray::storeYourself(), THROW_CIOERR, weights, weightsTf, and oofem::DataStream::write().
|
protected |
Definition at line 81 of file linearconstraintbc.h.
Referenced by assembleVector(), giveLocArray(), initializeFrom(), restoreContext(), and saveContext().
|
protected |
Definition at line 82 of file linearconstraintbc.h.
Referenced by assembleVector(), giveLocArray(), initializeFrom(), restoreContext(), and saveContext().
|
protected |
Definition at line 88 of file linearconstraintbc.h.
Referenced by assemble(), initializeFrom(), LinearConstraintBC(), restoreContext(), and saveContext().
|
protected |
Definition at line 83 of file linearconstraintbc.h.
Referenced by assembleVector(), giveLocArray(), LinearConstraintBC(), restoreContext(), and saveContext().
|
protected |
Definition at line 79 of file linearconstraintbc.h.
Referenced by assembleVector(), initializeFrom(), restoreContext(), and saveContext().
|
protected |
Definition at line 80 of file linearconstraintbc.h.
Referenced by assembleVector(), initializeFrom(), restoreContext(), and saveContext().
|
protected |
Definition at line 89 of file linearconstraintbc.h.
Referenced by assembleVector(), initializeFrom(), LinearConstraintBC(), restoreContext(), and saveContext().
|
protected |
Definition at line 77 of file linearconstraintbc.h.
Referenced by assemble(), assembleVector(), giveLocArray(), initializeFrom(), restoreContext(), and saveContext().
|
protected |
Definition at line 78 of file linearconstraintbc.h.
Referenced by assemble(), assembleVector(), initializeFrom(), restoreContext(), and saveContext().