55 Real scale_factor = -50.;
60 Real intervallorampa = 0.05;
64 Real percar = 60.0 / strokes;
66 Real pigreco2 = 6.2831853;
68 Real coeff02 = - 0.35;
70 Real coeff12 = - 0.05;
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;
84 if (time < intervallorampa)
90 newtime = time + deltat - intervallorampa;
93 while (Taux < newtime)
97 Tcorr = newtime - Taux + Tfin;
104 if (Tcorr <= prefirst)
106 a = pigreco2 * Tcorr / first;
107 flux = coeff01 + coeff02 * cos (a);
110 else if ( (Tcorr > prefirst) && (Tcorr <= first) )
112 b1 = coeff01 - coeff31;
113 b2 = coeff02 * pigreco2 / first;
114 a22 = prefirst - first;
119 det = a22 * a11 - a12 * a21;
120 coeff32 = (a22 * b1 - a12 * b2) / det;
121 coeff33 = (a11 * b2 - a21 * b1) / det;
123 flux = coeff32 * dt * dt * dt * dt + coeff33 * dt * dt + coeff31;
126 else if ( (Tcorr > first) && (Tcorr <= presecond) )
128 a = pigreco2 * (Tcorr) / first;
129 flux = coeff41 + coeff42 * cos (a);
132 else if ( (Tcorr > presecond) && (Tcorr <= second) )
134 a = pigreco2 * (Tcorr - first) / first;
135 flux = coeff11 + coeff12 * cos (a);
137 else if (Tcorr > second)
139 a = pigreco2 * (second - first) / first;
140 b1 = coeff11 + coeff12 * cos (a) - coeff21;
141 b2 = - coeff12 * pigreco2 * sin (a) / first;
145 a21 = - 4 * a12 * a22;
147 det = a22 * a11 - a12 * a21;
148 coeff22 = (a22 * b1 - a12 * b2) / det;
149 coeff23 = (a11 * b2 - a21 * b1) / det;
151 flux = coeff22 * dt * dt * dt * dt + coeff23 * dt * dt + coeff21;
153 if (time < intervallorampa)
155 flux = ( time / intervallorampa ) * scale_factor * flux;
159 flux = scale_factor * flux;
173 #ifdef ANEURISM100170 550 Real highestPressure ( - ( 13330 - 113305 ) );
552 Real totalTime = 0.8;
553 Real halfTime = totalTime / 2.0;
555 Real a = ( highestPressure / 2 ) * ( 1 / ( halfTime * halfTime ) );
557 if ( t <= totalTime )
559 pressure = ( highestPressure / totalTime ) * t;
563 pressure = highestPressure;
594 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
621 return -10000000 * ( t - 0.4 );
679 ERROR_MSG (
"This entry is not allowed: ud_functions.hpp");
701 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
711 Real rampAmpl (1.012);
712 Real activeRamp ( rampAmpl / 1.0 );
715 if ( t <= activeRamp )
717 fluxFinal = ( 0.1747 / activeRamp ) * t;
719 else if ( t > activeRamp && t <= rampAmpl )
721 fluxFinal = ( 0.1747 );
728 const Real pi = 3.141592653589793;
729 const Real area = 0.0033853;
732 const Real areaFactor = area / ( 0.195 * 0.195 * pi);
736 const Real unitFactor = 1. / 60.;
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};
751 const Real xi (2 * pi * (t - 0.8 + dt) / T);
757 flux += a0 * (a[k - 1] * cos (k * xi) + b[k - 1] * sin (k * xi) );
760 fluxFinal = (flux * areaFactor * unitFactor);
763 std::cout <<
"Flux that is imposed" << fluxFinal << std::endl;
779 Real flux (fluxFunctionAneurysm (t, x, y, z, i) );
780 Real area (0.0033853);
785 Real radiusSquared = radius * radius;
787 peak = ( 2 * flux ) / ( area );
794 return n1 * ( peak * ( (radiusSquared - ( (x - x0) * (x - x0) + (y - y0) * (y - y0) ) ) / radiusSquared) ) ;
798 return n2 * ( peak * ( (radiusSquared - ( (x - x0) * (x - x0) + (y - y0) * (y - y0) ) ) / radiusSquared) ) ;
802 return n3 * ( peak * ( (radiusSquared - ( (x - x0) * (x - x0) + (y - y0) * (y - y0) ) ) / radiusSquared) ) ;
811 return - (t < (0.005 / 2) ) * std::sin (2 *
M_PI * t / 0.005) * std::sin (2 *
M_PI * t / 0.005);
818 Real thetaChangeOfVariable = std::atan( y / x );
823 Real pi(3.141592653589793);
824 thetaChangeOfVariable += pi;
831 return - std::sin( thetaChangeOfVariable ) * std::cos( theta );
837 return std::cos( thetaChangeOfVariable ) * std::cos( theta );
843 return std::sin( theta );
848 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
856 Real theta = - 0.9865;
857 Real thetaChangeOfVariable = std::atan( y / x );
862 Real pi(3.141592653589793);
863 thetaChangeOfVariable += pi;
870 return - std::sin( thetaChangeOfVariable ) * std::cos( theta );
876 return std::cos( thetaChangeOfVariable ) * std::cos( theta );
882 return std::sin( theta );
887 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
908 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
930 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
952 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
973 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
980 fibersDirectionList::fibersDirectionList() :
981 M_mapNameDefinition( )
984 fibersDirectionList::~fibersDirectionList()
987 void fibersDirectionList::setupFiberDefinitions(
const UInt nbFamilies )
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." );
996 fiberFunctionPtr_Type pointerToFunction(
new fiberFunction_Type( Family1 ) );
997 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
998 (
"Family1", pointerToFunction ) );
1000 pointerToFunction.reset(
new fiberFunction_Type( Family2 ) );
1001 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1002 (
"Family2", pointerToFunction ) );
1004 pointerToFunction.reset(
new fiberFunction_Type( Family3 ) );
1005 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1006 (
"Family3", pointerToFunction ) );
1008 pointerToFunction.reset(
new fiberFunction_Type( Family4 ) );
1009 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1010 (
"Family4", pointerToFunction ) );
1012 pointerToFunction.reset(
new fiberFunction_Type( Family5 ) );
1013 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1014 (
"Family5", pointerToFunction ) );
1016 pointerToFunction.reset(
new fiberFunction_Type( Family6 ) );
1017 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
1018 (
"Family6", pointerToFunction ) );
1023 fibersDirectionList::fiberFunctionPtr_Type fibersDirectionList::fiberDefinition(
const std::string nameFamily )
1026 mapNameDefinitionFiberFunction_Type::const_iterator IT;
1028 IT = M_mapNameDefinition.find ( nameFamily );
1030 if ( IT != M_mapNameDefinition.end() )
1036 std::cout <<
" Wrong identification of the fiber function! " << std::endl;
1037 fiberFunctionPtr_Type pointerToFunction(
new fiberFunction_Type() );
1039 return pointerToFunction;
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.
void updateInverseJacobian(const UInt &iQuadPt)
Real w0(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
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.
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)
Real u2(const Real &t, const Real &, const Real &, const Real &, const ID &i)