www.mooseframework.org
LazyCoupleable.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 // MOOSE includes
13 #include "MooseVariableBase.h"
14 
15 // Forward declarations
16 class InputParameters;
17 class MooseObject;
18 class MooseApp;
19 
25 {
26 public:
32  LazyCoupleable(const MooseObject * moose_object);
33 
34  virtual ~LazyCoupleable() = default;
35 
42  void setFEProblemPtr(FEProblemBase * fe_problem);
43 
44 private:
45  void init();
46 
54  unsigned int & coupled(const std::string & var_name, unsigned int comp = 0);
55 
56  // Reference to the interface's input parameters
58 
60  const std::string & _l_name;
61 
64 
67 
69  std::map<std::string, std::unique_ptr<unsigned int>> _coupled_var_numbers;
70 };
std::map< std::string, std::unique_ptr< unsigned int > > _coupled_var_numbers
Coupled vars whose values we provide.
const std::string & _l_name
The name of the object this interface is part of.
virtual ~LazyCoupleable()=default
Base class for MOOSE-based applications.
Definition: MooseApp.h:73
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const InputParameters & _l_parameters
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
unsigned int & coupled(const std::string &var_name, unsigned int comp=0)
Returns the index for a coupled variable by name.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
MooseApp & _l_app
Reference to the MooseApp.
Interface for objects that need coupling capabilities.
FEProblemBase * _l_fe_problem
Reference to FEProblemBase.
LazyCoupleable(const MooseObject *moose_object)
Constructing the object.
void setFEProblemPtr(FEProblemBase *fe_problem)
Sets the FEProblem pointer which can (and is expected) to happen long after this interface is constru...