template class geode::RegularGridScalarFunction

Overview

#include <regular_grid_scalar_function.h>

template <index_t dimension>
class RegularGridScalarFunction
{
public:
    // construction

    RegularGridScalarFunction(RegularGridScalarFunction<dimension>&& other);

    // methods

    void set_value(const GridVertexIndices<dimension>& vertex_index, double value);
    void set_value(index_t vertex_index, double value);
    double value(const GridVertexIndices<dimension>& vertex_index) const;
    double value(index_t vertex_index) const;

    double value(
        const Point<dimension>& point,
        const GridCellIndices<dimension>& grid_cell_indices
        ) const;

    static RegularGridScalarFunction<dimension> create(
        const RegularGrid<dimension>& grid,
        absl::string_view function_name,
        double value
        );

    static RegularGridScalarFunction<dimension> find(
        const RegularGrid<dimension>& grid,
        absl::string_view function_name
        );
};

Detailed Documentation

Methods

static RegularGridScalarFunction<dimension> create(
    const RegularGrid<dimension>& grid,
    absl::string_view function_name,
    double value
    )

Create a new object function from a RegularGrid, a name, and a value. Throws an exception if an attribute with the same name exists.

static RegularGridScalarFunction<dimension> find(
    const RegularGrid<dimension>& grid,
    absl::string_view function_name
    )

Finds an object function that already exists in the given RegularGrid, from its given name. Throws an exception if no attribute with the same name exists.