OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
pfem.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 - 2013 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 // Implementation according paper:
36 // S.R. Idelsohn, E. Onate, F. Del Pin
37 // The particle finite element method: a powerful tool to solve
38 // incompressible flows with free-surface and breaking waves
39 
40 #include "pfem.h"
41 #include "nummet.h"
42 #include "timestep.h"
43 #include "metastep.h"
44 #include "element.h"
45 #include "dofmanager.h"
46 #include "elementside.h"
47 #include "dof.h"
48 #include "initialcondition.h"
49 #include "verbose.h"
50 #include "connectivitytable.h"
51 #include "pfemelement.h"
52 #include "tr1_2d_pfem.h"
53 #include "delaunaytriangulator.h"
54 #include "load.h"
55 #include "pfemparticle.h"
56 #include "octreelocalizert.h" //changed from "octreelocalizer.h"
57 #include "spatiallocalizer.h"
58 #include "classfactory.h"
59 #include "mathfem.h"
60 #include "datastream.h"
61 #include "contextioerr.h"
62 #include "leplic.h"
63 
64 
65 namespace oofem {
67 
68 
70 {
71  PFEMElement &pelem = static_cast< PFEMElement & >( element );
72 
73  FloatMatrix d;
74  pelem.giveCharacteristicMatrix(d, DivergenceMatrix, tStep);
75  FloatArray u_star;
76  pelem.computeVectorOf(VM_Intermediate, tStep, u_star);
77  vec.beProductOf(d, u_star);
78 
79  FloatArray reducedVec;
80  pelem.computePrescribedRhsVector(reducedVec, tStep, mode);
81  reducedVec.negated();
82  vec.assemble( reducedVec, pelem.givePressureDofMask() );
83 }
84 
85 
87 {
88  PFEMElement &pelem = static_cast< PFEMElement & >( element );
89 
90  FloatMatrix g;
91  FloatArray p;
92  pelem.computeVectorOfPressures(VM_Total, tStep, p);
93  pelem.computeGradientMatrix(g, tStep);
94  vec.beProductOf(g, p);
95  vec.times(-deltaT);
96 
97  FloatMatrix m;
98  FloatArray u;
99  pelem.computeDiagonalMassMtrx(m, tStep);
100  pelem.computeVectorOfVelocities(VM_Intermediate, tStep, u);
101  for ( int i = 0; i < m.giveNumberOfColumns(); ++i ) {
102  vec [ i ] += m(i, i) * u [ i ];
103  }
104 }
105 
107 {
108  // Note: For 2D, the V_w will just be ignored anyweay, so it's safe to use all three always.
109  //element.giveLocationArray(loc, {V_u, V_v, V_w}, s, dofIds);
110  element.giveLocationArray(loc, { V_u, V_v }, s, dofIds);
111 }
112 
113 
115 {
116  PFEMElement &pelem = static_cast< PFEMElement & >( element );
117 
118  FloatMatrix l;
119  FloatArray u;
120  pelem.computeStiffnessMatrix(l, TangentStiffness, tStep);
121  pelem.computeVectorOfVelocities(VM_Total, tStep, u);
122  vec.beProductOf(l, u);
123 }
124 
126 {
127  //element.giveLocationArray(loc, {V_u, V_v, V_w}, s, dofIds);
128  element.giveLocationArray(loc, { V_u, V_v }, s, dofIds);
129 }
130 
131 
133 {
134  PFEMElement &pelem = static_cast< PFEMElement & >( element );
135 
136  FloatMatrix m;
137  FloatArray u;
138  pelem.computeDiagonalMassMtrx(m, tStep);
139  pelem.computeVectorOfVelocities(VM_Total, tStep, u);
140  vec.beProductOf(m, u);
141 }
142 
144 {
145  //element.giveLocationArray(loc, {V_u, V_v, V_w}, s, dofIds);
146  element.giveLocationArray(loc, { V_u, V_v }, s, dofIds);
147 }
148 
149 
151 {
152  PFEMElement &pelem = static_cast< PFEMElement & >( element );
153  pelem.computePressureLaplacianMatrix(mat, tStep);
154 }
155 
157 {
158  element.giveLocationArray(loc, { P_f }, s, dofIds);
159 }
160 
161 
163 {
164  if ( nMethod ) {
165  return nMethod;
166  }
167 
168  nMethod = classFactory.createSparseLinSolver(solverType, this->giveDomain(1), this);
169  if ( nMethod == NULL ) {
170  OOFEM_ERROR("linear solver creation failed for lstype %d", solverType);
171  }
172 
173  return nMethod;
174 }
175 
176 
177 int
179 {
180  resetEquationNumberings();
181  // forces equation renumbering for current time step
182  // intended mainly for problems with changes of static system
183  // during solution
184  // OUTPUT:
185  // sets this->numberOfEquations and this->numberOfPrescribedEquations and returns this value
186 
187  // first initialize default numbering (for velocity unknowns only)
188 
189  Domain *domain = this->giveDomain(id);
190  TimeStep *currStep = this->giveCurrentStep();
191 
192  this->domainNeqs.at(id) = 0;
193  this->domainPrescribedNeqs.at(id) = 0;
194 
195  // number velocities first
196  for ( auto &dman : domain->giveDofManagers() ) {
197  for ( Dof *jDof: *dman ) {
198  DofIDItem type = jDof->giveDofID();
199  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
200  jDof->askNewEquationNumber(currStep);
201  }
202  }
203  }
204 
205  // initialize the independent pressure and auxiliary velocity/equation numbering
206  pns.init(domain, currStep);
207  avns.init(domain);
208 
209  return domainNeqs.at(id);
210 }
211 
212 
213 
216 {
217  IRResultType result; // Required by IR_GIVE_FIELD macro
218 
220  int val = 0;
222  solverType = ( LinSystSolverType ) val;
223 
224  val = 0;
226  sparseMtrxType = ( SparseMtrxType ) val;
227 
228  IR_GIVE_FIELD(ir, deltaT, _IFT_PFEM_deltat);
229  minDeltaT = 0.;
231 
232  alphaShapeCoef = 1.0;
234 
235  maxiter = 50;
237 
238  rtolv = 1.e-8;
240 
241  rtolp = 1.e-8;
243 
244  particleRemovalRatio = 0.0;
245  IR_GIVE_OPTIONAL_FIELD(ir, particleRemovalRatio, _IFT_PFEM_particalRemovalRatio);
246 
247  val = 0;
249  printVolumeReport = ( val == 1 );
250 
251  IR_GIVE_OPTIONAL_FIELD(ir, discretizationScheme, _IFT_PFEM_discretizationScheme);
252 
253  IR_GIVE_FIELD(ir, associatedMaterial, _IFT_PFEM_associatedMaterial);
254  IR_GIVE_FIELD(ir, associatedCrossSection, _IFT_PFEM_associatedCrossSection);
255  IR_GIVE_FIELD(ir, associatedPressureBC, _IFT_PFEM_pressureBC);
256 
257  return IRRT_OK;
258 }
259 
260 
261 
262 double
264 // returns unknown quantity like pressure or velocity of dof
265 {
266  if ( mode == VM_Intermediate ) {
267  if ( AuxVelocity.isNotEmpty() ) {
268  int index = avns.giveDofEquationNumber(dof);
269  if ( index > 0 && index <= AuxVelocity.giveSize() ) {
270  return AuxVelocity.at(index);
271  } else {
272  return 0.0;
273  }
274  } else {
275  return 0.;
276  }
277  } else {
278  if ( this->requiresUnknownsDictionaryUpdate() ) {
279  int hash = this->giveUnknownDictHashIndx(mode, tStep);
280  if ( dof->giveUnknowns()->includes(hash) ) {
281  return dof->giveUnknowns()->at(hash);
282  } else {
283  OOFEM_ERROR( "giveUnknown: Dof unknowns dictionary does not contain unknown of value mode (%s)", __ValueModeTypeToString(mode) );
284  return 0.; // to make compiler happy
285  }
286  } else {
287  return 0.0;
288  }
289  }
290 }
291 
292 
293 TimeStep *
295 {
296  if ( !stepWhenIcApply ) {
297  stepWhenIcApply.reset( new TimeStep(giveNumberOfTimeStepWhenIcApply(), this, 0, 0.0, deltaT, 0) );
298  }
299 
300  return stepWhenIcApply.get();
301 }
302 
303 void
305 {
306  Domain *domain = this->giveDomain(1);
307  domain->clearElements();
308 
309  DelaunayTriangulator myMesher(domain, alphaShapeCoef);
310  myMesher.generateMesh();
311 
312  for ( auto &dman : domain->giveDofManagers() ) {
313  PFEMParticle *particle = dynamic_cast< PFEMParticle * >( dman.get() );
314  particle->setFree();
315  }
316 
317  if ( domain->giveNumberOfElements() > 0 ) {
318  for ( auto &element : domain->giveElements() ) {
319  element->checkConsistency();
320 
321  for ( int j = 1; j <= element->giveNumberOfDofManagers(); j++ ) {
322  dynamic_cast< PFEMParticle * >( element->giveDofManager(j) )->setFree(false);
323  }
324  }
325  } else {
326  VERBOSE_PRINTS("Mesh generation failed", "0 elements created");
327  }
328 
329  for ( auto &dman : domain->giveDofManagers() ) {
330  for ( Dof *jDof: *dman ) {
331  DofIDItem type = jDof->giveDofID();
332  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
333  if ( jDof->giveBcId() ) {
334  dynamic_cast< PFEMParticle * >( dman.get() )->setFree(false);
335  break;
336  }
337  }
338  }
339  }
340 }
341 
342 TimeStep *
344 {
345  int istep = this->giveNumberOfFirstStep();
346  double totalTime = 0;
347  StateCounterType counter = 1;
348  Domain *domain = this->giveDomain(1);
349 
350  if ( !currentStep ) {
351  // first step -> generate initial step
352  currentStep.reset( new TimeStep( * giveSolutionStepWhenIcApply() ) );
353  } else {
354  istep = currentStep->giveNumber() + 1;
355  counter = currentStep->giveSolutionStateCounter() + 1;
356  }
357 
358  previousStep = std :: move(currentStep);
359 
361 
362  double volume = 0.0;
363 
364  double ndt = dynamic_cast< PFEMElement * >( domain->giveElement(1) )->computeCriticalTimeStep( previousStep.get() );
365  // check for critical time step
366  for ( int i = 2; i <= domain->giveNumberOfElements(); i++ ) {
367  TR1_2D_PFEM *ielem = dynamic_cast< TR1_2D_PFEM * >( domain->giveElement(i) );
368  double idt = ielem->computeCriticalTimeStep( previousStep.get() );
369  if ( idt < ndt ) {
370  ndt = idt;
371  OOFEM_LOG_INFO("Reducing time step due to element #%i \n", i);
372  }
373  volume += ielem->computeArea();
374  }
375 
376  ndt = min(ndt, deltaT);
377 
378  totalTime = previousStep->giveTargetTime() + ndt;
379 
380  currentStep.reset( new TimeStep(istep, this, 1, totalTime, ndt, counter) );
381  // time and dt variables are set eq to 0 for staics - has no meaning
382 
383  OOFEM_LOG_INFO( "SolutionStep %d : t = %e, dt = %e\n", istep, totalTime * this->giveVariableScale(VST_Time), ndt * this->giveVariableScale(VST_Time) );
384  if ( printVolumeReport ) {
385  OOFEM_LOG_INFO("Volume leakage: %.3f%%\n", ( 1.0 - ( volume / domainVolume ) ) * 100.0);
386  }
387 
388  return currentStep.get();
389 }
390 
391 void
393 {
394  int auxmomneq = this->giveNumberOfDomainEquations(1, avns);
395  int momneq = this->giveNumberOfDomainEquations(1, vns);
396  int presneq = this->giveNumberOfDomainEquations(1, pns);
397 
398  double deltaT = tStep->giveTimeIncrement();
399 
400  FloatArray rhs(auxmomneq);
401 
402 
403  double d_pnorm = 1.0;
404  double d_vnorm = 1.0;
405 
406  AuxVelocity.resize(auxmomneq);
407 
408  avLhs.clear();
409  avLhs.resize(auxmomneq);
410 
411  this->assembleVector( avLhs, tStep, LumpedMassVectorAssembler(), VM_Total, avns, this->giveDomain(1) );
412 
413  pLhs.reset( classFactory.createSparseMtrx(sparseMtrxType) );
414  if ( !pLhs ) {
415  OOFEM_ERROR("solveYourselfAt: sparse matrix creation failed");
416  }
417 
418  pLhs->buildInternalStructure(this, 1, pns);
419 
420  this->assemble( * pLhs, tStep, PFEMPressureLaplacianAssembler(), pns, this->giveDomain(1) );
421 
422  pLhs->times(deltaT);
423 
425 
426  vLhs.clear();
427  vLhs.resize(momneq);
428 
429  this->assembleVector( vLhs, tStep, LumpedMassVectorAssembler(), VM_Total, vns, this->giveDomain(1) );
430 
431  if ( tStep->giveNumber() == giveNumberOfFirstStep() ) {
432  TimeStep *stepWhenIcApply = tStep->givePreviousStep();
433  this->applyIC(stepWhenIcApply);
434  }
435 
436  if ( VelocityField.giveActualStepNumber() < tStep->giveNumber() ) {
437  VelocityField.advanceSolution(tStep);
438  }
439 
440  if ( PressureField.giveActualStepNumber() < tStep->giveNumber() ) {
441  PressureField.advanceSolution(tStep);
442  }
443 
444  FloatArray *velocityVector = VelocityField.giveSolutionVector(tStep);
445  FloatArray *pressureVector = PressureField.giveSolutionVector(tStep);
446 
447  FloatArray velocityVectorThisStep(* velocityVector);
448  FloatArray velocityVectorLastStep(* velocityVector);
449 
450  FloatArray pressureVectorThisStep(* pressureVector);
451  FloatArray pressureVectorLastStep(* pressureVector);
452 
453  if ( tStep->isTheFirstStep() ) {
454  for ( int i = 1; i <= this->giveDomain(1)->giveNumberOfDofManagers(); i++ ) {
455  this->updateDofUnknownsDictionary(this->giveDomain(1)->giveDofManager(i), tStep);
456  }
457  }
458 
459  FloatArray externalForces;
460  externalForces.resize(auxmomneq);
461  this->assembleVector( externalForces, tStep, ExternalForceAssembler(), VM_Total, avns, this->giveDomain(1) );
462 
463  int iteration = 0;
464  do {
465  iteration++;
466 
467  velocityVectorLastStep = velocityVectorThisStep;
468  pressureVectorLastStep = pressureVectorThisStep;
469 
470  /************************** STEP 1 - calculates auxiliary velocities *************************/
471 
472  rhs.resize(auxmomneq);
473  rhs.zero();
474 
475  if ( discretizationScheme == 1 ) { //implicit
476  if ( iteration > 1 ) {
477  this->assembleVectorFromElements( rhs, tStep, PFEMLaplaceVelocityAssembler(), VM_Total, avns, this->giveDomain(1) );
478  }
479  } else if ( discretizationScheme == 0 ) { // explicit
480  this->assembleVectorFromElements( rhs, tStep->givePreviousStep(), PFEMLaplaceVelocityAssembler(), VM_Total, avns, this->giveDomain(1) );
481  }
482 
483  rhs.negated();
484 
485  // constant member placed outside of the loop
486  rhs.add(externalForces);
487 
488  rhs.times(deltaT);
489 
490 
492  // for ( int i = 1; i <= momneq; i++ ) {
493  // rhs.at(i) +=  avLhs.at(i) * oldVelocityVector.at(i);
494  // }
495 
496  if ( tStep->isTheFirstStep() == false ) {
497  this->assembleVectorFromElements( rhs, tStep->givePreviousStep(), PFEMMassVelocityAssembler(), VM_Total, avns, this->giveDomain(1) );
498  }
499 
500  this->giveNumericalMethod( this->giveMetaStep( tStep->giveMetaStepNumber() ) );
501  AuxVelocity.resize( rhs.giveSize() );
502  for ( int i = 1; i <= auxmomneq; i++ ) {
503  AuxVelocity.at(i) = rhs.at(i) / avLhs.at(i);
504  }
505 
506  /************************* STEP 2 - calculates pressure ************************************/
507 
508  rhs.resize(presneq);
509  rhs.zero();
510 
511  this->assembleVectorFromElements( rhs, tStep, PFEMPressureRhsAssembler(), VM_Total, pns, this->giveDomain(1) );
512 
513  this->giveNumericalMethod( this->giveMetaStep( tStep->giveMetaStepNumber() ) );
514  pressureVector->resize(presneq);
515  nMethod->solve(* pLhs, rhs, * pressureVector);
516 
517  for ( auto &dman : this->giveDomain(1)->giveDofManagers() ) {
518  this->updateDofUnknownsDictionaryPressure(dman.get(), tStep);
519  }
520 
521  /**************************** STEP 3 - velocity correction step ********************************/
522 
523 
524 
525  rhs.resize(momneq);
526  rhs.zero();
527  velocityVector->resize(momneq);
528 
529  this->assembleVectorFromElements( rhs, tStep, PFEMCorrectionRhsAssembler(deltaT), VM_Total, vns, this->giveDomain(1) );
530 
531  this->giveNumericalMethod( this->giveMetaStep( tStep->giveMetaStepNumber() ) );
532 
533  velocityVector->resize( rhs.giveSize() );
534  for ( int i = 1; i <= momneq; i++ ) {
535  velocityVector->at(i) = rhs.at(i) / vLhs.at(i);
536  }
537 
538  for ( int i = 1; i <= this->giveDomain(1)->giveNumberOfDofManagers(); i++ ) {
539  PFEMParticle *particle = dynamic_cast< PFEMParticle * >( this->giveDomain(1)->giveDofManager(i) );
540  this->updateDofUnknownsDictionaryVelocities(particle, tStep);
541  }
542 
543  velocityVectorThisStep = * velocityVector;
544  pressureVectorThisStep = * pressureVector;
545 
546  if ( iteration == 1 ) {
547  d_vnorm = velocityVectorThisStep.computeNorm();
548  d_pnorm = pressureVectorThisStep.computeNorm();
549  } else {
550  FloatArray diffVelocity = velocityVectorThisStep;
551  diffVelocity.subtract(velocityVectorLastStep);
552 
553  d_vnorm = 0.0;
554  for ( int i = 1; i <= diffVelocity.giveSize(); i++ ) {
555  d_vnorm = max(d_vnorm, fabs( diffVelocity.at(i) ) > 1.e-6 ? fabs( diffVelocity.at(i) / velocityVectorLastStep.at(i) ) : 0);
556  }
557 
558  FloatArray diffPressure = pressureVectorThisStep;
559  diffPressure.subtract(pressureVectorLastStep);
560  d_pnorm = 0.0;
561  for ( int i = 1; i <= diffPressure.giveSize(); i++ ) {
562  // TODO : what about divide by zero ????
563  d_pnorm = max(d_pnorm, fabs( diffPressure.at(i) ) > 1.e-6 ? fabs( diffPressure.at(i) / pressureVectorLastStep.at(i) ) : 0);
564  }
565  }
566  } while ( discretizationScheme == 1 && ( d_vnorm > rtolv || d_pnorm > rtolp ) && iteration < maxiter );
567 
568  if ( iteration > maxiter ) {
569  OOFEM_ERROR("Maximal iteration count exceded");
570  } else {
571  OOFEM_LOG_INFO("\n %i iterations performed.\n", iteration);
572  }
573 
574 
575 
576  Domain *d = this->giveDomain(1);
577  for ( auto &dman : d->giveDofManagers() ) {
578  PFEMParticle *particle = dynamic_cast< PFEMParticle * >( dman.get() );
579 
580  if ( particle->isFree() && particle->isActive() ) {
581  for ( Dof *dof : *particle ) {
582  DofIDItem type = dof->giveDofID();
583  if ( type == V_u || type == V_v || type == V_w ) {
584  int eqnum = dof->giveEquationNumber(vns);
585  if ( eqnum ) {
586  double previousValue = dof->giveUnknown( VM_Total, tStep->givePreviousStep() );
587  Load *load = d->giveLoad(3);
588  FloatArray gVector;
589  load->computeComponentArrayAt(gVector, tStep, VM_Total);
590  previousValue += gVector [ type - V_w ] * deltaT; // Get the corresponding coordinate index for the velocities.
591  velocityVector->at(eqnum) = previousValue;
592  }
593  }
594  }
595  }
596  }
597  tStep->incrementStateCounter();
598 }
599 
600 
601 void
603 {
604  this->updateInternalState(stepN);
606 
607  this->deactivateTooCloseParticles();
608 }
609 
610 
611 
612 void
614 {
615  for ( auto &domain : this->domainList ) {
616  if ( requiresUnknownsDictionaryUpdate() ) {
617  for ( auto &dman : domain->giveDofManagers() ) {
618  this->updateDofUnknownsDictionary(dman.get(), stepN);
619  }
620  }
621 
622  for ( auto &elem : domain->giveElements() ) {
623  elem->updateInternalState(stepN);
624  }
625  }
626 }
627 
628 int
630 {
631  if ( ( stepN == this->giveCurrentStep() ) || ( stepN == this->givePreviousStep() ) ) {
632  int index = ( stepN->giveNumber() % 2 ) * 100 + mode;
633  return index;
634  } else {
635  OOFEM_ERROR("giveUnknownDictHashIndx: unsupported solution step");
636  }
637 
638  return 0;
639 }
640 
641 void
643 {
644  for ( Dof *iDof: *inode ) {
645  int eqNum = 0;
646  double val = 0;
647  if ( iDof->hasBc(tStep) ) { // boundary condition
648  val = iDof->giveBcValue(VM_Total, tStep);
649  } else {
650  if ( iDof->giveDofID() == P_f ) {
651  eqNum = pns.giveDofEquationNumber(iDof);
652  FloatArray *vect = PressureField.giveSolutionVector(tStep);
653  if ( vect->giveSize() > 0 ) { // in the first step -> zero will be set
654  val = vect->at(eqNum);
655  }
656  } else { // velocities
657  eqNum = iDof->__giveEquationNumber();
658  FloatArray *vect = VelocityField.giveSolutionVector(tStep);
659  if ( vect->giveSize() > 0 ) {
660  val = vect->at(eqNum);
661  }
662  }
663  }
664 
665  iDof->updateUnknownsDictionary(tStep, VM_Total, val);
666  }
667 }
668 
669 void
671 {
672  Dof *iDof = inode->giveDofWithID(P_f);
673  double val = 0;
674  if ( iDof->hasBc(tStep) ) {
675  val = iDof->giveBcValue(VM_Total, tStep);
676  } else {
677  int eqNum = pns.giveDofEquationNumber(iDof);
678  FloatArray *vect = PressureField.giveSolutionVector(tStep);
679  val = vect->at(eqNum);
680  }
681 
682  iDof->updateUnknownsDictionary(tStep, VM_Total, val);
683 }
684 
685 void
687 {
688  for ( Dof *iDof : *inode ) {
689  DofIDItem type = iDof->giveDofID();
690  if ( type == V_u || type == V_v || type == V_w ) {
691  int eqNum = 0;
692  double val = 0;
693  if ( iDof->hasBc(tStep) ) { // boundary condition
694  val = iDof->giveBcValue(VM_Total, tStep);
695  } else {
696  eqNum = iDof->__giveEquationNumber();
697  FloatArray *vect = VelocityField.giveSolutionVector(tStep);
698  if ( vect->giveSize() > 0 ) {
699  val = vect->at(eqNum);
700  }
701  }
702  iDof->updateUnknownsDictionary(tStep, VM_Total, val);
703  }
704  }
705 }
706 
707 
708 // NOT ACTIVE
711 {
712  contextIOResultType iores;
713 
714  if ( ( iores = EngngModel :: saveContext(stream, mode) ) != CIO_OK ) {
715  THROW_CIOERR(iores);
716  }
717 
718  if ( ( iores = PressureField.saveContext(stream, mode) ) != CIO_OK ) {
719  THROW_CIOERR(iores);
720  }
721 
722  if ( ( iores = VelocityField.saveContext(stream, mode) ) != CIO_OK ) {
723  THROW_CIOERR(iores);
724  }
725 
726  return CIO_OK;
727 }
728 
729 
730 // NOT ACTIVE
733 {
734  contextIOResultType iores;
735 
736  if ( ( iores = EngngModel :: restoreContext(stream, mode) ) != CIO_OK ) {
737  THROW_CIOERR(iores);
738  }
739 
740  if ( ( iores = PressureField.restoreContext(stream, mode) ) != CIO_OK ) {
741  THROW_CIOERR(iores);
742  }
743 
744  if ( ( iores = VelocityField.restoreContext(stream, mode) ) != CIO_OK ) {
745  THROW_CIOERR(iores);
746  }
747 
748  return CIO_OK;
749 }
750 
751 
752 int
754 {
755  Domain *domain = this->giveDomain(1);
756 
757  // check for proper element type
758  for ( auto &elem : domain->giveElements() ) {
759  if ( !dynamic_cast< PFEMElement * >( elem.get() ) ) {
760  OOFEM_WARNING( "Element %d has no PFEM base", elem->giveLabel() );
761  return 0;
762  }
763  }
764 
766 }
767 
768 
769 void
770 PFEM :: printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *atTime)
771 {
772  DofIDItem type = iDof->giveDofID();
773  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
774  iDof->printSingleOutputAt(stream, atTime, '*', VM_Intermediate);
775  iDof->printSingleOutputAt(stream, atTime, 'u', VM_Total);
776 
777  // printing coordinate in DofMan Output
778  DofManager *dman = iDof->giveDofManager();
779  double coordinate = 0.0;
780  int dofNumber = 0;
781  switch ( type ) {
782  case V_u: dofNumber = 1;
783  break;
784  case V_v: dofNumber = 2;
785  break;
786  case V_w: dofNumber = 3;
787  break;
788  default:;
789  }
790  coordinate = dman->giveCoordinate(dofNumber);
791  fprintf(stream, " dof %d c % .8e\n", dofNumber, coordinate);
792  } else if ( ( type == P_f ) ) {
793  iDof->printSingleOutputAt(stream, atTime, 'p', VM_Total);
794  } else {
795  OOFEM_ERROR("printDofOutputAt: unsupported dof type");
796  }
797 }
798 
799 void
800 PFEM :: applyIC(TimeStep *stepWhenIcApply)
801 {
802  Domain *domain = this->giveDomain(1);
803  int mbneq = this->giveNumberOfDomainEquations(1, vns);
804  int pdneq = this->giveNumberOfDomainEquations(1, pns);
805  FloatArray *velocityVector, *pressureVector;
806 
807 #ifdef VERBOSE
808  OOFEM_LOG_INFO("Applying initial conditions\n");
809 #endif
810 
811  int velocityFieldStepNumber = VelocityField.giveActualStepNumber();
812 
813  if ( velocityFieldStepNumber < stepWhenIcApply->giveNumber() ) {
814  VelocityField.advanceSolution(stepWhenIcApply);
815  }
816  velocityVector = VelocityField.giveSolutionVector(stepWhenIcApply);
817  velocityVector->resize(mbneq);
818  velocityVector->zero();
819 
820  int pressureFieldStepNumber = PressureField.giveActualStepNumber();
821  if ( pressureFieldStepNumber < stepWhenIcApply->giveNumber() ) {
822  PressureField.advanceSolution(stepWhenIcApply);
823  }
824  pressureVector = PressureField.giveSolutionVector(stepWhenIcApply);
825  pressureVector->resize(pdneq);
826  pressureVector->zero();
827 
828 
829  for ( auto &node : domain->giveDofManagers() ) {
830  for ( Dof *iDof: *node ) {
831  // ask for initial values obtained from
832  // bc (boundary conditions) and ic (initial conditions)
833  //iDof = node->giveDof(k);
834  if ( !iDof->isPrimaryDof() ) {
835  continue;
836  }
837 
838  int jj = iDof->__giveEquationNumber();
839  DofIDItem type = iDof->giveDofID();
840 
841  if ( jj ) {
842  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
843  velocityVector->at(jj) = iDof->giveUnknown(VM_Total, stepWhenIcApply);
844  } else {
845  pressureVector->at(jj) = iDof->giveUnknown(VM_Total, stepWhenIcApply);
846  }
847  }
848  }
849  }
850 
851  // update element state according to given ic
852  for ( auto &elem : domain->giveElements() ) {
853  PFEMElement *element = static_cast< PFEMElement * >( elem.get() );
854  element->updateInternalState(stepWhenIcApply);
855  element->updateYourself(stepWhenIcApply);
856  domainVolume += element->computeArea();
857  }
858 }
859 
860 int
862 {
863  if ( ( id == V_u ) || ( id == V_v ) || ( id == V_w ) ) {
864  return this->vns.askNewEquationNumber();
865  } else {
866  OOFEM_ERROR("giveNewEquationNumber:: Unknown DofIDItem");
867  }
868 
869  return 0;
870 }
871 
872 int
874 {
875  if ( ( id == V_u ) || ( id == V_v ) || ( id == V_w ) ) {
876  return prescribedVns.askNewEquationNumber();
877  } else {
878  OOFEM_ERROR("giveNewPrescribedEquationNumber:: Unknown DofIDItem");
879  }
880 
881  return 0;
882 }
883 
884 int PFEM :: giveNumberOfDomainEquations(int d, const UnknownNumberingScheme &numberingScheme) { //
885  // returns number of equations of current problem
886  // this method is implemented here, because some method may add some
887  // conditions in to system and this may results into increased number of
888  // equations.
889  //
890 
891  if ( !equationNumberingCompleted ) {
893  }
894 
895  return numberingScheme.giveRequiredNumberOfDomainEquation();
896 }
897 
898 
899 void
901 {
902  vns.reset();
903  prescribedVns.reset();
904  pns.reset();
905  avns.reset();
906 }
907 
908 void
910 {
911  Domain *d = this->giveDomain(1);
912  // deactivating particles
913  if ( particleRemovalRatio > 1.e-6 ) { // >0
914  for ( int i = 1; i <= d->giveNumberOfElements(); i++ ) {
915  TR1_2D_PFEM *element = dynamic_cast< TR1_2D_PFEM * >( d->giveElement(i) );
916 
917  PFEMParticle *particle1 = dynamic_cast< PFEMParticle * >( element->giveNode(1) );
918  PFEMParticle *particle2 = dynamic_cast< PFEMParticle * >( element->giveNode(2) );
919  PFEMParticle *particle3 = dynamic_cast< PFEMParticle * >( element->giveNode(3) );
920 
921  double l12 = particle1->giveCoordinates()->distance( particle2->giveCoordinates() );
922  double l23 = particle2->giveCoordinates()->distance( particle3->giveCoordinates() );
923  double l31 = particle3->giveCoordinates()->distance( particle1->giveCoordinates() );
924 
925  double maxLength = max( l12, max(l23, l31) );
926  double minLength = min( l12, min(l23, l31) );
927 
928  if ( minLength / maxLength < particleRemovalRatio ) {
929  if ( fabs(l12 - minLength) < 1.e-6 ) { // ==
930  if ( particle1->isActive() && particle2->isActive() ) {
931  bool isSupported = false;
932 
933  for ( Dof *jDof: *particle1 ) {//int j = 1; j <= particle1->giveNumberOfDofs();
934  DofIDItem type = jDof->giveDofID();
935  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
936  if ( jDof->giveBcId() ) {
937  isSupported = true;
938  }
939  }
940  }
941  if ( isSupported == false ) {
942  particle1->deactivate();
943  } else {
944  particle2->deactivate();
945  }
946  } else if ( particle1->isActive() == false || particle2->isActive() == false ) {
947  ; // it was deactivated by other element
948  } else {
949  OOFEM_ERROR("Both particles deactivated");
950  }
951  }
952 
953  if ( fabs(l23 - minLength) < 1.e-6 ) { // ==
954  if ( particle2->isActive() && particle3->isActive() ) {
955  bool isSupported = false;
956 
957  for ( Dof *jDof : *particle2 ) {
958  DofIDItem type = jDof->giveDofID();
959  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
960  if ( jDof->giveBcId() ) {
961  isSupported = true;
962  }
963  }
964  }
965  if ( isSupported == false ) {
966  particle2->deactivate();
967  } else {
968  particle3->deactivate();
969  }
970  } else if ( particle2->isActive() == false || particle3->isActive() == false ) {
971  ; // it was deactivated by other element
972  } else {
973  OOFEM_ERROR("Both particles deactivated");
974  }
975  }
976 
977  if ( fabs(l31 - minLength) < 1.e-6 ) { // ==
978  if ( particle3->isActive() && particle1->isActive() ) {
979  bool isSupported = false;
980  for ( Dof *jDof : *particle3 ) {
981  DofIDItem type = jDof->giveDofID();
982  if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
983  if ( jDof->giveBcId() ) {
984  isSupported = true;
985  }
986  }
987  }
988  if ( isSupported == false ) {
989  particle3->deactivate();
990  } else {
991  particle1->deactivate();
992  }
993  } else if ( particle3->isActive() == false || particle1->isActive() == false ) {
994  ; // it was deactivated by other element
995  } else {
996  OOFEM_ERROR("Both particles deactivated");
997  }
998  }
999  }
1000  }
1001  }
1002 }
1003 } // end namespace oofem
LinSystSolverType
The values of this type should be related not to specific solvers, but more to specific packages that...
int giveNumberOfColumns() const
Returns number of columns of receiver.
Definition: floatmatrix.h:158
void updateDofUnknownsDictionaryPressure(DofManager *inode, TimeStep *tStep)
Writes pressures into the dof unknown dictionaries.
Definition: pfem.C:670
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
Implementation of callback class for assembling right-hand side vector of laplacian multiplied by vel...
Definition: pfem.h:94
Implementation of callback class for assembling right-hand side of velocity equations.
Definition: pfem.h:79
#define _IFT_PFEM_maxiter
Definition: pfem.h:62
virtual void computeDiagonalMassMtrx(FloatArray &answer, TimeStep *)=0
Calculates diagonal mass matrix as vector.
virtual void locationFromElement(IntArray &loc, Element &element, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
Default implementation takes all the DOF IDs.
Definition: pfem.C:106
This class is the implementation of triangular PFEM element with linear (and equal order) interpolati...
Definition: tr1_2d_pfem.h:68
Class and object Domain.
Definition: domain.h:115
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
Definition: element.C:86
#define _IFT_PFEM_discretizationScheme
Definition: pfem.h:56
#define _IFT_PFEM_deltat
Definition: pfem.h:51
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
Definition: engngm.C:262
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
Definition: pfem.C:710
Class representing meta step.
Definition: metastep.h:62
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
Definition: classfactory.C:105
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
Definition: pfem.C:132
void resetEquationNumberings()
Resets the equation numberings as the mesh is recreated in each time step.
Definition: pfem.C:900
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
void updateDofUnknownsDictionaryVelocities(DofManager *inode, TimeStep *tStep)
Writes velocities into the dof unknown dictionaries.
Definition: pfem.C:686
virtual int giveNumberOfDomainEquations(int, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
Definition: pfem.C:884
Callback class for assembling pressure laplacian matrix.
Definition: pfem.h:112
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
int max(int i, int j)
Returns bigger value form two given decimals.
Definition: mathfem.h:71
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
long StateCounterType
StateCounterType type used to indicate solution state.
TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
Definition: pfem.C:343
This base class is an abstraction for numerical algorithm.
Definition: nummet.h:80
virtual bool isFree()
Returns the free-propery flag.
Definition: pfemparticle.h:84
void solveYourselfAt(TimeStep *)
Solves problem for given time step.
Definition: pfem.C:392
#define _IFT_PFEM_particalRemovalRatio
Definition: pfem.h:54
virtual void computePrescribedRhsVector(FloatArray &answer, TimeStep *tStep, ValueModeType mode)=0
Calculates the prescribed velocity vector for the right hand side of the pressure equation...
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Definition: element.C:779
virtual int giveUnknownDictHashIndx(ValueModeType mode, TimeStep *stepN)
This method is responsible for computing unique dictionary id (ie hash value) from given valueModeTyp...
Definition: pfem.C:629
void incrementStateCounter()
Updates solution state counter.
Definition: timestep.h:190
Implementation of callback class for assembling right-hand side of pressure equations.
Definition: pfem.h:70
Abstract base class for all finite elements.
Definition: element.h:145
virtual void updateInternalState(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Definition: pfemelement.C:207
Base class for dof managers.
Definition: dofmanager.h:113
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
Definition: domain.h:400
int giveNumberOfElements() const
Returns number of elements in domain.
Definition: domain.h:434
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes boundary condition value - its components values at given time.
Definition: load.C:82
virtual bool isActive()
Returns the activeFlag.
Definition: pfemparticle.h:94
REGISTER_EngngModel(ProblemSequence)
Class implementing an array of integers.
Definition: intarray.h:61
virtual void computePressureLaplacianMatrix(FloatMatrix &answer, TimeStep *atTime)=0
Calculates the pressure laplacian matrix.
void giveCharacteristicMatrix(FloatMatrix &answer, CharType, TimeStep *)
Computes characteristic matrix of receiver of requested type in given time step.
Definition: pfemelement.C:82
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual void giveUnknowns(FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep)
The key method of class Dof.
Definition: dof.C:162
IRResultType initializeFrom(InputRecord *ir)
Initialization from given input record.
Definition: pfem.C:215
virtual void preInitializeNextStep()
Removes all elements and call DelaunayTriangulator to build up new mesh with new recognized boundary...
Definition: pfem.C:304
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
Definition: pfem.C:86
void updateInternalState(TimeStep *)
Updates nodal values (calls also this->updateDofUnknownsDictionary for updating dofs unknowns diction...
Definition: pfem.C:613
This abstract class represent a general base element class for fluid dynamic problems solved using PF...
Definition: pfemelement.h:66
Implementation of callback class for assembling right-hand side vector of mass matrix multiplied by v...
Definition: pfem.h:103
double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
Definition: pfem.C:263
double giveTimeIncrement()
Returns solution step associated time increment.
Definition: timestep.h:150
bool isTheFirstStep()
Check if receiver is first step.
Definition: timestep.C:134
virtual void computeGradientMatrix(FloatMatrix &answer, TimeStep *atTime)=0
Calculates the pressure gradient matrix.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
Definition: floatarray.C:489
virtual void computeVectorOfPressures(ValueModeType mode, TimeStep *tStep, FloatArray &pressures)
Definition: fmelement.C:55
#define VERBOSE_PRINTS(str, str1)
Definition: verbose.h:55
virtual void matrixFromElement(FloatMatrix &mat, Element &element, TimeStep *tStep) const
Definition: pfem.C:150
void applyIC(TimeStep *)
Initializes velocity and pressure fields in the first step with prescribed values.
Definition: pfem.C:800
int giveNumber()
Returns receiver&#39;s number.
Definition: timestep.h:129
#define OOFEM_LOG_INFO(...)
Definition: logger.h:127
Element * giveElement(int n)
Service for accessing particular domain fe element.
Definition: domain.C:160
NumericalMethod * giveNumericalMethod(MetaStep *)
Returns reference to receiver&#39;s numerical method.
Definition: pfem.C:162
virtual void computeVectorOfVelocities(ValueModeType mode, TimeStep *tStep, FloatArray &velocities)
Definition: fmelement.C:48
#define _IFT_EngngModel_smtype
Definition: engngm.h:82
#define OOFEM_ERROR(...)
Definition: error.h:61
DofIDItem
Type representing particular dof type.
Definition: dofiditem.h:86
virtual void updateUnknownsDictionary(TimeStep *tStep, ValueModeType mode, double dofValue)
Abstract function, allowing Dof to store its unknowns in its own private dictionary.
Definition: dof.h:366
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
TimeStep * giveSolutionStepWhenIcApply()
Definition: pfem.C:294
Implementation for assembling external forces vectors in standard monolithic FE-problems.
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...
Definition: element.C:390
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
Definition: engngm.C:612
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
Definition: dof.h:276
#define _IFT_PFEM_rtolp
Definition: pfem.h:61
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
Definition: pfem.C:69
virtual void updateYourself(TimeStep *tStep)
Updates nodal values (calls also this->updateDofUnknownsDictionary for updating dofs unknowns diction...
Definition: pfem.C:602
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
#define _IFT_PFEM_associatedMaterial
Definition: pfem.h:57
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
Definition: timestep.C:114
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
Definition: pfem.C:732
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
Definition: pfem.C:114
void clearElements()
Clear all elements.
Definition: domain.C:466
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
Definition: engngm.C:1527
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
Definition: engngm.C:473
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
virtual void locationFromElement(IntArray &loc, Element &element, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
Default implementation takes all the DOF IDs.
Definition: pfem.C:125
#define _IFT_PFEM_printVolumeReport
Definition: pfem.h:55
Class representing vector of real numbers.
Definition: floatarray.h:82
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
Definition: classfactory.C:120
virtual double computeCriticalTimeStep(TimeStep *tStep)
Calculates critical time step.
Definition: tr1_2d_pfem.C:307
virtual int checkConsistency()
Allows programmer to test some receiver&#39;s internal data, before computation begins.
Definition: engngm.h:995
virtual void updateDofUnknownsDictionary(DofManager *inode, TimeStep *tStep)
Updates necessary values in Dofs unknown dictionaries.
Definition: pfem.C:642
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
#define _IFT_EngngModel_lstype
Definition: engngm.h:81
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual int giveRequiredNumberOfDomainEquation() const
Returns required number of domain equation.
#define _IFT_PFEM_mindeltat
Definition: pfem.h:52
virtual double computeArea()
Computes the area (zero for all but 2d geometries).
Definition: element.C:1115
Implementation for assembling lumped mass matrix (diagonal components) in vector form.
virtual void deactivate()
Sets the activeFlag to false.
Definition: pfemparticle.h:96
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.
Definition: floatarray.C:551
int giveMetaStepNumber()
Returns receiver&#39;s meta step number.
Definition: timestep.h:135
#define _IFT_PFEM_rtolv
Definition: pfem.h:60
double computeNorm() const
Computes the norm (or length) of the vector.
Definition: floatarray.C:840
virtual int checkConsistency()
Allows programmer to test some receiver&#39;s internal data, before computation begins.
Definition: pfem.C:753
Class representing the general Input Record.
Definition: inputrecord.h:101
#define _IFT_PFEM_alphashapecoef
Definition: pfem.h:53
virtual void printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *atTime)
DOF printing routine.
Definition: pfem.C:770
virtual void locationFromElement(IntArray &loc, Element &element, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
Definition: pfem.C:156
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
Definition: dofmanager.C:119
virtual double giveBcValue(ValueModeType mode, TimeStep *tStep)
Returns value of boundary condition of dof if it is prescribed.
Definition: dof.C:120
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual void setFree(bool newFlag=true)
Sets the free-property flag.
Definition: pfemparticle.h:86
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, TimeStep *atTime)=0
Calculates the stiffness matrix.
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
#define _IFT_PFEM_associatedCrossSection
Definition: pfem.h:58
virtual const IntArray & givePressureDofMask() const =0
Returns mask of pressure Dofs.
ClassFactory & classFactory
Definition: classfactory.C:59
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
virtual FloatArray * giveCoordinates()
Definition: node.h:114
virtual bool hasBc(TimeStep *tStep)=0
Test if Dof has active boundary condition.
Mesh generator for the PFEM problem, using Bowyer-Watson algorithm of the Delaunay triangulation of a...
Particle class being used in PFEM computations.
Definition: pfemparticle.h:56
int min(int i, int j)
Returns smaller value from two given decimals.
Definition: mathfem.h:59
std::vector< std::unique_ptr< Element > > & giveElements()
Definition: domain.h:279
virtual int giveNewEquationNumber(int domain, DofIDItem)
Increases number of equations of receiver&#39;s domain and returns newly created equation number...
Definition: pfem.C:861
Load is base abstract class for all loads.
Definition: load.h:61
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
DofManager * giveDofManager() const
Definition: dof.h:123
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
virtual double giveCoordinate(int i)
Definition: dofmanager.h:380
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
Definition: engngm.C:1592
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
void negated()
Switches the sign of every coefficient of receiver.
Definition: floatarray.C:739
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
Load * giveLoad(int n)
Service for accessing particular domain load.
Definition: domain.C:222
virtual void locationFromElement(IntArray &loc, Element &element, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
Default implementation takes all the DOF IDs.
Definition: pfem.C:143
#define OOFEM_WARNING(...)
Definition: error.h:62
#define _IFT_PFEM_pressureBC
Definition: pfem.h:59
Class representing solution step.
Definition: timestep.h:80
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
virtual void printSingleOutputAt(FILE *file, TimeStep *tStep, char ch, ValueModeType mode, double scale=1.0)
Prints Dof output (it prints value of unknown related to dof at given timeStep).
Definition: dof.C:76
virtual int giveNewPrescribedEquationNumber(int domain, DofIDItem)
Increases number of prescribed equations of receiver&#39;s domain and returns newly created equation numb...
Definition: pfem.C:873
const char * __ValueModeTypeToString(ValueModeType _value)
Definition: cltypes.C:322
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
void deactivateTooCloseParticles()
Deactivates particles upon the particalRemovalRatio.
Definition: pfem.C:909

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011