62 for (
int i = 0; i < nsd * nsd; i++ ) {
106 if ( type == ExternalForcesVector ) {
114 stressLoad.
beScaled(-rve_size*loadLevel, gradVoigt);
116 answer.
assemble(stressLoad, sigma_loc);
117 }
else if ( type == InternalForcesVector ) {
121 IntArray loc, masterDofIDs, sigmaMasterDofIDs;
131 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
133 int boundary = boundaries.
at(pos * 2);
155 if ( eNorm != NULL ) {
166 if ( type == TangentStiffnessMatrix || type == SecantStiffnessMatrix || type == ElasticStiffnessMatrix ) {
168 IntArray loc_r, loc_c, sigma_loc_r, sigma_loc_c;
170 const IntArray &boundaries =
set->giveBoundaryList();
176 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
178 int boundary = boundaries.
at(pos * 2);
193 answer.
assemble(sigma_loc_r, loc_c, Ke);
194 answer.
assemble(loc_r, sigma_loc_c, KeT);
197 OOFEM_LOG_DEBUG(
"Skipping assembly in PrescribedGradientBCNeumann::assemble().");
204 IntArray loc_r, loc_c, sigma_loc_r, sigma_loc_c;
211 const IntArray &boundaries =
set->giveBoundaryList();
214 cols.resize( boundaries.
giveSize() );
216 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
229 cols [ i ] = sigma_loc_c;
232 rows [ i ] = sigma_loc_r;
248 std :: unique_ptr< SparseLinearSystemNM > solver(
263 OOFEM_ERROR(
"Couldn't create sparse matrix of type %d\n", stype);
271 int neq = Kff->giveNumberOfRows();
274 for (
int i = 1; i <= neq; ++i ) {
280 std :: unique_ptr< SparseMtrx > Kuu(Kff->giveSubMatrix(loc_u, loc_u));
282 std :: unique_ptr< SparseMtrx > Kus(Kff->giveSubMatrix(loc_u, loc_s));
283 FloatMatrix eye(Kus->giveNumberOfColumns(), Kus->giveNumberOfColumns());
286 Kus->
times(KusD, eye);
294 solver->solve(*Kuu, KusD, us);
304 tangent.
times(rve_size);
327 std :: unique_ptr< IntegrationRule > ir;
333 if ( interp2d == NULL ) {
334 OOFEM_ERROR(
"failed to cast to FEInterpolation2d.")
341 std :: vector< Line >segments;
342 std :: vector< FloatArray >intersecPoints;
346 int numPointsPerSeg = 1;
347 ir->SetUpPointsOnLine(numPointsPerSeg, matMode);
354 for (
auto &gp: *ir ) {
355 const FloatArray &lcoords = gp->giveNaturalCoordinates();
384 E_n.
at(1, 1) = normal.
at(1);
385 E_n.
at(2, 2) = normal.
at(2);
386 E_n.
at(3, 3) = normal.
at(3);
387 E_n.
at(4, 1) = normal.
at(2);
388 E_n.
at(5, 1) = normal.
at(3);
389 E_n.
at(6, 2) = normal.
at(3);
390 E_n.
at(7, 2) = normal.
at(1);
391 E_n.
at(8, 3) = normal.
at(1);
392 E_n.
at(9, 3) = normal.
at(2);
393 }
else if ( nsd == 2 ) {
394 E_n.
at(1, 1) = normal.
at(1);
395 E_n.
at(2, 2) = normal.
at(2);
396 E_n.
at(3, 1) = normal.
at(2);
397 E_n.
at(4, 2) = normal.
at(1);
399 E_n.
at(1, 1) = normal.
at(1);
404 oTangent.
add(detJ * gp->giveWeight(), contrib);
bool contains(int value) const
The representation of EngngModel default unknown numbering.
virtual void computeField(FloatArray &sigma, TimeStep *tStep)
Computes the homogenized, macroscopic, field (stress).
void integrateTangent(FloatMatrix &oTangent, Element *e, int iBndIndex)
Help function that integrates the tangent contribution from a single element boundary.
REGISTER_BoundaryCondition(BoundaryCondition)
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)=0
Assembles sparse matrix from contribution of local elements.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
virtual void computeTangent(FloatMatrix &tangent, TimeStep *tStep)
Computes the macroscopic tangent for homogenization problems through sensitivity analysis.
virtual void giveInputRecord(DynamicInputRecord &input)
virtual DofManager * giveInternalDofManager(int i)
Gives an internal dof manager from receiver.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Base class for all matrices stored in sparse format.
virtual ~PrescribedGradientBCNeumann()
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.
const IntArray & giveBoundaryList()
Returns list of element boundaries within set.
Class for homogenization of applied gradients.
virtual double domainSize()
Provides Xfem interface for an element.
virtual double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the normal on the requested boundary.
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Function * giveTimeFunction()
Class representing a general abstraction for surface finite element interpolation class...
int giveInterpolationOrder()
Returns the interpolation order.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Implementation for assembling tangent matrices in standard monolithic FE-problems.
DiscontinuousSegmentIntegrationRule provides integration over a discontinuous boundary segment...
double giveTargetTime()
Returns target time.
Abstract base class for all finite elements.
void giveStressLocationArray(IntArray &oCols, const UnknownNumberingScheme &r_s)
Base class for dof managers.
virtual MaterialMode giveMaterialMode()
Returns material mode for receiver integration points.
void negated()
Changes sign of receiver values.
int giveNumber()
Returns domain number.
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
MaterialMode
Type representing material mode of integration point.
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual void computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)=0
virtual FEInterpolation * giveInterpolation() const
virtual void giveInputRecord(DynamicInputRecord &input)
Class representing a general abstraction for finite element interpolation class.
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.
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
int giveSetNumber()
Gives the set number which boundary condition is applied to.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Element * giveElement(int n)
Service for accessing particular domain fe element.
DofIDItem
Type representing particular dof type.
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Maps the local boundary coordinates to global.
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Returns the location array (array of code numbers) of receiver for given numbering scheme...
void times(double f)
Multiplies receiver by factor f.
Set of elements, boundaries, edges and/or nodes.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
void XfemElementInterface_createEnrNmatrixAt(FloatMatrix &oAnswer, const FloatArray &iLocCoord, Element &iEl, bool iSetDiscontContribToZero)
Creates enriched N-matrix.
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.
Abstract base class for all active boundary conditions.
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.
void resize(int n)
Checks size of receiver towards requested bounds.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
FloatMatrix mGradient
Prescribed gradient .
void partitionEdgeSegment(int iBndIndex, std::vector< Line > &oSegments, std::vector< FloatArray > &oIntersectionPoints, const double &iTangDistPadding=0.0)
Partition a boundary segment to account for cracks cutting the boundary.
void beNMatrixOf(const FloatArray &n, int nsd)
Assigns the receiver to be a repeated diagonal matrix.
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.
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 IntegrationRule * giveBoundaryIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
void add(const FloatMatrix &a)
Adds matrix to the receiver.
virtual void scale(double s)
Scales the receiver according to given value.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0)
Assembles B.C.
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
void assembleSquared(const FloatArray &fe, const IntArray &loc)
Assembles the array fe with each component squared.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
PrescribedGradientBCNeumann(int n, Domain *d)
ClassFactory & classFactory
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
void zero()
Zeroes all coefficient of receiver.
void giveGradientVoigt(FloatArray &oGradient) const
Gives back the applied gradient in Voigt form.
std::unique_ptr< Node > mpSigmaHom
DOF-manager containing the unknown homogenized stress.
Domain * giveDomain() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
void beUnitMatrix()
Sets receiver to unity matrix.
Abstract base class representing the "problem" under consideration.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
the oofem namespace is to define a context or scope in which all oofem names are defined.
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Class implementing node in finite element mesh.
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
void negated()
Switches the sign of every coefficient of receiver.
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.
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
virtual void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the basis functions on the requested boundary.
Class representing solution step.
virtual void assembleVector(FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorm=NULL)
Assembles B.C.