MultiResolutionAnalysis

The MultiResolutionAnalysis (MRA) class contains the methods to project objects onto the spatial grid. That is, to combine different functions and operators in mathematical operations, they need to be compatible; they must be defined on the same computational domain and constructed using the same polynomial basis (order and type). This information constitutes an MRA, which needs to be defined and passed as argument to all function and operator constructors, and only functions and operators with compatible MRAs can be combined in subsequent calculations.

template<int D>
class MultiResolutionAnalysis

Class collecting computational domain and MW basis.

In order to combine different functions and operators in mathematical operations, they need to be compatible. That is, they must be defined on the same computational domain and constructed using the same polynomial basis (order and type). This information constitutes an MRA, which needs to be defined and passed as argument to all function and operator constructors, and only functions and operators with compatible MRAs can be combined in subsequent calculations.

Public Functions

MultiResolutionAnalysis(std::array<int, 2> bb, int order, int depth = MaxDepth)

Constructs a MultiResolutionAnalysis object composed of computational domain (world) and a polynomial basis (Multiwavelets)

Constructor of the MultiResolutionAnalysis class from scratch, without requiring any pre-existing complex structure. The constructor calls the InterpolatingBasis basis constructor to generate the MultiWavelets basis of functions, then the BoundingBox constructor to create the computational domain. The constructor then checks if the generated node depth, or node refinement is beyond the root scale or the maximum depth allowed, in which case it will abort the process. Otherwise, the process goes on to setup the filters with the class’ setupFilter method.

Parameters:
  • bb[in] 2-element integer array [Lower, Upper] defining the bounds for a BoundingBox object representing the computational domain

  • order[in] Maximum polynomial order of the multiwavelet basis, immediately used in the constructor of an InterPolatingBasis object which becomes an attribute of the MRA

  • maxDepth[in] Exponent of the node refinement in base 2, relative to root scale. In other words, it is the maximum amount of refinement that we allow in a node, in other to avoid overflow of values.

Returns:

New MultiResolutionAnalysis (MRA) object

MultiResolutionAnalysis(const BoundingBox<D> &bb, int order, int depth = MaxDepth)

Constructs a MultiResolutionAnalysis object composed of computational domain (world) and a polynomial basis (Multiwavelets) from a pre-existing BoundingBox object.

Constructor of the MultiResolutionAnalysis class from a BoundingBox object. For more details see the first constructor.

Parameters:
  • bb[in] BoundingBox object representing the computational domain

  • order[in] (integer) Maximum polynomial order of the multiwavelet basis, immediately used in the constructor of an InterPolatingBasis object which becomes an attribute of the MRA

  • maxDepth[in] (integer) Exponent of the node refinement in base 2, relative to root scale. In other words, it is the maximum amount of refinement that we allow in a node, in other to avoid overflow of values.

Returns:

New MultiResolutionAnalysis (MRA) object

MultiResolutionAnalysis(const BoundingBox<D> &bb, const ScalingBasis &sb, int depth = MaxDepth)

Constructor for a MultiResolutionAnalysis object from a pre-existing BoundingBox (computational domain) and a ScalingBasis (Multiwavelet basis) objects.

Creates a MRA object from pre-existing BoundingBox and ScalingBasis objects. These objects are taken as reference. For more details about the constructor itself, see the first constructor.

Parameters:
  • bb[in] Computational domain as a BoundingBox object, taken by constant reference

  • sb[in] Polynomial basis (MW) as a ScalingBasis object

  • depth[in] Maximum allowed resolution depth, relative to root scale

Returns:

New MultiResolutionAnalysis object

MultiResolutionAnalysis(const MultiResolutionAnalysis<D> &mra)

Copy constructor for a MultiResolutionAnalysis object composed of computational domain (world) and a polynomial basis (Multiwavelets)

Copy a MultiResolutionAnalysis object without modifying the original. For more details see the first constructor.

Parameters:

mra[in] Pre-existing MRA object

Returns:

New MultiResolutionAnalysis (MRA) object

double calcMaxDistance() const

Computes the difference between the lower and upper bounds of the computational domain.

Returns:

Maximum possible distance between two points in the MRA domain

bool operator==(const MultiResolutionAnalysis<D> &mra) const

Equality operator for the MultiResolutionAnalysis class, returns true if both MRAs have the same polynomial basis, computational domain and maximum depth, and false otherwise.

Equality operator for the MultiResolutionAnalysis class, returns true if both MRAs have the same polynomial basis represented by a BoundingBox object, computational domain (ScalingBasis object) and maximum depth (integer), and false otherwise. Computations on different MRA cannot be combined, this operator can be used to make sure that the multiple MRAs are compatible. For more information about the meaning of equality for BoundingBox and ScalingBasis objets, see their respective classes.

Parameters:

mra[in] MRA object, taken by constant reference

Returns:

Whether the two MRA objects are equal.

bool operator!=(const MultiResolutionAnalysis<D> &mra) const

Inequality operator for the MultiResolutionAnalysis class, returns false if both MRAs have the same polynomial basis, computational domain and maximum depth, and true otherwise.

Inequality operator for the MultiResolutionAnalysis class, returns true if both MRAs have the same polynomial basis represented by a BoundingBox object, computational domain (ScalingBasis object) and maximum depth (integer), and false otherwise. Opposite of the == operator. For more information about the meaning of equality for BoundingBox and ScalingBasis objets, see their respective classes.

Parameters:

mra[in] MRA object, taken by constant reference

Returns:

Whether the two MRA objects are not equal.

void print() const

Displays the MRA’s attributes in the outstream defined in the Printer class.

This function displays the attributes of the MRA in the using the Printer class. By default, the Printer class writes all information in the output file, not the terminal.

Protected Functions

void setupFilter()

Initializes the MW filters for the given MW basis.

By calling the get() function for the appropriate MW basis, the global FilterCache Singleton object is initialized. Any subsequent reference to this particular filter will point to the same unique global object.