OOFEM 3.0
Loading...
Searching...
No Matches
cbs.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#include "cbs.h"
36#include "nummet.h"
37#include "timestep.h"
38#include "element.h"
39#include "dofmanager.h"
40#include "dof.h"
41#include "initialcondition.h"
42#include "maskedprimaryfield.h"
43#include "verbose.h"
44#include "cbselement.h"
45#include "classfactory.h"
46#include "mathfem.h"
47#include "datastream.h"
48//<RESTRICTED_SECTION>
49#include "leplic.h"
50//</RESTRICTED_SECTION>
51#ifdef TIME_REPORT
52 #include "timer.h"
53#endif
54#include "contextioerr.h"
55
56namespace oofem {
58
59
60void NumberOfNodalPrescribedTractionPressureAssembler :: vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
61{
62 static_cast< CBSElement & >( element ).computeNumberOfNodalPrescribedTractionPressureContributions(vec, tStep);
63}
64
65void IntermediateConvectionDiffusionAssembler :: vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
66{
67 FloatArray vec_p;
68 static_cast< CBSElement & >( element ).computeConvectionTermsI(vec, tStep);
69 static_cast< CBSElement & >( element ).computeDiffusionTermsI(vec_p, tStep);
70 vec.add(vec_p);
71}
72
73void PrescribedVelocityRhsAssembler :: vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
74{
75 static_cast< CBSElement & >( element ).computePrescribedTermsI(vec, tStep);
76}
77
78void DensityPrescribedTractionPressureAssembler :: vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
79{
80 static_cast< CBSElement & >( element ).computePrescribedTractionPressure(vec, tStep);
81}
82
83void DensityRhsAssembler :: vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
84{
85 FloatArray vec_p;
86 static_cast< CBSElement & >( element ).computeDensityRhsVelocityTerms(vec, tStep);
87 static_cast< CBSElement & >( element ).computeDensityRhsPressureTerms(vec_p, tStep);
88 vec.add(vec_p);
89}
90
91void CorrectionRhsAssembler :: vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
92{
93 static_cast< CBSElement & >( element ).computeCorrectionRhs(vec, tStep);
94}
95
96void PressureLhsAssembler :: matrixFromElement(FloatMatrix &answer, Element &element, TimeStep *tStep) const
97{
98 static_cast< CBSElement & >( element ).computePressureLhs(answer, tStep);
99}
100
101void PressureLhsAssembler :: locationFromElement(IntArray& loc, Element& element, const UnknownNumberingScheme& s, IntArray* dofIds) const
102{
103 element.giveLocationArray(loc, {P_f}, s, dofIds);
104}
105
106
107
108CBS :: CBS(int i, EngngModel* _master) : FluidModel ( i, _master ),
109 pressureField ( this, 1, FT_Pressure, 1 ),
110 velocityField ( this, 1, FT_Velocity, 1 ),
112 vnum ( false ), vnumPrescribed ( true ), pnum ( false ), pnumPrescribed ( true ),
113 equationScalingFlag(false),
114 lscale(1.0), uscale(1.0), dscale(1.0), Re(1.0)
115{
116 ndomains = 1;
117}
118
119CBS :: ~CBS()
120{
121}
122
123NumericalMethod *CBS :: giveNumericalMethod(MetaStep *mStep)
124{
125 if ( !nMethod ) {
126 nMethod = classFactory.createSparseLinSolver(solverType, this->giveDomain(1), this);
127 if ( !nMethod ) {
128 OOFEM_ERROR("linear solver creation failed for lstype %d", solverType);
129 }
130 }
131 return nMethod.get();
132}
133
134void
135CBS :: initializeFrom(InputRecord &ir)
136{
137 EngngModel :: initializeFrom(ir);
138 int val = 0;
141
142 val = 0;
145
147 minDeltaT = 0.;
149
151
152 theta1 = theta2 = 1.0;
155
156 val = 0;
158 equationScalingFlag = val > 0;
159 if ( equationScalingFlag ) {
163 double vref = 1.0; // reference viscosity
164 Re = dscale * uscale * lscale / vref;
165 } else {
166 lscale = uscale = dscale = 1.0;
167 Re = 1.0;
168 }
169
170 //<RESTRICTED_SECTION>
171 val = 0;
173 if ( val ) {
174 this->materialInterface = std::make_unique<LEPlic>( 1, this->giveDomain(1) );
175 // export velocity field
176 FieldManager *fm = this->giveContext()->giveFieldManager();
177 IntArray mask = {V_u, V_v, V_w};
178
179 std::shared_ptr<Field> _velocityField = std::make_shared<MaskedPrimaryField>(FT_Velocity, &this->velocityField, mask);
180 fm->registerField(_velocityField, FT_Velocity);
181 }
182 //</RESTRICTED_SECTION>
183}
184
185
186double
187CBS :: giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
188{
189 if ( dof->giveDofID() == P_f ) { // pressures
190 return pressureField.giveUnknownValue(dof, mode, tStep);
191 } else { // velocities
192 return velocityField.giveUnknownValue(dof, mode, tStep);
193 }
194}
195
196
197double
198CBS :: giveReynoldsNumber()
199{
200 return equationScalingFlag ? this->Re : 1.0;
201}
202
203
204double CBS :: giveTheta1() { return this->theta1; }
205
206double CBS :: giveTheta2() { return this->theta2; }
207
208double
209CBS :: giveTractionPressure(Dof *dof)
210{
212 int eq = dof->__givePrescribedEquationNumber();
213 if ( eq ) {
214 return prescribedTractionPressure.at(eq);
215 } else {
216 OOFEM_ERROR("prescribed traction pressure requested for dof with no BC");
217 }
218
219 // return 0;
220}
221
222
223TimeStep *
224CBS :: giveSolutionStepWhenIcApply(bool force)
225{
226 if ( master && (!force)) {
227 return master->giveSolutionStepWhenIcApply();
228 } else {
229 if ( !stepWhenIcApply ) {
230 stepWhenIcApply = std::make_unique<TimeStep>(giveNumberOfTimeStepWhenIcApply(), this, 0, 0.0, deltaT, 0);
231 }
232
233 return stepWhenIcApply.get();
234 }
235}
236
237TimeStep *
238CBS :: giveNextStep()
239{
240 double dt = deltaT;
241 if ( !currentStep ) {
242 // first step -> generate initial step
243 currentStep = std::make_unique<TimeStep>( *giveSolutionStepWhenIcApply() );
244 }
245
246 previousStep = std :: move(currentStep);
247
248 Domain *domain = this->giveDomain(1);
249 // check for critical time step
250 for ( auto &elem : domain->giveElements() ) {
251 dt = min( dt, static_cast< CBSElement & >( *elem ).computeCriticalTimeStep(previousStep.get()) );
252 }
253
254 dt *= 0.6;
255 dt = max(dt, minDeltaT);
256 dt /= this->giveVariableScale(VST_Time);
257
258 currentStep = std::make_unique<TimeStep>(*previousStep, dt);
259
260 OOFEM_LOG_INFO( "SolutionStep %d : t = %e, dt = %e\n", currentStep->giveNumber(),
261 currentStep->giveTargetTime() * this->giveVariableScale(VST_Time), dt * this->giveVariableScale(VST_Time) );
262
263 return currentStep.get();
264}
265
266void
267CBS :: solveYourselfAt(TimeStep *tStep)
268{
269 int momneq = this->giveNumberOfDomainEquations(1, vnum);
270 int presneq = this->giveNumberOfDomainEquations(1, pnum);
271 int presneq_prescribed = this->giveNumberOfDomainEquations(1, pnumPrescribed);
272 double dt = tStep->giveTimeIncrement();
273
274 if ( initFlag ) {
275 deltaAuxVelocity.resize(momneq);
276
277 nodalPrescribedTractionPressureConnectivity.resize(presneq_prescribed);
281 pnumPrescribed, this->giveDomain(1) );
282
283
284 lhs = classFactory.createSparseMtrx(sparseMtrxType);
285 if ( !lhs ) {
286 OOFEM_ERROR("sparse matrix creation failed");
287 }
288
289 lhs->buildInternalStructure(this, 1, pnum);
290
292 pnum, this->giveDomain(1) );
293 lhs->times(dt * theta1 * theta2);
294
295 if ( consistentMassFlag ) {
296 mss = classFactory.createSparseMtrx(sparseMtrxType);
297 if ( !mss ) {
298 OOFEM_ERROR("sparse matrix creation failed");
299 }
300
301 mss->buildInternalStructure(this, 1, vnum);
303 vnum, this->giveDomain(1) );
304 } else {
305 mm.resize(momneq);
306 mm.zero();
308 vnum, this->giveDomain(1) );
309 }
310
311 //<RESTRICTED_SECTION>
312 // init material interface
313 if ( materialInterface ) {
314 materialInterface->initialize();
315 }
316
317 //</RESTRICTED_SECTION>
318 initFlag = 0;
319 }
320 //<RESTRICTED_SECTION>
321 else if ( materialInterface ) {
322 lhs->zero();
324 pnum, this->giveDomain(1) );
325 lhs->times(dt * theta1 * theta2);
326
327 if ( consistentMassFlag ) {
328 mss->zero();
330 vnum, this->giveDomain(1) );
331 } else {
332 mm.zero();
334 vnum, this->giveDomain(1) );
335 }
336 }
337
338 //</RESTRICTED_SECTION>
339
340 if ( tStep->isTheFirstStep() ) {
341 TimeStep *_stepWhenIcApply = tStep->givePreviousStep();
342 this->applyIC(_stepWhenIcApply);
343 }
344
345 velocityField.advanceSolution(tStep);
346 pressureField.advanceSolution(tStep);
347 //this->velocityField.applyBoundaryCondition(tStep);
348 //this->pressureField.applyBoundaryCondition(tStep);
349
350 FloatArray velocityVector;
351 FloatArray pressureVector;
352 FloatArray prevVelocityVector;
353 FloatArray prevPressureVector;
354
355 this->velocityField.initialize(VM_Total, tStep->givePreviousStep(), prevVelocityVector, this->vnum );
356 this->pressureField.initialize(VM_Total, tStep->givePreviousStep(), prevPressureVector, this->pnum );
357 this->velocityField.update(VM_Total, tStep, prevVelocityVector, this->vnum );
358 this->pressureField.update(VM_Total, tStep, prevPressureVector, this->pnum );
359
360 /* STEP 1 - calculates auxiliary velocities*/
361 FloatArray rhs(momneq);
362 rhs.zero();
363 // Depends on old v:
365 //this->assembleVectorFromElements(mm, tStep, LumpedMassVectorAssembler(), VM_Total, this->giveDomain(1));
366
367 if ( consistentMassFlag ) {
368 rhs.times(dt);
369 // Depends on prescribed v
370 this->assembleVectorFromElements( rhs, tStep, PrescribedVelocityRhsAssembler(), VM_Total, vnum, this->giveDomain(1) );
371 nMethod->solve(*mss, rhs, deltaAuxVelocity);
372 } else {
373 for ( int i = 1; i <= momneq; i++ ) {
374 deltaAuxVelocity.at(i) = dt * rhs.at(i) / mm.at(i);
375 }
376 }
377
378 /* STEP 2 - calculates pressure (implicit solver) */
379 this->prescribedTractionPressure.resize(presneq_prescribed);
380 this->prescribedTractionPressure.zero();
383 pnumPrescribed, this->giveDomain(1) );
384 for ( int i = 1; i <= presneq_prescribed; i++ ) {
386 }
387
388 // DensityRhsVelocityTerms needs this: Current velocity without correction;
389 velocityVector = prevVelocityVector;
390 velocityVector.add(this->theta1, deltaAuxVelocity);
391 this->velocityField.update(VM_Total, tStep, velocityVector, this->vnum );
392
393 // Depends on old V + deltaAuxV * theta1 and p:
394 rhs.resize(presneq);
395 rhs.zero();
396 this->assembleVectorFromElements( rhs, tStep, DensityRhsAssembler(), VM_Total, pnum, this->giveDomain(1) );
398 nMethod->solve(*lhs, rhs, pressureVector);
399 pressureVector.times(this->theta2);
400 pressureVector.add(prevPressureVector);
401 this->pressureField.update(VM_Total, tStep, pressureVector, this->pnum );
402
403 /* STEP 3 - velocity correction step */
404 rhs.resize(momneq);
405 rhs.zero();
406 // Depends on p:
407 this->assembleVectorFromElements( rhs, tStep, CorrectionRhsAssembler(), VM_Total, vnum, this->giveDomain(1) );
408 if ( consistentMassFlag ) {
409 rhs.times(dt);
410 //this->assembleVectorFromElements(rhs, tStep, PrescribedRhsAssembler(), VM_Incremental, vnum, this->giveDomain(1));
411 nMethod->solve(*mss, rhs, velocityVector);
412 velocityVector.add(deltaAuxVelocity);
413 velocityVector.add(prevVelocityVector);
414 } else {
415 for ( int i = 1; i <= momneq; i++ ) {
416 velocityVector.at(i) = prevVelocityVector.at(i) + deltaAuxVelocity.at(i) + dt *rhs.at(i) / mm.at(i);
417 }
418 }
419 this->velocityField.update(VM_Total, tStep, velocityVector, this->vnum );
420 this->updateInternalState(tStep);
421
422 // update solution state counter
423 tStep->incrementStateCounter();
424
425 //<RESTRICTED_SECTION>
426 if ( materialInterface ) {
427#ifdef TIME_REPORT
428 Timer _timer;
429 _timer.startTimer();
430#endif
431 materialInterface->updatePosition( this->giveCurrentStep() );
432#ifdef TIME_REPORT
433 _timer.stopTimer();
434 OOFEM_LOG_INFO( "CBS info: user time consumed by updating interfaces: %.2fs\n", _timer.getUtime() );
435#endif
436 }
437
438 //</RESTRICTED_SECTION>
439}
440
441
442int
443CBS :: giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep)
444{
445 return tStep->giveNumber() % 2;
446}
447
448
449void
450CBS :: updateYourself(TimeStep *tStep)
451{
452 EngngModel :: updateYourself(tStep);
453 //<RESTRICTED_SECTION>
454 if ( materialInterface ) {
455 materialInterface->updateYourself(tStep);
456 }
457
458 //</RESTRICTED_SECTION>
459 //previousSolutionVector = solutionVector;
460}
461
462
463void
464CBS :: updateInternalState(TimeStep *tStep)
465{
466 for ( auto &domain: domainList ) {
467 for ( auto &elem : domain->giveElements() ) {
468 elem->updateInternalState(tStep);
469 }
470 }
471}
472
473
474void
475CBS :: saveContext(DataStream &stream, ContextMode mode)
476{
477 EngngModel :: saveContext(stream, mode);
478
480 if ( ( iores = prescribedTractionPressure.storeYourself(stream) ) != CIO_OK ) {
481 THROW_CIOERR(iores);
482 }
483}
484
485
486void
487CBS :: restoreContext(DataStream &stream, ContextMode mode)
488{
489 EngngModel :: restoreContext(stream, mode);
490
492 if ( ( iores = prescribedTractionPressure.restoreYourself(stream) ) != CIO_OK ) {
493 THROW_CIOERR(iores);
494 }
495}
496
497
498int
499CBS :: checkConsistency()
500{
501 // check internal consistency
502 // if success returns nonzero
503 Domain *domain = this->giveDomain(1);
504
505 // check for proper element type
506 for ( auto &elem : domain->giveElements() ) {
507 if ( !dynamic_cast< CBSElement * >( elem.get() ) ) {
508 OOFEM_WARNING("Element %d has no CBS base", elem->giveLabel());
509 return 0;
510 }
511 }
512
513 EngngModel :: checkConsistency();
514
515
516 // scale boundary and initial conditions
517 if ( equationScalingFlag ) {
518 for ( auto &bc: domain->giveBcs() ) {
519 if ( bc->giveBCValType() == VelocityBVT ) {
520 bc->scale(1. / uscale);
521 } else if ( bc->giveBCValType() == PressureBVT ) {
522 bc->scale( 1. / this->giveVariableScale(VST_Pressure) );
523 } else if ( bc->giveBCValType() == ForceLoadBVT ) {
524 bc->scale( 1. / this->giveVariableScale(VST_Force) );
525 } else {
526 OOFEM_WARNING("unknown bc/ic type");
527 return 0;
528 }
529 }
530
531 for ( auto &ic : domain->giveIcs() ) {
532 if ( ic->giveICValType() == VelocityBVT ) {
533 ic->scale(VM_Total, 1. / uscale);
534 } else if ( ic->giveICValType() == PressureBVT ) {
535 ic->scale( VM_Total, 1. / this->giveVariableScale(VST_Pressure) );
536 } else {
537 OOFEM_WARNING("unknown bc/ic type");
538 return 0;
539 }
540 }
541 }
542
543 return 1;
544}
545
546
547void
548CBS :: updateDomainLinks()
549{
550 EngngModel :: updateDomainLinks();
551 this->giveNumericalMethod( this->giveCurrentMetaStep() )->setDomain( this->giveDomain(1) );
552}
553
554
555void
556CBS :: printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *tStep)
557{
558 double pscale = ( dscale * uscale * uscale );
559
560 DofIDItem type = iDof->giveDofID();
561 if ( type == V_u || type == V_v || type == V_w ) {
562 iDof->printSingleOutputAt(stream, tStep, 'd', VM_Total, uscale);
563 } else if ( type == P_f ) {
564 iDof->printSingleOutputAt(stream, tStep, 'd', VM_Total, pscale);
565 } else {
566 OOFEM_ERROR("unsupported dof type");
567 }
568}
569
570
571void
572CBS :: applyIC(TimeStep *_stepWhenIcApply)
573{
574#ifdef VERBOSE
575 OOFEM_LOG_INFO("Applying initial conditions\n");
576#endif
577 velocityField.applyDefaultInitialCondition();
578 pressureField.applyDefaultInitialCondition();
579
580 // update element state according to given ic
581 for ( auto &elem : this->giveDomain(1)->giveElements() ) {
582 CBSElement *element = static_cast< CBSElement * >( elem.get() );
583 element->updateInternalState(_stepWhenIcApply);
584 element->updateYourself(_stepWhenIcApply);
585 }
586}
587
588
589int
590CBS :: giveNewEquationNumber(int domain, DofIDItem id)
591{
592 if ( id == V_u || id == V_v || id == V_w ) {
593 return this->vnum.askNewEquationNumber();
594 } else if ( id == P_f ) {
595 return this->pnum.askNewEquationNumber();
596 } else {
597 OOFEM_ERROR("Unknown DofIDItem");
598 }
599
600 // return 0;
601}
602
603
604int
605CBS :: giveNewPrescribedEquationNumber(int domain, DofIDItem id)
606{
607 if ( id == V_u || id == V_v || id == V_w ) {
608 return this->vnumPrescribed.askNewEquationNumber();
609 } else if ( id == P_f ) {
610 return this->pnumPrescribed.askNewEquationNumber();
611 } else {
612 OOFEM_ERROR("Unknown DofIDItem");
613 }
614
615 //return 0;
616}
617
618
619int CBS :: giveNumberOfDomainEquations(int d, const UnknownNumberingScheme &num)
620{
623 }
624
626}
627
628
629double CBS :: giveVariableScale(VarScaleType varID)
630{
631 if ( varID == VST_Length ) {
632 return this->lscale;
633 } else if ( varID == VST_Velocity ) {
634 return this->uscale;
635 } else if ( varID == VST_Density ) {
636 return this->dscale;
637 } else if ( varID == VST_Time ) {
638 return ( lscale / uscale );
639 } else if ( varID == VST_Pressure ) {
640 return ( dscale * uscale * uscale );
641 } else if ( varID == VST_Force ) {
642 return ( uscale * uscale / lscale );
643 } else if ( varID == VST_Viscosity ) {
644 return 1.0;
645 } else {
646 OOFEM_ERROR("unknown variable type");
647 }
648
649 //return 0.0;
650}
651
652#if 0
653void CBS :: printOutputAt(FILE *file, TimeStep *tStep)
654{
655 int domCount = 0;
656 // fprintf (File,"\nOutput for time step number %d \n\n",tStep->giveNumber());
657 for ( auto &domain: this->domainList ) {
658 domCount += domain->giveOutputManager()->testTimeStepOutput(tStep);
659 }
660
661 if ( domCount == 0 ) {
662 return; // do not print even Solution step header
663 }
664
665 fprintf( File, "\nOutput for time % .8e \n\n", tStep->giveTime() / this->giveVariableScale(VST_Time) );
666 for ( auto &domain: this->domainList ) {
667 fprintf(file, "\nOutput for domain %3d\n", domain->giveNumber() );
668 domain->giveOutputManager()->doDofManOutput(file, tStep);
669 domain->giveOutputManager()->doElementOutput(file, tStep);
670 }
671}
672#endif
673} // end namespace oofem
#define _IFT_CBS_cmflag
Definition cbs.h:53
#define _IFT_CBS_theta1
Definition cbs.h:54
#define _IFT_CBS_miflag
Definition cbs.h:60
#define _IFT_CBS_dscale
Definition cbs.h:59
#define _IFT_CBS_theta2
Definition cbs.h:55
#define _IFT_CBS_scaleflag
Definition cbs.h:56
#define _IFT_CBS_deltat
Definition cbs.h:51
#define _IFT_CBS_mindeltat
Definition cbs.h:52
#define _IFT_CBS_uscale
Definition cbs.h:58
#define _IFT_CBS_lscale
Definition cbs.h:57
#define REGISTER_EngngModel(class)
virtual double computeCriticalTimeStep(TimeStep *tStep)=0
Calculates critical time step.
void updateInternalState(TimeStep *tStep) override
Definition cbselement.C:162
FloatArray nodalPrescribedTractionPressureConnectivity
Definition cbs.h:187
PressureEquationNumbering pnum
Definition cbs.h:205
LinSystSolverType solverType
Definition cbs.h:177
double dscale
Density scale.
Definition cbs.h:214
NumericalMethod * giveNumericalMethod(MetaStep *mStep) override
Returns reference to receiver's numerical method.
Definition cbs.C:123
std ::unique_ptr< MaterialInterface > materialInterface
Definition cbs.h:220
VelocityEquationNumbering vnumPrescribed
Definition cbs.h:204
int initFlag
Definition cbs.h:199
TimeStep * giveSolutionStepWhenIcApply(bool force=false) override
Definition cbs.C:224
int consistentMassFlag
Consistent mass flag.
Definition cbs.h:201
int giveNumberOfDomainEquations(int, const UnknownNumberingScheme &num) override
Definition cbs.C:619
double theta2
Definition cbs.h:197
void applyIC(TimeStep *tStep)
Definition cbs.C:572
std ::unique_ptr< SparseMtrx > mss
Sparse consistent mass.
Definition cbs.h:192
double minDeltaT
Definition cbs.h:195
FloatArray prescribedTractionPressure
Definition cbs.h:186
double lscale
Length scale.
Definition cbs.h:210
std ::unique_ptr< SparseLinearSystemNM > nMethod
Numerical method used to solve the problem.
Definition cbs.h:175
DofDistributedPrimaryField pressureField
Pressure field.
Definition cbs.h:182
SparseMtrxType sparseMtrxType
Definition cbs.h:178
double Re
Reynolds number.
Definition cbs.h:216
double deltaT
Time step and its minimal value.
Definition cbs.h:195
VelocityEquationNumbering vnum
Definition cbs.h:203
FloatArray deltaAuxVelocity
Definition cbs.h:185
FloatArray mm
Lumped mass matrix.
Definition cbs.h:190
DofDistributedPrimaryField velocityField
Velocity field.
Definition cbs.h:184
double uscale
Velocity scale.
Definition cbs.h:212
bool equationScalingFlag
Definition cbs.h:208
double giveVariableScale(VarScaleType varId) override
Returns the scale factor for given variable type.
Definition cbs.C:629
double theta1
Integration constants.
Definition cbs.h:197
PressureEquationNumbering pnumPrescribed
Definition cbs.h:206
void updateInternalState(TimeStep *tStep)
Definition cbs.C:464
std ::unique_ptr< SparseMtrx > lhs
Definition cbs.h:180
Implementation for assembling external forces vectors in standard monolithic FE-problems.
Definition cbs.h:102
Implementation for assembling external forces vectors in standard monolithic FE-problems.
Definition cbs.h:88
Implementation for assembling external forces vectors in standard monolithic FE-problems.
Definition cbs.h:95
DofIDItem giveDofID() const
Definition dof.h:276
virtual int __givePrescribedEquationNumber()=0
virtual void printSingleOutputAt(FILE *file, TimeStep *tStep, char ch, ValueModeType mode, double scale=1.0)
Definition dof.C:76
std ::vector< std ::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
Definition domain.h:349
std ::vector< std ::unique_ptr< Element > > & giveElements()
Definition domain.h:294
std ::vector< std ::unique_ptr< InitialCondition > > & giveIcs()
Definition domain.h:356
virtual void updateYourself(TimeStep *tStep)
Definition element.C:824
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Definition element.C:429
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
Definition engngm.h:787
std ::vector< std ::unique_ptr< Domain > > domainList
List of problem domains.
Definition engngm.h:217
virtual TimeStep * giveCurrentStep(bool force=false)
Definition engngm.h:717
void assembleVectorFromElements(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Definition engngm.C:1351
EngngModelContext * giveContext()
Context requesting service.
Definition engngm.h:1174
std ::unique_ptr< TimeStep > previousStep
Previous time step.
Definition engngm.h:243
int equationNumberingCompleted
Equation numbering completed flag.
Definition engngm.h:233
MetaStep * giveCurrentMetaStep()
Returns current meta step.
Definition engngm.C:1900
int ndomains
Number of receiver domains.
Definition engngm.h:215
Domain * giveDomain(int n)
Definition engngm.C:1936
std ::unique_ptr< TimeStep > currentStep
Current time step.
Definition engngm.h:241
EngngModel * master
Master e-model; if defined receiver is in maintained (slave) mode.
Definition engngm.h:274
std ::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
Definition engngm.h:239
void registerField(FieldPtr eField, FieldType key)
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void add(const FloatArray &src)
Definition floatarray.C:218
void times(double s)
Definition floatarray.C:834
int forceEquationNumbering(int id) override
Definition fluidmodel.C:44
FluidModel(int i, EngngModel *master)
Definition fluidmodel.h:49
Implementation for assembling external forces vectors in standard monolithic FE-problems.
Definition cbs.h:74
Implementation for assembling external forces vectors in standard monolithic FE-problems.
Definition cbs.h:67
Implementation for assembling external forces vectors in standard monolithic FE-problems.
Definition cbs.h:81
Callback class for assembling CBS pressure matrices.
Definition cbs.h:109
void incrementStateCounter()
Updates solution state counter.
Definition timestep.h:213
double giveTimeIncrement()
Returns solution step associated time increment.
Definition timestep.h:168
int giveNumber()
Returns receiver's number.
Definition timestep.h:144
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
Definition timestep.C:132
bool isTheFirstStep()
Definition timestep.C:148
double getUtime()
Returns total user time elapsed in seconds.
Definition timer.C:105
void startTimer()
Definition timer.C:69
void stopTimer()
Definition timer.C:77
virtual int giveRequiredNumberOfDomainEquation() const
#define THROW_CIOERR(e)
#define _IFT_EngngModel_lstype
Definition engngm.h:91
#define _IFT_EngngModel_smtype
Definition engngm.h:92
#define OOFEM_WARNING(...)
Definition error.h:80
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define OOFEM_LOG_INFO(...)
Definition logger.h:143
long ContextMode
Definition contextmode.h:43
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
VarScaleType
Type determining the scale corresponding to particular variable.
@ VST_Length
@ VST_Viscosity
@ VST_Velocity
@ VST_Force
@ VST_Density
@ VST_Pressure
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
@ ForceLoadBVT
Definition bcvaltype.h:43
@ VelocityBVT
Definition bcvaltype.h:46
@ PressureBVT
Definition bcvaltype.h:44
ClassFactory & classFactory

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011