https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MultiAppGeneralFieldFunctorTransfer.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
13#include "KDTree.h"
16
24
25{
26public:
28
30
31 void initialSetup() override;
32 void execute() override;
33
34protected:
35 virtual void prepareEvaluationOfInterpValues(const unsigned int var_index) override;
36
37 // TODO: rename! We are not just interpolating anymore
38 virtual void
39 evaluateInterpValues(const unsigned int var_index,
40 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
41 std::vector<std::pair<Real, Real>> & outgoing_vals) override;
42
43private:
44 /*
45 * Build KD-Trees for each local app for the external values to extrapolate with
46 * @param var_index the index of the variable being transferred
47 * @details fills _local_kdtrees, _local_points and _local_values
48 * Indexing is: local apps (outer-indexing) OR positions (if using nearest_positions),
49 * local nodes (inner-indexing)
50 */
51 void buildKDTrees(const unsigned int var_index) override;
52
53 std::string getDataSourceName(unsigned int var_index) const override
54 {
55 return "functor '" + _functor_names[var_index] + "'";
56 }
57
58 /*
59 * Evaluate values (interpolation and extrapolation) for incoming points
60 * @param incoming_points all the points at which we need values
61 * @param outgoing_vals vector containing the values and distances from point to nearest node
62 */
63 void evaluateValues(const unsigned int var_index,
64 const std::vector<std::pair<Point, unsigned int>> & incoming_points,
65 std::vector<std::pair<Real, Real>> & outgoing_vals);
66
67 // Point locators for all source meshes
68 std::vector<std::unique_ptr<libMesh::PointLocatorBase>> _point_locators;
69
71 const std::vector<MooseFunctorName> _functor_names;
73 std::vector<std::vector<const Moose::Functor<Real> *>> _functors;
75 std::vector<bool> _functor_is_variable;
76
79};
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
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Transfers a functor (can be variable, function, functor material property, spatial UO,...
virtual void prepareEvaluationOfInterpValues(const unsigned int var_index) override
void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup.
std::vector< bool > _functor_is_variable
Whether the functor is a variable.
std::string getDataSourceName(unsigned int var_index) const override
Return a human-readable description of the data source (variable, functor, user object,...
std::vector< std::vector< const Moose::Functor< Real > * > > _functors
Pointers to the source functors.
std::vector< std::unique_ptr< libMesh::PointLocatorBase > > _point_locators
virtual void evaluateInterpValues(const unsigned int var_index, const std::vector< std::pair< Point, unsigned int > > &incoming_points, std::vector< std::pair< Real, Real > > &outgoing_vals) override
void buildKDTrees(const unsigned int var_index) override
void evaluateValues(const unsigned int var_index, const std::vector< std::pair< Point, unsigned int > > &incoming_points, std::vector< std::pair< Real, Real > > &outgoing_vals)
const MooseEnum _extrapolation_behavior
How to determine values where the target mesh does not overlap the source mesh.
const std::vector< MooseFunctorName > _functor_names
Names of the source functors.
Base class for working with KDTrees in transfers, whether for interpolation or extrapolation.
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...