LCOV - code coverage report
Current view: top level - src/mfem/problem_operators - ComplexEquationSystemProblemOperator.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: fa5e60 Lines: 28 28 100.0 %
Date: 2026-06-24 08:03:36 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          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 "ComplexEquationSystemProblemOperator.h"
      13             : 
      14             : namespace Moose::MFEM
      15             : {
      16             : void
      17          63 : ComplexEquationSystemProblemOperator::SetGridFunctions()
      18             : {
      19          63 :   _trial_var_names = GetEquationSystem()->GetTrialVarNames();
      20          63 :   _test_var_names = GetEquationSystem()->GetTestVarNames();
      21             : 
      22          63 :   _cmplx_trial_variables = _problem_data.cmplx_gridfunctions.Get(_trial_var_names);
      23          63 :   _cmplx_test_variables = _problem_data.cmplx_gridfunctions.Get(_test_var_names);
      24             : 
      25             :   // Set operator size and block structure for trial spaces
      26          63 :   _block_true_offsets_trial.SetSize(_cmplx_trial_variables.size() + 1);
      27          63 :   _block_true_offsets_trial[0] = 0;
      28         105 :   for (const auto ind : index_range(_cmplx_trial_variables))
      29             :   {
      30          42 :     _block_true_offsets_trial[ind + 1] =
      31          42 :         2 * _cmplx_trial_variables.at(ind)->ParFESpace()->TrueVSize();
      32             :   }
      33          63 :   _block_true_offsets_trial.PartialSum();
      34             : 
      35             :   // Set operator size and block structure for test spaces
      36          63 :   _block_true_offsets_test.SetSize(_cmplx_test_variables.size() + 1);
      37          63 :   _block_true_offsets_test[0] = 0;
      38         105 :   for (const auto ind : index_range(_cmplx_test_variables))
      39             :   {
      40          42 :     _block_true_offsets_test[ind + 1] =
      41          42 :         2 * _cmplx_test_variables.at(ind)->ParFESpace()->TrueVSize();
      42             :   }
      43          63 :   _block_true_offsets_test.PartialSum();
      44             : 
      45          63 :   _true_x.Update(_block_true_offsets_trial);
      46          63 :   _true_rhs.Update(_block_true_offsets_test);
      47             : 
      48          63 :   width = _block_true_offsets_trial[_cmplx_trial_variables.size()];
      49          63 :   height = _block_true_offsets_test[_cmplx_test_variables.size()];
      50          63 : }
      51             : 
      52             : void
      53          42 : ComplexEquationSystemProblemOperator::Solve()
      54             : {
      55          42 :   BuildEquationSystemOperator();
      56             : 
      57          42 :   auto * const es = GetEquationSystem();
      58          42 :   SolveWithOperator(*es, _true_rhs, _true_x);
      59             : 
      60          42 :   es->SetTrialVariablesFromTrueVectors(_true_x);
      61          42 : }
      62             : 
      63             : } // namespace Moose::MFEM
      64             : 
      65             : #endif

Generated by: LCOV version 1.14