42 #include<lifev/core/array/VectorSmall.hpp> 43 #include<lifev/core/array/MatrixSmall.hpp> 45 #define PI 3.14159265359
64 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
89 return 0.088002 * ( x + 0.5 );
92 return - ( 0.02068 * 2.0 ) * ( y );
95 return - ( 0.02068 * 2.0 ) * ( z );
98 ERROR_MSG (
"This entry is not allowed: ud_functions.hpp");
120 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
141 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
190 Real radius = std::sqrt( x*x + y*y);
193 Real highestPressure(200000);
194 Real totalTime = 4.5;
195 Real halfTime = totalTime / 2.0;
210 return pressure * ( x / radius ) ;
213 return pressure * ( y / radius ) ;
233 Real thetaFiber ( 0.0 );
237 Real thetaRotation(0);
238 Real thetaPosition(0);
239 thetaFree = std::atan( z / ( x - xT ) );
240 thetaPosition = thetaFree;
243 thetaPosition = thetaFree +
PI;
244 thetaRotation =
PI/2.0 - std::fabs( thetaFree );
248 thetaRotation = thetaFree -
PI/2.0;
251 return thetaPosition;
257 Real thetaFiber ( 0.0 );
261 Real thetaRotation(0);
262 Real thetaPosition(0);
263 thetaFree = std::atan( z / ( x - xT ) );
264 thetaPosition = thetaFree;
267 thetaPosition = thetaFree +
PI;
268 thetaRotation =
PI/2.0 - std::fabs( thetaFree );
272 thetaRotation = thetaFree -
PI/2.0;
275 return thetaRotation;
294 Real thetaFiber ( 0.9865 );
298 Real thetaRotation(0);
299 Real thetaPosition(0);
300 thetaFree = std::atan( z / ( x - xT ) );
301 thetaPosition = thetaFree;
304 thetaPosition = thetaFree +
PI;
305 thetaRotation =
PI/2.0 - std::fabs( thetaFree );
309 thetaRotation = thetaFree -
PI/2.0;
314 xCenter = rT * std::cos( thetaPosition ) + xT;
315 zCenter = rT * std::sin( thetaPosition );
318 positionCenter
[0
] = xCenter;
319 positionCenter
[1
] = 0;
320 positionCenter
[2
] = zCenter;
327 MatrixSmall<3,3> changeOfVariable;
328 changeOfVariable(0,0) = std::cos( thetaRotation ); changeOfVariable(0,1) = 0.0; changeOfVariable(0,2) = std::sin( thetaRotation );
329 changeOfVariable(1,0) = 0.0; changeOfVariable(1,1) = 1.0; changeOfVariable(1,2) = 0.0;
330 changeOfVariable(2,0) = -std::sin( thetaRotation ); changeOfVariable(2,1) = 0.0; changeOfVariable(2,2) = std::cos( thetaRotation );
333 localPosition = changeOfVariable * ( position - positionCenter );
335 Real thetaPositionOnSection(0);
336 thetaPositionOnSection = std::atan( localPosition
[2
] / localPosition
[1
] );
338 if ( localPosition
[1
] < 0 )
339 thetaPositionOnSection +=
PI;
342 localFibers
[0
] = std::sin( thetaFiber );
343 localFibers
[1
] = std::cos( thetaFiber ) * std::sin( thetaPositionOnSection );
344 localFibers
[2
] = - std::cos( thetaFiber ) * std::cos( thetaPositionOnSection );
347 originFibers = changeOfVariable.transpose() * localFibers + positionCenter;
358 return originFibers
[0
];
368 return originFibers
[1
];
378 return originFibers
[2
];
384 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
394 Real thetaFiber ( 0.0 );
398 Real thetaRotation(0);
399 Real thetaPosition(0);
400 thetaFree = std::atan( z / ( x - xT ) );
401 thetaPosition = thetaFree;
404 thetaPosition = thetaFree +
PI;
405 thetaRotation =
PI/2.0 - std::fabs( thetaFree );
409 thetaRotation = thetaFree -
PI/2.0;
414 xCenter = rT * std::cos( thetaPosition ) + xT;
415 zCenter = rT * std::sin( thetaPosition );
438 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
449 Real thetaFiber ( 0.0 );
453 Real thetaRotation(0);
454 Real thetaPosition(0);
455 thetaFree = std::atan( z / ( x - xT ) );
456 thetaPosition = thetaFree;
459 thetaPosition = thetaFree +
PI;
460 thetaRotation =
PI/2.0 - std::fabs( thetaFree );
464 thetaRotation = thetaFree -
PI/2.0;
469 xCenter = rT * std::cos( thetaPosition ) + xT;
470 zCenter = rT * std::sin( thetaPosition );
473 positionCenter
[0
] = xCenter;
474 positionCenter
[1
] = 0;
475 positionCenter
[2
] = zCenter;
482 MatrixSmall<3,3> changeOfVariable;
483 changeOfVariable(0,0) = std::cos( thetaRotation ); changeOfVariable(0,1) = 0.0; changeOfVariable(0,2) = std::sin( thetaRotation );
484 changeOfVariable(1,0) = 0.0; changeOfVariable(1,1) = 1.0; changeOfVariable(1,2) = 0.0;
485 changeOfVariable(2,0) = -std::sin( thetaRotation ); changeOfVariable(2,1) = 0.0; changeOfVariable(2,2) = std::cos( thetaRotation );
488 localPosition = changeOfVariable * ( position - positionCenter );
494 return localPosition
[0
];
500 return localPosition
[1
];
506 return localPosition
[2
];
511 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
532 Real thetaFiber ( - 0.9865 );
536 Real thetaRotation(0);
537 Real thetaPosition(0);
538 thetaFree = std::atan( z / ( x - xT ) );
539 thetaPosition = thetaFree;
542 thetaPosition = thetaFree +
PI;
543 thetaRotation =
PI/2.0 - std::fabs( thetaFree );
547 thetaRotation = thetaFree -
PI/2.0;
552 xCenter = rT * std::cos( thetaPosition ) + xT;
553 zCenter = rT * std::sin( thetaPosition );
556 positionCenter
[0
] = xCenter;
557 positionCenter
[1
] = 0;
558 positionCenter
[2
] = zCenter;
565 MatrixSmall<3,3> changeOfVariable;
566 changeOfVariable(0,0) = std::cos( thetaRotation ); changeOfVariable(0,1) = 0.0; changeOfVariable(0,2) = std::sin( thetaRotation );
567 changeOfVariable(1,0) = 0.0; changeOfVariable(1,1) = 1.0; changeOfVariable(1,2) = 0.0;
568 changeOfVariable(2,0) = -std::sin( thetaRotation ); changeOfVariable(2,1) = 0.0; changeOfVariable(2,2) = std::cos( thetaRotation );
571 localPosition = changeOfVariable * ( position - positionCenter );
573 Real thetaPositionOnSection(0);
574 thetaPositionOnSection = std::atan( localPosition
[2
] / localPosition
[1
] );
576 if ( localPosition
[1
] < 0 )
577 thetaPositionOnSection +=
PI;
580 localFibers
[0
] = std::sin( thetaFiber );
581 localFibers
[1
] = std::cos( thetaFiber ) * std::sin( thetaPositionOnSection );
582 localFibers
[2
] = - std::cos( thetaFiber ) * std::cos( thetaPositionOnSection );
585 originFibers = changeOfVariable.transpose() * localFibers + positionCenter;
596 return originFibers
[0
];
606 return originFibers
[1
];
616 return originFibers
[2
];
622 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
631 Real theta = - 0.8426;
632 Real thetaChangeOfVariable = std::atan( y / x );
637 thetaChangeOfVariable +=
PI;
644 return - std::sin( thetaChangeOfVariable ) * std::cos( theta );
650 return std::cos( thetaChangeOfVariable ) * std::cos( theta );
656 return std::sin( theta );
661 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
683 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
705 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
726 ERROR_MSG (
"This entrie is not allowed: ud_functions.hpp");
733 fibersDirectionList::fibersDirectionList() :
734 M_mapNameDefinition( )
737 fibersDirectionList::~fibersDirectionList()
740 void fibersDirectionList::setupFiberDefinitions(
const UInt nbFamilies )
746 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." );
749 fiberFunctionPtr_Type pointerToFunction(
new fiberFunction_Type( Family1 ) );
750 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
751 (
"Family1", pointerToFunction ) );
753 pointerToFunction.reset(
new fiberFunction_Type( Family2 ) );
754 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
755 (
"Family2", pointerToFunction ) );
757 pointerToFunction.reset(
new fiberFunction_Type( Family3 ) );
758 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
759 (
"Family3", pointerToFunction ) );
761 pointerToFunction.reset(
new fiberFunction_Type( Family4 ) );
762 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
763 (
"Family4", pointerToFunction ) );
765 pointerToFunction.reset(
new fiberFunction_Type( Family5 ) );
766 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
767 (
"Family5", pointerToFunction ) );
769 pointerToFunction.reset(
new fiberFunction_Type( Family6 ) );
770 M_mapNameDefinition.insert( std::pair<std::string, fiberFunctionPtr_Type>
771 (
"Family6", pointerToFunction ) );
776 fibersDirectionList::fiberFunctionPtr_Type fibersDirectionList::fiberDefinition(
const std::string nameFamily )
779 mapNameDefinitionFiberFunction_Type::const_iterator IT;
781 IT = M_mapNameDefinition.find ( nameFamily );
783 if ( IT != M_mapNameDefinition.end() )
789 std::cout <<
" Wrong identification of the fiber function! " << std::endl;
790 fiberFunctionPtr_Type pointerToFunction(
new fiberFunction_Type() );
792 return pointerToFunction;
Real d0(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
void updateInverseJacobian(const UInt &iQuadPt)
void normalize()
Normalize vector.
Real w0(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
Real & operator[](UInt const &i)
Operator [].
Real f(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
double Real
Generic real data.
uint32_type UInt
generic unsigned integer (used mainly for addressing)