89 std :: unique_ptr< SparseMtrx > K;
90 std :: unique_ptr< SparseLinearSystemNM > solver;
96 K =
classFactory.createSparseMtrx(solver->giveRecommendedMatrix(
true));
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);
189 std::vector<double> nodeDispOld_;
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);
215 nodeDispOld_.push_back(dofUnknowns.
at(1));
219 nodeDispOld_.push_back(0.0);
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) );
233 nodeDispOld_.push_back( 0.0 );
272 double density = 1.0;
281 K->assemble(elDofsGlob, me);
288 for(
int bcInd = 1; bcInd <= numBC; bcInd++) {
292 if(activeBC != NULL) {
301 for(
int tracDofInd : tractionRows) {
302 const IntArray tracDofArray = {tracDofInd};
303 K->assemble(tracDofArray, tracDofArray, mNode);
311 if(neumannBC != NULL) {
317 K->assemble(stressRows, massMtrxBc);
334 solver->solve(*K, res, du);
SpatialLocalizer * giveSpatialLocalizer()
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
int giveNumberOfElements() const
Returns number of elements in domain.
DofManager * giveDofManager(int n)
Element * giveElement(int n)
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
GeneralBoundaryCondition * giveBc(int n)
EngngModel * giveEngngModel()