forked from idaholab/moose
/
MultiAppInterpolationTransfer.h
71 lines (57 loc) · 2.35 KB
/
MultiAppInterpolationTransfer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
// MOOSE includes
#include "MultiAppConservativeTransfer.h"
#include "libmesh/mesh_base.h"
#include "libmesh/meshfree_interpolation.h"
#include "libmesh/system.h"
#include "libmesh/radial_basis_interpolation.h"
// Forward declarations
class MultiAppInterpolationTransfer;
template <>
InputParameters validParams<MultiAppInterpolationTransfer>();
/**
* Copy the value to the target domain from the nearest node in the source domain.
*/
class MultiAppInterpolationTransfer : public MultiAppConservativeTransfer
{
public:
static InputParameters validParams();
MultiAppInterpolationTransfer(const InputParameters & parameters);
virtual void execute() override;
protected:
/**
* Return the nearest node to the point p.
* @param p The point you want to find the nearest node to.
* @param distance This will hold the distance between the returned node and p
* @param nodes_begin - iterator to the beginning of the node list
* @param nodes_end - iterator to the end of the node list
* @return The Node closest to point p.
*/
Node * getNearestNode(const Point & p,
Real & distance,
const MeshBase::const_node_iterator & nodes_begin,
const MeshBase::const_node_iterator & nodes_end);
void
fillSourceInterpolationPoints(FEProblemBase & from_problem,
MooseVariableFEBase & from_var,
Point & from_app_position,
std::unique_ptr<InverseDistanceInterpolation<LIBMESH_DIM>> & idi);
void interpolateTargetPoints(FEProblemBase & to_problem,
MooseVariableFEBase & to_var,
NumericVector<Real> & to_solution,
Point & to_app_position,
std::unique_ptr<InverseDistanceInterpolation<LIBMESH_DIM>> & idi);
subdomain_id_type subdomainIDNode(MooseMesh & mesh, Node & node);
unsigned int _num_points;
Real _power;
MooseEnum _interp_type;
Real _radius;
};