116 OOFEM_ERROR(
"Size of coordinate system different from center coordinate in b.c.");
120 if ( mode == VM_Total ) {
122 }
else if ( mode == VM_Velocity ) {
124 }
else if ( mode == VM_Acceleration ) {
127 OOFEM_ERROR(
"Should not be called for value mode type then total, velocity, or acceleration.");
134 if ( !
xis.empty() ) {
146 double domain_size = 0.0;
148 for (
auto &surf : this->
surfSets ) {
151 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
153 int boundary = boundaries.
at(pos * 2);
161 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
163 int boundary = boundaries.
at(pos * 2);
168 return fabs(domain_size / nsd);
186 Dof *d1 = n->giveDofWithID( this->
dofs(0) );
192 xi =
xis[n->giveNumber()];
194 for (
int i = 1; i <= nsd; ++i ) {
249 OOFEM_ERROR(
"Couldn't create sparse matrix of type %d\n", stype);
251 Kff->buildInternalStructure(rve, 1, fnum);
253 Kpf->buildInternalStructure(rve, 1, pnum, fnum);
254 Kpp->buildInternalStructure(rve, 1, pnum);
270 #pragma omp parallel for shared(Kff, Kpf, Kpp) private(mat, R, floc, ploc) 272 for (
int ielem = 1; ielem <= nelem; ielem++ ) {
281 ma.matrixFromElement(mat, *element, tStep);
284 ma.locationFromElement(floc, *element, fnum);
285 ma.locationFromElement(ploc, *element, pnum);
295 Kff->assemble(floc, mat);
296 Kpf->assemble(ploc, floc, mat);
297 Kpp->assemble(ploc, mat);
301 Kff->assembleBegin();
302 Kpf->assembleBegin();
303 Kpp->assembleBegin();
315 Kpf->timesT(C, KfpC);
318 sol.resize(KfpC.giveNumberOfRows(), KfpC.giveNumberOfColumns());
321 int k1 = n->giveDofWithID( this->
dofs(0) )->__giveEquationNumber();
324 for (
int i = 1; i <= nsd; ++i ) {
336 Kpf->times(sol, Kpfa);
354 for (
auto &surf : this->
surfSets ) {
362 std :: vector< std :: vector< int > > surf2edges = {{1, 2, 3, 4},
372 std :: vector< Set > edgeSets;
373 std :: vector< std :: vector< std :: tuple< int, int > > > surfedges( this->surfSets.giveSize() );
374 for (
int i = 0; i < this->surfSets.giveSize(); ++i ) {
376 surfedges[i].reserve( 4 * surfs.
giveSize() / 2 );
377 for (
int pos = 0; pos < surfs.
giveSize() / 2; ++pos ) {
378 for (
int edgenum : surf2edges[surfs[pos * 2 + 1]-1] ) {
379 surfedges[i].emplace_back( std :: make_tuple(surfs[pos * 2], edgenum) );
384 for (
int i = 0; i < this->surfSets.giveSize() - 1; ++i ) {
385 for (
int j = i+1; j < this->surfSets.giveSize(); ++j ) {
386 std :: vector< std :: tuple< int, int > > ijEdgeSet;
387 std :: set_intersection(surfedges[i].begin(), surfedges[i].end(),
388 surfedges[j].begin(), surfedges[j].end(), std::back_inserter(ijEdgeSet));
391 for (
auto &
edge : ijEdgeSet ) {
399 edgeSets.emplace_back(std :: move(s));
408 for (
auto &setPointer : edgeSets ) {
409 const IntArray &nodes = setPointer.giveNodeList();
410 for (
int n : nodes ) {
421 for (
auto &setPointer : edgeSets ) {
422 const IntArray &edges = setPointer.giveEdgeList();
425 std :: map< int, int > eqs;
427 for (
int n : setPointer.giveNodeList() ) {
443 for (
int pos = 0; pos < edges.
giveSize() / 2; ++pos ) {
445 int edge = edges[pos * 2 + 1];
458 for (
auto &gp: *ir ) {
459 const FloatArray &lcoords = gp->giveNaturalCoordinates();
465 double dL = detJ * gp->giveWeight();
472 for (
int i = 1; i <= b.
giveSize(); ++i ) {
480 double k = D.
at(1,1);
490 for (
int i = 1; i <= bNodes.
giveSize(); ++i ) {
491 int enode = bNodes.
at(i);
494 cvec.
at(i, 1) = x.
at(1);
495 cvec.at(i, 2) = x.
at(2);
496 cvec.at(i, 3) = x.
at(3);
503 K->assemble(loc, Ke);
508 solver->solve(*K, f, x);
510 for (
int n : setPointer.giveNodeList() ) {
513 this->
xis[n] = {x.
at(eq, 1), x.
at(eq, 2), x.
at(eq, 3)};
522 for (
auto &setNum : surfSets ) {
527 std :: map< int, int > eqs;
547 for (
int pos = 0; pos < surfs.
giveSize() / 2; ++pos ) {
549 int surf = surfs[pos * 2 + 1];
559 for (
auto &gp: *ir ) {
560 const FloatArray &lcoords = gp->giveNaturalCoordinates();
568 double dA = detJ * gp->giveWeight();
573 for (
int k = 1; k <= 3; ++k ) {
574 tmp += normal.
at(k) * B.
at(k,j);
576 B.
at(i,j) -= normal.
at(i) * tmp;
595 for (
int i = 1; i <= bNodes.
giveSize(); ++i ) {
596 int enode = bNodes.
at(i);
599 cvec.at(i, 1) = x.
at(1);
600 cvec.at(i, 2) = x.
at(2);
601 cvec.at(i, 3) = x.
at(3);
607 K->assemble(loc, Ke);
626 solver->solve(*K, q, qx);
627 solver->solve(*K, f, x);
637 this->
xis[n] = {x.
at(eq, 1), x.
at(eq, 2), x.
at(eq, 3)};
virtual bool isActivated(TimeStep *tStep)
int giveNumberOfColumns() const
Returns number of columns of receiver.
The representation of EngngModel default unknown numbering.
virtual void boundaryEdgeGiveNodes(IntArray &answer, int boundary)
Gives the boundary nodes for requested boundary number.
REGISTER_BoundaryCondition(BoundaryCondition)
virtual double evaluateAccelerationAtTime(double t)=0
Returns the second time derivative of the function at given time.
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
Implementation for assembling internal forces vectors in standard monolithic, nonlinear FE-problems...
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
virtual double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the normal on the requested boundary.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
const IntArray & giveBoundaryList()
Returns list of element boundaries within set.
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Function * giveTimeFunction()
int giveInterpolationOrder()
Returns the interpolation order.
bool insertSortedOnce(int value, int allocChunk=0)
Inserts given value into a receiver, which is assumed to be sorted.
virtual FloatArray * giveCoordinates()
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Implementation for assembling tangent matrices in standard monolithic FE-problems.
Abstract base class for all finite elements.
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
void negated()
Changes sign of receiver values.
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 .
void plusDyadUnsym(const FloatArray &a, const FloatArray &b, double dV)
Adds to the receiver the product .
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int __givePrescribedEquationNumber()=0
Returns prescribed equation number of receiver.
virtual FEInterpolation * giveInterpolation() const
virtual void edgeEvaldNdxi(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of edge interpolation functions (shape functions) at given point...
virtual IntegrationRule * giveBoundaryIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
#define NM_NoSuccess
Numerical method failed to solve problem.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
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.
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
virtual void computeTangent(FloatMatrix &tangent, TimeStep *tStep)
Computes the macroscopic tangent for homogenization problems through sensitivity analysis.
#define OOFEM_LOG_INFO(...)
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.
virtual void boundaryGiveNodes(IntArray &answer, int boundary)
Gives the boundary nodes for requested boundary number.
std::map< int, FloatArray > xis
Stores one "psi" value for each node.
#define _IFT_TransportGradientDirichlet_gradient
virtual void computeField(FloatArray &sigma, TimeStep *tStep)
Computes the homogenized, macroscopic, field (stress).
virtual double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation Jacobian on the requested boundary.
void setEdgeList(IntArray newEdges)
Sets list of element edges within set (must be edges of 3D elements).
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
Implementation for assembling external forces vectors in standard monolithic FE-problems.
void times(double f)
Multiplies receiver by factor f.
This abstract class represent a general base element class for transport problems.
Set of elements, boundaries, edges and/or nodes.
void computeXi()
Computes the offset values for "improved" Dirichlet. See class description.
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver 'a' transformed using give transformation matrix r.
virtual double give(Dof *dof, ValueModeType mode, double time)
const IntArray & giveNodeList()
Returns list of all nodes within set.
Wrapper around element definition to provide FEICellGeometry interface.
Set * giveSet(int n)
Service for accessing particular domain set.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
virtual bool giveRotationMatrix(FloatMatrix &answer)
Transformation matrices updates rotation matrix between element-local and primary DOFs...
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
IntArray dofs
Dofs that b.c. is applied to (relevant for Dirichlet type b.c.s).
#define _IFT_TransportGradientDirichlet_tractionControl
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
double at(int i, int j) const
Coefficient access function.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual double evaluateVelocityAtTime(double t)=0
Returns the first time derivative of the function at given time.
virtual void postInitialize()
Performs post initialization steps.
Class representing vector of real numbers.
void plusDyadSymmUpper(const FloatArray &a, double dV)
Adds to the receiver the dyadic product .
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
virtual void postInitialize()
Performs post initialization steps.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
GaussPoint * getIntegrationPoint(int n)
Access particular integration point of receiver.
virtual void surfaceEvaldNdx(FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of edge interpolation functions (shape functions) at given point...
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.
The representation of EngngModel default prescribed unknown numbering.
Class representing a general abstraction for surface finite element interpolation class...
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
void zero()
Zeroes all coefficients of receiver.
Class implementing single timer, providing wall clock and user time capabilities. ...
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
#define _IFT_TransportGradientDirichlet_surfSets
#define _IFT_TransportGradientDirichlet_centerCoords
virtual void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the basis functions on the requested boundary.
void times(double s)
Multiplies receiver with scalar.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
ClassFactory & classFactory
Element in active domain is only mirror of some remote element.
virtual FloatArray * giveCoordinates()
void zero()
Zeroes all coefficient of receiver.
Domain * giveDomain() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Abstract base class representing the "problem" under consideration.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
DofManager * giveDofManager() const
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
int giveSize() const
Returns the size of receiver.
void preallocate(int futureSize)
Preallocates receiver to given futureSize if larger then allocatedSize.
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.
bool containsSorted(int value) const
Checks if sorted receiver contains a given value.
void computeCoefficientMatrix(FloatMatrix &C)
Constructs a coefficient matrix for all prescribed unknowns.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
double normalize()
Normalizes receiver.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
int giveNumberOfRows() const
Returns number of rows of receiver.
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
double getUtime()
Returns total user time elapsed in seconds.
virtual IntegrationRule * giveBoundaryEdgeIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
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.
void add(const FloatArray &src)
Adds array src to receiver.
void resize(int s)
Resizes receiver towards requested size.