Commit 96940424 authored by thomaskummer's avatar thomaskummer
Browse files

cervin lifev update

parent aa2ff472
......@@ -554,8 +554,7 @@ int main (int argc, char** argv)
std::vector<double> bcValues { p ( "lv" ) , p ( "rv") };
std::vector<double> bcValuesPre ( bcValues );
VectorSmall<4> ABdplv, ABdprv, ABcoef;
ABcoef (0) = 55/24; ABcoef (1) = -59/24; ABcoef (2) = 37/24; ABcoef (3) = -3/8;
VectorSmall<4> ABdplv, ABdprv;
VectorSmall<2> VCirc, VCircNew, VCircPert, VFe, VFeNew, VFePert, R, dp;
MatrixSmall<2,2> JFe, JCirc, JR;
......@@ -799,20 +798,8 @@ int main (int argc, char** argv)
// 4th order Adam-Bashforth pressure extrapol.
//============================================//
for ( unsigned int i = ABcoef.size() - 1; i > 0; --i )
{
ABdplv(i) = ABdplv(i-1);
ABdprv(i) = ABdprv(i-1);
}
ABdplv(0) = bcValues[0] - bcValuesPre[0];
ABdprv(0) = bcValues[1] - bcValuesPre[1];
bcValuesPre = bcValues;
bcValues[0] += std::min( std::max( ABcoef.dot( ABdplv ) , - dpMax ) , dpMax );
bcValues[1] += std::min( std::max( ABcoef.dot( ABdprv ) , - dpMax ) , dpMax );
heartSolver.extrapolate4thOrderAdamBashforth(bcValues, bcValuesPre, ABdplv, ABdprv, dpMax);
if ( 0 == comm->MyPID() )
{
std::cout << "\n***************************************************************";
......
......@@ -145,6 +145,26 @@ public:
M_circulationSolver.restartFromFile ( restartDir + "solution.dat" , nIter );
}
template<class bcVectorType>
void extrapolate4thOrderAdamBashforth(bcVectorType& bcValues, bcVectorType& bcValuesPre, VectorSmall<4>& ABdplv, VectorSmall<4>& ABdprv, const Real& dpMax)
{
VectorSmall<4> ABcoef;
ABcoef (0) = 55/24; ABcoef (1) = -59/24; ABcoef (2) = 37/24; ABcoef (3) = -3/8;
for ( unsigned int i = ABcoef.size() - 1; i > 0; --i )
{
ABdplv(i) = ABdplv(i-1);
ABdprv(i) = ABdprv(i-1);
}
ABdplv(0) = bcValues[0] - bcValuesPre[0];
ABdprv(0) = bcValues[1] - bcValuesPre[1];
bcValuesPre = bcValues;
bcValues[0] += std::min( std::max( ABcoef.dot( ABdplv ) , - dpMax ) , dpMax );
bcValues[1] += std::min( std::max( ABcoef.dot( ABdprv ) , - dpMax ) , dpMax );
}
protected:
......@@ -159,9 +179,9 @@ protected:
VectorSmall<2> M_pressure;
VectorSmall<2> M_volume;
std::string pipeToString ( const char* command )
{
FILE* file = popen( command, "r" ) ;
......
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