OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
levelsetpcs.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 "levelsetpcs.h"
36 #include "mathfem.h"
37 #include "timestep.h"
38 #include "node.h"
39 #include "element.h"
40 #include "datastream.h"
41 #include "connectivitytable.h"
42 #include "spatiallocalizer.h"
43 #include "geotoolbox.h"
44 #include "fastmarchingmethod.h"
45 #include "error.h"
46 #include "contextioerr.h"
47 
48 namespace oofem {
49 void
51 {
52  if ( 0 ) {
54  OOFEM_ERROR("size of levelSetValues does not match number of dof managers");
55  }
56  } else {
57  if ( initialRefMatFlag ) {
58  int nnodes = domain->giveNumberOfDofManagers();
60  for ( int i = 1; i <= nnodes; i++ ) {
63  }
64  }
65 
67  //previousLevelSetValues.printYourself();
68  }
69 
71 }
72 
73 
76 {
77  IRResultType result;
78 
81  FloatArray refmatpoly_x, refmatpoly_y;
84  ci1 = 1, ci2 = 2;
87 
88  int nvert = refmatpoly_x.giveSize();
89  if ( nvert ) {
90  Vertex v;
91  for ( int i = 1; i <= nvert; i++ ) {
92  // create polygonal representation
93  v.setCoords( refmatpoly_x.at(i), refmatpoly_y.at(i) );
95  }
96 
97  // close polygon (add first vertex at the end
98  v.setCoords( refmatpoly_x.at(1), refmatpoly_y.at(1) );
100  }
101 
102  initialRefMatFlag = true;
103  }
104 
105  reinit_alg = 1;
107 
108  reinit_dt = 0.0;
110  if ( reinit_dt > 0. ) {
111  reinit_dt_flag = true;
112  }
113 
114  reinit_err = 1.e-6;
116 
117  nsd = 2;
119 
120  return IRRT_OK;
121 }
122 
123 
124 void
126 {
127  OOFEM_ERROR("giveInputRecord not implemented yet");
128  //input.setField(this->..., _IFT_..._...);
129 }
130 
131 
132 void
134 {
135  int i, j, l, inodes, inode;
136  int ndofman = domain->giveNumberOfDofManagers();
137  bool twostage = true;
138 
139  double help, dt, volume, gfi_norm;
140 
141  FloatArray fs(ndofman), w(ndofman);
142  FloatMatrix dN;
143  FloatArray fi(4), gfi(nsd), n(nsd), k(4), dfii(4), alpha(4), un;
144  LevelSetPCSElementInterface *interface;
145  Element *ielem;
147 
148  // needed for multistep update
149  FloatArray ls_n;
150  int __step = 0, __nstep = 10;
151 
153  dt = tStep->giveTimeIncrement() / __nstep;
154 
155  do {
156  ls_n = levelSetValues;
157 
158  this->pcs_stage1(levelSetValues, fs, w, tStep, PCS_levelSetUpdate);
159 
160  // update level set values
161  for ( inode = 1; inode <= ndofman; inode++ ) {
162  if ( fabs( w.at(inode) ) > 0.0 ) {
163  // single stage integration
164  levelSetValues.at(inode) = ls_n.at(inode) - dt *fs.at(inode) / w.at(inode);
165  } else {
166  // -------------------------
167  // inflow into boundary node
168  // -------------------------
169  const IntArray *elems;
170  IntArray mask(nsd);
171  double v;
172  // get velocity in inode
173  if ( nsd == 2 ) {
174  mask = {V_u, V_v};
175  } else if ( nsd == 3 ) {
176  mask = {V_u, V_v, V_w};
177  }
178 
179  domain->giveDofManager(inode)->giveUnknownVector( un, mask, VM_Total, tStep->givePreviousStep() );
180  elems = contable->giveDofManConnectivityArray(inode);
181  // loop over shared elements
182  volume = 0.0;
183  help = 0.0;
184  for ( l = 1; l <= elems->giveSize(); l++ ) {
185  // get element level set gradient
186  ielem = domain->giveElement( elems->at(l) );
187  inodes = ielem->giveNumberOfNodes();
188  interface = static_cast< LevelSetPCSElementInterface * >( ielem->giveInterface(LevelSetPCSElementInterfaceType) );
189 
190  if ( interface ) {
191  interface->LS_PCS_computedN(dN);
192  // assemble element vector with level set values
193  for ( i = 1; i <= inodes; i++ ) {
194  fi.at(i) = ls_n.at( ielem->giveDofManagerNumber(i) );
195  }
196 
197  // compute gradient of level set
198  for ( j = 1; j <= nsd; j++ ) {
199  gfi.at(j) = 0.0;
200  for ( i = 1; i <= inodes; i++ ) {
201  gfi.at(j) += dN.at(i, j) * fi.at(i);
202  }
203  }
204 
205  volume += ( v = interface->LS_PCS_computeVolume() );
206  gfi_norm = gfi.computeNorm();
207  if ( gfi_norm > 1.e-6 ) {
208  help += un.dotProduct(gfi) * v / gfi_norm;
209  }
210  }
211  } // end loop over shared nodes
212 
213  levelSetValues.at(inode) = ls_n.at(inode) - dt * help / volume;
214  }
215  } // end loop over nodes
216 
217  if ( twostage ) {
218  //this->pcs_stage1(levelSetValues, fs, w, tStep, PCS_levelSetUpdate); // ?
219 
220  for ( inode = 1; inode <= ndofman; inode++ ) {
221  if ( w.at(inode) > 0.0 ) {
222  //two stage integration
223  // update
224  levelSetValues.at(inode) = 0.5 * ( ls_n.at(inode) + levelSetValues.at(inode) ) -
225  0.5 *dt *fs.at(inode) / w.at(inode);
226  }
227  }
228  }
229 
230  printf(".");
231  } while ( ++__step < __nstep );
232 
233  printf("\n");
234  // print level set values to stdout (debug only)
235  /*
236  * printf ("Node: Level Set Value\n");
237  * for (inode=1; inode<=ndofman; inode++) {
238  * printf ("%5d %le\n",inode, levelSetValues.at(inode));
239  * }
240  */
241  // redistance
242  this->reinitialization(tStep);
243 
244  levelSetVersion++;
245 }
246 
247 
248 double
250 {
251  return 1.e6;
252 }
253 
254 
255 void
257 {
258  double ls;
259  FloatArray N;
260  answer.resize(2);
261 
263  LevelSetPCSElementInterface *interface = static_cast< LevelSetPCSElementInterface * >( elem->giveInterface(LevelSetPCSElementInterfaceType) );
264  if ( interface ) {
265  if ( elem->computeLocalCoordinates(N, position) ) {
266  int inodes = elem->giveNumberOfNodes();
267  ls = 0.0;
268  for ( int i = 1; i <= inodes; i++ ) {
269  ls += N.at(i) * levelSetValues.at( elem->giveDofManagerNumber(i) );
270  }
271 
272  if ( ls > 0.0 ) {
273  answer.at(1) = 1.0;
274  answer.at(2) = 0.0;
275  } else {
276  answer.at(1) = 0.0;
277  answer.at(2) = 1.0;
278  }
279  } else {
280  OOFEM_ERROR("computeLocalCoordinates failed");
281  }
282  } else {
283  answer.at(1) = 1.0;
284  answer.at(2) = 0.0;
285  }
286 }
287 
288 void
290 {
291 #ifdef LevelSetPCS_CACHE_ELEMENT_VOF
293  answer = elemVof [ ie - 1 ];
294  return;
295  } else {
296  LevelSetPCSElementInterface *interface;
297  FloatArray fi;
298 
299  elemVof.resize( domain->giveNumberOfElements() );
300  for ( int _ie = 1; _ie <= domain->giveNumberOfElements(); _ie++ ) {
301  Element *ielem = domain->giveElement(_ie);
302  int inodes = ielem->giveNumberOfNodes();
303  fi.resize(inodes);
304  interface = static_cast< LevelSetPCSElementInterface * >( ielem->giveInterface(LevelSetPCSElementInterfaceType) );
305  for ( int i = 1; i <= inodes; i++ ) {
306  fi.at(i) = levelSetValues.at( ielem->giveDofManagerNumber(i) );
307  }
308 
309  interface->LS_PCS_computeVOFFractions(elemVof [ _ie - 1 ], fi);
310  }
311 
313  answer = elemVof [ ie - 1 ];
314  return;
315  }
316 
317 #else
318 
319  Element *ielem = domain->giveElement(ie);
320  int inodes = ielem->giveNumberOfNodes();
321  LevelSetPCSElementInterface *interface = static_cast< LevelSetPCSElementInterface * >( ielem->giveInterface(LevelSetPCSElementInterfaceType) );
322  FloatArray fi(inodes);
323 
324  for ( int i = 1; i <= inodes; i++ ) {
325  fi.at(i) = levelSetValues.at( ielem->giveDofManagerNumber(i) );
326  }
327 
328  interface->LS_PCS_computeVOFFractions(answer, fi);
329 #endif
330 }
331 
332 void
334 {
335  if ( reinit_alg == 0 ) {
336  return;
337  } else if ( reinit_alg == 1 ) {
338  this->redistance(tStep);
339  } else if ( reinit_alg == 2 ) {
340  FloatArray ls1;
341  this->FMMReinitialization(ls1);
342  levelSetValues = ls1;
343  } else {
344  OOFEM_ERROR("unknown reinitialization scheme (%d)", reinit_alg);
345  }
346 }
347 
348 
349 void
351 {
352  int nite = 0;
353  int ndofman = domain->giveNumberOfDofManagers();
354  int nelem = domain->giveNumberOfElements();
355  bool twostage = false;
356  double dt, c, cm;
357 
358  FloatArray fs(ndofman), w(ndofman), d_old, d;
359  FloatMatrix dN;
360  //ConnectivityTable* contable = domain->giveConnectivityTable();
361  //LevelSetPCSElementInterface* interface;
362 
363  //return;
364  if ( this->reinit_dt_flag ) {
365  dt = this->reinit_dt;
366  } else {
367  dt = tStep->giveTimeIncrement();
368  }
369 
370  IntArray _boundary(ndofman);
371  int pos, neg, _node;
372  // check for boundary node
373  for ( int ie = 1; ie <= nelem; ie++ ) {
374  Element *ielem = domain->giveElement(ie);
375  int inodes = ielem->giveNumberOfNodes();
376  pos = 0;
377  neg = 0;
378  for ( int i = 1; i <= inodes; i++ ) {
379  _node = ielem->giveDofManagerNumber(i);
380  if ( levelSetValues.at(_node) >= 0 ) {
381  pos++;
382  } else {
383  neg++;
384  }
385  }
386 
387  if ( pos && neg ) {
388  for ( int i = 1; i <= inodes; i++ ) {
389  _node = ielem->giveDofManagerNumber(i);
390  _boundary.at(_node) = 1;
391  }
392  }
393  }
394 
395 
396  d = levelSetValues;
397  do {
398  d_old = d;
399  //levelSetValues = d; // updated sign funtion
401 
402  // update level set values
403  // single stage integration
404  cm = 0.0;
405  for ( int inode = 1; inode <= ndofman; inode++ ) {
406  if ( _boundary.at(inode) ) {
407  continue;
408  }
409 
410  if ( fabs( w.at(inode) ) > 0.0 ) {
411  c = dt * fs.at(inode) / w.at(inode);
412  cm = max( cm, fabs( c / levelSetValues.at(inode) ) );
413  levelSetValues.at(inode) = levelSetValues.at(inode) - c;
414  } else {
415  //printf ("(%d) ", inode);
416  }
417  }
418 
419  if ( twostage ) {
420  // this->pcs_stage1(d, fs, w, tStep, PCS_levelSetRedistance); //?
421  cm = 0.0;
422  for ( int inode = 1; inode <= ndofman; inode++ ) {
423  if ( _boundary.at(inode) ) {
424  continue;
425  }
426 
427  if ( fabs( w.at(inode) ) > 0.0 ) {
428  //two stage integration
429  // update
430  d.at(inode) = 0.5 * ( d_old.at(inode) + d.at(inode) ) -
431  0.5 *dt *fs.at(inode) / w.at(inode);
432  cm = max( cm, fabs( ( d.at(inode) - d_old.at(inode) ) / d_old.at(inode) ) );
433  }
434  }
435  }
436  } while ( ( cm > this->reinit_err ) && ( ++nite < 2000 ) );
437 
438  //} while ((++nite < 200));
439  OOFEM_LOG_INFO("LevelSetPCS :: redistance - error %le in %d iterations", cm, nite);
440 
441  //levelSetValues = d;
442 }
443 
444 
445 void
447 {
448  int ndofman = domain->giveNumberOfDofManagers(), nelem = domain->giveNumberOfElements();
449  double alpha, dfi, help, sumkn, F, f, volume, gfi_norm;
450  FloatMatrix dN;
451  FloatArray gfi, fi(4), n(nsd), k(4), dfii(4);
452  LevelSetPCSElementInterface *interface;
453 
454  fs.resize(ndofman);
455  w.resize(ndofman);
456  fs.zero();
457  w.zero();
458 
459  // loop over elements
460  for ( int ie = 1; ie <= nelem; ie++ ) {
461  Element *ielem = domain->giveElement(ie);
462  int inodes = ielem->giveNumberOfNodes();
463  interface = static_cast< LevelSetPCSElementInterface * >
465 
466  if ( interface ) {
467  F = this->evalElemFContribution(t, ie, tStep);
468  f = this->evalElemfContribution(t, ie, tStep);
469 
470  interface->LS_PCS_computedN(dN);
471  volume = interface->LS_PCS_computeVolume();
472 
473  // assemble element vector with level set values
474  for ( int i = 1; i <= inodes; i++ ) {
475  fi.at(i) = ls.at( ielem->giveDofManagerNumber(i) );
476  }
477 
478  // compute gradient of level set
479  gfi.beTProductOf(dN, fi);
480 
481  // eval size of gfi
482  gfi_norm = gfi.computeNorm();
483  // compute ki
484  for ( int i = 1; i <= inodes; i++ ) {
485  if ( gfi_norm > 1.e-12 ) {
486  // evaluate i-th normal (corresponding to side opposite to i-th vertex)
487  for ( int j = 1; j <= nsd; j++ ) {
488  n.at(j) = nsd * dN.at(i, j) * volume; //?
489  }
490 
491  k.at(i) = F * gfi.dotProduct(n) / ( nsd * gfi_norm );
492  } else {
493  OOFEM_LOG_INFO("LevelSetPCS :: pcs_stage1 - zero gfi_norm for %d node", i);
494  k.at(i) = 0.0;
495  }
496  }
497 
498  dfi = fi.dotProduct(k);
499  for ( int i = 1; i <= inodes; i++ ) {
500  help = 0.0;
501  sumkn = 0.0;
502  for ( int l = 1; l <= inodes; l++ ) {
503  help += negbra( k.at(l) ) * ( fi.at(i) - fi.at(l) );
504  sumkn += negbra( k.at(l) );
505  }
506 
507  if ( fabs(sumkn) > 1.e-12 ) {
508  dfii.at(i) = macbra( k.at(i) ) * help / sumkn;
509  } else {
510  OOFEM_LOG_INFO("LevelSetPCS :: pcs_stage1 - zero sumkn for %d node", i);
511  dfii.at(i) = 0.0;
512  }
513  }
514 
515  //compute alpha_i
516  help = 0.0;
517  for ( int l = 1; l <= inodes; l++ ) {
518  help += max(0.0, dfii.at(l) / dfi);
519  }
520 
521  for ( int i = 1; i <= inodes; i++ ) {
522  int _ig = ielem->giveDofManagerNumber(i);
523  if ( fabs(help) > 0.0 ) {
524  alpha = max(0.0, dfii.at(i) / dfi) / help;
525  fs.at(_ig) += alpha * ( dfi - f * volume );
526  w.at(_ig) += alpha * volume;
527  }
528  }
529  } else {
530  OOFEM_ERROR("element %d does not implement LevelSetPCSElementInterfaceType", ie);
531  }
532  } // end loop over elements
533 }
534 
535 
536 double
538 {
539  LevelSetPCSElementInterface *interface = static_cast< LevelSetPCSElementInterface * >
541  if ( t == PCS_levelSetUpdate ) {
542  return interface->LS_PCS_computeF(this, tStep);
543  } else if ( t == PCS_levelSetRedistance ) {
544  return interface->LS_PCS_computeS(this, tStep);
545  }
546 
547  return 0.0;
548 }
549 
550 
551 double
553 {
554  LevelSetPCSElementInterface *interface = static_cast< LevelSetPCSElementInterface * >
556  if ( t == PCS_levelSetUpdate ) {
557  return 0.0;
558  } else if ( t == PCS_levelSetRedistance ) {
559  return interface->LS_PCS_computeS(this, tStep);
560  }
561 
562  return 0.0;
563 }
564 
565 
566 void
568 {
569  // tag points with boundary value as known
570  // then tag as trial all points that are one grid point away
571  // finally tag as far all other grid points
572  int jnode, enodes, __pos, __neg, nelem = domain->giveNumberOfElements();
573  double _lsval;
574  std :: list< int >bcDofMans;
575 
576  dmanValues.resize( domain->giveNumberOfDofManagers() );
577  // here we loop over elements and identify those, that have zero level set
578  // then nodes belonging to these elements are boundary ones (with known distance)
579  for ( int i = 1; i <= nelem; i++ ) {
580  Element *ie = domain->giveElement(i);
581  enodes = ie->giveNumberOfDofManagers();
582  __pos = 0;
583  __neg = 0; // count positive and negative level set values in element nodes
584  for ( int j = 1; j <= enodes; j++ ) {
585  _lsval = this->giveLevelSetDofManValue( ie->giveDofManagerNumber(j) );
586  if ( _lsval > 0.0 ) {
587  __pos++;
588  }
589 
590  if ( _lsval < 0.0 ) {
591  __neg++;
592  }
593  }
594 
595  if ( ( __pos && __neg ) || ( __pos + __neg < enodes ) ) {
596  // zero level set within element
597  // we have to tag element nodes as known and compute their boundary value
598  for ( int j = 1; j <= enodes; j++ ) {
599  // simplified (here we use original level set values)
600  jnode = ie->giveDofManagerNumber(j);
601  if ( ( dmanValues.at(jnode) = this->giveLevelSetDofManValue(jnode) ) >= 0. ) {
602  bcDofMans.push_front(jnode);
603  } else {
604  bcDofMans.push_front(-jnode);
605  }
606  }
607  }
608  }
609 
611  // fast marching for positive level set values
612  fmm.solve(dmanValues, bcDofMans, 1.0);
613  // revert bcDofMans signs
614  for ( int &node: bcDofMans ) {
615  node = -node;
616  }
617 
618  // fast marching for negative level set values
619  fmm.solve(dmanValues, bcDofMans, -1.0);
620 }
621 
622 
625 {
626  contextIOResultType iores;
627 
628  if ( !stream.write(levelSetVersion) ) {
630  }
631 
632  if ( ( iores = levelSetValues.storeYourself(stream) ) != CIO_OK ) {
633  THROW_CIOERR(iores);
634  }
635 
636  return CIO_OK;
637 }
638 
639 
642 {
643  contextIOResultType iores;
644 
645  if ( !stream.read(levelSetVersion) ) {
647  }
648 
649  if ( ( iores = levelSetValues.restoreYourself(stream) ) != CIO_OK ) {
650  THROW_CIOERR(iores);
651  }
652 
654 #ifdef LevelSetPCS_CACHE_ELEMENT_VOF
656 #endif
657 
658  return CIO_OK;
659 }
660 } // end namespace oofem
int nsd
number of spatial dimensions.
Definition: levelsetpcs.h:133
#define _IFT_LevelSetPCS_reinit_dt
Definition: levelsetpcs.h:49
virtual void reinitialization(TimeStep *tStep)
Definition: levelsetpcs.C:333
virtual double computeCriticalTimeStep(TimeStep *tStep)
Computes critical time step induced by receiver integration algorithm.
Definition: levelsetpcs.C:249
int giveDofManagerNumber(int i) const
Translates local to global indices for dof managers.
Definition: element.h:590
virtual double LS_PCS_computeF(LevelSetPCS *ls, TimeStep *tStep)=0
Evaluates F in level set equation of the form where for interface position driven by flow with speed...
double evalElemFContribution(PCSEqType t, int ie, TimeStep *tStep)
Definition: levelsetpcs.C:537
virtual void initialize()
Initializes receiver.
Definition: levelsetpcs.C:50
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Definition: domain.h:432
std::vector< FloatArray > elemVof
Definition: levelsetpcs.h:138
FloatArray levelSetValues
Array used to store value of level set function for each node.
Definition: levelsetpcs.h:118
Fast Marching Method for unstructured grids.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
contextIOResultType storeYourself(DataStream &stream) const
Definition: floatarray.C:872
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
double giveLevelSetDofManValue(int i)
Returns level set value in specific node.
Definition: levelsetpcs.h:168
double pointDistance(double x, double y) const
Definition: geotoolbox.C:98
int max(int i, int j)
Returns bigger value form two given decimals.
Definition: mathfem.h:71
Element interface for LevelSetPCS class representing level-set like material interface.
Definition: levelsetpcs.h:68
ConnectivityTable * giveConnectivityTable()
Returns receiver&#39;s associated connectivity table.
Definition: domain.C:1170
long int levelSetVersion
Level set values version.
Definition: levelsetpcs.h:135
double macbra(double x)
Returns the positive part of given float.
Definition: mathfem.h:115
virtual void updatePosition(TimeStep *tStep)
Updates the position of interface according to state reached in given solution step.
Definition: levelsetpcs.C:133
Abstract base class for all finite elements.
Definition: element.h:145
General IO error.
#define _IFT_LevelSetPCS_levelSetValues
Definition: levelsetpcs.h:46
int giveNumberOfElements() const
Returns number of elements in domain.
Definition: domain.h:434
virtual double giveCoordinate(int i)
Definition: node.C:82
double reinit_err
Reinitialization error limit.
Definition: levelsetpcs.h:131
void FMMReinitialization(FloatArray &ls)
Reinitializes the level set representation using fast marching method.
Definition: levelsetpcs.C:567
#define _IFT_LevelSetPCS_ci1
Definition: levelsetpcs.h:53
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.
int ci1
Indexes of nodal coordinates used to init levelset using initialRefMatVol.
Definition: levelsetpcs.h:123
#define _IFT_LevelSetPCS_refmatpoly_y
Definition: levelsetpcs.h:48
virtual int giveNumberOfDofManagers() const
Definition: element.h:656
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual void giveElementMaterialMixture(FloatArray &answer, int ielem)
Returns volumetric (or other based measure) of relative material contents in given element...
Definition: levelsetpcs.C:289
double giveTimeIncrement()
Returns solution step associated time increment.
Definition: timestep.h:150
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
Definition: element.h:662
void solve(FloatArray &dmanValues, const std::list< int > &bcDofMans, double F)
Solution of problem.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
virtual void LS_PCS_computeVOFFractions(FloatArray &answer, FloatArray &fi)=0
Returns VOF fractions for each material on element according to nodal values of level set function (p...
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: levelsetpcs.C:641
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
#define OOFEM_LOG_INFO(...)
Definition: logger.h:127
Element * giveElement(int n)
Service for accessing particular domain fe element.
Definition: domain.C:160
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
#define _IFT_LevelSetPCS_ci2
Definition: levelsetpcs.h:54
int reinit_alg
Type of reinitialization algorithm to use.
Definition: levelsetpcs.h:126
#define OOFEM_ERROR(...)
Definition: error.h:61
#define _IFT_LevelSetPCS_reinit_alg
Definition: levelsetpcs.h:51
#define _IFT_LevelSetPCS_nsd
Definition: levelsetpcs.h:52
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver&#39;s associated spatial localizer.
Definition: domain.C:1184
contextIOResultType restoreYourself(DataStream &stream)
Definition: floatarray.C:895
Class representing connectivity table.
virtual double LS_PCS_computeS(LevelSetPCS *ls, TimeStep *tStep)=0
Evaluates S in level set equation of the form where .
#define N(p, q)
Definition: mdm.C:367
virtual void giveMaterialMixtureAt(FloatArray &answer, FloatArray &position)
Returns relative material contents at given point.
Definition: levelsetpcs.C:256
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
Definition: timestep.C:114
double reinit_dt
Time step used in reinitialization of LS (if apply).
Definition: levelsetpcs.h:128
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
Definition: floatarray.C:708
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
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...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: levelsetpcs.C:75
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
const IntArray * giveDofManConnectivityArray(int dofman)
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
void setCoords(double x, double y)
Definition: geotoolbox.h:77
Polygon initialRefMatVol
Definition: levelsetpcs.h:120
void redistance(TimeStep *tStep)
Reinitializes the level set representation by solving to steady state.
Definition: levelsetpcs.C:350
double computeNorm() const
Computes the norm (or length) of the vector.
Definition: floatarray.C:840
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: levelsetpcs.C:624
long int elemVofLevelSetVersion
Definition: levelsetpcs.h:139
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual void LS_PCS_computedN(FloatMatrix &answer)=0
Returns gradient of shape functions.
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
Definition: femcmpnn.h:179
Class representing the a dynamic Input Record.
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
Definition: element.C:1222
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
Class representing vertex.
Definition: geotoolbox.h:60
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
virtual double LS_PCS_computeVolume()=0
Returns receiver&#39;s volume.
int giveSize() const
Definition: intarray.h:203
double evalElemfContribution(PCSEqType t, int ie, TimeStep *tStep)
Definition: levelsetpcs.C:552
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
Node * giveNode(int n)
Service for accessing particular domain node.
Definition: domain.h:371
the oofem namespace is to define a context or scope in which all oofem names are defined.
void addVertex(Vertex v)
Definition: geotoolbox.h:96
#define _IFT_LevelSetPCS_refmatpoly_x
Definition: levelsetpcs.h:47
double negbra(double x)
Returns the negative part of given float.
Definition: mathfem.h:117
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Definition: domain.C:314
#define _IFT_LevelSetPCS_reinit_err
Definition: levelsetpcs.h:50
FloatArray previousLevelSetValues
Definition: levelsetpcs.h:118
void pcs_stage1(FloatArray &ls, FloatArray &fs, FloatArray &w, TimeStep *tStep, PCSEqType t)
Definition: levelsetpcs.C:446
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: levelsetpcs.C:125
Class representing solution step.
Definition: timestep.h:80
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:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011