41 #include <lifev/heart/solver/HeartFunctors.hpp> 43 using namespace LifeV;
160 M_sphereX (dataFile
("electric/physics/sphere_center", 0.
, 0
) ),
161 M_sphereY (dataFile
("electric/physics/sphere_center", 0.
, 1
) ),
162 M_sphereZ (dataFile
("electric/physics/sphere_center", 0.
, 2
) ),
163 M_sphereR (dataFile
("electric/physics/sphere_radius", 0.
) ),
191 M_conductivityReduction (0) = dataFile (
"electric/physics/sigma_reduction", 1., 0);
192 M_conductivityReduction (1) = dataFile (
"electric/physics/sigma_reduction", 1., 1);
193 M_stimulusCenter1 (0) = dataFile (
"electric/physics/stim_center_1", 0., 0);
194 M_stimulusCenter1 (1) = dataFile (
"electric/physics/stim_center_1", 0., 1);
195 M_stimulusCenter1 (2) = dataFile (
"electric/physics/stim_center_1", 0., 2);
196 M_stimulusCenter2 (0) = dataFile (
"electric/physics/stim_center_2", 0., 0);
197 M_stimulusCenter2 (1) = dataFile (
"electric/physics/stim_center_2", 0., 1);
198 M_stimulusCenter2 (2) = dataFile (
"electric/physics/stim_center_2", 0., 2);
199 M_stimulusCenter3 (0) = dataFile (
"electric/physics/stim_center_3", 0., 0);
200 M_stimulusCenter3 (1) = dataFile (
"electric/physics/stim_center_3", 0., 1);
201 M_stimulusCenter3 (2) = dataFile (
"electric/physics/stim_center_3", 0., 2);
202 M_stimulusCenter4 (0) = dataFile (
"electric/physics/stim_center_4", 0., 0);
203 M_stimulusCenter4 (1) = dataFile (
"electric/physics/stim_center_4", 0., 1);
204 M_stimulusCenter4 (2) = dataFile (
"electric/physics/stim_center_4", 0., 2);
205 M_stimulusCenter5 (0) = dataFile (
"electric/physics/stim_center_5", 0., 0);
206 M_stimulusCenter5 (1) = dataFile (
"electric/physics/stim_center_5", 0., 1);
207 M_stimulusCenter5 (2) = dataFile (
"electric/physics/stim_center_5", 0., 2);
208 M_stimulusCenter6 (0) = dataFile (
"electric/physics/stim_center_6", 0., 0);
209 M_stimulusCenter6 (1) = dataFile (
"electric/physics/stim_center_6", 0., 1);
210 M_stimulusCenter6 (2) = dataFile (
"electric/physics/stim_center_6", 0., 2);
219 Real appliedCurrent = 0.0;
220 Real pi = std::acos ( -1.0 );
223 Real sumL1, sumL4, aL, bL, cL, e1, e4;
231 sumL1 = x * x / ( ( aL - e1 ) * ( aL - e1 ) ) * 100 +
232 y * y / ( ( bL - e1 ) * ( bL - e1 ) ) * 100 +
233 z * z / ( ( cL - e1 ) * ( cL - e1 ) ) * 100 - 1;
235 sumL4 = x * x / ( ( aL - e4 ) * ( aL - e4 ) ) * 100 +
236 y * y / ( ( bL - e4 ) * ( bL - e4 ) ) * 100 +
237 z * z / ( ( cL - e4 ) * ( cL - e4 ) ) * 100 - 1;
239 Real sumR2, aR, bR, cR, e2;
245 sumR2 = x * x / ( ( aR - e2 ) * ( aR - e2 ) ) * 100 +
246 y * y / ( ( bR - e2 ) * ( bR - e2 ) ) * 100 +
247 z * z / ( ( cR - e2 ) * ( cR - e2 ) ) * 100 - 1;
254 ( std::atan ( ( x + 1.5e+00) / ( 2.7586e+00 - z) ) < fmod (t,
M_timePeriod) * AngularVelocityLeftVentricule ) )
259 appliedCurrent = ( -5 / 2 * sumL1 + 0.375) * 8 ;
267 sumL4 >= -0.2 && sumL4 <= 0.0 && x < -2.4 )
269 appliedCurrent = (5 / 2 * sumL4 + 0.5) * 8 ;
279 if ( sumR2 >= 0.0 && sumR2 < 0.1 &&
280 std::atan ( (- 3.7e+00 - x ) / ( 2.9586e+00 - z) ) < fmod (t,
M_timePeriod) * AngularVelocityRightVentricule )
284 appliedCurrent = 0.5 * 8 ;
289 return appliedCurrent;
303 Real appliedCurrent = 0.0;
312 if ( ( ( x - x0 ) * ( x - x0 ) +
313 ( y - y0 ) * ( y - y0 ) +
316 ( ( x - x0 ) * ( x - x0 ) +
317 ( y - y0 ) * ( y - y0 ) +
323 if ( ( ref == 1 ) || ( ref == 20 ) )
326 if ( ( ( x - x0 ) * ( x - x0 ) +
327 ( y - y0 ) * ( y - y0 ) +
330 ( ( x - x0 ) * ( x - x0 ) +
331 ( y - y0 ) * ( y - y0 ) +
339 return appliedCurrent;
359 if ( (timeReset1 >= M_stimulusStart1 && timeReset1 <= M_stimulusStop1) &&
360 ( ( ( x - M_stimulusCenter1 (0) ) * ( x - M_stimulusCenter1 (0) ) +
361 ( y - M_stimulusCenter1 (1) ) * ( y - M_stimulusCenter1 (1) ) +
362 ( z - M_stimulusCenter1 (2) ) * ( z - M_stimulusCenter1 (2) ) ) <= ( M_stimulusRadius1 * M_stimulusRadius1 ) ) )
371 if ( (timeReset2 >= M_stimulusStart2 && timeReset2 <= M_stimulusStop2) &&
372 ( ( ( x - M_stimulusCenter2 (0) ) * ( x - M_stimulusCenter2 (0) ) +
373 ( y - M_stimulusCenter2 (1) ) * ( y - M_stimulusCenter2 (1) ) +
374 ( z - M_stimulusCenter2 (2) ) * ( z - M_stimulusCenter2 (2) ) ) <= ( M_stimulusRadius2 * M_stimulusRadius2 ) ) )
383 if ( (timeReset3 >= M_stimulusStart3 && timeReset3 <= M_stimulusStop3) &&
384 ( ( ( x - M_stimulusCenter3 (0) ) * ( x - M_stimulusCenter3 (0) ) +
385 ( y - M_stimulusCenter3 (1) ) * ( y - M_stimulusCenter3 (1) ) +
386 ( z - M_stimulusCenter3 (2) ) * ( z - M_stimulusCenter3 (2) ) ) <= ( M_stimulusRadius3 * M_stimulusRadius3 ) ) )
395 if ( (timeReset4 >= M_stimulusStart4 && timeReset4 <= M_stimulusStop4) &&
396 ( ( ( x - M_stimulusCenter4 (0) ) * ( x - M_stimulusCenter4 (0) ) +
397 ( y - M_stimulusCenter4 (1) ) * ( y - M_stimulusCenter4 (1) ) +
398 ( z - M_stimulusCenter4 (2) ) * ( z - M_stimulusCenter4 (2) ) ) <= ( M_stimulusRadius4 * M_stimulusRadius4 ) ) )
407 if ( (timeReset5 >= M_stimulusStart5 && timeReset5 <= M_stimulusStop5) &&
408 ( ( ( x - M_stimulusCenter5 (0) ) * ( x - M_stimulusCenter5 (0) ) +
409 ( y - M_stimulusCenter5 (1) ) * ( y - M_stimulusCenter5 (1) ) +
410 ( z - M_stimulusCenter5 (2) ) * ( z - M_stimulusCenter5 (2) ) ) <= ( M_stimulusRadius5 * M_stimulusRadius5 ) ) )
419 if ( (timeReset6 >= M_stimulusStart6 && timeReset6 <= M_stimulusStop6) &&
420 ( ( ( x - M_stimulusCenter6 (0) ) * ( x - M_stimulusCenter6 (0) ) +
421 ( y - M_stimulusCenter6 (1) ) * ( y - M_stimulusCenter6 (1) ) +
422 ( z - M_stimulusCenter6 (2) ) * ( z - M_stimulusCenter6 (2) ) ) <= ( M_stimulusRadius6 * M_stimulusRadius6 ) ) )
431 Real returnValue = returnValue1 + returnValue2 + returnValue3 + returnValue4 + returnValue5 + returnValue6;
457 const Real& sigma)
const 463 return sigma * M_conductivityReduction (id);
479 const Real& sigma )
const 481 Real distance2, distanceX, distanceY, distanceZ;
497 distance2 = std::pow (distanceX, 2) + std::pow (distanceY, 2) + std::pow (distanceZ, 2);
501 return sigma * M_conductivityReduction (id);
518 const Real& sigma )
const 524 return sigma * M_conductivityReduction (id);
563 f = std::bind (&HeartFunctors::setAppliedCurrent,
this, 1, 2, 3, 4 );
571 f = std::bind (&HeartFunctors::setStimulus,
this, 1, 2, 3, 4, 5);
579 f = std::bind (&HeartFunctors::setReducedConductivitySphere,
this, 1, 2, 3, 4, 5, 6);
587 f = std::bind (&HeartFunctors::setReducedConductivityCylinder,
this, 1, 2, 3, 4, 5, 6);
595 f = std::bind (&HeartFunctors::setReducedConductivityBox,
this, 1, 2, 3, 4, 5, 6);
603 f = std::bind (&HeartFunctors::setInitialScalar,
this, 1, 2, 3, 4, 5);
611 f = std::bind (&HeartFunctors::setZeroScalar,
this, 1, 2, 3, 4, 5);
double operator()(const char *VarName, const double &Default, unsigned Idx) const
Real setStimulus(const Real &t, const Real &x, const Real &y, const Real &z, const ID &id) const
double operator()(const char *VarName, const double &Default) const
Real setAppliedCurrentZygote(const double &t, const double &x, const double &y, const double &z, const ID &, const markerID_Type &ref)
Real setInitialScalar(const Real &t, const Real &x, const Real &y, const Real &z, const ID &id)
Real M_ventricularFibrillation
Real M_nb_fibrillationSources
std::function< Real(Real const &x, Real const &y, Real const &z, Real const &, ID const &id, Real const &) > region_Type
ID markerID_Type
markerID_Type is the type used to store the geometric entity marker IDs
void updateInverseJacobian(const UInt &iQuadPt)
const region_Type reducedConductivitySphere()
region1_Type appliedCurrent()
Real setReducedConductivityCylinder(const Real &x, const Real &y, const Real &z, const Real &, const ID &id, const Real &sigma) const
Reduces the conductivity in a cylinder.
std::function< Real(Real const &x, Real const &y, Real const &z, Real const &, ID const &id) > region1_Type
Real M_appliedCurrentRightVentriculeAngle
const region1_Type initialScalar()
Real setAppliedCurrent(const Real &x, const Real &y, const Real &z, const Real &t) const
current volume source
HeartFunctors(GetPot &dataFile)
Real setReducedConductivitySphere(const Real &x, const Real &y, const Real &z, const Real &, const ID &id, const Real &sigma) const
Reduces the conductivity in a sphere.
Real setZeroScalar(const Real &t, const Real &x, const Real &y, const Real &z, const ID &id)
double Real
Generic real data.
int operator()(const char *VarName, int Default) const
Real M_appliedCurrentLeftVentriculeAngle
Real M_appliedCurrentStimulusTimeRightVentricule
const region1_Type zeroScalar()
Real M_appliedCurrentStimulusTimeLeftVentrivcule
const region_Type reducedConductivityBox()
Real M_fibrillationSources
const region_Type reducedConductivityCylinder()
Real setReducedConductivityBox(const Real &x, const Real &y, const Real &z, const Real &, const ID &id, const Real &sigma) const