13 #include "Adaptivity.h"
14 #include "FEProblem.h"
15 #include "MooseVariable.h"
25 InputParameters params = validParams<MultiAppCopyTransfer>();
26 params.addClassDescription(
"Transfers the mesh from the master application to the sub "
27 "application for the purposes of level set reinitialization problems "
28 "with mesh adaptivity.");
29 params.set<MultiMooseEnum>(
"direction") =
"TO_MULTIAPP";
30 params.suppressParameter<MultiMooseEnum>(
"direction");
32 ExecFlagEnum & exec = params.set<ExecFlagEnum>(
"execute_on");
35 params.set<
bool>(
"check_multiapp_execute_on") =
false;
36 params.suppressParameter<ExecFlagEnum>(
"execute_on");
42 : MultiAppCopyTransfer(parameters)
49 FEProblemBase & from_problem = _multi_app->problemBase();
50 for (
unsigned int i = 0; i < _multi_app->numGlobalApps(); i++)
51 if (_multi_app->hasLocalApp(i))
53 FEProblemBase & to_problem = _multi_app->appProblemBase(i);
54 MooseVariable & to_var = to_problem.getStandardVariable(0, _to_var_name);
55 Adaptivity & adapt = to_problem.adaptivity();
56 adapt.setMarkerVariableName(to_var.name());
57 adapt.setCyclesPerStep(from_problem.adaptivity().getCyclesPerStep());
59 adapt.setUseNewSystem();
60 adapt.setMaxHLevel(from_problem.adaptivity().getMaxHLevel());
61 adapt.setAdaptivityOn(
false);
69 MultiAppCopyTransfer::execute();
73 for (
unsigned int i = 0; i < _multi_app->numGlobalApps(); i++)
74 if (_multi_app->hasLocalApp(i))
76 FEProblemBase & to_problem = _multi_app->appProblemBase(i);
77 Adaptivity & adapt = to_problem.adaptivity();
78 adapt.setAdaptivityOn(
true);
79 to_problem.adaptMesh();
80 adapt.setAdaptivityOn(
false);