https://mooseframework.inl.gov
ExternalProblem.C
Go to the documentation of this file.
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 // MOOSE includes
11 #include "ExternalProblem.h"
12 #include "NonlinearSystem.h"
13 #include "AuxiliarySystem.h"
14 
17 {
19  params.set<bool>("skip_nl_system_check") = true;
20 
21  // there is no nonlinear system (we set it as empty in the constructor)
22  params.suppressParameter<bool>("ignore_zeros_in_jacobian");
23  params.suppressParameter<MooseEnum>("kernel_coverage_check");
24  params.suppressParameter<std::vector<NonlinearSystemName>>("nl_sys_names");
25  params.suppressParameter<bool>("previous_nl_solution_required");
26  params.suppressParameter<bool>("skip_nl_system_check");
27  params.suppressParameter<bool>("use_nonlinear");
28 
29  params.addClassDescription("Problem extension point for wrapping external applications");
30  return params;
31 }
32 
34 {
40  if (_num_nl_sys)
41  {
42  _nl[0] = std::make_shared<NonlinearSystem>(*this, "nl0");
44  }
45  _aux = std::make_shared<AuxiliarySystem>(*this, "aux0");
46 
52 
53  // Create extra vectors and matrices if any
55 
56  // Create extra solution vectors if any
58 }
59 
60 void
61 ExternalProblem::solve(const unsigned int)
62 {
63  TIME_SECTION("solve", 1, "Solving", false)
64 
66  externalSolve();
68 }
const std::size_t _num_nl_sys
The number of nonlinear systems.
virtual void newAssemblyArray(std::vector< std::shared_ptr< SolverSystem >> &solver_systems)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< std::shared_ptr< SolverSystem > > _solver_systems
Combined container to base pointer of every solver system.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn&#39;t required or valid in the derived class...
std::vector< std::shared_ptr< NonlinearSystemBase > > _nl
The nonlinear systems.
void createTagSolutions()
Create extra tagged solution vectors.
void createTagVectors()
Create extra tagged vectors and matrices.
virtual void syncSolutions(Direction direction)=0
Method to transfer data to/from the external application to the associated transfer mesh...
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
virtual void solve(unsigned int nl_sys_num=0) override final
Solve is implemented to providing syncing to/from the "transfer" mesh.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
static InputParameters validParams()
ExternalProblem(const InputParameters &parameters)
virtual void externalSolve()=0
New interface for solving an External problem.