Commit 4e7a03ed authored by thomaskummer's avatar thomaskummer
Browse files

intrepid lifev update

parent 2fc57e9c
......@@ -127,7 +127,7 @@ int main (int argc, char** argv)
//============================================//
// Declare communicator and solver
// Communicator and displayer
//============================================//
#ifdef HAVE_MPI
......@@ -139,8 +139,34 @@ int main (int argc, char** argv)
Displayer displayer ( comm );
displayer.leaderPrint ("\nUsing MPI\n");
EMSolver<mesh_Type, monodomain_Type> solver(comm);
//============================================//
// Electromechanic solver
//============================================//
EMSolver<mesh_Type, monodomain_Type> solver(comm);
//============================================//
// Body circulation
//============================================//
const std::string circulationInputFile = command_line.follow ("circulation", 2, "-cif", "--cifile");
const std::string circulationOutputFile = command_line.follow ( (problemFolder + "solution.dat").c_str(), 2, "-cof", "--cofile");
Circulation circulationSolver( circulationInputFile );
// Flow rate between two vertices
auto Q = [&circulationSolver] (const std::string& N1, const std::string& N2) { return circulationSolver.solution ( std::vector<std::string> {N1, N2} ); };
auto p = [&circulationSolver] (const std::string& N1) { return circulationSolver.solution ( N1 ); };
//============================================//
// Heart solver
//============================================//
HeartSolver<mesh_Type>> heartSolver (solver, circulationSolver);
//============================================//
// Read data file and create output folder
......@@ -277,20 +303,6 @@ int main (int argc, char** argv)
function_Type stim = &Iapp;
//============================================//
// Body circulation
//============================================//
const std::string circulationInputFile = command_line.follow ("circulation", 2, "-cif", "--cifile");
const std::string circulationOutputFile = command_line.follow ( (problemFolder + "solution.dat").c_str(), 2, "-cof", "--cofile");
Circulation circulationSolver( circulationInputFile );
// Flow rate between two vertices
auto Q = [&circulationSolver] (const std::string& N1, const std::string& N2) { return circulationSolver.solution ( std::vector<std::string> {N1, N2} ); };
auto p = [&circulationSolver] (const std::string& N1) { return circulationSolver.solution ( N1 ); };
//============================================//
// Kept-normal boundary conditions
//============================================//
......@@ -425,7 +437,6 @@ int main (int argc, char** argv)
//============================================//
// Set variables and functions
//============================================//
HeartSolver<EMSolver<mesh_Type, monodomain_Type>, Circulation> heartSolver (solver, circulationSolver);
Real dt_activation = solver.data().electroParameter<Real>("timestep");
Real dt_loadstep = dataFile ( "solid/time_discretization/dt_loadstep", 1.0 );
......
......@@ -51,6 +51,37 @@ protected:
Real patchForce (const Real& t, const Real& Tmax, const Real& tmax, const Real& tduration) const
{
bool time ( fmod(t-tmax+0.5*tduration, 700.) < tduration && fmod(t-tmax+0.5*tduration, 700.) > 0);
Real force = std::pow( std::sin(fmod(t-tmax+0.5*tduration, 700.)*3.14159265359/tduration) , 2 ) * Tmax;
return ( time ? force : 0 );
}
Real patchFunction (const Real& t, const Real& X, const Real& Y, const Real& Z, const ID& /*i*/) const
{
Real disp = std::pow( std::sin(fmod(t, 700.) * 3.14159265359/300) , 2 )*15;
return disp;
}
Real Iapp (const Real& t, const Real& X, const Real& Y, const Real& Z, const ID& /*i*/) const
{
bool coords ( Y < -7. );
//bool coords ( Y > 4. ); //( Y > 1.5 && Y < 3 );
bool time ( fmod(t, 700.) < 4 && fmod(t, 700.) > 2);
return ( coords && time ? 30 : 0 );
}
Real potentialMultiplyerFcn (const Real& t, const Real& X, const Real& Y, const Real& Z, const ID& /*i*/) const
{
bool time ( fmod(t, 700.) < 4 && fmod(t, 700.) > 2);
return 1.4 * time; // ( Y < 2.5 && Y > 0.5 ? 1.0 : 0.0 );
}
Real
externalPower ( const VectorEpetra& dispCurrent,
const VectorEpetra& dispPrevious,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment