Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #ifdef MOOSE_MFEM_ENABLED 11 : 12 : #include "EquationSystemProblemOperator.h" 13 : 14 : namespace Moose::MFEM 15 : { 16 : void 17 1051 : EquationSystemProblemOperator::SetGridFunctions() 18 : { 19 1051 : _trial_var_names = GetEquationSystem()->GetTrialVarNames(); 20 1051 : _test_var_names = GetEquationSystem()->GetTestVarNames(); 21 1051 : ProblemOperator::SetGridFunctions(); 22 1051 : } 23 : 24 : void 25 738 : EquationSystemProblemOperator::Solve() 26 : { 27 738 : BuildEquationSystemOperator(); 28 : 29 738 : if (_problem_data.jacobian_solver->isLOR() && GetEquationSystem()->GetTestVarNames().size() > 1) 30 0 : mooseError("LOR solve is only supported for single-variable systems"); 31 738 : _problem_data.jacobian_solver->updateSolver( 32 738 : *GetEquationSystem()->_blfs.Get(GetEquationSystem()->GetTestVarNames().at(0)), 33 738 : GetEquationSystem()->_ess_tdof_lists.at(0)); 34 : 35 738 : _problem_data.nonlinear_solver->SetPreconditioner(_problem_data.jacobian_solver->getSolver()); 36 738 : _problem_data.nonlinear_solver->SetOperator(*GetEquationSystem()); 37 738 : _problem_data.nonlinear_solver->Mult(_true_rhs, _true_x); 38 : 39 738 : GetEquationSystem()->SetTrialVariablesFromTrueVectors(_true_x); 40 738 : } 41 : 42 : void 43 779 : EquationSystemProblemOperator::BuildEquationSystemOperator() 44 : { 45 779 : GetEquationSystem()->BuildEquationSystem(); 46 779 : GetEquationSystem()->FormSystem(_true_x, _true_rhs); 47 779 : } 48 : 49 : } // namespace Moose::MFEM 50 : 51 : #endif