File interpolation_factory.hxx

class InterpolationFactory

Public Types

using CreateInterpCallback = Interpolation *(*)(Mesh *)

Callback function definition for creating Interpolation objects.

Public Functions

~InterpolationFactory()
std::string getDefaultInterpType()

A string representing the default interpolation type.

Interpolation *create(Mesh *mesh)

Create an interpolation object.

Interpolation *create(Options *options = nullptr, Mesh *mesh = nullptr)
Interpolation *create(const std::string &name, Options *options = nullptr, Mesh *mesh = nullptr)

Create an Interpolation object

Return
A new copy of an Interpolation object
Parameters
  • name: The name of the interpolation method
  • options: An Options object (e.g. an input file)
  • mesh: A Mesh object to construct the interpolation on

void add(CreateInterpCallback interp, const std::string &name)

Add available interpolations to database.

Public Static Functions

InterpolationFactory *getInstance()

Create or get the singleton instance of the factory.

void cleanup()

Destroy the singleton instance.

Private Functions

InterpolationFactory()

Add the available interpolation methods to the internal map

Private default constructor to prevent instantiation of this class

InterpolationFactory::CreateInterpCallback findInterpolation(const std::string &name)

Find an interpolation method in the list of available methods

Return
A pointer to the Interpolation object in the map
Parameters
  • name: Name of the interpolation method

Private Members

std::map<std::string, CreateInterpCallback> interp_map

Database of available interpolations.

Private Static Attributes

InterpolationFactory *instance = nullptr

The only instance of this class (singleton)