File interpolation_factory.hxx

class InterpolationFactory

Public Types

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

Callback function definition for creating Interpolation objects.

Public Functions

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

A new copy of an Interpolation object
  • 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


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

A pointer to the Interpolation object in the map
  • 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)