Line data Source code
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 "MultiAppConservativeTransfer.h" 13 : 14 : // Forward declarations 15 : namespace libMesh 16 : { 17 : class LinearImplicitSystem; 18 : } 19 : 20 : /** 21 : * Project values from one domain to another 22 : */ 23 : class MultiAppProjectionTransfer : public MultiAppConservativeTransfer 24 : { 25 : public: 26 : static InputParameters validParams(); 27 : 28 : MultiAppProjectionTransfer(const InputParameters & parameters); 29 : 30 : virtual void initialSetup() override; 31 : 32 : virtual void execute() override; 33 : 34 : protected: 35 : void toMultiApp(); 36 : void fromMultiApp(); 37 : 38 : void assembleL2(libMesh::EquationSystems & es, const std::string & system_name); 39 : 40 : void projectSolution(unsigned int to_problem); 41 : 42 : MooseEnum _proj_type; 43 : 44 : /// True, if we need to recompute the projection matrix 45 : bool _compute_matrix; 46 : std::vector<libMesh::LinearImplicitSystem *> _proj_sys; 47 : /// Having one projection variable number seems weird, but there is always one variable in every system being used for projection, 48 : /// thus is always going to be 0 unless something changes in libMesh or we change the way we project variables 49 : unsigned int _proj_var_num; 50 : 51 : friend void assemble_l2(libMesh::EquationSystems & es, const std::string & system_name); 52 : 53 : // These variables allow us to cache qps for fixed meshes. 54 : bool _fixed_meshes; 55 : bool _qps_cached; 56 : std::map<processor_id_type, std::vector<libMesh::Point>> _cached_qps; 57 : std::map<processor_id_type, std::map<std::pair<unsigned int, unsigned int>, unsigned int>> 58 : _cached_index_map; 59 : 60 : private: 61 96 : bool usesMooseAppCoordTransform() const override { return true; } 62 : };