https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MultiAppNearestNodeTransfer.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
15namespace libMesh
16{
17class DofObject;
18}
20
25{
26public:
28
30
31 virtual void execute() override;
32
33protected:
42 Real bboxMaxDistance(const Point & p, const libMesh::BoundingBox & bbox);
43
52 Real bboxMinDistance(const Point & p, const libMesh::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
82private:
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};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Transfers variables on possibly different meshes while conserving a user defined property (Postproces...
Copy the value to the target domain from the nearest node in the source domain.
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< processor_id_type, std::vector< dof_id_type > > & _cached_dof_ids
Real bboxMinDistance(const Point &p, const libMesh::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.
virtual void execute() override
Execute the transfer.
std::map< std::pair< unsigned int, dof_id_type >, unsigned int > & _cached_from_inds
const std::vector< Node * > & getTargetLocalNodes(const unsigned int to_problem_id)
Get the local nodes on the target boundary for the transfer.
std::map< processor_id_type, std::vector< unsigned int > > & _cached_froms
std::map< dof_id_type, Node * > & _node_map
Used to cache nodes.
Real bboxMaxDistance(const Point &p, const libMesh::BoundingBox &bbox)
Return the distance between the given point and the farthest corner of the given bounding box.
std::map< dof_id_type, Real > & _distance_map
Used to cache distances.
std::vector< Node * > _target_local_nodes
Target local nodes for receiving a nodal variable.
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.
MeshBase & mesh
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...