39 #include "../sm/Elements/structuralelement.h" 89 std :: unique_ptr< SparseMtrx > K;
90 std :: unique_ptr< SparseLinearSystemNM > solver;
98 K->buildInternalStructure( engngMod, iNewDom.
giveNumber(), num );
102 for (
int iter = 0; iter < maxIter; iter++ ) {
108 for (
int elIndex = 1; elIndex <= numElNew; elIndex++ ) {
110 if ( elNew == NULL ) {
111 OOFEM_ERROR(
"Failed to cast Element new to StructuralElement.");
120 for (
int i = 1; i <= numElNodes; i++ ) {
143 const FloatArray &localCoord = gp->giveNaturalCoordinates();
150 FloatArray localCoordOld(dim), pointCoordOld(dim);
152 if ( elOld == NULL ) {
153 OOFEM_ERROR(
"Failed to cast Element old to StructuralElement.");
170 for (
Dof *dof: *dMan ) {
171 if ( elDofsGlob.
at(dofsPassed) != 0 ) {
172 nodeDispNew.at(dofsPassed) = oU.
at( elDofsGlob.
at(dofsPassed) );
174 if ( dof->hasBc(& iTStep) ) {
175 nodeDispNew.at(dofsPassed) = dof->giveBcValue(iMode, & iTStep);
196 for(
int nodeIndOld = 1; nodeIndOld <= numElNodesOld; nodeIndOld++) {
199 for (
Dof *dof: *dManOld ) {
200 if ( elDofsGlobOld.
at(dofsPassed) != 0 ) {
203 if(dof->giveEqn() > 0) {
204 dof->giveUnknowns(dofUnknowns, iMode, &iTStep);
222 if ( dof->hasBc(& iTStep) ) {
225 if(!std::isfinite(dof->giveBcValue(iMode, & iTStep))) {
226 OOFEM_ERROR(
"!std::isfinite(dof->giveBcValue(iMode, & iTStep))")
229 nodeDispOld.
push_back( dof->giveBcValue(iMode, & iTStep) );
271 double density = 1.0;
280 K->assemble(elDofsGlob, me);
287 for(
int bcInd = 1; bcInd <= numBC; bcInd++) {
291 if(activeBC != NULL) {
300 for(
int tracDofInd : tractionRows) {
301 const IntArray tracDofArray = {tracDofInd};
302 K->assemble(tracDofArray, tracDofArray, mNode);
310 if(neumannBC != NULL) {
316 K->assemble(stressRows, massMtrxBc);
333 solver->solve(*K, res, du);
The representation of EngngModel default unknown numbering.
virtual ~PrimaryVariableMapper()
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
virtual IntegrationRule * giveIntegrationRule(int i)
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
Imposes a prescribed gradient weakly on the boundary with a Neumann boundary condition.
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
bool isFinite() const
Returns true if no element is NAN or infinite.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
void giveStressLocationArray(IntArray &oCols, const UnknownNumberingScheme &r_s)
Base class for dof managers.
int giveNumber()
Returns domain number.
int giveNumberOfElements() const
Returns number of elements in domain.
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int giveNumberOfDofManagers() const
bool isFinite() const
Returns true if no element is NAN or infinite.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
int giveNumberOfIntegrationRules()
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
Abstract base class for all "structural" finite elements.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
const IntArray & giveDofManArray() const
int giveNumberOfDofs() const
Element * giveElement(int n)
Service for accessing particular domain fe element.
virtual void giveTractionLocationArray(IntArray &rows, const UnknownNumberingScheme &s)
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...
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
virtual void mapPrimaryVariables(FloatArray &oU, Domain &iOldDom, Domain &iNewDom, ValueModeType iMode, TimeStep &iTStep)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
Imposes a prescribed gradient weakly on the boundary with an independent traction discretization...
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.
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.
virtual Element * giveElementClosestToPoint(FloatArray &lcoords, FloatArray &closest, const FloatArray &coords, int region=0)=0
Returns the element closest to a given point.
void zero()
Zeroes all coefficients of receiver.
ClassFactory & classFactory
void push_back(const double &iVal)
Add one element.
void beUnitMatrix()
Sets receiver to unity matrix.
Abstract base class representing the "problem" under consideration.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
LSPrimaryVariableMapper()
DofManager * giveDofManager(int i) const
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Class representing integration point in finite element program.
Class representing solution step.
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element's local coordinates.
virtual ~LSPrimaryVariableMapper()
void add(const FloatArray &src)
Adds array src to receiver.
virtual void computeConsistentMassMatrix(FloatMatrix &answer, TimeStep *tStep, double &mass, const double *ipDensity=NULL)
Computes consistent mass matrix of receiver using numerical integration over element volume...
void resize(int s)
Resizes receiver towards requested size.