https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
MappingInterface Class Reference

An interface class that helps getting access to Mapping objects. More...

#include <MappingInterface.h>

Inheritance diagram for MappingInterface:
[legend]

Public Member Functions

 MappingInterface (const MooseObject *moose_object)
 Construct using a moose object (usually the object which inherits from the interface) More...
 
VariableMappingBasegetMapping (const std::string &name) const
 Get the mapping using the parameters of the moose object. More...
 
VariableMappingBasegetMappingByName (const UserObjectName &name) const
 Get the mapping by supplying the name of the object in the warehouse. More...
 

Static Public Member Functions

static InputParameters validParams ()
 

Private Attributes

const InputParameters_smi_params
 Parameters of the object with this interface. More...
 
FEProblemBase_smi_feproblem
 Reference to FEProblemBase instance. More...
 

Detailed Description

An interface class that helps getting access to Mapping objects.

Definition at line 19 of file MappingInterface.h.

Constructor & Destructor Documentation

◆ MappingInterface()

MappingInterface::MappingInterface ( const MooseObject moose_object)

Construct using a moose object (usually the object which inherits from the interface)

Definition at line 19 of file MappingInterface.C.

20  : _smi_params(moose_object->parameters()),
21  _smi_feproblem(*_smi_params.get<FEProblemBase *>("_fe_problem_base"))
22 {
23 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
const InputParameters & _smi_params
Parameters of the object with this interface.
const InputParameters & parameters() const

Member Function Documentation

◆ getMapping()

VariableMappingBase & MappingInterface::getMapping ( const std::string &  name) const

Get the mapping using the parameters of the moose object.

Parameters
nameThe parameter name

Definition at line 40 of file MappingInterface.C.

Referenced by SingularTripletReporter::initialSetup(), and InverseMapping::initialSetup().

41 {
42  return getMappingByName(_smi_params.get<UserObjectName>(name));
43 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) 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.

◆ getMappingByName()

VariableMappingBase & MappingInterface::getMappingByName ( const UserObjectName &  name) const

Get the mapping by supplying the name of the object in the warehouse.

Parameters
nameThe name of the mapping object

Definition at line 26 of file MappingInterface.C.

Referenced by getMapping(), MappingReporter::initialSetup(), and MappingOutput::output().

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 }
void mooseError(Args &&... args)
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
TheWarehouse & theWarehouse() const
const std::string name
Definition: Setup.h:20
Query query()

◆ validParams()

InputParameters MappingInterface::validParams ( )
static

Definition at line 14 of file MappingInterface.C.

Referenced by SingularTripletReporter::validParams(), and MappingReporter::validParams().

15 {
16  return emptyInputParameters();
17 }
InputParameters emptyInputParameters()

Member Data Documentation

◆ _smi_feproblem

FEProblemBase& MappingInterface::_smi_feproblem
private

Reference to FEProblemBase instance.

Definition at line 44 of file MappingInterface.h.

Referenced by getMappingByName().

◆ _smi_params

const InputParameters& MappingInterface::_smi_params
private

Parameters of the object with this interface.

Definition at line 41 of file MappingInterface.h.

Referenced by getMapping().


The documentation for this class was generated from the following files: