LifeV
fsi/examples/example_SmoothAneurysm/ud_functions.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  * @file
29  * @brief File containing the boundary conditions for the Monolithic Test
30  *
31  * @date 2009-04-09
32  * @author Paolo Crosetto <crosetto@iacspc70.epfl.ch>
33  *
34  * @contributor Cristiano Malossi <cristiano.malossi@epfl.ch>
35  * @maintainer Paolo Crosetto <crosetto@iacspc70.epfl.ch>
36  *
37  * Contains the functions to be assigned as boundary conditions, in the file boundaryConditions.hpp . The functions
38  * can depend on time and space, while they can take in input an ID specifying one of the three principal axis
39  * if the functions to assign is vectorial and the boundary condition is of type \c Full \c.
40  */
41 
42 #include "ud_functions.hpp"
43 
44 
45 namespace LifeV
46 {
47 
48 Real uInterpolated (const Real& time, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& i)
49 {
50 
51  //GetPot data_file( getpot::StringVector data_file_name );
52  // GetPot data_file(data_file_name.c_str());
53 
54  // Real scale_factor = data_file("fluid/miscellaneous/my_flux_physio_scale_factor", .1);
55  Real scale_factor = -50.;//data_file("fluid/miscellaneous/my_flux_physio_scale_factor", .1);
56 
57  Real newtime;
58  // Real intervallorampa = data_file("fluid/miscellaneous/timeramp",0.05);
59  // Real deltat = data_file("fluid/discretization/timestep",0.01);
60  Real intervallorampa = 0.05; //data_file("fluid/miscellaneous/timeramp",0.05);
61  Real deltat = 0.001; //data_file("fluid/discretization/timestep",0.01);
62 
63  Real strokes = 72.0;
64  Real percar = 60.0 / strokes;
65  Real Tfin = percar;
66  Real pigreco2 = 6.2831853;
67  Real coeff01 = 0.65;
68  Real coeff02 = - 0.35;
69  Real coeff11 = 0.35;
70  Real coeff12 = - 0.05;
71  Real coeff21 = 0.3;
72  Real coeff31 = 0.32;
73  Real coeff41 = 0.36;
74  Real coeff42 = - 0.04;
75  Real prefirst = 0.15 * Tfin;
76  Real first = 0.2 * Tfin;
77  Real presecond = 0.3 * Tfin;
78  Real second = 0.51 * Tfin;
79  Real a, b1, b2, a22, a12, a11, a21, det, dt, coeff22, coeff23, coeff32, coeff33;
80  Real flux (0);
81  Real Tcorr;
82  Real Taux = Tfin;
83 
84  if (time < intervallorampa)
85  {
86  newtime = deltat;
87  }
88  else
89  {
90  newtime = time + deltat - intervallorampa;
91  }
92 
93  while (Taux < newtime)
94  {
95  Taux = Taux + Tfin;
96  }
97  Tcorr = newtime - Taux + Tfin;
98 
99  if (Tcorr == Tfin)
100  {
101  Tcorr = 0;
102  }
103 
104  if (Tcorr <= prefirst)
105  {
106  a = pigreco2 * Tcorr / first;
107  flux = coeff01 + coeff02 * cos (a);
108  }
109 
110  else if ( (Tcorr > prefirst) && (Tcorr <= first) )
111  {
112  b1 = coeff01 - coeff31;
113  b2 = coeff02 * pigreco2 / first;
114  a22 = prefirst - first;
115  a12 = a22 * a22;
116  a11 = a12 * a12;
117  a21 = 4 * a12 * a22;
118  a22 = 2 * a22;
119  det = a22 * a11 - a12 * a21;
120  coeff32 = (a22 * b1 - a12 * b2) / det;
121  coeff33 = (a11 * b2 - a21 * b1) / det;
122  dt = Tcorr - first;
123  flux = coeff32 * dt * dt * dt * dt + coeff33 * dt * dt + coeff31;
124  }
125 
126  else if ( (Tcorr > first) && (Tcorr <= presecond) )
127  {
128  a = pigreco2 * (Tcorr) / first;
129  flux = coeff41 + coeff42 * cos (a);
130  }
131 
132  else if ( (Tcorr > presecond) && (Tcorr <= second) )
133  {
134  a = pigreco2 * (Tcorr - first) / first;
135  flux = coeff11 + coeff12 * cos (a);
136  }
137  else if (Tcorr > second)
138  {
139  a = pigreco2 * (second - first) / first;
140  b1 = coeff11 + coeff12 * cos (a) - coeff21;
141  b2 = - coeff12 * pigreco2 * sin (a) / first;
142  a22 = Tfin - second;
143  a12 = a22 * a22;
144  a11 = a12 * a12;
145  a21 = - 4 * a12 * a22;
146  a22 = - 2 * a22;
147  det = a22 * a11 - a12 * a21;
148  coeff22 = (a22 * b1 - a12 * b2) / det;
149  coeff23 = (a11 * b2 - a21 * b1) / det;
150  dt = Tcorr - Tfin;
151  flux = coeff22 * dt * dt * dt * dt + coeff23 * dt * dt + coeff21;
152  }
153  if (time < intervallorampa)
154  {
155  flux = ( time / intervallorampa ) * scale_factor * flux;
156  }
157  else
158  {
159  flux = scale_factor * flux;
160  }
161 
162  // Real pi = 3.14159265358979;
163 #ifdef AORTA // ifdef ANEURISM100170
164  if ( i == 2 )
165  {
166  return flux; // *1.42?
167  }
168  if ( i == 1 )
169  {
170  return flux; // *1.42?
171  }
172 #endif
173 #ifdef ANEURISM100170 // ifdef ANEURISM100170
174  if ( i == 2 )
175  {
176  return -flux; // *1.42?
177  }
178 #else
179  if ( i == 3 )
180  {
181  return -flux;
182  }
183 #endif
184  return 0;
185 
186 }
187 
188 
189 
190 // fct_type getUInterpolated()
191 // {
192 // fct_type f;
193 // f = std::bind(&Cylinder::Private::uInterpolated, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5);
194 // return f;
195 // }
196 
197 Real aortaPhisPress (const Real& t, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
198 {
199  /*switch(i) {
200  case 1:
201  return 0.0;
202  break;*/
203  // case 2:
204  if (t <= 0.00)
205  {
206  return -110170;
207  }
208  if (t <= 0.01)
209  {
210  return -109540;
211  }
212  if (t <= 0.02)
213  {
214  return -108930;
215  }
216  if (t <= 0.03)
217  {
218  return -108320;
219  }
220  if (t <= 0.04)
221  {
222  return -107710;
223  }
224  if (t <= 0.05)
225  {
226  return -107120;
227  }
228  if (t <= 0.06)
229  {
230  return -106530;
231  }
232  if (t <= 0.07)
233  {
234  return -111130;
235  }
236  if (t <= 0.08)
237  {
238  return -115440;
239  }
240  if (t <= 0.09)
241  {
242  return -118690;
243  }
244  if (t <= 0.10)
245  {
246  return -121460;
247  }
248  if (t <= 0.11)
249  {
250  return -123940;
251  }
252  if (t <= 0.12)
253  {
254  return -126350;
255  }
256  if (t <= 0.13)
257  {
258  return -128890;
259  }
260  if (t <= 0.14)
261  {
262  return -131510;
263  }
264  if (t <= 0.15)
265  {
266  return -133980;
267  }
268  if (t <= 0.16)
269  {
270  return -136200;
271  }
272  if (t <= 0.17)
273  {
274  return -138330;
275  }
276  if (t <= 0.18)
277  {
278  return -140350;
279  }
280  if (t <= 0.19)
281  {
282  return -142290;
283  }
284  if (t <= 0.20)
285  {
286  return -144360;
287  }
288  if (t <= 0.21)
289  {
290  return -146130;
291  }
292  if (t <= 0.22)
293  {
294  return -147530;
295  }
296  if (t <= 0.23)
297  {
298  return -148780;
299  }
300  if (t <= 0.24)
301  {
302  return -149740;
303  }
304  if (t <= 0.25)
305  {
306  return -150320;
307  }
308  if (t <= 0.26)
309  {
310  return -150470;
311  }
312  if (t <= 0.27)
313  {
314  return -150250;
315  }
316  if (t <= 0.28)
317  {
318  return -149750;
319  }
320  if (t <= 0.29)
321  {
322  return -148990;
323  }
324  if (t <= 0.30)
325  {
326  return -148220;
327  }
328  if (t <= 0.31)
329  {
330  return -147210;
331  }
332  if (t <= 0.32)
333  {
334  return -145940;
335  }
336  if (t <= 0.33)
337  {
338  return -144960;
339  }
340  if (t <= 0.34)
341  {
342  return -143750;
343  }
344  if (t <= 0.35)
345  {
346  return -141980;
347  }
348  if (t <= 0.36)
349  {
350  return -139900;
351  }
352  if (t <= 0.37)
353  {
354  return -137260;
355  }
356  if (t <= 0.38)
357  {
358  return -133970;
359  }
360  if (t <= 0.39)
361  {
362  return -131670;
363  }
364  if (t <= 0.40)
365  {
366  return -131320;
367  }
368  if (t <= 0.41)
369  {
370  return -133150;
371  }
372  if (t <= 0.42)
373  {
374  return -132710;
375  }
376  if (t <= 0.43)
377  {
378  return -131570;
379  }
380  if (t <= 0.44)
381  {
382  return -130280;
383  }
384  if (t <= 0.45)
385  {
386  return -129750;
387  }
388  if (t <= 0.46)
389  {
390  return -129330;
391  }
392  if (t <= 0.47)
393  {
394  return -128910;
395  }
396  if (t <= 0.48)
397  {
398  return -128360;
399  }
400  if (t <= 0.49)
401  {
402  return -127680;
403  }
404  if (t <= 0.50)
405  {
406  return -127000;
407  }
408  if (t <= 0.51)
409  {
410  return -126410;
411  }
412  if (t <= 0.52)
413  {
414  return -125920;
415  }
416  if (t <= 0.53)
417  {
418  return -125480;
419  }
420  if (t <= 0.54)
421  {
422  return -125040;
423  }
424  if (t <= 0.55)
425  {
426  return -124560;
427  }
428  if (t <= 0.56)
429  {
430  return -124050;
431  }
432  if (t <= 0.57)
433  {
434  return -123530;
435  }
436  if (t <= 0.58)
437  {
438  return -123000;
439  }
440  if (t <= 0.59)
441  {
442  return -122440;
443  }
444  if (t <= 0.60)
445  {
446  return -121840;
447  }
448  if (t <= 0.61)
449  {
450  return -121220;
451  }
452  if (t <= 0.62)
453  {
454  return -120580;
455  }
456  if (t <= 0.63)
457  {
458  return -119950;
459  }
460  if (t <= 0.64)
461  {
462  return -119330;
463  }
464  if (t <= 0.65)
465  {
466  return -118710;
467  }
468  if (t <= 0.66)
469  {
470  return -118100;
471  }
472  if (t <= 0.67)
473  {
474  return -117470;
475  }
476  if (t <= 0.68)
477  {
478  return -116840;
479  }
480  if (t <= 0.69)
481  {
482  return -116200;
483  }
484  if (t <= 0.70)
485  {
486  return -115560;
487  }
488  if (t <= 0.71)
489  {
490  return -114920;
491  }
492  if (t <= 0.72)
493  {
494  return -114280;
495  }
496  if (t <= 0.73)
497  {
498  return -113650;
499  }
500  if (t <= 0.74)
501  {
502  return -113020;
503  }
504  if (t <= 0.75)
505  {
506  return -112400;
507  }
508  if (t <= 0.76)
509  {
510  return -111790;
511  }
512  if (t <= 0.77)
513  {
514  return -111200;
515  }
516  if (t <= 0.78)
517  {
518  return -110620;
519  }
520  if (t <= 0.79)
521  {
522  return -110060;
523  }
524  // break;
525  /* case 3:
526  return 0.0;
527  break;}
528  return 0.;*/
529  return 0.;
530 }
531 
532 
533 Real f (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
534 {
535  return 0.;
536 }
537 
538 Real u1 (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
539 {
540  return 0.0;
541 }
542 
543 Real fZero (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
544 {
545  return 0.0;
546 }
547 
548 Real outerWallPressure (const Real& t, const Real& /*x*/, const Real& /*y*/, const Real& z, const ID& /*i*/)
549 {
550  Real highestPressure ( - ( 13330 - 113305 ) );
551  Real pressure (0);
552  Real totalTime = 0.8;
553  Real halfTime = totalTime / 2.0;
554 
555  Real a = ( highestPressure / 2 ) * ( 1 / ( halfTime * halfTime ) );
556 
557  if ( t <= totalTime )
558  {
559  pressure = ( highestPressure / totalTime ) * t;
560  }
561  else
562  {
563  pressure = highestPressure;
564  }
565 
566  // if ( t <= 0.8 )
567  // {
568  // return ( value / ( 0.8 * 0.8 * 0.8 * 0.8 ) ) * ( t * t *t *t );
569  // }
570  // else
571  // {
572  // return value;
573  // }
574 
575  return -pressure;
576 
577 }
578 
579 Real epsilon (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& i)
580 {
581 
582  switch (i)
583  {
584  case 0:
585  return 0.0;
586  break;
587  case 1:
588  return 0.0;
589  break;
590  case 2:
591  return 113487.36193;
592  break;
593  default:
594  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
595  return 0.;
596  break;
597  }
598 }
599 
600 Real pressureInitial (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
601 {
602  return 113305;
603 }
604 
605 // Initial velocity
606 Real u0 (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
607 {
608  return 0.0;
609 }
610 
611 Real p0 (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
612 {
613  return 0.0;
614 }
615 
616 
617 Real E (const Real& t, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
618 {
619  if ( t <= 0.4 )
620  {
621  return -10000000 * ( t - 0.4 );
622  }
623  else
624  {
625  return 0.0;
626  }
627 
628  return 0.0;
629 
630 }
631 
632 
633 Real hydro (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
634 {
635  return -1.33 * 1e5;
636 }
637 
638 Real u2 (const Real& t, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& i)
639 {
640  switch (i)
641  {
642  case 0:
643  return 0.0;
644  break;
645  case 2:
646  if ( t <= 0.003 )
647  {
648  return 1.5;
649  }
650  // return 0.01;
651  return 0.0;
652  break;
653  case 1:
654  return 0.0;
655  // return 1.3332e4;
656  // else
657  // return 0.0;
658  break;
659  }
660  return 0;
661 }
662 
663 
664 // Initial displacement and velocity
665 Real d0 (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& i)
666 {
667  switch (i)
668  {
669  case 0:
670  return 0.;
671  break;
672  case 1:
673  return 0.;
674  break;
675  case 2:
676  return 0.;
677  break;
678  default:
679  ERROR_MSG ("This entry is not allowed: ud_functions.hpp");
680  return 0.;
681  break;
682  }
683 }
684 
685 
686 Real w0 (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& i)
687 {
688 
689  switch (i)
690  {
691  case 0:
692  return 0.0;
693  break;
694  case 1:
695  return 0.0;
696  break;
697  case 2:
698  return 10.0;
699  break;
700  default:
701  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
702  return 0.;
703  break;
704  }
705 }
706 
707 Real fluxFunctionAneurysm (const Real& t, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
708 {
709 
710  Real fluxFinal;
711  Real rampAmpl (1.012);
712  Real activeRamp ( rampAmpl / 1.0 );
713  Real dt (0.001);
714 
715  if ( t <= activeRamp )
716  {
717  fluxFinal = ( 0.1747 / activeRamp ) * t; // 0.033 cm
718  }
719  else if ( t > activeRamp && t <= rampAmpl )
720  {
721  fluxFinal = ( 0.1747 );
722  }
723  else
724  {
725 
726 
727  // We change the flux for our geometry
728  const Real pi = 3.141592653589793;
729  const Real area = 0.0033853; // radius = 0.033 cm
730  // const Real area = 0.013684; // radius = 0.066 cm
731 
732  const Real areaFactor = area / ( 0.195 * 0.195 * pi);
733  //const Real Average = (48.21 * pow (area, 1.84) ) * 60; //Mean Cebral's Flux per minut
734 
735  // Unit conversion from ml/min to cm^3/s
736  const Real unitFactor = 1. / 60.;
737 
738  // T is the period of the cardiac cycle
739  const Real T = 0.8;
740 
741  // a0 is the average VFR (the value is taken from Karniadakis p970)
742  const Real a0 = 255;
743  //const Real volumetric = Average / a0; //VolumetricFactor per minut
744 
745  // Fourrier
746  const Int M (7);
747  const Real a[M] = { -0.152001, -0.111619, 0.043304, 0.028871, 0.002098, -0.027237, -0.000557};
748  const Real b[M] = { 0.129013, -0.031435, -0.086106, 0.028263, 0.010177, 0.012160, -0.026303};
749 
750  Real flux (0);
751  const Real xi (2 * pi * (t - 0.8 + dt) / T);
752 
753  flux = a0;
754  Int k (1);
755  for (; k <= M ; ++k)
756  {
757  flux += a0 * (a[k - 1] * cos (k * xi) + b[k - 1] * sin (k * xi) );
758  }
759 
760  fluxFinal = (flux * areaFactor * unitFactor);
761  }
762 
763  std::cout << "Flux that is imposed" << fluxFinal << std::endl;
764 
765  return fluxFinal;
766 
767 }
768 
769 Real aneurismFluxInVectorial (const Real& t, const Real& x, const Real& y, const Real& z, const ID& i)
770 {
771  Real n1 (0.0);
772  Real n2 (0.0);
773  Real n3 (1.0);
774 
775  Real x0 (0.0);
776  Real y0 (0.0);
777 
778 
779  Real flux (fluxFunctionAneurysm (t, x, y, z, i) );
780  Real area (0.0033853); // 0.033 cm
781  //Real area (0.013684); // 0.066 cm
782 
783  //Parabolic profile
784  Real radius (0.033);
785  Real radiusSquared = radius * radius;
786  Real peak (0);
787  peak = ( 2 * flux ) / ( area );
788 
789  switch (i)
790  {
791  case 0:
792  // Flat profile: flux / area;
793  // return n1 * flux / area;
794  return n1 * ( peak * ( (radiusSquared - ( (x - x0) * (x - x0) + (y - y0) * (y - y0) ) ) / radiusSquared) ) ;
795  case 1:
796  // Flat profile: flux / area;
797  //return n2 * flux / area;
798  return n2 * ( peak * ( (radiusSquared - ( (x - x0) * (x - x0) + (y - y0) * (y - y0) ) ) / radiusSquared) ) ;
799  case 2:
800  // Flat profile: flux / area;
801  //return n3 * flux / area;
802  return n3 * ( peak * ( (radiusSquared - ( (x - x0) * (x - x0) + (y - y0) * (y - y0) ) ) / radiusSquared) ) ;
803  default:
804  return 0.0;
805  }
806 }
807 
808 
809 Real squareSinusoidalFluxFunction (const Real& t, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
810 {
811  return - (t < (0.005 / 2) ) * std::sin (2 * M_PI * t / 0.005) * std::sin (2 * M_PI * t / 0.005);
812 }
813 
814 //----------------------------------------------Fibers Directions--------------
815 Real Family1 ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& i)
816 {
817  Real theta = 0.9865; // value for anisotropic characterization taken from Robertson // ( PI / 6.0 );
818  Real thetaChangeOfVariable = std::atan( y / x );
819 
820  if( x < 0 )
821  {
822  // This is due to the periodicity of std::atan ( ref. official documentation )
823  Real pi(3.141592653589793);
824  thetaChangeOfVariable += pi;
825  }
826 
827  switch (i)
828  {
829  case 0:
830  // Tube
831  return - std::sin( thetaChangeOfVariable ) * std::cos( theta );
832  // Cube
833  // return std::sin( theta );
834  break;
835  case 1:
836  // Tube
837  return std::cos( thetaChangeOfVariable ) * std::cos( theta );
838  // Cube
839  // return std::cos( theta );
840  break;
841  case 2:
842  // Tube
843  return std::sin( theta );
844  // Cube
845  // return 0.0;
846  break;
847  default:
848  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
849  return 0.;
850  break;
851  }
852 }
853 
854 Real Family2 ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& i)
855 {
856  Real theta = - 0.9865; //( - PI / 6.0 );
857  Real thetaChangeOfVariable = std::atan( y / x );
858 
859  if( x < 0 )
860  {
861  // This is due to the periodicity of std::atan ( ref. official documentation )
862  Real pi(3.141592653589793);
863  thetaChangeOfVariable += pi;
864  }
865 
866  switch (i)
867  {
868  case 0:
869  // Tube
870  return - std::sin( thetaChangeOfVariable ) * std::cos( theta );
871  // Cube
872  // return std::sin( theta );
873  break;
874  case 1:
875  // Tube
876  return std::cos( thetaChangeOfVariable ) * std::cos( theta );
877  // Cube
878  //return std::cos( theta );
879  break;
880  case 2:
881  // Tube
882  return std::sin( theta );
883  // Cube
884  // return 0.0;
885  break;
886  default:
887  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
888  return 0.;
889  break;
890  }
891 }
892 
893 Real Family3 ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& i)
894 {
895 
896  switch (i)
897  {
898  case 0:
899  return 0.0;
900  break;
901  case 1:
902  return 0.0;
903  break;
904  case 2:
905  return -1.0;
906  break;
907  default:
908  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
909  return 0.;
910  break;
911  }
912 }
913 
914 
915 Real Family4 ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& i)
916 {
917 
918  switch (i)
919  {
920  case 0:
921  return 0.0;
922  break;
923  case 1:
924  return 0.0;
925  break;
926  case 2:
927  return 0.0;
928  break;
929  default:
930  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
931  return 0.;
932  break;
933  }
934 }
935 
936 
937 Real Family5 ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& i)
938 {
939 
940  switch (i)
941  {
942  case 0:
943  return 0.0;
944  break;
945  case 1:
946  return 0.0;
947  break;
948  case 2:
949  return 0.0;
950  break;
951  default:
952  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
953  return 0.;
954  break;
955  }
956 }
957 
958 Real Family6 ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& i)
959 {
960 
961  switch (i)
962  {
963  case 0:
964  return 0.0;
965  break;
966  case 1:
967  return 0.0;
968  break;
969  case 2:
970  return 0.0;
971  break;
972  default:
973  ERROR_MSG ("This entrie is not allowed: ud_functions.hpp");
974  return 0.;
975  break;
976  }
977 }
978 
979 // Method for the definition of the fibers
980 fibersDirectionList::fibersDirectionList() :
981  M_mapNameDefinition( )
982 {}
983 
984 fibersDirectionList::~fibersDirectionList()
985 {}
986 
987 void fibersDirectionList::setupFiberDefinitions( const UInt nbFamilies )
988 {
989  // At the moment the creation of the table of fiber functions is done
990  // manually. There should be a way to make it automatically. Btw, only
991  // the first nbFamilies that are set in the data file are taken into account
992 
993  ASSERT( nbFamilies < 6, "At the moment, a maximum number = 6 of families can be used! If you want more \n modifiy the file ud_functions.hpp in the application folder." );
994 
995  // Creation of the database of functions
996  fiberFunctionPtr_Type pointerToFunction( new fiberFunction_Type( Family1 ) );
997  M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
998  ( "Family1", pointerToFunction ) );
999 
1000  pointerToFunction.reset( new fiberFunction_Type( Family2 ) );
1001  M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1002  ( "Family2", pointerToFunction ) );
1003 
1004  pointerToFunction.reset( new fiberFunction_Type( Family3 ) );
1005  M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1006  ( "Family3", pointerToFunction ) );
1007 
1008  pointerToFunction.reset( new fiberFunction_Type( Family4 ) );
1009  M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1010  ( "Family4", pointerToFunction ) );
1011 
1012  pointerToFunction.reset( new fiberFunction_Type( Family5 ) );
1013  M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1014  ( "Family5", pointerToFunction ) );
1015 
1016  pointerToFunction.reset( new fiberFunction_Type( Family6 ) );
1017  M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1018  ( "Family6", pointerToFunction ) );
1019 
1020 
1021 }
1022 
1023 fibersDirectionList::fiberFunctionPtr_Type fibersDirectionList::fiberDefinition( const std::string nameFamily )
1024 {
1025 
1026  mapNameDefinitionFiberFunction_Type::const_iterator IT;
1027 
1028  IT = M_mapNameDefinition.find ( nameFamily );
1029 
1030  if ( IT != M_mapNameDefinition.end() )
1031  {
1032  return IT->second;
1033  }
1034  else
1035  {
1036  std::cout << " Wrong identification of the fiber function! " << std::endl;
1037  fiberFunctionPtr_Type pointerToFunction( new fiberFunction_Type() );
1038 
1039  return pointerToFunction;
1040  }
1041 }
1042 
1043 }
Real fZero(const Real &, const Real &, const Real &, const Real &, const ID &)
Real d0(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
Real E(const Real &, const Real &, const Real &, const Real &, const ID &)
Real p0(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
int32_type Int
Generic integer data.
Definition: LifeV.hpp:188
#define M_PI
Definition: winmath.h:20
void updateInverseJacobian(const UInt &iQuadPt)
Real w0(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
#define ERROR_MSG(A)
Definition: LifeAssert.hpp:69
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real f(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
Real uInterpolated(const Real &time, const Real &, const Real &, const Real &, const ID &i)
Real aortaPhisPress(const Real &t, const Real &x=0, const Real &y=0, const Real &z=0, const ID &i=0)
double Real
Generic real data.
Definition: LifeV.hpp:175
Real u1(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
Real u0(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
Real u2(const Real &t, const Real &, const Real &, const Real &, const ID &i)
Definition: cylinder.cpp:81