https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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");
43 _solver_systems[0] = std::dynamic_pointer_cast<SolverSystem>(_nl[0]);
44 }
45 _aux = std::make_shared<AuxiliarySystem>(*this, "aux0");
46
47 // Set the current nonlinear system to the null system we created.
49
55
56 // Create extra vectors and matrices if any
58
59 // Create extra solution vectors if any
61}
62
63void
64ExternalProblem::solve(const unsigned int)
65{
66 TIME_SECTION("solve", 1, "Solving", false)
67
69 if (shouldSolve())
72}
static InputParameters validParams()
virtual void syncSolutions(Direction direction)=0
Method to transfer data to/from the external application to the associated transfer mesh.
virtual void externalSolve()=0
New interface for solving an External problem.
ExternalProblem(const InputParameters &parameters)
virtual void solve(unsigned int nl_sys_num=0) override final
Solve is implemented to providing syncing to/from the "transfer" mesh.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
void createTagVectors()
Create extra tagged vectors and matrices.
bool shouldSolve() const
virtual void newAssemblyArray(std::vector< std::shared_ptr< SolverSystem > > &solver_systems)
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
const std::size_t _num_nl_sys
The number of nonlinear systems.
std::vector< std::shared_ptr< NonlinearSystemBase > > _nl
The nonlinear systems.
void createTagSolutions()
Create extra tagged solution vectors.
std::vector< std::shared_ptr< SolverSystem > > _solver_systems
Combined container to base pointer of every solver system.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn't required or valid in the derived class...
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.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55