https://mooseframework.inl.gov
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 
12 #include "MultiAppFieldTransfer.h"
13 
19 {
20 public:
22 
24 
25  virtual void initialSetup() override;
26 
31  virtual void postExecute();
32 
33 protected:
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 
55 private:
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 };
bool _use_nearestpoint_pps
Whether to use a nearest point UserObject to obtain the conservation factor.
const std::vector< VariableName > _from_var_names
Name of variables transferring from.
void adjustTransferredSolutionNearestPoint(unsigned int i, FEProblemBase *from_problem, PostprocessorName &from_postprocessor, FEProblemBase &to_problem, PostprocessorName &to_postprocessor)
bool _allow_skipped_adjustment
Whether the adjustment may be skipped when the postprocessor values are 0 / of different signs...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void postExecute()
Add some extra work if necessary after execute().
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void adjustTransferredSolution(FEProblemBase *from_problem, PostprocessorName &from_postprocessor, FEProblemBase &to_problem, PostprocessorName &to_postprocessor)
virtual void initialSetup() override
Method called at the beginning of the simulation for checking integrity or doing one-time setup...
MultiAppConservativeTransfer(const InputParameters &parameters)
Intermediary class that allows variable names as inputs.
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:202
const std::vector< AuxVariableName > _to_var_names
Name of variables transferring to.
Transfers variables on possibly different meshes while conserving a user defined property (Postproces...
bool performAdjustment(const PostprocessorValue &from, const PostprocessorValue &to) const
virtual std::vector< VariableName > getFromVarNames() const override
Virtual function defining variables to be transferred.
virtual std::vector< AuxVariableName > getToVarNames() const override
Virtual function defining variables to transfer to.
std::vector< PostprocessorName > _to_postprocessors_to_be_preserved
Postprocessor evaluates an adjuster for the target physics.
const InputParameters & parameters() const
Get the parameters of the object.
std::vector< PostprocessorName > _from_postprocessors_to_be_preserved
Postprocessor evaluates an adjuster for the source physics.
VariableName _from_var_name
This values are used if a derived class only supports one variable.
bool _preserve_transfer
If this transfer is going to conserve the physics.