https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MultiAppConservativeTransfer.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
19{
20public:
22
24
25 virtual void initialSetup() override;
26
31 virtual void postExecute();
32
33protected:
34 virtual std::vector<VariableName> getFromVarNames() const override { return _from_var_names; }
35 virtual std::vector<AuxVariableName> getToVarNames() const override { return _to_var_names; }
36
37 bool performAdjustment(const PostprocessorValue & from, const PostprocessorValue & to) const;
38
40 const std::vector<VariableName> _from_var_names;
42 const std::vector<AuxVariableName> _to_var_names;
43
45 VariableName _from_var_name;
46 AuxVariableName _to_var_name;
47
51 std::vector<PostprocessorName> _from_postprocessors_to_be_preserved;
53 std::vector<PostprocessorName> _to_postprocessors_to_be_preserved;
54
55private:
56 void adjustTransferredSolution(FEProblemBase * from_problem,
57 PostprocessorName & from_postprocessor,
58 FEProblemBase & to_problem,
59 PostprocessorName & to_postprocessor);
60
61 void adjustTransferredSolutionNearestPoint(unsigned int i,
62 FEProblemBase * from_problem,
63 PostprocessorName & from_postprocessor,
64 FEProblemBase & to_problem,
65 PostprocessorName & to_postprocessor);
66
71};
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
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
Transfers variables on possibly different meshes while conserving a user defined property (Postproces...
bool performAdjustment(const PostprocessorValue &from, const PostprocessorValue &to) const
std::vector< PostprocessorName > _to_postprocessors_to_be_preserved
Postprocessor evaluates an adjuster for the target physics.
VariableName _from_var_name
This values are used if a derived class only supports one variable.
const std::vector< VariableName > _from_var_names
Name of variables transferring from.
bool _use_nearestpoint_pps
Whether to use a nearest point UserObject to obtain the conservation factor.
const std::vector< AuxVariableName > _to_var_names
Name of variables transferring to.
std::vector< PostprocessorName > _from_postprocessors_to_be_preserved
Postprocessor evaluates an adjuster for the source physics.
virtual void postExecute()
Add some extra work if necessary after execute().
bool _allow_skipped_adjustment
Whether the adjustment may be skipped when the postprocessor values are 0 / of different signs.
bool _preserve_transfer
If this transfer is going to conserve the physics.
virtual void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup.
virtual std::vector< VariableName > getFromVarNames() const override
Virtual function defining variables to be transferred.
void adjustTransferredSolution(FEProblemBase *from_problem, PostprocessorName &from_postprocessor, FEProblemBase &to_problem, PostprocessorName &to_postprocessor)
virtual std::vector< AuxVariableName > getToVarNames() const override
Virtual function defining variables to transfer to.
void adjustTransferredSolutionNearestPoint(unsigned int i, FEProblemBase *from_problem, PostprocessorName &from_postprocessor, FEProblemBase &to_problem, PostprocessorName &to_postprocessor)
Intermediary class that allows variable names as inputs.