21 "multiapps",
"Name(s) of the multiapps providing the positions");
22 params.
addParam<
bool>(
"use_apps_centroid",
24 "Whether to use the mesh centroid offset by the app position rather than " 25 "just the position of each child app");
30 params.
set<
bool>(
"auto_sort") =
false;
32 params.
set<
bool>(
"auto_broadcast") =
false;
35 "Obtain positions from MultiApps. This may only be used to set the positions of those same " 36 "multiapps if an 'initial_positions' parameter is used.");
41 :
Positions(parameters), _use_apps_centroid(getParam<bool>(
"use_apps_centroid"))
53 const auto & multiapps = getParam<std::vector<MultiAppName>>(
"multiapps");
58 const std::string & multiapp_name = multiapps[m_it];
61 for (
const auto & i_global :
make_range(multiapp->numGlobalApps()))
63 const auto p = multiapp->position(i_global);
73 if (!multiapp->hasLocalApp(i_global))
75 auto & fe_problem_base = multiapp->appProblemBase(i_global);
76 const MeshBase &
mesh = (getParam<bool>(
"use_displaced_mesh") &&
77 fe_problem_base.getDisplacedProblem().get() != NULL)
78 ? fe_problem_base.getDisplacedProblem()->mesh().getMesh()
79 : fe_problem_base.mesh().getMesh();
83 if (multiapp->isFirstLocalRank())
A MultiMooseEnum object to hold "execute_on" flags.
static InputParameters validParams()
void clearPositions()
Clear all positions vectors.
Positions objects are under the hood Reporters.
registerMooseObject("MooseApp", MultiAppPositions)
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
bool _initialized
Whether the positions object has been initialized. This must be set by derived objects.
std::vector< std::vector< Point > > _positions_2d
2D storage for all the positions
std::vector< Point > & _positions
For now, only the 1D vector will be shared across all ranks.
void initialize() override
In charge of computing / loading the positions.
bool _need_broadcast
Whether generation of positions is distributed or not (and therefore needs a broadcast) ...
const bool _use_apps_centroid
Whether to use the subapp mesh centroids to compute the positions, further translated by the position...
Positions from all the MultiApps.
static InputParameters validParams()
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
IntRange< T > make_range(T beg, T end)
Point meshCentroidCalculator(const MeshBase &mesh)
Calculates the centroid of a MeshBase.
auto index_range(const T &sizable)
const ExecFlagType EXEC_INITIAL
MultiAppPositions(const InputParameters ¶meters)