https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
18
20 : _smi_params(moose_object->parameters()),
21 _smi_feproblem(*_smi_params.get<FEProblemBase *>("_fe_problem_base"))
22{
23}
24
26MappingInterface::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
40MappingInterface::getMapping(const std::string & name) const
41{
42 return getMappingByName(_smi_params.get<UserObjectName>(name));
43}
InputParameters emptyInputParameters()
void mooseError(Args &&... args)
const std::string name
Definition Setup.h:21
TheWarehouse & theWarehouse() const
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
static InputParameters validParams()
VariableMappingBase & getMapping(const std::string &name) const
Get the mapping using the parameters of the moose object.
VariableMappingBase & getMappingByName(const UserObjectName &name) const
Get the mapping by supplying the name of the object in the warehouse.
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
MappingInterface(const MooseObject *moose_object)
Construct using a moose object (usually the object which inherits from the interface)
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...