-
Notifications
You must be signed in to change notification settings - Fork 1k
/
ExternalProblem.C
52 lines (45 loc) · 1.55 KB
/
ExternalProblem.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
// MOOSE includes
#include "ExternalProblem.h"
#include "NonlinearSystem.h"
#include "AuxiliarySystem.h"
template <>
InputParameters
validParams<ExternalProblem>()
{
InputParameters params = validParams<FEProblemBase>();
params.set<bool>("skip_nl_system_check") = true;
params.addClassDescription("Problem extension point for wrapping external applications");
return params;
}
ExternalProblem::ExternalProblem(const InputParameters & parameters) : FEProblemBase(parameters)
{
/**
* Ideally the nonlinear system should not exist since we won't ever use it or call solve on it.
* However, MOOSE currently expects it to exist in several locations throughout the framework.
* Luckily, it can just be empty (no variables).
*/
_nl = std::make_shared<NonlinearSystem>(*this, "nl0");
_aux = std::make_shared<AuxiliarySystem>(*this, "aux0");
/**
* We still need to create Assembly objects to hold the data structures for working with Aux
* Variables, which will be used in the external problem.
*/
newAssemblyArray(*_nl);
// Create etra vectors and matrices if any
CreateTagVectors();
}
void
ExternalProblem::solve()
{
syncSolutions(Direction::TO_EXTERNAL_APP);
externalSolve();
syncSolutions(Direction::FROM_EXTERNAL_APP);
}