www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MultiAppNearestNodeTransfer Class Reference

Copy the value to the target domain from the nearest node in the source domain. More...

#include <MultiAppNearestNodeTransfer.h>

Inheritance diagram for MultiAppNearestNodeTransfer:
[legend]

Public Types

enum  DIRECTION { TO_MULTIAPP, FROM_MULTIAPP }
 

Public Member Functions

 MultiAppNearestNodeTransfer (const InputParameters &parameters)
 
virtual void initialSetup () override
 Method called at the beginning of the simulation for checking integrity or doing one-time setup. More...
 
virtual void execute () override
 Execute the transfer. More...
 
int direction ()
 The direction this Transfer is going in. More...
 
void variableIntegrityCheck (const AuxVariableName &var_name) const
 Utility to verify that the vEariable in the destination system exists. More...
 
const std::shared_ptr< MultiAppgetMultiApp () const
 Return the MultiApp that this transfer belongs to. More...
 
virtual const std::vector< ExecFlagType > & execFlags () const
 Return the execution flags, handling "same_as_multiapp". More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. More...
 
template<typename... Args>
void mooseError (Args &&...args) const
 
template<typename... Args>
void mooseWarning (Args &&...args) const
 
template<typename... Args>
void mooseDeprecated (Args &&...args) const
 
template<typename... Args>
void mooseInfo (Args &&...args) const
 
virtual void timestepSetup ()
 Gets called at the beginning of the timestep before this object is asked to do its job. More...
 
virtual void jacobianSetup ()
 Gets called just before the Jacobian is computed and before this object is asked to do its job. More...
 
virtual void residualSetup ()
 Gets called just before the residual is computed and before this object is asked to do its job. More...
 
virtual void subdomainSetup ()
 Gets called when the subdomain changes (i.e. More...
 
ExecFlagType execBitFlags () const
 Build and return the execution flags as a bitfield. More...
 

Static Public Member Functions

static MooseEnum directions ()
 Used to construct InputParameters. More...
 
static System * find_sys (EquationSystems &es, const std::string &var_name)
 Small helper function for finding the system containing the variable. More...
 
static MultiMooseEnum getExecuteOptions ()
 Returns the available options for the 'execute_on' input parameters. More...
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Static Public Attributes

static const Number OutOfMeshValue = -999999
 

Protected Member Functions

Node * getNearestNode (const Point &p, Real &distance, MooseMesh *mesh, bool local)
 Return the nearest node to the point p. More...
 
Real bboxMaxDistance (Point p, BoundingBox bbox)
 Return the distance between the given point and the farthest corner of the given bounding box. More...
 
Real bboxMinDistance (Point p, BoundingBox bbox)
 Return the distance between the given point and the nearest corner of the given bounding box. More...
 
void getLocalNodes (MooseMesh *mesh, std::vector< Node * > &local_nodes)
 
void getAppInfo ()
 This method will fill information into the convenience member variables (_to_problems, _from_meshes, etc.) More...
 
std::vector< BoundingBox > getFromBoundingBoxes ()
 Return the bounding boxes of all the "from" domains, including all the domains not local to this processor. More...
 
std::vector< unsigned int > getFromsPerProc ()
 Return the number of "from" domains that each processor owns. More...
 
NumericVector< Real > & getTransferVector (unsigned int i_local, std::string var_name)
 If we are transferring to a multiapp, return the appropriate solution vector. More...
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 

Protected Attributes

AuxVariableName _to_var_name
 
VariableName _from_var_name
 
bool _fixed_meshes
 If true then node connections will be cached. More...
 
std::map< dof_id_type, Node * > & _node_map
 Used to cache nodes. More...
 
std::map< dof_id_type, Real > & _distance_map
 Used to cache distances. More...
 
bool & _neighbors_cached
 
std::vector< std::vector< unsigned int > > & _cached_froms
 
std::vector< std::vector< dof_id_type > > & _cached_dof_ids
 
std::map< dof_id_type, unsigned int > & _cached_from_inds
 
std::map< dof_id_type, unsigned int > & _cached_qp_inds
 
std::shared_ptr< MultiApp_multi_app
 The MultiApp this Transfer is transferring data to or from. More...
 
MooseEnum _direction
 Whether we're transferring to or from the MultiApp. More...
 
std::vector< FEProblemBase * > _to_problems
 
std::vector< FEProblemBase * > _from_problems
 
std::vector< EquationSystems * > _to_es
 
std::vector< EquationSystems * > _from_es
 
std::vector< MooseMesh * > _to_meshes
 
std::vector< MooseMesh * > _from_meshes
 
std::vector< Point > _to_positions
 
std::vector< Point > _from_positions
 
bool _displaced_source_mesh
 
bool _displaced_target_mesh
 
std::vector< unsigned int > _local2global_map
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
THREAD_ID _tid
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 
std::vector< ExecFlagType_exec_flags
 execution flag (when is the object executed/evaluated) More...
 
const ExecFlagType_current_execute_flag
 Reference to FEProblemBase. More...
 

Detailed Description

Copy the value to the target domain from the nearest node in the source domain.

Definition at line 30 of file MultiAppNearestNodeTransfer.h.

Member Enumeration Documentation

Enumerator
TO_MULTIAPP 
FROM_MULTIAPP 

Definition at line 46 of file MultiAppTransfer.h.

Constructor & Destructor Documentation

MultiAppNearestNodeTransfer::MultiAppNearestNodeTransfer ( const InputParameters parameters)

Definition at line 60 of file MultiAppNearestNodeTransfer.C.

61  : MultiAppTransfer(parameters),
62  _to_var_name(getParam<AuxVariableName>("variable")),
63  _from_var_name(getParam<VariableName>("source_variable")),
64  _fixed_meshes(getParam<bool>("fixed_meshes")),
65  _node_map(declareRestartableData<std::map<dof_id_type, Node *>>("node_map")),
66  _distance_map(declareRestartableData<std::map<dof_id_type, Real>>("distance_map")),
67  _neighbors_cached(declareRestartableData<bool>("neighbors_cached", false)),
68  _cached_froms(declareRestartableData<std::vector<std::vector<unsigned int>>>("cached_froms")),
70  declareRestartableData<std::vector<std::vector<dof_id_type>>>("cached_dof_ids")),
72  declareRestartableData<std::map<dof_id_type, unsigned int>>("cached_from_ids")),
73  _cached_qp_inds(declareRestartableData<std::map<dof_id_type, unsigned int>>("cached_qp_inds"))
74 {
75  // This transfer does not work with DistributedMesh
76  _displaced_source_mesh = getParam<bool>("displaced_source_mesh");
77  _displaced_target_mesh = getParam<bool>("displaced_target_mesh");
78 }
MultiAppTransfer(const InputParameters &parameters)
Here we need to remove the special option that indicates to the user that this object will follow it&#39;...
std::vector< std::vector< dof_id_type > > & _cached_dof_ids
std::map< dof_id_type, unsigned int > & _cached_from_inds
std::map< dof_id_type, Real > & _distance_map
Used to cache distances.
std::map< dof_id_type, unsigned int > & _cached_qp_inds
std::map< dof_id_type, Node * > & _node_map
Used to cache nodes.
std::vector< std::vector< unsigned int > > & _cached_froms
bool _fixed_meshes
If true then node connections will be cached.
T & declareRestartableData(std::string data_name)
Declare a piece of data as "restartable".
Definition: Restartable.h:224

Member Function Documentation

Real MultiAppNearestNodeTransfer::bboxMaxDistance ( Point  p,
BoundingBox  bbox 
)
protected

Return the distance between the given point and the farthest corner of the given bounding box.

Parameters
pThe point to evaluate all distances from.
bboxThe bounding box to evaluate the distance to.
Returns
The maximum distance between the point p and the eight corners of the bounding box bbox.

Definition at line 588 of file MultiAppNearestNodeTransfer.C.

Referenced by execute().

589 {
590  std::vector<Point> source_points = {bbox.first, bbox.second};
591 
592  std::vector<Point> all_points(8);
593  for (unsigned int x = 0; x < 2; x++)
594  for (unsigned int y = 0; y < 2; y++)
595  for (unsigned int z = 0; z < 2; z++)
596  all_points[x + 2 * y + 4 * z] =
597  Point(source_points[x](0), source_points[y](1), source_points[z](2));
598 
599  Real max_distance = 0.;
600 
601  for (unsigned int i = 0; i < 8; i++)
602  {
603  Real distance = (p - all_points[i]).norm();
604  if (distance > max_distance)
605  max_distance = distance;
606  }
607  return max_distance;
608 }
static PetscErrorCode Vec x
Real MultiAppNearestNodeTransfer::bboxMinDistance ( Point  p,
BoundingBox  bbox 
)
protected

Return the distance between the given point and the nearest corner of the given bounding box.

Parameters
pThe point to evaluate all distances from.
bboxThe bounding box to evaluate the distance to.
Returns
The minimum distance between the point p and the eight corners of the bounding box bbox.

Definition at line 611 of file MultiAppNearestNodeTransfer.C.

Referenced by execute().

612 {
613  std::vector<Point> source_points = {bbox.first, bbox.second};
614 
615  std::vector<Point> all_points(8);
616  for (unsigned int x = 0; x < 2; x++)
617  for (unsigned int y = 0; y < 2; y++)
618  for (unsigned int z = 0; z < 2; z++)
619  all_points[x + 2 * y + 4 * z] =
620  Point(source_points[x](0), source_points[y](1), source_points[z](2));
621 
622  Real min_distance = 0.;
623 
624  for (unsigned int i = 0; i < 8; i++)
625  {
626  Real distance = (p - all_points[i]).norm();
627  if (distance < min_distance)
628  min_distance = distance;
629  }
630  return min_distance;
631 }
static PetscErrorCode Vec x
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 224 of file Restartable.h.

225 {
226  return declareRestartableDataWithContext<T>(data_name, NULL);
227 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 231 of file Restartable.h.

232 {
233  return declareRestartableDataWithContext<T>(data_name, init_value, NULL);
234 }
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 238 of file Restartable.h.

239 {
241  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
242 
243  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
244  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
245 
247 
248  return data_ptr->get();
249 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
258  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
259 
260  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
261  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
262 
263  data_ptr->set() = init_value;
264 
266 
267  return data_ptr->get();
268 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
int MultiAppTransfer::direction ( )
inlineinherited

The direction this Transfer is going in.

Definition at line 56 of file MultiAppTransfer.h.

56 { return _direction; }
MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
static MooseEnum MultiAppTransfer::directions ( )
inlinestaticinherited

Used to construct InputParameters.

Definition at line 53 of file MultiAppTransfer.h.

Referenced by validParams< MultiAppTransfer >().

53 { return MooseEnum("to_multiapp from_multiapp"); }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
virtual bool MooseObject::enabled ( )
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 77 of file MooseObject.h.

Referenced by EigenKernel::enabled().

77 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:117
ExecFlagType SetupInterface::execBitFlags ( ) const
inherited

Build and return the execution flags as a bitfield.

Definition at line 100 of file SetupInterface.C.

Referenced by EigenExecutionerBase::init().

101 {
102  unsigned int exec_bit_field = EXEC_NONE;
103  for (unsigned int i = 0; i < _exec_flags.size(); ++i)
104  exec_bit_field |= _exec_flags[i];
105 
106  return static_cast<ExecFlagType>(exec_bit_field);
107 }
std::vector< ExecFlagType > _exec_flags
execution flag (when is the object executed/evaluated)
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
const std::vector< ExecFlagType > & MultiAppTransfer::execFlags ( ) const
virtualinherited

Return the execution flags, handling "same_as_multiapp".

Reimplemented from SetupInterface.

Definition at line 97 of file MultiAppTransfer.C.

Referenced by MultiAppTransfer::getMultiApp(), and MultiAppTransfer::MultiAppTransfer().

98 {
99  if (Transfer::execFlags().empty())
100  return _multi_app->execFlags();
101  else
102  return Transfer::execFlags();
103 }
virtual const std::vector< ExecFlagType > & execFlags() const
Get the execution flag for the object.
std::shared_ptr< MultiApp > _multi_app
The MultiApp this Transfer is transferring data to or from.
void MultiAppNearestNodeTransfer::execute ( )
overridevirtual

Execute the transfer.

Implements Transfer.

Definition at line 90 of file MultiAppNearestNodeTransfer.C.

91 {
92  _console << "Beginning NearestNodeTransfer " << name() << std::endl;
93 
94  getAppInfo();
95 
96  // Get the bounding boxes for the "from" domains.
97  std::vector<BoundingBox> bboxes = getFromBoundingBoxes();
98 
99  // Figure out how many "from" domains each processor owns.
100  std::vector<unsigned int> froms_per_proc = getFromsPerProc();
101 
103  // For every point in the local "to" domain, figure out which "from" domains
104  // might contain it's nearest neighbor, and send that point to the processors
105  // that own those "from" domains.
106  //
107  // How do we know which "from" domains might contain the nearest neighbor, you
108  // ask? Well, consider two "from" domains, A and B. If every point in A is
109  // closer than every point in B, then we know that B cannot possibly contain
110  // the nearest neighbor. Hence, we'll only check A for the nearest neighbor.
111  // We'll use the functions bboxMaxDistance and bboxMinDistance to figure out
112  // if every point in A is closer than every point in B.
114 
115  // outgoing_qps = nodes/centroids we'll send to other processors.
116  std::vector<std::vector<Point>> outgoing_qps(n_processors());
117  // When we get results back, node_index_map will tell us which results go with
118  // which points
119  std::vector<std::map<std::pair<unsigned int, unsigned int>, unsigned int>> node_index_map(
120  n_processors());
121 
122  if (!_neighbors_cached)
123  {
124  for (unsigned int i_to = 0; i_to < _to_problems.size(); i_to++)
125  {
126  System * to_sys = find_sys(*_to_es[i_to], _to_var_name);
127  unsigned int sys_num = to_sys->number();
128  unsigned int var_num = to_sys->variable_number(_to_var_name);
129  MeshBase * to_mesh = &_to_meshes[i_to]->getMesh();
130  bool is_nodal = to_sys->variable_type(var_num).family == LAGRANGE;
131 
132  if (is_nodal)
133  {
134  std::vector<Node *> target_local_nodes;
135 
136  if (isParamValid("target_boundary"))
137  {
138  BoundaryID target_bnd_id =
139  _to_meshes[i_to]->getBoundaryID(getParam<BoundaryName>("target_boundary"));
140 
141  ConstBndNodeRange & bnd_nodes = *(_to_meshes[i_to])->getBoundaryNodeRange();
142  for (const auto & bnode : bnd_nodes)
143  if (bnode->_bnd_id == target_bnd_id && bnode->_node->processor_id() == processor_id())
144  target_local_nodes.push_back(bnode->_node);
145  }
146  else
147  {
148  target_local_nodes.resize(to_mesh->n_local_nodes());
149  MeshBase::const_node_iterator nodes_begin = to_mesh->local_nodes_begin();
150  MeshBase::const_node_iterator nodes_end = to_mesh->local_nodes_end();
151 
152  unsigned int i = 0;
153  for (MeshBase::const_node_iterator nodes_it = nodes_begin; nodes_it != nodes_end;
154  ++nodes_it, ++i)
155  target_local_nodes[i] = *nodes_it;
156  }
157 
158  for (const auto & node : target_local_nodes)
159  {
160  // Skip this node if the variable has no dofs at it.
161  if (node->n_dofs(sys_num, var_num) < 1)
162  continue;
163 
164  // Find which bboxes might have the nearest node to this point.
165  Real nearest_max_distance = std::numeric_limits<Real>::max();
166  for (const auto & bbox : bboxes)
167  {
168  Real distance = bboxMaxDistance(*node, bbox);
169  if (distance < nearest_max_distance)
170  nearest_max_distance = distance;
171  }
172 
173  unsigned int from0 = 0;
174  for (processor_id_type i_proc = 0; i_proc < n_processors();
175  from0 += froms_per_proc[i_proc], i_proc++)
176  {
177  bool qp_found = false;
178  for (unsigned int i_from = from0; i_from < from0 + froms_per_proc[i_proc] && !qp_found;
179  i_from++)
180  {
181  Real distance = bboxMinDistance(*node, bboxes[i_from]);
182  if (distance < nearest_max_distance || bboxes[i_from].contains_point(*node))
183  {
184  std::pair<unsigned int, unsigned int> key(i_to, node->id());
185  node_index_map[i_proc][key] = outgoing_qps[i_proc].size();
186  outgoing_qps[i_proc].push_back(*node + _to_positions[i_to]);
187  qp_found = true;
188  }
189  }
190  }
191  }
192  }
193  else // Elemental
194  {
195  MeshBase::const_element_iterator elem_it = to_mesh->local_elements_begin();
196  MeshBase::const_element_iterator elem_end = to_mesh->local_elements_end();
197 
198  for (; elem_it != elem_end; ++elem_it)
199  {
200  Elem * elem = *elem_it;
201 
202  Point centroid = elem->centroid();
203 
204  // Skip this element if the variable has no dofs at it.
205  if (elem->n_dofs(sys_num, var_num) < 1)
206  continue;
207 
208  // Find which bboxes might have the nearest node to this point.
209  Real nearest_max_distance = std::numeric_limits<Real>::max();
210  for (const auto & bbox : bboxes)
211  {
212  Real distance = bboxMaxDistance(centroid, bbox);
213  if (distance < nearest_max_distance)
214  nearest_max_distance = distance;
215  }
216 
217  unsigned int from0 = 0;
218  for (processor_id_type i_proc = 0; i_proc < n_processors();
219  from0 += froms_per_proc[i_proc], i_proc++)
220  {
221  bool qp_found = false;
222  for (unsigned int i_from = from0; i_from < from0 + froms_per_proc[i_proc] && !qp_found;
223  i_from++)
224  {
225  Real distance = bboxMinDistance(centroid, bboxes[i_from]);
226  if (distance < nearest_max_distance || bboxes[i_from].contains_point(centroid))
227  {
228  std::pair<unsigned int, unsigned int> key(i_to, elem->id());
229  node_index_map[i_proc][key] = outgoing_qps[i_proc].size();
230  outgoing_qps[i_proc].push_back(centroid + _to_positions[i_to]);
231  qp_found = true;
232  }
233  }
234  }
235  }
236  }
237  }
238  }
239 
241  // Send local node/centroid positions off to the other processors and take
242  // care of points sent to this processor. We'll need to check the points
243  // against all of the "from" domains that this processor owns. For each
244  // point, we'll find the nearest node, then we'll send the value at that node
245  // and the distance between the node and the point back to the processor that
246  // requested that point.
248 
249  std::vector<std::vector<Real>> incoming_evals(n_processors());
250  std::vector<Parallel::Request> send_qps(n_processors());
251  std::vector<Parallel::Request> send_evals(n_processors());
252 
253  // Create these here so that they live the entire life of this function
254  // and are NOT reused per processor.
255  std::vector<std::vector<Real>> processor_outgoing_evals(n_processors());
256 
257  if (!_neighbors_cached)
258  {
259  for (processor_id_type i_proc = 0; i_proc < n_processors(); i_proc++)
260  {
261  if (i_proc == processor_id())
262  continue;
263  _communicator.send(i_proc, outgoing_qps[i_proc], send_qps[i_proc]);
264  }
265 
266  // Build an array of pointers to all of this processor's local nodes. We
267  // need to do this to avoid the expense of using LibMesh iterators. This
268  // step also takes care of limiting the search to boundary nodes, if
269  // applicable.
270  std::vector<std::vector<Node *>> local_nodes(froms_per_proc[processor_id()]);
271  for (unsigned int i = 0; i < froms_per_proc[processor_id()]; i++)
272  {
273  getLocalNodes(_from_meshes[i], local_nodes[i]);
274  }
275 
276  if (_fixed_meshes)
277  {
278  _cached_froms.resize(n_processors());
279  _cached_dof_ids.resize(n_processors());
280  }
281 
282  for (processor_id_type i_proc = 0; i_proc < n_processors(); i_proc++)
283  {
284  std::vector<Point> incoming_qps;
285  if (i_proc == processor_id())
286  incoming_qps = outgoing_qps[i_proc];
287  else
288  _communicator.receive(i_proc, incoming_qps);
289 
290  if (_fixed_meshes)
291  {
292  _cached_froms[i_proc].resize(incoming_qps.size());
293  _cached_dof_ids[i_proc].resize(incoming_qps.size());
294  }
295 
296  std::vector<Real> & outgoing_evals = processor_outgoing_evals[i_proc];
297  outgoing_evals.resize(2 * incoming_qps.size());
298 
299  for (unsigned int qp = 0; qp < incoming_qps.size(); qp++)
300  {
301  Point qpt = incoming_qps[qp];
302  outgoing_evals[2 * qp] = std::numeric_limits<Real>::max();
303  for (unsigned int i_local_from = 0; i_local_from < froms_per_proc[processor_id()];
304  i_local_from++)
305  {
306  MooseVariable & from_var = _from_problems[i_local_from]->getVariable(0, _from_var_name);
307  System & from_sys = from_var.sys().system();
308  unsigned int from_sys_num = from_sys.number();
309  unsigned int from_var_num = from_sys.variable_number(from_var.name());
310 
311  for (unsigned int i_node = 0; i_node < local_nodes[i_local_from].size(); i_node++)
312  {
313  Real current_distance =
314  (qpt - *(local_nodes[i_local_from][i_node]) - _from_positions[i_local_from]).norm();
315  if (current_distance < outgoing_evals[2 * qp])
316  {
317  // Assuming LAGRANGE!
318  if (local_nodes[i_local_from][i_node]->n_dofs(from_sys_num, from_var_num) > 0)
319  {
320  dof_id_type from_dof =
321  local_nodes[i_local_from][i_node]->dof_number(from_sys_num, from_var_num, 0);
322 
323  outgoing_evals[2 * qp] = current_distance;
324  outgoing_evals[2 * qp + 1] = (*from_sys.solution)(from_dof);
325 
326  if (_fixed_meshes)
327  {
328  // Cache the nearest nodes.
329  _cached_froms[i_proc][qp] = i_local_from;
330  _cached_dof_ids[i_proc][qp] = from_dof;
331  }
332  }
333  }
334  }
335  }
336  }
337 
338  if (i_proc == processor_id())
339  incoming_evals[i_proc] = outgoing_evals;
340  else
341  _communicator.send(i_proc, outgoing_evals, send_evals[i_proc]);
342  }
343  }
344 
345  else // We've cached the nearest nodes.
346  {
347  for (processor_id_type i_proc = 0; i_proc < n_processors(); i_proc++)
348  {
349  std::vector<Real> & outgoing_evals = processor_outgoing_evals[i_proc];
350  outgoing_evals.resize(_cached_froms[i_proc].size());
351 
352  for (unsigned int qp = 0; qp < outgoing_evals.size(); qp++)
353  {
354  MooseVariable & from_var =
355  _from_problems[_cached_froms[i_proc][qp]]->getVariable(0, _from_var_name);
356  System & from_sys = from_var.sys().system();
357  dof_id_type from_dof = _cached_dof_ids[i_proc][qp];
358  // outgoing_evals[qp] = (*from_sys.solution)(_cached_dof_ids[i_proc][qp]);
359  outgoing_evals[qp] = (*from_sys.solution)(from_dof);
360  }
361 
362  if (i_proc == processor_id())
363  incoming_evals[i_proc] = outgoing_evals;
364  else
365  _communicator.send(i_proc, outgoing_evals, send_evals[i_proc]);
366  }
367  }
368 
370  // Gather all of the evaluations, find the nearest one for each node/element,
371  // and apply the values.
373 
374  for (processor_id_type i_proc = 0; i_proc < n_processors(); i_proc++)
375  {
376  if (i_proc == processor_id())
377  continue;
378 
379  _communicator.receive(i_proc, incoming_evals[i_proc]);
380  }
381 
382  for (unsigned int i_to = 0; i_to < _to_problems.size(); i_to++)
383  {
384  // Loop over the master nodes and set the value of the variable
385  System * to_sys = find_sys(*_to_es[i_to], _to_var_name);
386 
387  unsigned int sys_num = to_sys->number();
388  unsigned int var_num = to_sys->variable_number(_to_var_name);
389 
390  NumericVector<Real> * solution = nullptr;
391  switch (_direction)
392  {
393  case TO_MULTIAPP:
394  solution = &getTransferVector(i_to, _to_var_name);
395  break;
396  case FROM_MULTIAPP:
397  solution = to_sys->solution.get();
398  break;
399  default:
400  mooseError("Unknown direction");
401  }
402 
403  MeshBase * to_mesh = &_to_meshes[i_to]->getMesh();
404 
405  bool is_nodal = to_sys->variable_type(var_num).family == LAGRANGE;
406 
407  if (is_nodal)
408  {
409  std::vector<Node *> target_local_nodes;
410 
411  if (isParamValid("target_boundary"))
412  {
413  BoundaryID target_bnd_id =
414  _to_meshes[i_to]->getBoundaryID(getParam<BoundaryName>("target_boundary"));
415 
416  ConstBndNodeRange & bnd_nodes = *(_to_meshes[i_to])->getBoundaryNodeRange();
417  for (const auto & bnode : bnd_nodes)
418  if (bnode->_bnd_id == target_bnd_id && bnode->_node->processor_id() == processor_id())
419  target_local_nodes.push_back(bnode->_node);
420  }
421  else
422  {
423  target_local_nodes.resize(to_mesh->n_local_nodes());
424  MeshBase::const_node_iterator nodes_begin = to_mesh->local_nodes_begin();
425  MeshBase::const_node_iterator nodes_end = to_mesh->local_nodes_end();
426 
427  unsigned int i = 0;
428  for (MeshBase::const_node_iterator nodes_it = nodes_begin; nodes_it != nodes_end;
429  ++nodes_it, ++i)
430  target_local_nodes[i] = *nodes_it;
431  }
432 
433  for (const auto & node : target_local_nodes)
434  {
435  // Skip this node if the variable has no dofs at it.
436  if (node->n_dofs(sys_num, var_num) < 1)
437  continue;
438 
439  Real best_val = 0;
440  if (!_neighbors_cached)
441  {
442  Real min_dist = std::numeric_limits<Real>::max();
443  for (unsigned int i_from = 0; i_from < incoming_evals.size(); i_from++)
444  {
445  std::pair<unsigned int, unsigned int> key(i_to, node->id());
446  if (node_index_map[i_from].find(key) == node_index_map[i_from].end())
447  continue;
448  unsigned int qp_ind = node_index_map[i_from][key];
449  if (incoming_evals[i_from][2 * qp_ind] >= min_dist)
450  continue;
451  min_dist = incoming_evals[i_from][2 * qp_ind];
452  best_val = incoming_evals[i_from][2 * qp_ind + 1];
453 
454  if (_fixed_meshes)
455  {
456  // Cache these indices.
457  _cached_from_inds[node->id()] = i_from;
458  _cached_qp_inds[node->id()] = qp_ind;
459  }
460  }
461  }
462 
463  else
464  {
465  best_val = incoming_evals[_cached_from_inds[node->id()]][_cached_qp_inds[node->id()]];
466  }
467 
468  dof_id_type dof = node->dof_number(sys_num, var_num, 0);
469  solution->set(dof, best_val);
470  }
471  }
472  else // Elemental
473  {
474  MeshBase::const_element_iterator elem_it = to_mesh->local_elements_begin();
475  MeshBase::const_element_iterator elem_end = to_mesh->local_elements_end();
476 
477  for (; elem_it != elem_end; ++elem_it)
478  {
479  Elem * elem = *elem_it;
480 
481  // Skip this element if the variable has no dofs at it.
482  if (elem->n_dofs(sys_num, var_num) < 1)
483  continue;
484 
485  Real best_val = 0;
486  if (!_neighbors_cached)
487  {
488  Real min_dist = std::numeric_limits<Real>::max();
489  for (unsigned int i_from = 0; i_from < incoming_evals.size(); i_from++)
490  {
491  std::pair<unsigned int, unsigned int> key(i_to, elem->id());
492  if (node_index_map[i_from].find(key) == node_index_map[i_from].end())
493  continue;
494  unsigned int qp_ind = node_index_map[i_from][key];
495  if (incoming_evals[i_from][2 * qp_ind] >= min_dist)
496  continue;
497  min_dist = incoming_evals[i_from][2 * qp_ind];
498  best_val = incoming_evals[i_from][2 * qp_ind + 1];
499 
500  if (_fixed_meshes)
501  {
502  // Cache these indices.
503  _cached_from_inds[elem->id()] = i_from;
504  _cached_qp_inds[elem->id()] = qp_ind;
505  }
506  }
507  }
508 
509  else
510  {
511  best_val = incoming_evals[_cached_from_inds[elem->id()]][_cached_qp_inds[elem->id()]];
512  }
513 
514  dof_id_type dof = elem->dof_number(sys_num, var_num, 0);
515  solution->set(dof, best_val);
516  }
517  }
518  solution->close();
519  to_sys->update();
520  }
521 
522  if (_fixed_meshes)
523  _neighbors_cached = true;
524 
525  // Make sure all our sends succeeded.
526  for (processor_id_type i_proc = 0; i_proc < n_processors(); i_proc++)
527  {
528  if (i_proc == processor_id())
529  continue;
530  send_qps[i_proc].wait();
531  send_evals[i_proc].wait();
532  }
533 
534  _console << "Finished NearestNodeTransfer " << name() << std::endl;
535 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
NumericVector< Real > & getTransferVector(unsigned int i_local, std::string var_name)
If we are transferring to a multiapp, return the appropriate solution vector.
Class for stuff related to variables.
Definition: MooseVariable.h:43
std::vector< EquationSystems * > _to_es
std::vector< BoundingBox > getFromBoundingBoxes()
Return the bounding boxes of all the "from" domains, including all the domains not local to this proc...
std::vector< FEProblemBase * > _to_problems
std::vector< Point > _from_positions
const std::string & name() const
Get the variable name.
std::vector< std::vector< dof_id_type > > & _cached_dof_ids
std::map< dof_id_type, unsigned int > & _cached_from_inds
std::vector< MooseMesh * > _from_meshes
MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
std::vector< unsigned int > getFromsPerProc()
Return the number of "from" domains that each processor owns.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:67
virtual System & system()=0
Get the reference to the libMesh system.
std::map< dof_id_type, unsigned int > & _cached_qp_inds
Real bboxMinDistance(Point p, BoundingBox bbox)
Return the distance between the given point and the nearest corner of the given bounding box...
std::vector< Point > _to_positions
std::vector< std::vector< unsigned int > > & _cached_froms
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
Real bboxMaxDistance(Point p, BoundingBox bbox)
Return the distance between the given point and the farthest corner of the given bounding box...
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
static System * find_sys(EquationSystems &es, const std::string &var_name)
Small helper function for finding the system containing the variable.
Definition: Transfer.C:70
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:1184
void getAppInfo()
This method will fill information into the convenience member variables (_to_problems, _from_meshes, etc.)
SystemBase & sys()
Get the system this variable is part of.
void getLocalNodes(MooseMesh *mesh, std::vector< Node * > &local_nodes)
std::vector< FEProblemBase * > _from_problems
bool _fixed_meshes
If true then node connections will be cached.
std::vector< MooseMesh * > _to_meshes
boundary_id_type BoundaryID
Definition: MooseTypes.h:75
System * Transfer::find_sys ( EquationSystems &  es,
const std::string &  var_name 
)
staticinherited

Small helper function for finding the system containing the variable.

Note that this implies that variable names are unique across all systems!

Parameters
esThe EquationSystems object to be searched.
var_nameThe name of the variable you are looking for.

Note that this implies that variable names are unique across all systems!

Definition at line 70 of file Transfer.C.

Referenced by MultiAppPostprocessorInterpolationTransfer::execute(), execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppDTKInterpolationTransfer::execute(), DTKInterpolationAdapter::get_values_to_fill(), DTKInterpolationAdapter::get_variable_evaluator(), MultiAppMeshFunctionTransfer::transferVariable(), DTKInterpolationAdapter::update_variable_values(), and MultiAppTransfer::variableIntegrityCheck().

71 {
72  // Find the system this variable is from
73  for (unsigned int i = 0; i < es.n_systems(); i++)
74  if (es.get_system(i).has_variable(var_name))
75  return &es.get_system(i);
76 
77  ::mooseError("Unable to find variable " + var_name + " in any system.");
78 
79  // Unreachable
80  return &es.get_system(0);
81 }
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
void MultiAppTransfer::getAppInfo ( )
protectedinherited

This method will fill information into the convenience member variables (_to_problems, _from_meshes, etc.)

Definition at line 106 of file MultiAppTransfer.C.

Referenced by execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppProjectionTransfer::execute(), and MultiAppProjectionTransfer::initialSetup().

107 {
108  // I would like to do all of this in initialSetup, but it will fail with
109  // multiapps that reset. A reset deletes and rebuilds the FEProblems so all
110  // of the pointers will be broken.
111 
112  // Clear the vectors since we've probably built them up from a previous call
113  _from_problems.clear();
114  _to_problems.clear();
115  _from_es.clear();
116  _to_es.clear();
117  _from_meshes.clear();
118  _to_meshes.clear();
119  _to_positions.clear();
120  _from_positions.clear();
121 
122  // Build the vectors for to problems, from problems, and subapps positions.
123  switch (_direction)
124  {
125  case TO_MULTIAPP:
126  _from_problems.push_back(&_multi_app->problemBase());
127  _from_positions.push_back(Point(0., 0., 0.));
128  for (unsigned int i_app = 0; i_app < _multi_app->numGlobalApps(); i_app++)
129  {
130  if (!_multi_app->hasLocalApp(i_app))
131  continue;
132  _local2global_map.push_back(i_app);
133  _to_problems.push_back(&_multi_app->appProblemBase(i_app));
134  _to_positions.push_back(_multi_app->position(i_app));
135  }
136  break;
137 
138  case FROM_MULTIAPP:
139  _to_problems.push_back(&_multi_app->problemBase());
140  _to_positions.push_back(Point(0., 0., 0.));
141  for (unsigned int i_app = 0; i_app < _multi_app->numGlobalApps(); i_app++)
142  {
143  if (!_multi_app->hasLocalApp(i_app))
144  continue;
145  _local2global_map.push_back(i_app);
146  _from_problems.push_back(&_multi_app->appProblemBase(i_app));
147  _from_positions.push_back(_multi_app->position(i_app));
148  }
149  break;
150  }
151 
152  // Build the from and to equation systems and mesh vectors.
153  for (unsigned int i = 0; i < _to_problems.size(); i++)
154  {
155  // TODO: Do I actually want es or displaced es?
156  _to_es.push_back(&_to_problems[i]->es());
157  if (_displaced_target_mesh && _to_problems[i]->getDisplacedProblem())
158  _to_meshes.push_back(&_to_problems[i]->getDisplacedProblem()->mesh());
159  else
160  _to_meshes.push_back(&_to_problems[i]->mesh());
161  }
162  for (unsigned int i = 0; i < _from_problems.size(); i++)
163  {
164  _from_es.push_back(&_from_problems[i]->es());
165  if (_displaced_source_mesh && _from_problems[i]->getDisplacedProblem())
166  _from_meshes.push_back(&_from_problems[i]->getDisplacedProblem()->mesh());
167  else
168  _from_meshes.push_back(&_from_problems[i]->mesh());
169  }
170 }
std::vector< EquationSystems * > _to_es
std::vector< FEProblemBase * > _to_problems
std::vector< Point > _from_positions
std::shared_ptr< MultiApp > _multi_app
The MultiApp this Transfer is transferring data to or from.
std::vector< MooseMesh * > _from_meshes
MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
std::vector< unsigned int > _local2global_map
std::vector< Point > _to_positions
std::vector< EquationSystems * > _from_es
std::vector< FEProblemBase * > _from_problems
std::vector< MooseMesh * > _to_meshes
MultiMooseEnum SetupInterface::getExecuteOptions ( )
staticinherited

Returns the available options for the 'execute_on' input parameters.

Returns
A MooseEnum with the available 'execute_on' options, the default is 'residual'

Definition at line 110 of file SetupInterface.C.

Referenced by AddNodalNormalsAction::act(), AdvancedOutput::addValidParams(), AdvancedOutput::initExecutionTypes(), OutputOnWarehouse::OutputOnWarehouse(), validParams< CommonOutputAction >(), validParams< Output >(), and validParams< SetupInterface >().

111 {
112  return MultiMooseEnum("none=0x00 initial=0x01 linear=0x02 nonlinear=0x04 timestep_end=0x08 "
113  "timestep_begin=0x10 final=0x20 custom=0x100",
114  "linear");
115 }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
std::vector< BoundingBox > MultiAppTransfer::getFromBoundingBoxes ( )
protectedinherited

Return the bounding boxes of all the "from" domains, including all the domains not local to this processor.

Definition at line 173 of file MultiAppTransfer.C.

Referenced by execute(), MultiAppProjectionTransfer::execute(), and MultiAppMeshFunctionTransfer::transferVariable().

174 {
175  std::vector<std::pair<Point, Point>> bb_points(_from_meshes.size());
176  for (unsigned int i = 0; i < _from_meshes.size(); i++)
177  {
178  // Get a bounding box around the mesh elements that are local to the current
179  // processor.
180  BoundingBox bbox = MeshTools::create_local_bounding_box(*_from_meshes[i]);
181 
182  // Translate the bounding box to the from domain's position.
183  bbox.first += _from_positions[i];
184  bbox.second += _from_positions[i];
185 
186  // Cast the bounding box into a pair of points (so it can be put through
187  // MPI communication).
188  bb_points[i] = static_cast<std::pair<Point, Point>>(bbox);
189  }
190 
191  // Serialize the bounding box points.
192  _communicator.allgather(bb_points);
193 
194  // Recast the points back into bounding boxes and return.
195  std::vector<BoundingBox> bboxes(bb_points.size());
196  for (unsigned int i = 0; i < bb_points.size(); i++)
197  bboxes[i] = static_cast<BoundingBox>(bb_points[i]);
198 
199  return bboxes;
200 }
std::vector< Point > _from_positions
std::vector< MooseMesh * > _from_meshes
std::vector< unsigned int > MultiAppTransfer::getFromsPerProc ( )
protectedinherited

Return the number of "from" domains that each processor owns.

Definition at line 203 of file MultiAppTransfer.C.

Referenced by execute(), MultiAppProjectionTransfer::execute(), and MultiAppMeshFunctionTransfer::transferVariable().

204 {
205  std::vector<unsigned int> froms_per_proc;
206  switch (_direction)
207  {
208  case TO_MULTIAPP:
209  froms_per_proc.resize(n_processors(), 1);
210  break;
211  case FROM_MULTIAPP:
212  froms_per_proc.resize(n_processors());
213  _communicator.allgather(_multi_app->numLocalApps(), froms_per_proc);
214  break;
215  }
216  return froms_per_proc;
217 }
std::shared_ptr< MultiApp > _multi_app
The MultiApp this Transfer is transferring data to or from.
MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
void MultiAppNearestNodeTransfer::getLocalNodes ( MooseMesh mesh,
std::vector< Node * > &  local_nodes 
)
protected

Definition at line 634 of file MultiAppNearestNodeTransfer.C.

Referenced by execute().

635 {
636  if (isParamValid("source_boundary"))
637  {
638  BoundaryID src_bnd_id = mesh->getBoundaryID(getParam<BoundaryName>("source_boundary"));
639 
640  ConstBndNodeRange & bnd_nodes = *mesh->getBoundaryNodeRange();
641  for (const auto & bnode : bnd_nodes)
642  if (bnode->_bnd_id == src_bnd_id && bnode->_node->processor_id() == processor_id())
643  local_nodes.push_back(bnode->_node);
644  }
645  else
646  {
647  local_nodes.resize(mesh->getMesh().n_local_nodes());
648 
649  MeshBase::const_node_iterator nodes_begin = mesh->localNodesBegin();
650  MeshBase::const_node_iterator nodes_end = mesh->localNodesEnd();
651 
652  unsigned int i = 0;
653  for (MeshBase::const_node_iterator node_it = nodes_begin; node_it != nodes_end; ++node_it, ++i)
654  local_nodes[i] = *node_it;
655  }
656 }
MeshBase::const_node_iterator localNodesBegin()
Calls local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2000
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:929
MeshBase::const_node_iterator localNodesEnd()
Definition: MooseMesh.C:2006
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:67
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:1184
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:724
boundary_id_type BoundaryID
Definition: MooseTypes.h:75
MooseApp& MooseObject::getMooseApp ( )
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 72 of file MooseObject.h.

Referenced by RestartableDataIO::createBackup(), RestartableDataIO::deserializeRestartableData(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

72 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
const std::shared_ptr<MultiApp> MultiAppTransfer::getMultiApp ( ) const
inlineinherited

Return the MultiApp that this transfer belongs to.

Definition at line 64 of file MultiAppTransfer.h.

64 { return _multi_app; }
std::shared_ptr< MultiApp > _multi_app
The MultiApp this Transfer is transferring data to or from.
Node * MultiAppNearestNodeTransfer::getNearestNode ( const Point &  p,
Real &  distance,
MooseMesh mesh,
bool  local 
)
protected

Return the nearest node to the point p.

Parameters
pThe point you want to find the nearest node to.
distanceThis will hold the distance between the returned node and p
meshThe mesh in which we search for the node
localtrue if we look at local nodes, otherwise we look at all nodes
Returns
The Node closest to point p.

Definition at line 538 of file MultiAppNearestNodeTransfer.C.

542 {
543  distance = std::numeric_limits<Real>::max();
544  Node * nearest = NULL;
545 
546  if (isParamValid("source_boundary"))
547  {
548  BoundaryID src_bnd_id = mesh->getBoundaryID(getParam<BoundaryName>("source_boundary"));
549 
550  ConstBndNodeRange & bnd_nodes = *mesh->getBoundaryNodeRange();
551  for (const auto & bnode : bnd_nodes)
552  {
553  if (bnode->_bnd_id == src_bnd_id)
554  {
555  Node * node = bnode->_node;
556  Real current_distance = (p - *node).norm();
557 
558  if (current_distance < distance)
559  {
560  distance = current_distance;
561  nearest = node;
562  }
563  }
564  }
565  }
566  else
567  {
568  SimpleRange<MeshBase::const_node_iterator> range(
569  local ? mesh->localNodesBegin() : mesh->getMesh().nodes_begin(),
570  local ? mesh->localNodesEnd() : mesh->getMesh().nodes_end());
571 
572  for (auto & node : range)
573  {
574  Real current_distance = (p - *node).norm();
575 
576  if (current_distance < distance)
577  {
578  distance = current_distance;
579  nearest = node;
580  }
581  }
582  }
583 
584  return nearest;
585 }
MeshBase::const_node_iterator localNodesBegin()
Calls local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2000
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:929
MeshBase::const_node_iterator localNodesEnd()
Definition: MooseMesh.C:2006
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:67
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:1184
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:724
boundary_id_type BoundaryID
Definition: MooseTypes.h:75
template<typename T >
const T & MooseObject::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 122 of file MooseObject.h.

Referenced by FEProblemBase::addMaterial(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), EigenKernel::EigenKernel(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), MooseObject::parameters(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

123 {
124  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
125 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
NumericVector< Real > & MultiAppTransfer::getTransferVector ( unsigned int  i_local,
std::string  var_name 
)
protectedinherited

If we are transferring to a multiapp, return the appropriate solution vector.

Definition at line 220 of file MultiAppTransfer.C.

Referenced by execute(), and MultiAppMeshFunctionTransfer::transferVariable().

221 {
222  mooseAssert(_direction == TO_MULTIAPP, "getTransferVector only works for transfers to multiapps");
223 
224  return _multi_app->appTransferVector(_local2global_map[i_local], var_name);
225 }
std::shared_ptr< MultiApp > _multi_app
The MultiApp this Transfer is transferring data to or from.
MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
std::vector< unsigned int > _local2global_map
void MultiAppNearestNodeTransfer::initialSetup ( )
overridevirtual

Method called at the beginning of the simulation for checking integrity or doing one-time setup.

Reimplemented from Transfer.

Definition at line 81 of file MultiAppNearestNodeTransfer.C.

82 {
83  if (_direction == TO_MULTIAPP)
85  else
87 }
void variableIntegrityCheck(const AuxVariableName &var_name) const
Utility to verify that the vEariable in the destination system exists.
MooseEnum _direction
Whether we&#39;re transferring to or from the MultiApp.
bool MooseObject::isParamValid ( const std::string &  name) const
inlineinherited

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 67 of file MooseObject.h.

Referenced by BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), GeneratedMesh::buildMesh(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), getLocalNodes(), getNearestNode(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), AdvancedOutput::initExecutionTypes(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), SolutionAux::initialSetup(), MooseParsedVectorFunction::initialSetup(), Console::initialSetup(), Receiver::initialSetup(), SolutionFunction::initialSetup(), MooseParsedGradFunction::initialSetup(), MooseParsedFunction::initialSetup(), AdvancedOutput::initialSetup(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), IterationAdaptiveDT::IterationAdaptiveDT(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), BreakBoundaryOnSubdomain::modify(), MeshExtruder::modify(), MeshSideSet::modify(), AssignElementSubdomainID::modify(), RenameBlock::modify(), ParsedSubdomainMeshModifier::modify(), SubdomainBoundingBox::modify(), EigenExecutionerBase::normalizeSolution(), Output::Output(), Exodus::outputSetup(), PetscOutput::PetscOutput(), Piecewise::Piecewise(), SolutionUserObject::readExodusII(), RenameBlock::RenameBlock(), Piecewise::setData(), SolutionUserObject::SolutionUserObject(), and TimePeriod::TimePeriod().

67 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
void SetupInterface::jacobianSetup ( )
virtualinherited

Gets called just before the Jacobian is computed and before this object is asked to do its job.

Definition at line 79 of file SetupInterface.C.

80 {
81 }
template<typename... Args>
void MooseObject::mooseDeprecated ( Args &&...  args) const
inlineinherited
template<typename... Args>
void MooseObject::mooseError ( Args &&...  args) const
inlineinherited

Definition at line 80 of file MooseObject.h.

Referenced by FEProblemBase::addInitialCondition(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), MooseMesh::addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), MooseMesh::buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMesh::buildMesh3D(), MooseMesh::buildRefinementMap(), EigenExecutionerBase::chebyshev(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkDependMaterialsHelper(), FEProblemBase::checkDisplacementOrders(), Material::checkExecutionStage(), Steady::checkIntegrity(), EigenExecutionerBase::checkIntegrity(), SubProblem::checkMatProps(), FEProblemBase::checkProblemIntegrity(), Material::checkStatefulSanity(), FEProblemBase::checkUserObjects(), LibmeshPartitioner::clone(), CompositeFunction::CompositeFunction(), ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), FEProblemBase::computeResidual(), Material::computeSubdomainProperties(), PenetrationAux::computeValue(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DGKernel::DGKernel(), SolutionUserObject::discontinuousPointValue(), SolutionUserObject::discontinuousPointValueGradient(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), MooseMesh::errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), PerflogDumper::execute(), NodalValueSampler::execute(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), FindValueOnLine::execute(), MultiAppInterpolationTransfer::execute(), TimeExtremeValue::execute(), LeastSquaresFit::execute(), FEProblemBase::executeControls(), FileOutput::FileOutput(), MultiApp::fillPositions(), VerifyElementUniqueID::finalize(), VerifyNodalUniqueID::finalize(), DiscreteElementUserObject::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), FunctionDT::FunctionDT(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), GeneratedMesh::GeneratedMesh(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), MooseMesh::getBoundaryID(), MultiApp::getBoundingBox(), MooseMesh::getCoarseningMap(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), GeneratedMesh::getMaxInDimension(), AnnularMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), GeneratedMesh::getMinInDimension(), AnnularMesh::getMinInDimension(), MooseMesh::getMortarInterface(), MooseMesh::getMortarInterfaceByName(), MooseMesh::getNodeBlockIds(), MooseMesh::getNodeList(), FEProblemBase::getNonlinearSystem(), MooseMesh::getPairedBoundaryMapping(), ImageMesh::GetPixelInfo(), MaterialStdVectorAux::getRealValue(), MooseMesh::getRefinementMap(), FEProblemBase::getSampler(), DisplacedProblem::getScalarVariable(), FEProblemBase::getScalarVariable(), MooseMesh::getSubdomainBoundaryIds(), MooseMesh::getSubdomainID(), DisplacedProblem::getSystem(), FEProblemBase::getSystem(), FEProblemBase::getUserObjectBase(), NumVars::getValue(), PerformanceData::getValue(), Residual::getValue(), FindValueOnLine::getValueAtPoint(), DisplacedProblem::getVariable(), FEProblemBase::getVariable(), MultiApp::globalAppToLocal(), MooseParsedVectorFunction::gradient(), AdvancedOutput::hasOutputHelper(), CSVTimeSequenceStepper::init(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), FEProblemBase::init(), NumPicardIterations::initialize(), FullSolveMultiApp::initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionFunction::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), KernelBase::KernelBase(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), LinearCombinationFunction::LinearCombinationFunction(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), LinearNodalConstraint::LinearNodalConstraint(), LineMaterialSamplerBase< T >::LineMaterialSamplerBase(), MaterialRealTensorValueAux::MaterialRealTensorValueAux(), MaterialRealVectorValueAux::MaterialRealVectorValueAux(), MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), AssignElementSubdomainID::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), NodalBC::NodalBC(), NodalConstraint::NodalConstraint(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), VTKOutput::output(), XDA::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PatternedMesh::PatternedMesh(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMultilinear::PiecewiseMultilinear(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postStep(), LStableDirk3::postStep(), ImplicitMidpoint::postStep(), ExplicitTVDRK2::postStep(), AStableDirk4::postStep(), LStableDirk4::postStep(), ExplicitRK2::postStep(), Predictor::Predictor(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), Piecewise::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromPoints::SideSetsFromPoints(), SolutionUserObject::SolutionUserObject(), FullSolveMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), Transient::Transient(), TransientMultiApp::TransientMultiApp(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), and VolumeHistogram::VolumeHistogram().

81  {
82  std::ostringstream oss;
83  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
84  std::string msg = oss.str();
85  callMooseErrorRaw(msg, &_app);
86  }
void mooseStreamAll(std::ostringstream &ss)
Definition: MooseError.C:78
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:45
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename... Args>
void MooseObject::mooseInfo ( Args &&...  args) const
inlineinherited

Definition at line 101 of file MooseObject.h.

102  {
103  moose::internal::mooseInfoStream(_console, std::forward<Args>(args)...);
104  }
void mooseInfoStream(S &oss, Args &&...args)
Definition: MooseError.h:145
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
template<typename... Args>
void MooseObject::mooseWarning ( Args &&...  args) const
inlineinherited
const std::string& MooseObject::name ( ) const
inlineinherited

Get the name of the object.

Returns
The name of the object

Definition at line 47 of file MooseObject.h.

Referenced by FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), MooseMesh::addMortarInterface(), FEProblemBase::addMultiApp(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), AStableDirk4::AStableDirk4(), Function::average(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), AuxKernel::coupledCallback(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), MultiApp::createApp(), DGKernel::DGKernel(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), GeneralUserObject::GeneralUserObject(), MultiApp::getBoundingBox(), Control::getControllableParameterHelper(), Control::getControllableValue(), AuxKernel::getDependObjects(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), OutputWarehouse::getOutput(), Transient::getTimeStepperName(), InitialCondition::getUserObject(), AuxKernel::getUserObject(), InitialCondition::getUserObjectByName(), AuxKernel::getUserObjectByName(), AdvancedOutput::hasOutputHelper(), FEProblemBase::init(), CSVReader::initialize(), MultiAppProjectionTransfer::initialSetup(), InitialCondition::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), KernelBase::KernelBase(), LinearCombinationFunction::LinearCombinationFunction(), Marker::Marker(), MaterialDerivativeTestKernelBase< T >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), ElementDeleterBase::modify(), NodalBC::NodalBC(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalValueSampler::NodalValueSampler(), NodalVariableValue::NodalVariableValue(), DOFMapOutput::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::parameters(), Executioner::parentOutputPositionChanged(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), Material::resetQpProperties(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), MooseMesh::setBoundaryName(), Control::setControllableValue(), OutputWarehouse::setFileNumbers(), MooseMesh::setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), Function::timeDerivative(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), and AdvancedOutput::wantOutput().

47 { return _name; }
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:114
const InputParameters& MooseObject::parameters ( ) const
inlineinherited
void SetupInterface::residualSetup ( )
virtualinherited

Gets called just before the residual is computed and before this object is asked to do its job.

Definition at line 84 of file SetupInterface.C.

85 {
86 }
void SetupInterface::subdomainSetup ( )
virtualinherited

Gets called when the subdomain changes (i.e.

in a Jacobian or residual loop) and before this object is asked to do its job

Reimplemented in Material, Constraint, GeneralUserObject, and NodalUserObject.

Definition at line 89 of file SetupInterface.C.

90 {
91 }
void SetupInterface::timestepSetup ( )
virtualinherited

Gets called at the beginning of the timestep before this object is asked to do its job.

Reimplemented in SolutionUserObject, NumNonlinearIterations, and MemoryUsage.

Definition at line 74 of file SetupInterface.C.

75 {
76 }
void MultiAppTransfer::variableIntegrityCheck ( const AuxVariableName &  var_name) const
inherited

Utility to verify that the vEariable in the destination system exists.

Definition at line 89 of file MultiAppTransfer.C.

Referenced by MultiAppTransfer::direction(), initialSetup(), MultiAppVariableValueSampleTransfer::initialSetup(), MultiAppInterpolationTransfer::initialSetup(), MultiAppMeshFunctionTransfer::initialSetup(), MultiAppUserObjectTransfer::initialSetup(), and MultiAppCopyTransfer::initialSetup().

90 {
91  for (unsigned int i = 0; i < _multi_app->numGlobalApps(); i++)
92  if (_multi_app->hasLocalApp(i) && !find_sys(_multi_app->appProblemBase(i).es(), var_name))
93  mooseError("Cannot find variable ", var_name, " for ", name(), " Transfer");
94 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
std::shared_ptr< MultiApp > _multi_app
The MultiApp this Transfer is transferring data to or from.
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
static System * find_sys(EquationSystems &es, const std::string &var_name)
Small helper function for finding the system containing the variable.
Definition: Transfer.C:70

Member Data Documentation

MooseApp& MooseObject::_app
protectedinherited

The MooseApp this object is associated with.

Definition at line 108 of file MooseObject.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), Executioner::addAttributeReporter(), FEProblemBase::addMaterial(), FEProblemBase::addMultiApp(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), FileMesh::buildMesh(), FEProblemBase::checkNonlinearConvergence(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobian(), FEProblemBase::computeResidualType(), Console::Console(), TimeStepper::constrainStep(), MultiApp::createApp(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), InversePowerMethod::execute(), NonlinearEigen::execute(), Transient::execute(), Steady::execute(), FileOutput::FileOutput(), FEProblemBase::forceOutput(), MooseObject::getMooseApp(), InversePowerMethod::init(), NonlinearEigen::init(), Transient::init(), Steady::init(), MooseMesh::init(), NumPicardIterations::initialize(), TimePeriod::initialSetup(), Console::initialSetup(), MultiApp::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), FEProblemBase::initPetscOutput(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), InversePowerMethod::InversePowerMethod(), MooseObject::mooseError(), MooseMesh::MooseMesh(), NonlinearEigen::NonlinearEigen(), Tecplot::output(), Exodus::output(), Nemesis::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), Console::outputSystemInformation(), MultiApp::parentOutputPositionChanged(), PerformanceData::PerformanceData(), PetscOutput::petscLinearOutput(), PetscOutput::petscNonlinearOutput(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), TransientMultiApp::solveStep(), FEProblemBase::subdomainSetup(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), FEProblemBase::timestepSetup(), Transient::Transient(), and Console::write().

std::vector<std::vector<dof_id_type> >& MultiAppNearestNodeTransfer::_cached_dof_ids
protected

Definition at line 87 of file MultiAppNearestNodeTransfer.h.

Referenced by execute().

std::map<dof_id_type, unsigned int>& MultiAppNearestNodeTransfer::_cached_from_inds
protected

Definition at line 88 of file MultiAppNearestNodeTransfer.h.

Referenced by execute().

std::vector<std::vector<unsigned int> >& MultiAppNearestNodeTransfer::_cached_froms
protected

Definition at line 86 of file MultiAppNearestNodeTransfer.h.

Referenced by execute().

std::map<dof_id_type, unsigned int>& MultiAppNearestNodeTransfer::_cached_qp_inds
protected

Definition at line 89 of file MultiAppNearestNodeTransfer.h.

Referenced by execute().

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 37 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), CreateProblemAction::act(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), FEProblemBase::advanceMultiApps(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualType(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), NonlinearEigen::init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), DT2::step(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), FEProblemBase::useFECache(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

const ExecFlagType& SetupInterface::_current_execute_flag
protectedinherited

Reference to FEProblemBase.

Definition at line 85 of file SetupInterface.h.

MooseEnum MultiAppTransfer::_direction
protectedinherited
bool MultiAppTransfer::_displaced_source_mesh
protectedinherited
bool MultiAppTransfer::_displaced_target_mesh
protectedinherited
std::map<dof_id_type, Real>& MultiAppNearestNodeTransfer::_distance_map
protected

Used to cache distances.

Definition at line 82 of file MultiAppNearestNodeTransfer.h.

const bool& MooseObject::_enabled
protectedinherited

Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.

Definition at line 117 of file MooseObject.h.

Referenced by MooseObject::enabled().

std::vector<ExecFlagType> SetupInterface::_exec_flags
protectedinherited

execution flag (when is the object executed/evaluated)

Definition at line 82 of file SetupInterface.h.

Referenced by SetupInterface::execBitFlags(), SetupInterface::execFlags(), and SetupInterface::SetupInterface().

FEProblemBase& Transfer::_fe_problem
protectedinherited
bool MultiAppNearestNodeTransfer::_fixed_meshes
protected

If true then node connections will be cached.

Definition at line 76 of file MultiAppNearestNodeTransfer.h.

Referenced by execute().

std::vector<EquationSystems *> MultiAppTransfer::_from_es
protectedinherited

Definition at line 85 of file MultiAppTransfer.h.

Referenced by MultiAppTransfer::getAppInfo().

std::vector<MooseMesh *> MultiAppTransfer::_from_meshes
protectedinherited
std::vector<Point> MultiAppTransfer::_from_positions
protectedinherited
std::vector<FEProblemBase *> MultiAppTransfer::_from_problems
protectedinherited
VariableName MultiAppNearestNodeTransfer::_from_var_name
protected

Definition at line 73 of file MultiAppNearestNodeTransfer.h.

Referenced by execute(), and initialSetup().

std::vector<unsigned int> MultiAppTransfer::_local2global_map
protectedinherited
std::shared_ptr<MultiApp> MultiAppTransfer::_multi_app
protectedinherited
const std::string& MooseObject::_name
protectedinherited
bool& MultiAppNearestNodeTransfer::_neighbors_cached
protected

Definition at line 85 of file MultiAppNearestNodeTransfer.h.

Referenced by execute().

std::map<dof_id_type, Node *>& MultiAppNearestNodeTransfer::_node_map
protected

Used to cache nodes.

Definition at line 79 of file MultiAppNearestNodeTransfer.h.

const InputParameters& MooseObject::_pars
protectedinherited
SubProblem& Transfer::_subproblem
protectedinherited

Definition at line 74 of file Transfer.h.

SystemBase& Transfer::_sys
protectedinherited

Definition at line 76 of file Transfer.h.

THREAD_ID Transfer::_tid
protectedinherited
std::vector<EquationSystems *> MultiAppTransfer::_to_es
protectedinherited
std::vector<MooseMesh *> MultiAppTransfer::_to_meshes
protectedinherited
std::vector<Point> MultiAppTransfer::_to_positions
protectedinherited
std::vector<FEProblemBase *> MultiAppTransfer::_to_problems
protectedinherited
AuxVariableName MultiAppNearestNodeTransfer::_to_var_name
protected

Definition at line 72 of file MultiAppNearestNodeTransfer.h.

Referenced by execute(), and initialSetup().

const Number Transfer::OutOfMeshValue = -999999
staticinherited

The documentation for this class was generated from the following files: