68 for (
int i = 0; i < nsd; i++ ) {
93 return this->
grad.get();
104 std :: vector< FloatArray > jumps;
106 jumps.reserve((2 << (nsd-1)) - 1);
110 jumps.emplace_back(
jump);
121 for (
int inode : nodes ) {
122 Node *masterNode = NULL;
130 if ( masterNode != NULL ) {
148 double domain_size = 0.0;
151 const IntArray &boundaries =
set->giveBoundaryList();
153 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
155 int boundary = boundaries.
at(pos * 2);
159 return fabs(domain_size / nsd);
181 return this->
grad->giveDofWithID(this->
grad_ids[mdof-2]);
221 int neq = Kff->giveNumberOfRows();
237 #pragma omp parallel for shared(Kff, Kfp, Kpp) private(mat, R, floc, ploc) 239 for (
int ielem = 1; ielem <= nelem; ielem++ ) {
248 ma.matrixFromElement(mat, *element, tStep);
251 ma.locationFromElement(floc, *element, fnum);
252 ma.locationFromElement(ploc, *element, pnum);
262 Kff->assemble(floc, mat);
263 Kfp->assemble(floc, ploc, mat);
264 Kpp->assemble(ploc, mat);
268 Kff->assembleBegin();
269 Kfp->assembleBegin();
270 Kpp->assembleBegin();
277 FloatMatrix grad_pert(nsd, nsd), rhs, sol(neq, nsd);
278 grad_pert.resize(nsd, nsd);
279 grad_pert.beUnitMatrix();
282 this->
grad->giveLocationArray(this->
grad_ids, grad_loc, pnum);
284 pert.
assemble(grad_pert, grad_loc, {1,2,3});
292 Kfp->times(pert, rhs);
297 int k1 = n->giveDofWithID( this->
dofs(0) )->__giveEquationNumber();
300 for (
int i = 1; i <= nsd; ++i ) {
313 Kpp->
times(pert, tmpMat);
334 masterContribs.
at(1) = 1.;
335 for (
int i = 1; i <= dx.
giveSize(); ++i ) {
336 masterContribs.
at(i+1) = dx.
at(i);
346 this->
grad->giveUnknownVector(g, this->
grad_ids, mode, tStep);
373 if ( mode == VM_Incremental ) {
The base class for all spatial localizers.
virtual bool isActivated(TimeStep *tStep)
std::map< int, int > slavemap
The representation of EngngModel default unknown numbering.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
REGISTER_BoundaryCondition(BoundaryCondition)
Implementation for assembling internal forces vectors in standard monolithic, nonlinear FE-problems...
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.
std::unique_ptr< Node > grad
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
virtual int giveNumberOfMasterDofs(ActiveDof *dof)
Allows for active boundary conditions to handle their own special DOF.
Abstract class representing field of primary variables (those, which are unknown and are typically as...
Specialized numbering scheme for assembling only specified DofIDs.
double & at(int i)
Coefficient access function.
void findSlaveToMasterMap()
This is the central support function, which finds the corresponding slave nodes for each master node...
void beSubMatrixOf(const FloatMatrix &src, int topRow, int bottomRow, int topCol, int bottomCol)
Assigns to the receiver the sub-matrix of another matrix.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Function * giveTimeFunction()
virtual Dof * giveMasterDof(ActiveDof *dof, int mdof)
Give the pointer to master dof belonging to active DOF.
virtual void computeTangent(FloatMatrix &E, TimeStep *tStep)
virtual FloatArray * giveCoordinates()
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.
Abstract base class for all finite elements.
Base class for dof managers.
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
int giveNumber()
Returns domain number.
int giveNumberOfElements() const
Returns number of elements in domain.
virtual double evalNXIntegral(int boundary, const FEICellGeometry &cellgeo)
Computes the integral .
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual FEInterpolation * giveInterpolation() const
TransportGradientPeriodic(int n, Domain *d)
virtual bool hasBc(Dof *dof, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
#define NM_NoSuccess
Numerical method failed to solve problem.
Class representing a general abstraction for finite element interpolation class.
bool isNotEmpty() const
Tests for empty matrix.
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.
virtual double domainSize(Domain *d, int setNum)
virtual DofManager * giveInternalDofManager(int i)
Gives an internal dof manager from receiver.
virtual void postInitialize()
Performs post initialization steps.
Element * giveElement(int n)
Service for accessing particular domain fe element.
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
DofIDItem
Type representing particular dof type.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
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.
Set of elements, boundaries, edges and/or nodes.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver 'a' transformed using give transformation matrix r.
const IntArray & giveNodeList()
Returns list of all nodes within set.
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
Wrapper around element definition to provide FEICellGeometry interface.
Set * giveSet(int n)
Service for accessing particular domain set.
#define _IFT_TransportGradientPeriodic_jump
virtual bool giveRotationMatrix(FloatMatrix &answer)
Transformation matrices updates rotation matrix between element-local and primary DOFs...
IntArray dofs
Dofs that b.c. is applied to (relevant for Dirichlet type b.c.s).
Abstract base class for all active boundary conditions.
double at(int i, int j) const
Coefficient access function.
Class representing "slave" degree of freedom with an active boundary condition.
void subtract(const FloatMatrix &a)
Subtracts matrix from the receiver.
#define _IFT_TransportGradientPeriodic_gradient
virtual int giveNumberOfInternalDofManagers()
Gives the number of internal dof managers.
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.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Implementation of matrix containing floating point numbers.
virtual double giveBcValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
IRResultType
Type defining the return values of InputRecord reading operations.
double giveUnknown(double val, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
double computeNorm() const
Computes the norm (or length) of the vector.
The representation of EngngModel default prescribed unknown numbering.
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.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
void times(double s)
Multiplies receiver with scalar.
ClassFactory & classFactory
Element in active domain is only mirror of some remote element.
#define _IFT_TransportGradientPeriodic_centerCoords
virtual FloatArray * giveCoordinates()
virtual ~TransportGradientPeriodic()
Domain * giveDomain() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual void computeField(FloatArray &sigma, TimeStep *tStep)
Abstract base class representing the "problem" under consideration.
DofManager * giveDofManager() const
virtual void computeDofTransformation(ActiveDof *dof, FloatArray &masterContribs)
int giveSize() const
Returns the size of receiver.
virtual bool isPrimaryDof(ActiveDof *dof)
Checks to see if the dof is a primary DOF.
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.
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.
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
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.
#define _IFT_TransportGradientPeriodic_masterSet
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
void resize(int s)
Resizes receiver towards requested size.