37 #include <lifev/multiscale/algorithms/MultiscaleAlgorithmAitken.hpp> 54 #ifdef HAVE_LIFEV_DEBUG 55 debugStream ( 8011 ) <<
"MultiscaleAlgorithmAitken::MultiscaleAlgorithmAitken() \n";
61 M_methodMap[
"Scalar"] = Scalar;
62 M_methodMap[
"Vectorial"] = Vectorial;
73 #ifdef HAVE_LIFEV_DEBUG 74 debugStream ( 8011 ) <<
"MultiscaleAlgorithmAitken::setupData( fileName ) \n";
79 solverParametersList = Teuchos::getParametersFromXmlFile ( fileName );
82 setAlgorithmName ( solverParametersList->sublist (
"Multiscale",
true,
"" ) );
83 setAlgorithmParameters ( solverParametersList->sublist (
"Multiscale Algorithm",
true,
"" ) );
87 MultiscaleAlgorithmAitken::subIterate()
90 #ifdef HAVE_LIFEV_DEBUG 91 debugStream ( 8011 ) <<
"MultiscaleAlgorithmAitken::subIterate() \n";
94 multiscaleAlgorithm_Type::subIterate();
97 if ( checkResidual ( 0 ) )
102 M_multiscale->exportCouplingVariables ( *M_couplingVariables );
104 M_generalizedAitken.restart();
113 for ( UInt subIT = 1; subIT <= M_subiterationsMaximumNumber; ++subIT )
120 *M_couplingVariables += M_generalizedAitken.computeDeltaLambdaScalar ( *M_couplingVariables, *M_couplingResiduals );
126 *M_couplingVariables += M_generalizedAitken.computeDeltaLambdaVector ( *M_couplingVariables, *M_couplingResiduals,
true );
138 M_multiscale->importCouplingVariables ( *M_couplingVariables );
141 if ( checkResidual ( subIT ) )
147 save ( M_subiterationsMaximumNumber, M_couplingResiduals->norm2() );
149 multiscaleErrorCheck ( Tolerance,
"Aitken algorithm residual: " + number2string ( M_couplingResiduals->norm2() ) +
150 " (required: " + number2string ( M_tolerance ) +
")\n", M_multiscale->communicator() == 0 );
154 MultiscaleAlgorithmAitken::showMe()
156 if ( M_comm->MyPID() == 0 )
158 multiscaleAlgorithm_Type::showMe();
160 std::cout <<
"Aitken Method = " << enum2String ( M_method, M_methodMap ) << std::endl;
161 std::cout << std::endl << std::endl;
169 MultiscaleAlgorithmAitken::setAlgorithmParameters (
const multiscaleParameterList_Type& parameterList )
171 multiscaleAlgorithm_Type::setAlgorithmParameters ( parameterList );
173 M_generalizedAitken.setDefaultOmega ( parameterList.get<Real> (
"Omega" ) );
174 M_generalizedAitken.useDefaultOmega ( parameterList.get<
bool> (
"Fixed omega" ) );
175 M_generalizedAitken.setOmegaMin ( parameterList.get<Real> (
"Range minimum" ) );
176 M_generalizedAitken.setOmegaMax ( parameterList.get<Real> (
"Range maximum" ) );
177 M_generalizedAitken.setMinimizationType ( parameterList.get<
bool> (
"Inverse omega" ) );
178 M_method = M_methodMap[ parameterList.get<std::string> (
"Method" ) ];
MultiscaleAlgorithm()
Constructor.
MultiscaleAlgorithmAitken()
Constructor.
MultiscaleAlgorithmAitken - The Multiscale Algorithm implementation of Aitken.
void setupData(const std::string &fileName)
Setup the data of the algorithm using a data file.
MultiscaleAlgorithm multiscaleAlgorithm_Type
LinearSolver::parameterListPtr_Type multiscaleParameterListPtr_Type