https://mooseframework.inl.gov
MappingInterface.C
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 #include "MappingInterface.h"
11 #include "MooseTypes.h"
12 
15 {
16  return emptyInputParameters();
17 }
18 
20  : _smi_params(moose_object->parameters()),
21  _smi_feproblem(*_smi_params.get<FEProblemBase *>("_fe_problem_base"))
22 {
23 }
24 
26 MappingInterface::getMappingByName(const UserObjectName & name) const
27 {
28  std::vector<VariableMappingBase *> models;
30  .query()
31  .condition<AttribName>(name)
32  .condition<AttribSystem>("VariableMappingBase")
33  .queryInto(models);
34  if (models.empty())
35  mooseError("Unable to find a Mapping object with the name '" + name + "'");
36  return *(models[0]);
37 }
38 
40 MappingInterface::getMapping(const std::string & name) const
41 {
42  return getMappingByName(_smi_params.get<UserObjectName>(name));
43 }
void mooseError(Args &&... args)
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
VariableMappingBase & getMapping(const std::string &name) const
Get the mapping using the parameters of the moose object.
InputParameters emptyInputParameters()
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
TheWarehouse & theWarehouse() const
const std::string name
Definition: Setup.h:20
VariableMappingBase & getMappingByName(const UserObjectName &name) const
Get the mapping by supplying the name of the object in the warehouse.
const InputParameters & _smi_params
Parameters of the object with this interface.
Query query()
This is an abstract base class for objects that provide mapping between a full-order and a latent spa...
MappingInterface(const MooseObject *moose_object)
Construct using a moose object (usually the object which inherits from the interface) ...
static InputParameters validParams()
const Elem & get(const ElemType type_in)