37 #include <lifev/multiscale/algorithms/MultiscaleAlgorithmNewton.hpp> 53 #ifdef HAVE_LIFEV_DEBUG 54 debugStream ( 8013 ) <<
"MultiscaleAlgorithmNewton::MultiscaleAlgorithmNewton() \n";
67 #ifdef HAVE_LIFEV_DEBUG 68 debugStream ( 8013 ) <<
"MultiscaleAlgorithmNewton::setupData( fileName ) \n";
73 solverParametersList = Teuchos::getParametersFromXmlFile ( fileName );
76 setAlgorithmName ( solverParametersList->sublist (
"Multiscale",
true,
"" ) );
77 setAlgorithmParameters ( solverParametersList->sublist (
"Multiscale Algorithm",
true,
"" ) );
80 M_solver.setCommunicator ( M_comm );
81 M_solver.setParameters ( solverParametersList->sublist (
"Linear Solver List",
true,
"" ) );
85 MultiscaleAlgorithmNewton::subIterate()
88 #ifdef HAVE_LIFEV_DEBUG 89 debugStream ( 8013 ) <<
"MultiscaleAlgorithmNewton::subIterate() \n";
92 multiscaleAlgorithm_Type::subIterate();
95 if ( checkResidual ( 0 ) )
100 M_multiscale->exportCouplingVariables ( *M_couplingVariables );
102 multiscaleVectorPtr_Type delta (
new multiscaleVector_Type ( *M_couplingResiduals, Unique ) );
105 for ( UInt subIT (1); subIT <= M_subiterationsMaximumNumber; ++subIT )
108 assembleJacobianMatrix();
111 M_solver.setOperator ( M_jacobian );
112 M_solver.setRightHandSide ( M_couplingResiduals );
115 M_solver.solve ( delta );
121 *M_couplingVariables += *delta;
124 M_multiscale->importCouplingVariables ( *M_couplingVariables );
127 if ( checkResidual ( subIT ) )
133 save ( M_subiterationsMaximumNumber, M_couplingResiduals->norm2() );
135 multiscaleErrorCheck ( Tolerance,
"Newton algorithm residual: " + number2string ( M_couplingResiduals->norm2() ) +
136 " (required: " + number2string ( M_tolerance ) +
")\n", M_multiscale->communicator() == 0 );
143 MultiscaleAlgorithmNewton::assembleJacobianMatrix()
146 M_jacobian.reset (
new multiscaleMatrix_Type ( M_couplingVariables->map(), 50 ) );
147 M_multiscale->exportJacobian ( *M_jacobian );
148 M_jacobian->globalAssemble();
MultiscaleAlgorithm()
Constructor.
multiscaleMatrixPtr_Type M_jacobian
MultiscaleAlgorithmNewton()
Constructor.
MultiscaleAlgorithmNewton - The Multiscale Algorithm implementation of Newton.
void setupData(const std::string &fileName)
Setup the data of the algorithm using a data file.
MultiscaleAlgorithm multiscaleAlgorithm_Type
LinearSolver::parameterListPtr_Type multiscaleParameterListPtr_Type