www.mooseframework.org
MultiAppNearestNodeTransfer.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef MULTIAPPNEARESTNODETRANSFER_H
16 #define MULTIAPPNEARESTNODETRANSFER_H
17 
18 // MOOSE includes
19 #include "MultiAppTransfer.h"
20 
21 // Forward declarations
23 
24 template <>
26 
31 {
32 public:
34 
35  virtual void initialSetup() override;
36 
37  virtual void execute() override;
38 
39 protected:
48  Node * getNearestNode(const Point & p, Real & distance, MooseMesh * mesh, bool local);
49 
58  Real bboxMaxDistance(Point p, BoundingBox bbox);
59 
68  Real bboxMinDistance(Point p, BoundingBox bbox);
69 
70  void getLocalNodes(MooseMesh * mesh, std::vector<Node *> & local_nodes);
71 
72  AuxVariableName _to_var_name;
73  VariableName _from_var_name;
74 
77 
79  std::map<dof_id_type, Node *> & _node_map;
80 
82  std::map<dof_id_type, Real> & _distance_map;
83 
84  // These variables allow us to cache nearest node info
86  std::vector<std::vector<unsigned int>> & _cached_froms;
87  std::vector<std::vector<dof_id_type>> & _cached_dof_ids;
88  std::map<dof_id_type, unsigned int> & _cached_from_inds;
89  std::map<dof_id_type, unsigned int> & _cached_qp_inds;
90 };
91 
92 #endif /* MULTIAPPNEARESTNODETRANSFER_H */
MultiAppNearestNodeTransfer(const InputParameters &parameters)
InputParameters validParams< MultiAppNearestNodeTransfer >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Copy the value to the target domain from the nearest node in the source domain.
std::vector< std::vector< dof_id_type > > & _cached_dof_ids
virtual void execute() override
Execute the transfer.
std::map< dof_id_type, unsigned int > & _cached_from_inds
virtual void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup...
std::map< dof_id_type, Real > & _distance_map
Used to cache distances.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
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::map< dof_id_type, Node * > & _node_map
Used to cache nodes.
std::vector< std::vector< unsigned int > > & _cached_froms
Base class for all MultiAppTransfer objects.
Node * getNearestNode(const Point &p, Real &distance, MooseMesh *mesh, bool local)
Return the nearest node to the point p.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
Real bboxMaxDistance(Point p, BoundingBox bbox)
Return the distance between the given point and the farthest corner of the given bounding box...
void getLocalNodes(MooseMesh *mesh, std::vector< Node * > &local_nodes)
bool _fixed_meshes
If true then node connections will be cached.