www.mooseframework.org
MultiAppNearestNodeTransfer.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
14 
15 namespace libMesh
16 {
17 class DofObject;
18 }
20 
25 {
26 public:
28 
30 
31  virtual void execute() override;
32 
33 protected:
42  Real bboxMaxDistance(const Point & p, const BoundingBox & bbox);
43 
52  Real bboxMinDistance(const Point & p, const BoundingBox & bbox);
53 
61  std::vector<std::pair<Point, DofObject *>> & local_entities,
62  std::vector<unsigned int> & local_comps,
63  bool nodal,
64  bool constant);
65 
68 
70  std::map<dof_id_type, Node *> & _node_map;
71 
73  std::map<dof_id_type, Real> & _distance_map;
74 
75  // These variables allow us to cache nearest node info
77  std::map<processor_id_type, std::vector<unsigned int>> & _cached_froms;
78  std::map<processor_id_type, std::vector<dof_id_type>> & _cached_dof_ids;
79  std::map<std::pair<unsigned int, dof_id_type>, unsigned int> & _cached_from_inds;
80  std::map<std::pair<unsigned int, dof_id_type>, unsigned int> & _cached_qp_inds;
81 
82 private:
83  bool usesMooseAppCoordTransform() const override { return true; }
84 
86  std::vector<Node *> _target_local_nodes;
87 
93  const std::vector<Node *> & getTargetLocalNodes(const unsigned int to_problem_id);
94 };
std::map< std::pair< unsigned int, dof_id_type >, unsigned int > & _cached_from_inds
MultiAppNearestNodeTransfer(const InputParameters &parameters)
Real bboxMaxDistance(const Point &p, const BoundingBox &bbox)
Return the distance between the given point and the farthest corner of the given bounding box...
const std::vector< Node * > & getTargetLocalNodes(const unsigned int to_problem_id)
Get the local nodes on the target boundary for the transfer.
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< Node * > _target_local_nodes
Target local nodes for receiving a nodal variable.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Real bboxMinDistance(const Point &p, const BoundingBox &bbox)
Return the distance between the given point and the nearest corner of the given bounding box...
bool usesMooseAppCoordTransform() const override
Whether this transfer handles non-translation-based transformations, e.g.
Copy the value to the target domain from the nearest node in the source domain.
virtual void execute() override
Execute the transfer.
std::map< processor_id_type, std::vector< dof_id_type > > & _cached_dof_ids
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:88
Transfers variables on possibly different meshes while conserving a user defined property (Postproces...
std::map< processor_id_type, std::vector< unsigned int > > & _cached_froms
std::map< dof_id_type, Node * > & _node_map
Used to cache nodes.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
void getLocalEntitiesAndComponents(MooseMesh *mesh, std::vector< std::pair< Point, DofObject *>> &local_entities, std::vector< unsigned int > &local_comps, bool nodal, bool constant)
Get nearest node candidates.
std::map< std::pair< unsigned int, dof_id_type >, unsigned int > & _cached_qp_inds
bool _fixed_meshes
If true then node connections will be cached.