OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
primaryfield.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 #include "primaryfield.h"
36 #include "spatiallocalizer.h"
37 #include "dofmanager.h"
38 #include "dof.h"
39 #include "element.h"
40 #include "timestep.h"
41 #include "datastream.h"
42 #include "contextioerr.h"
43 #include "engngm.h"
44 #include "unknownnumberingscheme.h"
45 #include "initialcondition.h"
46 #include "boundarycondition.h"
47 
48 namespace oofem {
50  FieldType ft, int nHist) : Field(ft), solutionVectors(nHist + 1), prescribedVectors(nHist + 1), solStepList(nHist + 1, a)
51 {
52  this->actualStepNumber = -999;
53  this->actualStepIndx = 0;
54  this->nHistVectors = nHist;
55 
56  emodel = a;
57  domainIndx = idomain;
58 }
59 
61 { }
62 
63 
64 void
66 {
67  for ( Dof *dof: dman ) {
68  int eq = dof->giveEqn();
69  TimeStep *step = tStep;
70  for ( int hist = 0; hist < this->nHistVectors; ++hist ) {
71  if ( eq > 0 ) {
72  FloatArray *vec = this->giveSolutionVector( resolveIndx(tStep, 0) );
73  dof->updateUnknownsDictionary(step, VM_Total, vec->at(eq));
74  } else if ( eq < 0 ) {
75  FloatArray *vec = this->givePrescribedVector( resolveIndx(tStep, 0) );
76  dof->updateUnknownsDictionary(step, VM_Total, vec->at(-eq));
77  }
78  step = tStep->givePreviousStep();
79  }
80  }
81 }
82 
83 void
85 {
87  for ( auto &dman : d->giveDofManagers() ) {
88  this->storeDofManager(tStep, *dman);
89  }
90 
91  for ( auto &elem : d->giveElements() ) {
92  int ndman = elem->giveNumberOfInternalDofManagers();
93  for ( int i = 1; i <= ndman; i++ ) {
94  this->storeDofManager(tStep, *elem->giveInternalDofManager(i));
95  }
96  }
97 
98  for ( auto &bc : d->giveBcs() ) {
99  int ndman = bc->giveNumberOfInternalDofManagers();
100  for ( int i = 1; i <= ndman; i++ ) {
101  this->storeDofManager(tStep, *bc->giveInternalDofManager(i));
102  }
103  }
104 }
105 
106 
107 void
109 {
110  for ( Dof *dof: dman ) {
111  int eq = dof->giveEqn();
112  TimeStep *step = tStep;
113  for ( int hist = 0; hist < this->nHistVectors; ++hist ) {
114  if ( eq > 0 ) {
115  FloatArray *vec = this->giveSolutionVector( resolveIndx(tStep, 0));
116  vec->at(eq) = dof->giveUnknownsDictionaryValue(step, VM_Total);
117  } else if ( eq < 0 ) {
118  FloatArray *vec = this->givePrescribedVector( resolveIndx(tStep, 0) );
119  vec->at(-eq) = dof->giveUnknownsDictionaryValue(step, VM_Total);
120  }
121  step = tStep->givePreviousStep();
122  }
123  }
124 }
125 
126 
127 void
129 {
131  //int neq = this->emodel->giveNumberOfDomainEquations(domainIndx, EModelDefaultEquationNumbering());
132  //int peq = this->emodel->giveNumberOfDomainEquations(domainIndx, EModelDefaultPrescribedEquationNumbering());
133  for ( auto &dman : d->giveDofManagers() ) {
134  this->readDofManager(tStep, *dman);
135  }
136 
137  for ( auto &elem : d->giveElements() ) {
138  int ndman = elem->giveNumberOfInternalDofManagers();
139  for ( int i = 1; i <= ndman; i++ ) {
140  this->readDofManager(tStep, *elem->giveInternalDofManager(i));
141  }
142  }
143 
144  for ( auto &bc : d->giveBcs() ) {
145  int ndman = bc->giveNumberOfInternalDofManagers();
146  for ( int i = 1; i <= ndman; i++ ) {
147  this->readDofManager(tStep, *bc->giveInternalDofManager(i));
148  }
149  }
150 }
151 
152 
153 void
155 {
156  if ( mode == VM_Total ) {
157  answer = * ( this->giveSolutionVector(tStep) );
158  } else if ( mode == VM_Incremental ) {
159  int indxm1 = this->resolveIndx(tStep, -1);
160  answer = * ( this->giveSolutionVector(tStep) );
161  answer.subtract( * this->giveSolutionVector(indxm1) );
162  } else {
163  OOFEM_ERROR("unsupported mode %s", __ValueModeTypeToString(mode));
164  }
165 }
166 
167 void
169 {
172  for ( auto &s : solutionVectors ) {
173  s.resize(neq);
174  s.zero();
175  }
176  for ( auto &s : prescribedVectors ) {
177  s.resize(npeq);
178  s.zero();
179  }
180 
183  int indxm0;
184  if ( tStep == NULL ) {
185  indxm0 = 1;
186  } else {
187  indxm0 = this->resolveIndx(tStep, 0);
188  }
189  FloatArray *f0 = this->giveSolutionVector(indxm0);
190  FloatArray *p0 = this->givePrescribedVector(indxm0);
191  for ( auto &dman : d->giveDofManagers() ) {
192  for ( auto &dof : *dman ) {
193  int icid = dof->giveIcId();
194  if ( icid > 0 && dof->isPrimaryDof() ) {
195  InitialCondition *ic = d->giveIc(icid);
196  if ( ic->hasConditionOn(VM_Total) ) {
197  double val = ic->give(VM_Total);
198  int eq = dof->giveEqn();
199  dof->updateUnknownsDictionary(tStep, VM_Total, val);
200  if ( eq > 0 ) {
201  f0->at(eq) = val;
202  } else if ( eq < 0 ) {
203  p0->at(-eq) = val;
204  }
205  }
206  }
207  }
208  }
209  // Apply ICs that use sets.
210  for ( auto &ic : emodel->giveDomain(domainIndx)->giveIcs() ) {
211  this->applyInitialCondition(*ic);
212  }
213 }
214 
215 
216 void
218 {
219  if ( ic.giveSetNumber() == 0 ) {
220  return;
221  }
222 
223  Domain *d = ic.giveDomain();
224  Set *set = d->giveSet(ic.giveSetNumber());
226  int indxm0 = this->resolveIndx(tStep, 0);
227  int indxm1 = this->resolveIndx(tStep, -1);
228  FloatArray *f0 = this->giveSolutionVector(indxm0);
229  FloatArray *f1 = this->giveSolutionVector(indxm1);
230  FloatArray *p0 = this->givePrescribedVector(indxm0);
231  FloatArray *p1 = this->givePrescribedVector(indxm1);
232 
233  // We have to set initial value, and velocity, for this particular primary field.
234  for ( int inode : set->giveNodeList() ) {
235  DofManager *dman = d->giveDofManager(inode);
236  double tot0 = 0., tot1 = 0.;
237  if ( ic.hasConditionOn(VM_Total) ) {
238  tot0 = ic.give(VM_Total);
239  }
240  if ( ic.hasConditionOn(VM_Incremental) ) {
241  tot1 = tot0 - ic.give(VM_Incremental);
242  } else if ( ic.hasConditionOn(VM_Velocity) ) {
243  tot1 = tot0 - ic.give(VM_Velocity) * tStep->giveTimeIncrement();
244  } else {
245  tot1 = tot0;
246  }
247  for ( auto &dof : *dman ) {
248  int eq = dof->giveEqn();
249  if ( eq > 0 ) {
250  f0->at(eq) = tot0;
251  f1->at(eq) = tot1;
252  } else if ( eq < 0 ) {
253  p0->at(-eq) = tot0;
254  p1->at(-eq) = tot1;
255  }
256  }
257  }
258 }
259 
260 
261 void
263 {
265  FloatArray *f = this->givePrescribedVector(resolveIndx(tStep, 0));
266  for ( auto &dman : d->giveDofManagers() ) {
267  for ( auto &dof : *dman ) {
268  int peq = - dof->giveEqn();
269  if ( peq > 0 ) {
270  int bcid = dof->giveBcId();
271  f->at(peq) = static_cast< BoundaryCondition* >(d->giveBc(bcid))->give(dof, VM_Total, tStep->giveTargetTime());
272  }
273  }
274  }
275 
276  for ( auto &bc : d->giveBcs() ) {
277  BoundaryCondition *dbc = dynamic_cast< BoundaryCondition* >(bc.get());
278  if ( dbc ) {
279  this->applyBoundaryCondition(*dbc, tStep);
280  }
281  }
282 }
283 
284 
285 void
287 {
288  if ( bc.giveSetNumber() == 0 ) {
289  return;
290  }
291 
292  Domain *d = bc.giveDomain();
293  Set *set = d->giveSet(bc.giveSetNumber());
294  FloatArray *f = this->givePrescribedVector(resolveIndx(tStep, 0));
295  for ( int inode : set->giveNodeList() ) {
296  DofManager *dman = d->giveDofManager(inode);
297  for ( auto &dofid : bc.giveDofIDs() ) {
298  Dof *dof = dman->giveDofWithID(dofid);
299  int peq = - dof->giveEqn(); // Note, only consider prescribed equations here
300  if ( peq > 0 ) {
301  f->at(peq) = bc.give(dof, VM_Total, tStep->giveTargetTime());
302  }
303  }
304  }
305 }
306 
307 
308 void
310 {
311  if ( mode == VM_Total ) {
312  * this->giveSolutionVector(tStep) = vectorToStore;
313  } else {
314  OOFEM_ERROR("unsupported mode %s", __ValueModeTypeToString(mode));
315  }
316 }
317 
318 double
320 {
321  int eq = dof->giveEqn();
322  if ( eq == 0 ) {
323  OOFEM_ERROR("invalid equation number (slave dof maybe?)");
324  }
325 
326  if ( mode == VM_Total ) {
327  int indxm0 = this->resolveIndx(tStep, 0);
328  if ( eq > 0 )
329  return this->giveSolutionVector(indxm0)->at(eq);
330  else
331  return this->givePrescribedVector(indxm0)->at(-eq);
332  } else if ( mode == VM_Incremental ) {
333  int indxm0 = this->resolveIndx(tStep, 0);
334  int indxm1 = this->resolveIndx(tStep, -1);
335  if ( this->giveSolutionVector(indxm1)->giveSize() == 0 )
336  this->giveSolutionVector(indxm1)->resize(this->giveSolutionVector(indxm0)->giveSize());
337  if ( eq > 0 )
338  return ( this->giveSolutionVector(indxm0)->at(eq) - this->giveSolutionVector(indxm1)->at(eq) );
339  else
340  return ( this->givePrescribedVector(indxm0)->at(-eq) - this->givePrescribedVector(indxm1)->at(-eq) );
341  } else {
342  OOFEM_ERROR("unsupported mode");
343  }
344 
345  return 0.0;
346 }
347 
348 int
350  ValueModeType mode, TimeStep *tStep,
351  IntArray *dofId)
352 {
353  if ( dman->giveDomain() == this->emodel->giveDomain(domainIndx) ) {
354  if ( dofId ) {
355  dman->giveUnknownVector(answer, * dofId, * this, mode, tStep);
356  return 0; // ok
357  } else { // all dofs requested
358  dman->giveCompleteUnknownVector(answer, mode, tStep);
359  return 0; // ok
360  }
361  } else {
362  return this->__evaluateAt(answer, * dman->giveCoordinates(),
363  mode, tStep, dofId);
364  }
365 }
366 
367 
368 int
370  ValueModeType mode, TimeStep *tStep,
371  IntArray *dofId)
372 {
373  Domain *domain = emodel->giveDomain(domainIndx);
374  SpatialLocalizer *sl = domain->giveSpatialLocalizer();
375 
376 #if 0
377  // locate background element
378  FloatArray lcoords, closest;
379  Element *bgelem = sl->giveElementClosestToPoint(lcoords, closest, coords);
380  if ( bgelem == NULL ) {
381  return 1;
382  }
383 
384  if ( dofId ) {
385  bgelem->computeField(mode, tStep, lcoords, answer);
386  } else {
387  FloatArray field;
388  IntArray elemDofId;
389  bgelem->giveElementDofIDMask(elemDofId);
390  bgelem->computeField(mode, tStep, lcoords, field);
391  answer.resize( dofId->giveSize() );
392  answer.zero();
393  for ( int i = 1; i <= dofId->giveSize(); ++i ) {
394  int pos = elemDofId.findFirstIndexOf(dofId->at(i));
395  if ( pos > 0 ) {
396  answer.at(pos) = field.at(i);
397  }
398  }
399  }
400 
401  return 0;
402 #else
403  Element *bgelem;
404  // locate background element
405  if ( ( bgelem = sl->giveElementContainingPoint(coords) ) == NULL ) {
406  //_error("PrimaryField::evaluateAt: point not found in domain\n");
407  return 1;
408  }
409 
410  EIPrimaryFieldInterface *interface = static_cast< EIPrimaryFieldInterface * >( bgelem->giveInterface(EIPrimaryFieldInterfaceType) );
411  if ( interface ) {
412  if ( dofId ) {
413  return interface->EIPrimaryFieldI_evaluateFieldVectorAt(answer, * this, coords, * dofId, mode, tStep);
414  } else { // use element default dof id mask
415  IntArray elemDofId;
416  bgelem->giveElementDofIDMask(elemDofId);
417  return interface->EIPrimaryFieldI_evaluateFieldVectorAt(answer, * this, coords, elemDofId, mode, tStep);
418  }
419  } else {
420  OOFEM_ERROR("background element does not support EIPrimaryFiledInterface");
421  return 1; // failed
422  }
423 #endif
424 }
425 
426 int
428  ValueModeType mode, TimeStep *tStep)
429 {
430  return this->__evaluateAt(answer, coords, mode, tStep, NULL);
431 }
432 
433 
434 int
436  ValueModeType mode, TimeStep *tStep)
437 {
438  return this->__evaluateAt(answer, dman, mode, tStep, NULL);
439 }
440 
441 
442 FloatArray *
444 {
445  return this->giveSolutionVector( resolveIndx(tStep, 0) );
446 }
447 
448 FloatArray *
450 {
451  if ( ( i < 1 ) || ( i > ( nHistVectors + 1 ) ) ) {
452  OOFEM_ERROR("index out of range");
453  }
454  return &solutionVectors[i-1];
455 }
456 
457 FloatArray *
459 {
460  if ( ( i < 1 ) || ( i > ( nHistVectors + 1 ) ) ) {
461  OOFEM_ERROR("index out of range");
462  }
463  return &prescribedVectors[i-1];
464 }
465 
466 
467 int
469 {
470  int tStepo = tStep->giveNumber();
471  int relPos = actualStepNumber - tStepo - shift;
472  if ( ( relPos >= 0 ) && ( relPos <= nHistVectors ) ) {
473  return ( actualStepIndx + relPos ) % ( nHistVectors + 1 ) + 1;
474  } else {
475  OOFEM_ERROR("History not available for relative step no. %d to step no. %d (actualStepNumber = %d)", shift, tStepo, actualStepNumber);
476  }
477 
478  return 0;
479 }
480 
481 
482 void
484 {
485  if ( actualStepNumber == tStep->giveNumber() ) {
486  // We're one the correct step already, no need to advance.
487  return;
488  }
489  if ( ( actualStepNumber >= 0 ) && ( actualStepNumber + 1 != tStep->giveNumber() ) ) {
490  OOFEM_ERROR("can not advance due to steps skipped");
491  }
492 
494  actualStepNumber = tStep->giveNumber();
495  solStepList[actualStepIndx] = * tStep;
496  if ( nHistVectors > 1 ) {
497  // Copy over the old status to the new nodes
498  int curr = this->resolveIndx(tStep, 0);
499  int prev = this->resolveIndx(tStep, -1);
500  *this->giveSolutionVector(curr) = *this->giveSolutionVector(prev);
501  *this->givePrescribedVector(curr) = *this->givePrescribedVector(prev);
502  }
503 }
504 
505 
508 {
510 
511  if ( !stream.write(actualStepNumber) ) {
513  }
514 
515  if ( !stream.write(actualStepIndx) ) {
517  }
518 
519  for ( const auto &vec : solutionVectors ) {
520  if ( ( iores = vec.storeYourself(stream) ) != CIO_OK ) {
521  THROW_CIOERR(iores);
522  }
523  }
524 
525  for ( const auto &vec : prescribedVectors ) {
526  if ( ( iores = vec.storeYourself(stream) ) != CIO_OK ) {
527  THROW_CIOERR(iores);
528  }
529  }
530 
531  for ( auto &step : solStepList ) {
532  if ( ( iores = step.saveContext(stream, mode) ) != CIO_OK ) {
533  THROW_CIOERR(iores);
534  }
535  }
536 
537  return CIO_OK;
538 }
539 
542 {
544 
545  if ( !stream.read(actualStepNumber) ) {
547  }
548 
549  if ( !stream.read(actualStepIndx) ) {
551  }
552 
553  for ( auto &vec : solutionVectors ) {
554  if ( ( iores = vec.restoreYourself(stream) ) != CIO_OK ) {
555  THROW_CIOERR(iores);
556  }
557  }
558 
559  for ( auto &vec : prescribedVectors ) {
560  if ( ( iores = vec.storeYourself(stream) ) != CIO_OK ) {
561  THROW_CIOERR(iores);
562  }
563  }
564 
565  for ( int i = 0; i <= nHistVectors; i++ ) {
567  if ( ( iores = solStepList[i].restoreContext(stream, mode) ) != CIO_OK ) {
568  THROW_CIOERR(iores);
569  }
570  }
571 
572  return CIO_OK;
573 }
574 } // end namespace oofem
virtual FloatArray * giveSolutionVector(TimeStep *tStep)
Definition: primaryfield.C:443
The base class for all spatial localizers.
The representation of EngngModel default unknown numbering.
void readFromDofDictionaries(TimeStep *tStep)
Definition: primaryfield.C:128
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
virtual void advanceSolution(TimeStep *tStep)
Brings up a new solution vector for given time step.
Definition: primaryfield.C:483
Class and object Domain.
Definition: domain.h:115
void readDofManager(TimeStep *tStep, DofManager &dman)
Definition: primaryfield.C:108
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
Definition: engngm.C:391
FieldType
Physical type of field.
Definition: field.h:60
Class implementing general initial condition.
InitialCondition * giveIc(int n)
Service for accessing particular domain ic.
Definition: domain.C:255
virtual double give(Dof *dof, ValueModeType mode, TimeStep *tStep)
Returns the value of a prescribed unknown, respecting requested mode for given time.
virtual int EIPrimaryFieldI_evaluateFieldVectorAt(FloatArray &answer, PrimaryField &pf, const FloatArray &coords, IntArray &dofId, ValueModeType mode, TimeStep *tStep)=0
Evaluates the value of field at given point of interest (should be located inside receiver&#39;s volume) ...
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
virtual const IntArray & giveDofIDs() const
Array with default dofs which b.c.
virtual int giveEqn()
Gives number for equation, negative for prescribed equations.
Definition: dof.h:407
PrimaryField(EngngModel *a, int idomain, FieldType ft, int nHist)
Constructor.
Definition: primaryfield.C:49
virtual FloatArray * giveCoordinates()
Definition: dofmanager.h:382
double giveTargetTime()
Returns target time.
Definition: timestep.h:146
Abstract base class for all finite elements.
Definition: element.h:145
Base class for dof managers.
Definition: dofmanager.h:113
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
Definition: domain.h:400
General IO error.
int resolveIndx(TimeStep *tStep, int shift)
Definition: primaryfield.C:468
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
std::vector< TimeStep > solStepList
Definition: primaryfield.h:112
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
Abstract class representing field.
Definition: field.h:80
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
Definition: domain.C:243
double giveTimeIncrement()
Returns solution step associated time increment.
Definition: timestep.h:150
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
Element interface class.
Definition: primaryfield.h:58
std::vector< std::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
Definition: domain.h:322
FloatArray * givePrescribedVector(int)
Definition: primaryfield.C:458
int giveSetNumber()
Gives the set number which boundary condition is applied to.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores receiver state to output stream.
Definition: primaryfield.C:507
void giveUnknownVector(FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *tStep, bool padding=false)
Assembles the vector of unknowns in global c.s for given dofs of receiver.
Definition: dofmanager.C:685
Class implementing Dirichlet boundary condition on DOF (primary boundary condition).
int giveNumber()
Returns receiver&#39;s number.
Definition: timestep.h:129
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the receiver state previously written in stream.
Definition: primaryfield.C:541
#define OOFEM_ERROR(...)
Definition: error.h:61
int hasConditionOn(int u)
Tests if receiver has initial condition for specific unknown-mode.
virtual void applyBoundaryCondition(TimeStep *tStep)
Applies all boundary conditions to all prescribed DOFs.
Definition: primaryfield.C:262
Set of elements, boundaries, edges and/or nodes.
Definition: set.h:66
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver&#39;s associated spatial localizer.
Definition: domain.C:1184
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
void storeDofManager(TimeStep *tStep, DofManager &dman)
Definition: primaryfield.C:65
void applyInitialCondition(InitialCondition &ic)
Applies initial condition to all DOFs.
Definition: primaryfield.C:217
EngngModel * emodel
Definition: primaryfield.h:113
Set * giveSet(int n)
Service for accessing particular domain set.
Definition: domain.C:363
virtual void initialize(ValueModeType mode, TimeStep *tStep, FloatArray &answer, const UnknownNumberingScheme &s)
Copy unknowns from previous solution or DOF&#39;s dictionary to the solution vector.
Definition: primaryfield.C:154
std::vector< std::unique_ptr< InitialCondition > > & giveIcs()
Definition: domain.h:329
virtual int __evaluateAt(FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep, IntArray *dofId)
Evaluates the field at given DOF manager, allows to select specific dofs using mask.
Definition: primaryfield.C:349
virtual void giveElementDofIDMask(IntArray &answer) const
Returns element dof mask for node.
Definition: element.h:498
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
Definition: timestep.C:114
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=NULL)=0
Returns the element, containing given point and belonging to one of the region in region list...
double give(ValueModeType mode)
Returns value of initial condition for given unknown mode (determines whether total or velocity or ac...
void giveCompleteUnknownVector(FloatArray &answer, ValueModeType mode, TimeStep *tStep)
Assembles the complete unknown vector in node.
Definition: dofmanager.C:737
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual Element * giveElementClosestToPoint(FloatArray &lcoords, FloatArray &closest, const FloatArray &coords, int region=0)=0
Returns the element closest to a given point.
The representation of EngngModel default prescribed unknown numbering.
virtual ~PrimaryField()
Definition: primaryfield.C:60
std::vector< FloatArray > prescribedVectors
Definition: primaryfield.h:111
void storeInDofDictionaries(TimeStep *tStep)
Definition: primaryfield.C:84
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
Definition: dofmanager.C:119
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
Definition: femcmpnn.h:179
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
int giveSetNumber()
Gives the set number which initial condition is applied to.
Domain * giveDomain() const
Definition: femcmpnn.h:100
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
Definition: engngm.h:720
std::vector< std::unique_ptr< Element > > & giveElements()
Definition: domain.h:279
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
int giveSize() const
Definition: intarray.h:203
virtual void computeField(ValueModeType mode, TimeStep *tStep, const FloatArray &lcoords, FloatArray &answer)
Computes the unknown vector interpolated at the specified local coordinates.
Definition: element.h:508
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Definition: engngm.C:1720
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Definition: dof.h:93
std::vector< FloatArray > solutionVectors
Definition: primaryfield.h:110
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Definition: domain.C:314
virtual void applyDefaultInitialCondition()
Applies the default initial values values for all DOFs (0) in given domain.
Definition: primaryfield.C:168
Class representing solution step.
Definition: timestep.h:80
virtual double giveUnknownValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
Definition: primaryfield.C:319
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
Definition: intarray.C:331
virtual int evaluateAt(FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep)
Evaluates the field at given point.
Definition: primaryfield.C:427
virtual void update(ValueModeType mode, TimeStep *tStep, const FloatArray &vectorToStore, const UnknownNumberingScheme &s)
Project vectorToStore back to DOF&#39;s dictionary.
Definition: primaryfield.C:309
const char * __ValueModeTypeToString(ValueModeType _value)
Definition: cltypes.C:322
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

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