68 int components = nsd * nsd;
70 for (
int i = 0; i < components; i++ ) {
106 std :: vector< FloatArray > jumps;
108 jumps.reserve((2 << (nsd-1)) - 1);
112 jumps.emplace_back(
jump);
121 for (
int inode : nodes ) {
122 Node *masterNode = NULL;
130 if ( masterNode != NULL ) {
136 if ( masterNode != NULL ) {
168 if ( dofid == D_u || dofid == V_u ) {
170 }
else if ( dofid == D_v || dofid == V_v ) {
198 sigma.
assemble(sig_tmp, {1, 9, 8, 6, 2, 7, 5, 4, 3});
199 }
else if ( sig_tmp.
giveSize() == 4 ) {
200 sigma.
assemble(sig_tmp, {1, 4, 3, 2});
226 int neq = Kfp->giveNumberOfRows();
228 int ncomp = nsd * nsd;
230 FloatMatrix grad_pert(ncomp, ncomp), rhs, sol(neq, ncomp);
231 grad_pert.resize(ncomp, ncomp);
232 grad_pert.beUnitMatrix();
235 Kfp->times(grad_pert, rhs);
236 solver->solve(*Kff, rhs, sol);
240 Kfp->timesT(sol, E_tmp);
243 Kpp->
times(grad_pert, tmpMat);
250 E.
assemble(E_tmp, {1, 6, 5, 6, 2, 4, 5, 4, 3});
252 E.
assemble(E_tmp, {1, 9, 8, 6, 2, 7, 5, 4, 3});
254 }
else if ( nsd == 2 ) {
273 masterContribs.
resize(nsd + 1);
275 masterContribs.
at(1) = 1.;
276 for (
int i = 1; i <= dx.
giveSize(); ++i ) {
277 masterContribs.
at(i+1) = dx.
at(i);
292 if (
id == D_u ||
id == V_u ||
id == P_f ||
id == T_f ) {
294 }
else if (
id == D_v ||
id == V_v ) {
303 grad(i % 3, i / 3) = dof->
giveUnknown(mode, tStep);
307 return val + uM.
at(ind);
333 if ( mode == VM_Incremental ) {
The base class for all spatial localizers.
int giveNumberOfColumns() const
Returns number of columns of receiver.
The representation of EngngModel default unknown numbering.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
virtual void computeTangent(FloatMatrix &E, TimeStep *tStep)
Computes the macroscopic tangent for homogenization problems through sensitivity analysis.
REGISTER_BoundaryCondition(BoundaryCondition)
Implementation for assembling internal forces vectors in standard monolithic, nonlinear FE-problems...
virtual void giveInputRecord(DynamicInputRecord &input)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
Class for homogenization of applied gradients.
Abstract class representing field of primary variables (those, which are unknown and are typically as...
virtual double domainSize()
Specialized numbering scheme for assembling only specified DofIDs.
virtual Dof * giveMasterDof(ActiveDof *dof, int mdof)
Give the pointer to master dof belonging to active DOF.
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Function * giveTimeFunction()
virtual int giveNumberOfMasterDofs(ActiveDof *dof)
Allows for active boundary conditions to handle their own special DOF.
virtual FloatArray * giveCoordinates()
virtual double giveUnknown(ValueModeType mode, TimeStep *tStep)=0
The key method of class Dof.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Implementation for assembling tangent matrices in standard monolithic FE-problems.
double giveTargetTime()
Returns target time.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Base class for dof managers.
int giveNumber()
Returns domain number.
std::unique_ptr< Node > strain
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
Class implementing an array of integers.
virtual void computeField(FloatArray &sigma, TimeStep *tStep)
Computes the homogenized, macroscopic, field (stress).
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
virtual double giveBcValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
virtual ~PrescribedGradientBCPeriodic()
virtual DofManager * giveInternalDofManager(int i)
Gives an internal dof manager from receiver.
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &s, Domain *domain)
Assembles characteristic matrix of required type into given sparse matrix.
Class representing "master" degree of freedom.
virtual bool isPrimaryDof(ActiveDof *dof)
Checks to see if the dof is a primary DOF.
#define _IFT_PrescribedGradientBCPeriodic_masterSet
#define _IFT_PrescribedGradientBCPeriodic_jump
PrescribedGradientBCPeriodic(int n, Domain *d)
DofIDItem
Type representing particular dof type.
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
virtual Node * giveNodeClosestToPoint(const FloatArray &coords, double maxDist)=0
Returns the node closest to the given coordinate.
Implementation for assembling external forces vectors in standard monolithic FE-problems.
void times(double f)
Multiplies receiver by factor f.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
const IntArray & giveNodeList()
Returns list of all nodes within set.
virtual void postInitialize()
Performs post initialization steps.
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
Set * giveSet(int n)
Service for accessing particular domain set.
virtual bool hasBc(Dof *dof, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Abstract base class for all active boundary conditions.
std::map< int, int > slavemap
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
FloatMatrix mGradient
Prescribed gradient .
Class representing "slave" degree of freedom with an active boundary condition.
void subtract(const FloatMatrix &a)
Subtracts matrix from the receiver.
int giveNextFreeDofID(int increment=1)
Gives the next free dof ID.
Class representing vector of real numbers.
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
void findSlaveToMasterMap()
This is the central support function, which finds the corresponding slave nodes for each master node...
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
void assemble(const FloatArray &fe, const IntArray &loc)
Assembles the array fe (typically, the load vector of a finite element) into the receiver, using loc as location array.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void giveInputRecord(DynamicInputRecord &input)
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
void zero()
Zeroes all coefficients of receiver.
void times(double s)
Multiplies receiver with scalar.
ClassFactory & classFactory
virtual FloatArray * giveCoordinates()
Domain * giveDomain() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Abstract base class representing the "problem" under consideration.
DofManager * giveDofManager() const
int giveSize() const
Returns the size of receiver.
Node * giveNode(int n)
Service for accessing particular domain node.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void assemble(const FloatMatrix &src, const IntArray &loc)
Assembles the contribution using localization array into receiver.
bool isStrainDof(Dof *dof)
Class implementing node in finite element mesh.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
int giveNumberOfRows() const
Returns number of rows of receiver.
virtual void computeDofTransformation(ActiveDof *dof, FloatArray &masterContribs)
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
virtual int giveNumberOfInternalDofManagers()
Gives the number of internal dof managers.
void assembleVector(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Assembles characteristic vector of required type from dofManagers, element, and active boundary condi...
Class representing solution step.
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
double giveUnknown(double val, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
void resize(int s)
Resizes receiver towards requested size.