OOFEM 3.0
Loading...
Searching...
No Matches
nonstationarytransportproblem.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
37#include "nummet.h"
38#include "timestep.h"
39#include "element.h"
40#include "dofmanager.h"
41#include "dof.h"
42#include "maskedprimaryfield.h"
43#include "verbose.h"
45#include "classfactory.h"
46#include "datastream.h"
47#include "contextioerr.h"
48#include "function.h"
51
52#ifdef __CEMHYD_MODULE
54#endif
55
56namespace oofem {
58
59void TransportExternalForceAssembler :: vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
60{
61 TransportElement *telem = static_cast< TransportElement* >(&element);
62 telem->computeBCVectorAt(vec, tStep, mode);
63 FloatArray tmp;
64 telem->computeInternalSourceRhsVectorAt(tmp, tStep, mode);
65 vec.add(tmp);
66}
67
68
69MidpointLhsAssembler :: MidpointLhsAssembler(bool lumped, double alpha) :
71{}
72
73
74void MidpointLhsAssembler :: matrixFromElement(FloatMatrix &answer, Element &el, TimeStep *tStep) const
75{
76 FloatMatrix capacity;
77 el.giveCharacteristicMatrix(answer, TangentStiffnessMatrix, tStep);
78 el.giveCharacteristicMatrix(capacity, this->lumped ? LumpedMassMatrix : MassMatrix, tStep);
79 answer.times(this->alpha);
80 answer.add(1. / tStep->giveTimeIncrement(), capacity);
81}
82
83
84void IntSourceLHSAssembler :: matrixFromElement(FloatMatrix &answer, Element &el, TimeStep *tStep) const
85{
86 static_cast< TransportElement * >( &el )->computeIntSourceLHSMatrix(answer, tStep);
87}
88
89
90NonStationaryTransportProblem :: NonStationaryTransportProblem(int i, EngngModel *_master = nullptr) : StationaryTransportProblem(i, _master)
91{
92}
93
94
95NumericalMethod *NonStationaryTransportProblem :: giveNumericalMethod(MetaStep *mStep)
96// only one has reason for LinearStatic
97// - SolutionOfLinearEquations
98{
99 if ( !linSolver ) {
100 linSolver = classFactory.createSparseLinSolver(solverType, this->giveDomain(1), this);
101 if ( !linSolver ) {
102 OOFEM_ERROR("linear solver creation failed for lstype %d", solverType);
103 }
104 }
105 return linSolver.get();
106}
107
108void
109NonStationaryTransportProblem :: initializeFrom(InputRecord &ir)
110{
111 EngngModel :: initializeFrom(ir);
112
115 }
116
123 } else {
124 throw ValueInputException(ir, "none", "Time step not defined");
125 }
126
128 /* The following done in updateAttributes
129 * if (this->giveNumericalMethod (giveCurrentStep())) nMethod -> instanciateFrom (ir);
130 */
131 // read lumped capacity stabilization flag
134 }
135
136 //secure equation renumbering, otherwise keep efficient algorithms
138 changingProblemSize = true;
139 UnknownsField = std::make_unique<DofDistributedPrimaryField>(this, 1, FT_TransportProblemUnknowns, 1);
140 } else {
141 UnknownsField = std::make_unique<PrimaryField>(this, 1, FT_TransportProblemUnknowns, 1);
142 }
143
144 //read other input data from StationaryTransportProblem
145 StationaryTransportProblem :: initializeFrom(ir);
146
147 int val = 0;
150}
151
152
153double NonStationaryTransportProblem :: giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
154// returns unknown quantity like displacement, velocity of equation eq
155// This function translates this request to numerical method language
156{
157 if ( this->requiresUnknownsDictionaryUpdate() ) {
158 if (mode == VM_TotalIntrinsic) mode = VM_Total;
159 int hash = this->giveUnknownDictHashIndx(mode, tStep);
160 if ( dof->giveUnknowns()->includes(hash) ) {
161 return dof->giveUnknowns()->at(hash);
162 } else {
163 OOFEM_ERROR("Dof unknowns dictionary does not contain unknown of value mode (%s)", __ValueModeTypeToString(mode));
164 }
165 }
166
167 if ( dof->__giveEquationNumber() == 0 ) {
168 OOFEM_ERROR("invalid equation number on DoF %d", dof->giveDofID());
169 }
170
171 if (mode == VM_TotalIntrinsic) {
172 /*
173 if (tStep == this->giveCurrentStep()) {
174 double rt = UnknownsField->giveUnknownValue(dof, VM_Total, tStep);
175 double rtm1 = UnknownsField->giveUnknownValue(dof, VM_Total, tStep);
176 return (1.-alpha)*rtm1+alpha*rt;
177 } else {
178 OOFEM_ERROR ("mode only supported for current step");
179 }
180 */
181 mode = VM_Total;
182 }
183 return UnknownsField->giveUnknownValue(dof, mode, tStep);
184}
185
186
187TimeStep *
188NonStationaryTransportProblem :: giveSolutionStepWhenIcApply(bool force)
189{
190 if ( master && (!force)) {
191 return master->giveSolutionStepWhenIcApply();
192 } else {
193 if ( !stepWhenIcApply ) {
194 stepWhenIcApply = std::make_unique<TimeStep>(giveNumberOfTimeStepWhenIcApply(), this, 0, this->initT - giveDeltaT( giveNumberOfFirstStep() ), giveDeltaT( giveNumberOfFirstStep() ), 0);
195 //stepWhenIcApply = std::make_unique<TimeStep>(giveNumberOfTimeStepWhenIcApply(), this, 0, -deltaT, deltaT, 0);
196 }
197
198 return stepWhenIcApply.get();
199 }
200}
201
202
203Function *
204NonStationaryTransportProblem :: giveDtFunction()
205// Returns the load-time function of the receiver.
206{
207 if ( !dtFunction ) {
208 return NULL;
209 }
210
211 return giveDomain(1)->giveFunction(dtFunction);
212}
213
214double
215NonStationaryTransportProblem :: giveDeltaT(int n)
216{
217 if ( giveDtFunction() ) {
218 return giveDtFunction()->evaluateAtTime(n);
219 }
220
221 if ( discreteTimes.giveSize() > 0 ) {
222 return this->giveDiscreteTime(n) - this->giveDiscreteTime(n - 1);
223 }
224
225 return deltaT;
226}
227
228double
229NonStationaryTransportProblem :: giveDiscreteTime(int iStep)
230{
231 if ( ( iStep > 0 ) && ( iStep <= discreteTimes.giveSize() ) ) {
232 return ( discreteTimes.at(iStep) );
233 }
234
235 if ( ( iStep == 0 ) && ( iStep <= discreteTimes.giveSize() ) ) {
236 return ( initT );
237 }
238
239 OOFEM_ERROR("invalid iStep");
240}
241
242
243TimeStep *
244NonStationaryTransportProblem :: giveNextStep()
245{
246 int istep = this->giveNumberOfFirstStep();
247 double totalTime = this->initT;
248 double intrinsicTime;
249 StateCounterType counter = 1;
250
251 if ( currentStep ) {
252 istep = currentStep->giveNumber() + 1;
253 totalTime = currentStep->giveTargetTime() + giveDeltaT(istep);
254 counter = currentStep->giveSolutionStateCounter() + 1;
255 } else {
256 // first step -> generate initial step
257 currentStep = std::make_unique<TimeStep>( *giveSolutionStepWhenIcApply() );
258 }
259
260 previousStep = std :: move(currentStep);
261 currentStep = std::make_unique<TimeStep>(istep, this, 1, totalTime, this->giveDeltaT ( istep ), counter);
262 //set intrinsic time to time of integration
263 intrinsicTime = currentStep->giveTargetTime();
264// intrinsicTime = previousStep->giveTargetTime() + this->alpha *this->giveDeltaT(istep);
265 currentStep->setIntrinsicTime(intrinsicTime);
266 return currentStep.get();
267}
268
269
270void NonStationaryTransportProblem :: solveYourselfAt(TimeStep *tStep)
271{
272 // Creates system of governing eq's and solves them at given tStep
273 // The solution is stored in UnknownsField. If the problem is growing/decreasing, the UnknownsField is projected on DoFs when needed.
274 // If equations are not renumbered, the algorithm is efficient without projecting unknowns to DoFs (nodes).
275
276 //Right hand side
277 FloatArray rhs;
278 TimeStep *icStep = this->giveSolutionStepWhenIcApply();
279
281#ifdef VERBOSE
282 OOFEM_LOG_RELEVANT( "Solving [step number %8d, time %15e]\n", tStep->giveNumber(), tStep->giveTargetTime() );
283#endif
284
285 //Solution at the first time step needs history. Therefore, return back one time increment and create it.
286 if ( tStep->isTheFirstStep() ) {
287
288 bcRhs.resize(neq); //rhs vector from solution step i-1
289 bcRhs.zero();
290
291 this->applyIC(icStep);
292
293 //project initial conditions to have temporary temperature in integration points
294
295 //edge or surface loads on elements
296 //add internal source vector on elements
298 VM_Total, EModelDefaultEquationNumbering(), this->giveDomain(1) );
299 //add prescribed value, such as temperature, on nodes
300 this->assembleDirichletBcRhsVector( bcRhs, icStep, VM_Total,
302 //add nodal load
304 VM_Total, EModelDefaultEquationNumbering(), this->giveDomain(1) );
305 }
306
307 //Create a new lhs matrix if necessary
308 if ( tStep->isTheFirstStep() || this->changingProblemSize ) {
309
311 if ( !conductivityMatrix ) {
312 OOFEM_ERROR("sparse matrix creation failed");
313 }
314
315 conductivityMatrix->buildInternalStructure( this, 1, EModelDefaultEquationNumbering() );
316
317#ifdef VERBOSE
318 OOFEM_LOG_INFO("Assembling conductivity and capacity matrices\n");
319#endif
320
321 //Add contribution of alpha*K+C/dt (where K has contributions from conductivity and Neumann b.c.s)
324 }
325
326 //get the previous Rhs vector
327 if ( !tStep->isTheFirstStep() && this->changingProblemSize ) {
328 UnknownsField->initialize( VM_RhsTotal, tStep, bcRhs, EModelDefaultEquationNumbering() );
329 }
330
331 //prepare position in UnknownsField to store the results
332 FloatArray *solutionVector;
333 UnknownsField->advanceSolution(tStep);
334 solutionVector = UnknownsField->giveSolutionVector(tStep);
335// solutionVector->resize(neq);
336// solutionVector->zero();
337
338 //Initialize and give solutionVector from previous solution
339 //copy previous solution vector so we can use solution-dependent boundary conditions
340 if ( changingProblemSize ) {
341 if ( !tStep->isTheFirstStep() ) {
342 //copy recent solution to previous position, copy from hash=0 to hash=1(previous)
343 copyUnknownsInDictionary( VM_Total, tStep, tStep->givePreviousStep() );
344 }
345 UnknownsField->initialize( VM_Total, tStep->givePreviousStep(), *solutionVector, EModelDefaultEquationNumbering() );
346 } else {
347 //copy previous solution vector to actual
348 *solutionVector = *UnknownsField->giveSolutionVector( tStep->givePreviousStep() );
349 }
350
352
353#ifdef VERBOSE
354 OOFEM_LOG_INFO("Assembling rhs\n");
355#endif
356 // assembling load from elements
357 rhs = bcRhs;
358 rhs.times(1. - alpha);
359 bcRhs.zero();
360 //boundary conditions evaluated at targetTime
362 VM_Total, EModelDefaultEquationNumbering(), this->giveDomain(1) );
363 this->assembleDirichletBcRhsVector( bcRhs, tStep, VM_Total,
365
366 // assembling load from nodes
369 for ( int i = 1; i <= neq; i++ ) {
370 rhs.at(i) += bcRhs.at(i) * alpha;
371 }
372
373 // add the rhs part depending on previous solution
375 // set-up numerical model
377
378 // call numerical model to solve arised problem
379#ifdef VERBOSE
380 OOFEM_LOG_INFO("Solving ...\n");
381#endif
382// UnknownsField->giveSolutionVector(tStep)->resize(neq);
383 linSolver->solve(*conductivityMatrix, rhs, *UnknownsField->giveSolutionVector(tStep) );
384 // update solution state counter
385 tStep->incrementStateCounter();
386}
387
388void
389NonStationaryTransportProblem :: updateYourself(TimeStep *tStep)
390{
391 this->updateInternalState(tStep);
392 EngngModel :: updateYourself(tStep);
393
395#ifdef __CEMHYD_MODULE
396 for ( auto &domain: this->domainList ) {
397 for ( int i = 1; i <= domain->giveNumberOfElements(); ++i ) {
398 TransportElement *elem = static_cast< TransportElement * >( domain->giveElement(i) );
399 //store temperature and associated volume on each GP before performing averaging
400 CemhydMat *cem = dynamic_cast< CemhydMat * >( elem->giveMaterial() );
401 if ( cem ) {
403 cem->storeWeightTemperatureProductVolume(elem, tStep);
404 }
405 }
406 //perform averaging on each material instance
407 for ( int i = 1; i <= domain->giveNumberOfMaterialModels(); i++ ) {
408 CemhydMat *cem = dynamic_cast< CemhydMat * >( domain->giveMaterial(i) );
409 if ( cem ) {
410 cem->averageTemperature();
411 }
412 }
413 }
414 #ifdef VERBOSE
415 VERBOSE_PRINT0("Updated Materials ", 0)
416 #endif
417#endif
418}
419
420void
421NonStationaryTransportProblem :: copyUnknownsInDictionary(ValueModeType mode, TimeStep *fromTime, TimeStep *toTime)
422{
423 Domain *domain = this->giveDomain(1);
424
425 for ( auto &node : domain->giveDofManagers() ) {
426 for ( Dof *dof: *node ) {
427 double val = dof->giveUnknown(mode, fromTime);
428 dof->updateUnknownsDictionary(toTime, mode, val);
429 }
430 }
431}
432
433
434void
435NonStationaryTransportProblem :: updateInternalState(TimeStep *tStep)
436{
437 for ( auto &domain: domainList ) {
439 //update temperature vector
440 UnknownsField->update( VM_Total, tStep, * ( this->UnknownsField->giveSolutionVector(tStep) ), EModelDefaultEquationNumbering() );
441 //update Rhs vector
442 UnknownsField->update(VM_RhsTotal, tStep, bcRhs, EModelDefaultEquationNumbering());
443 }
444
446 for ( auto &elem : domain->giveElements() ) {
447 elem->updateInternalState(tStep);
448 }
449
451 }
452 }
453}
454
455
456void
457NonStationaryTransportProblem :: saveContext(DataStream &stream, ContextMode mode)
458{
459 EngngModel :: saveContext(stream, mode);
460 UnknownsField->saveContext(stream);
461}
462
463
464void
465NonStationaryTransportProblem :: restoreContext(DataStream &stream, ContextMode mode)
466{
467 EngngModel :: restoreContext(stream, mode);
468 UnknownsField->restoreContext(stream);
469}
470
471
472int
473NonStationaryTransportProblem :: checkConsistency()
474{
475 // check internal consistency
476 // if success returns nonzero
477 Domain *domain = this->giveDomain(1);
478
479 // check for proper element type
480 for ( auto &elem : domain->giveElements() ) {
481 if ( !dynamic_cast< TransportElement * >( elem.get() ) ) {
482 OOFEM_WARNING("Element %d has no TransportElement base", elem->giveLabel());
483 return 0;
484 }
485 }
486
487 EngngModel :: checkConsistency();
488
489 return 1;
490}
491
492
493void
494NonStationaryTransportProblem :: updateDomainLinks()
495{
496 EngngModel :: updateDomainLinks();
497 this->giveNumericalMethod( this->giveCurrentMetaStep() )->setDomain( this->giveDomain(1) );
498}
499
500int
501NonStationaryTransportProblem :: giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep)
502{
503 if ( mode == VM_Total ) { //Nodal temperature
504 return 0;
505 } else if ( mode == VM_RhsTotal ) { //Nodal Rhs
506 return 1;
507 } else {
508 OOFEM_ERROR("ValueModeType %s undefined", __ValueModeTypeToString(mode));
509 }
510}
511
512
513void
514NonStationaryTransportProblem :: assembleAlgorithmicPartOfRhs(FloatArray &answer,
515 const UnknownNumberingScheme &s, TimeStep *tStep)
516{
517 IntArray loc;
518 FloatMatrix charMtrx, charMtrx2;
519 FloatArray unknownVec, contrib, intSource;
520 Element *element;
521
522 Domain *domain = this->giveDomain(1);
523 int nelem = domain->giveNumberOfElements();
524
525 for ( int i = 1; i <= nelem; i++ ) {
526 element = domain->giveElement(i);
527 // skip remote elements (these are used as mirrors of remote elements on other domains
528 // when nonlocal constitutive models are used. They introduction is necessary to
529 // allow local averaging on domains without fine grain communication between domains).
530 if ( element->giveParallelMode() == Element_remote ) {
531 continue;
532 }
533
534 element->giveLocationArray(loc, s);
535 //(alpha-1)*K+C/dt
536 element->giveCharacteristicMatrix(charMtrx, TangentStiffnessMatrix, tStep);
537 element->giveCharacteristicMatrix(charMtrx2, lumpedCapacityStab ? LumpedMassMatrix : MassMatrix, tStep);
538
539 charMtrx.times(this->alpha - 1.0);
540 charMtrx.add(1. / tStep->giveTimeIncrement(), charMtrx2);
541
542 if ( charMtrx.isNotEmpty() ) {
543 element->computeVectorOf(VM_Total, tStep, unknownVec);
544 contrib.beProductOf(charMtrx, unknownVec);
545 answer.assemble(contrib, loc);
546 }
547 }
548}
549
550
551void
552NonStationaryTransportProblem :: applyIC(TimeStep *_stepWhenIcApply)
553{
554 Domain *domain = this->giveDomain(1);
556 FloatArray *solutionVector;
557 double val;
558
559#ifdef VERBOSE
560 OOFEM_LOG_INFO("Applying initial conditions\n");
561#endif
562
563 UnknownsField->advanceSolution(_stepWhenIcApply);
564 solutionVector = UnknownsField->giveSolutionVector(_stepWhenIcApply);
565 solutionVector->resize(neq);
566 solutionVector->zero();
567
568 for ( auto &node : domain->giveDofManagers() ) {
569
570 for ( Dof *dof: *node ) {
571 // ask for initial values obtained from
572 // bc (boundary conditions) and ic (initial conditions)
573 if ( !dof->isPrimaryDof() ) {
574 continue;
575 }
576
577 int jj = dof->__giveEquationNumber();
578 if ( jj ) {
579 val = dof->giveUnknown(VM_Total, _stepWhenIcApply);
580 solutionVector->at(jj) = val;
581 //update in dictionary, if the problem is growing/decreasing
582 if ( this->changingProblemSize ) {
583 dof->updateUnknownsDictionary(_stepWhenIcApply, VM_Total, val);
584 }
585 }
586 }
587 }
588
589
590 //project initial temperature to integration points
591
592 // for ( int j = 1; j <= nelem; j++ ) {
593 // domain->giveElement(j)->updateInternalState(_stepWhenIcApply);
594 // }
595
596#ifdef __CEMHYD_MODULE
597 // Not relevant in linear case, but needed for CemhydMat for temperature averaging before solving balance equations
598 // Update element state according to given ic
599 for ( auto &elem : domain->giveElements() ) {
600 TransportElement *element = static_cast< TransportElement * >( elem.get() );
601 CemhydMat *cem = dynamic_cast< CemhydMat * >( element->giveMaterial() );
602 //assign status to each integration point on each element
603 if ( cem ) {
604 cem->initMaterial(element); //create microstructures and statuses on specific GPs
605 element->updateInternalState(_stepWhenIcApply); //store temporary unequilibrated temperature
606 element->updateYourself(_stepWhenIcApply); //store equilibrated temperature
608 cem->storeWeightTemperatureProductVolume(element, _stepWhenIcApply);
609 }
610 }
611
612 //perform averaging on each material instance of CemhydMatClass
613 for ( auto &mat : domain->giveMaterials() ) {
614 CemhydMat *cem = dynamic_cast< CemhydMat * >( mat.get() );
615 if ( cem ) {
616 cem->averageTemperature();
617 }
618 }
619
620#endif //__CEMHYD_MODULE
621
622 // update element state according to given ic
623 for ( auto &elem : domain->giveElements() ) {
624 TransportElement *element = static_cast< TransportElement * >( elem.get() );
625 element->updateInternalState(_stepWhenIcApply);
626 element->updateYourself(_stepWhenIcApply);
627 }
628}
629
630
631void
632NonStationaryTransportProblem :: assembleDirichletBcRhsVector(FloatArray &answer, TimeStep *tStep,
633 ValueModeType mode,
634 const UnknownNumberingScheme &ns, Domain *d)
635{
636 IntArray loc, dofids;
637 FloatArray rp, charVec;
638 FloatMatrix s;
639 FloatMatrix capacity;
640
641 int nelem = d->giveNumberOfElements();
642
643 for ( int ielem = 1; ielem <= nelem; ielem++ ) {
644 Element *element = d->giveElement(ielem);
645
646 element->giveElementDofIDMask(dofids);
647 element->computeVectorOfPrescribed(dofids, mode, tStep, rp);
648 if ( rp.containsOnlyZeroes() ) {
649 continue;
650 } else {
651 element->giveCharacteristicMatrix(s, TangentStiffnessMatrix, tStep);
652 element->giveCharacteristicMatrix(capacity, lumpedCapacityStab ? LumpedMassMatrix : MassMatrix, tStep);
653 s.times(this->alpha);
654 s.add(1. / tStep->giveTimeIncrement(), capacity);
655
656 charVec.beProductOf(s, rp);
657 charVec.negated();
658
659 element->giveLocationArray(loc, ns);
660 answer.assemble(charVec, loc);
661 }
662 } // end element loop
663}
664
665#ifdef __CEMHYD_MODULE
666// needed for CemhydMat
667void
668NonStationaryTransportProblem :: averageOverElements(TimeStep *tStep)
669{
671 Domain *domain = this->giveDomain(1);
672 FloatArray vecTemperature;
673
674 for ( auto &elem : domain->giveElements() ) {
675 TransportMaterial *mat = dynamic_cast< CemhydMat * >( elem->giveMaterial() );
676 if ( mat ) {
677 for ( GaussPoint *gp: *elem->giveDefaultIntegrationRulePtr() ) {
678 elem->giveIPValue(vecTemperature, gp, IST_Temperature, tStep);
679 //mat->IP_volume += dV;
680 //mat->average_temp += vecState.at(1) * dV;
681 }
682 }
683 }
684
685 for ( auto &mat : domain->giveMaterials() ) {
686 CemhydMat *cem = dynamic_cast< CemhydMat * >( mat.get() );
687 if ( cem ) {
688 //cem->average_temp /= mat->IP_volume;
689 }
690 }
691}
692#endif
693} // end namespace oofem
#define REGISTER_EngngModel(class)
virtual void storeWeightTemperatureProductVolume(Element *element, TimeStep *tStep)
Store temperatures multiplied with volume around GPs - need before temperature averaging.
Definition cemhydmat.C:383
int initMaterial(Element *element) override
Definition cemhydmat.C:352
virtual void clearWeightTemperatureProductVolume(Element *element)
Clear temperatures multiplied with volume around GPs - need before temperature averaging.
Definition cemhydmat.C:373
virtual void averageTemperature()
Perform averaging on a master CemhydMatStatus.
Definition cemhydmat.C:397
DofIDItem giveDofID() const
Definition dof.h:276
virtual int __giveEquationNumber() const =0
virtual void giveUnknowns(FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep)
Definition dof.C:159
std ::vector< std ::unique_ptr< Material > > & giveMaterials()
Definition domain.h:371
int giveNumberOfElements() const
Returns number of elements in domain.
Definition domain.h:463
std ::vector< std ::unique_ptr< DofManager > > & giveDofManagers()
Definition domain.h:427
Element * giveElement(int n)
Definition domain.C:165
std ::vector< std ::unique_ptr< Element > > & giveElements()
Definition domain.h:294
virtual void giveElementDofIDMask(IntArray &answer) const
Definition element.h:510
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
Definition element.C:620
virtual void updateYourself(TimeStep *tStep)
Definition element.C:824
void computeVectorOfPrescribed(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Definition element.C:212
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Definition element.C:429
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Definition element.C:103
elementParallelMode giveParallelMode() const
Definition element.h:1139
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
Definition engngm.h:787
void assembleVectorFromDofManagers(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Definition engngm.C:1136
std ::vector< std ::unique_ptr< Domain > > domainList
List of problem domains.
Definition engngm.h:217
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Definition engngm.C:452
void assembleVectorFromElements(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Definition engngm.C:1351
std ::unique_ptr< TimeStep > previousStep
Previous time step.
Definition engngm.h:243
MetaStep * giveCurrentMetaStep()
Returns current meta step.
Definition engngm.C:1900
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
virtual int giveNumberOfFirstStep(bool force=false)
Definition engngm.h:763
std ::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
Definition engngm.h:239
bool containsOnlyZeroes() const
Definition floatarray.C:671
void assemble(const FloatArray &fe, const IntArray &loc)
Definition floatarray.C:616
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 beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void add(const FloatArray &src)
Definition floatarray.C:218
void times(double s)
Definition floatarray.C:834
void times(double f)
void add(const FloatMatrix &a)
bool isNotEmpty() const
Tests for empty matrix.
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
FloatArray discreteTimes
Specified times where the problem is solved.
virtual void assembleDirichletBcRhsVector(FloatArray &answer, TimeStep *tStep, ValueModeType mode, const UnknownNumberingScheme &s, Domain *d)
int requiresUnknownsDictionaryUpdate() override
Allows to change number of equations during solution.
int giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep) override
std ::unique_ptr< SparseLinearSystemNM > linSolver
TimeStep * giveSolutionStepWhenIcApply(bool force=false) override
double initT
Initial time from which the computation runs. Default is zero.
int lumpedCapacityStab
If set then stabilization using lumped capacity will be used.
NumericalMethod * giveNumericalMethod(MetaStep *mStep) override
Returns reference to receiver's numerical method.
int dtFunction
Associated time function for time step increment.
virtual void copyUnknownsInDictionary(ValueModeType mode, TimeStep *fromTime, TimeStep *toTime)
bool changingProblemSize
Determines if there are change in the problem size (no application/removal of Dirichlet boundary cond...
virtual void assembleAlgorithmicPartOfRhs(FloatArray &rhs, const UnknownNumberingScheme &s, TimeStep *tStep)
FloatArray bcRhs
Right hand side vector from boundary conditions.
StationaryTransportProblem(int i, EngngModel *_master)
std ::unique_ptr< PrimaryField > UnknownsField
This field stores solution vector. For fixed size of problem, the PrimaryField is used,...
std ::unique_ptr< SparseMtrx > conductivityMatrix
void incrementStateCounter()
Updates solution state counter.
Definition timestep.h:213
double giveTimeIncrement()
Returns solution step associated time increment.
Definition timestep.h:168
double giveTargetTime()
Returns target time.
Definition timestep.h:164
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
StateCounterType giveSolutionStateCounter()
Definition timestep.h:211
Material * giveMaterial() override
void updateInternalState(TimeStep *tStep) override
virtual void computeInternalSourceRhsVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
virtual void computeBCVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
#define _IFT_EngngModel_lstype
Definition engngm.h:91
#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
#define OOFEM_LOG_RELEVANT(...)
Definition logger.h:142
long ContextMode
Definition contextmode.h:43
@ Element_remote
Element in active domain is only mirror of some remote element.
Definition element.h:89
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
long StateCounterType
StateCounterType type used to indicate solution state.
ClassFactory & classFactory
#define _IFT_NonStationaryTransportProblem_deltatfunction
#define _IFT_NonStationaryTransportProblem_initt
#define _IFT_NonStationaryTransportProblem_prescribedtimes
#define _IFT_NonStationaryTransportProblem_deltat
#define _IFT_NonStationaryTransportProblem_changingproblemsize
#define _IFT_NonStationaryTransportProblem_alpha
#define _IFT_NonStationaryTransportProblem_lumpedcapa
#define VERBOSE_PRINT0(str, number)
Definition verbose.h:56

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