Skip to content
Snippets Groups Projects
Commit 01a77a08 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Allow IDiscreteFunction to return its underlying data type

This allows for instance to retrieve completely the kind of P0
function that is in use. For instance a P0 function build of R^d
elements.
parent 406fedff
No related branches found
No related tags found
1 merge request!75Feature/language discretization
......@@ -22,6 +22,12 @@ class DiscreteFunctionP0 : public IDiscreteFunction
DiscreteFunctionDescriptorP0 m_discrete_function_descriptor;
public:
ASTNodeDataType
dataType() const final
{
return ast_node_data_type_from<DataType>;
}
CellValue<DataType>
cellValues() const
{
......@@ -51,6 +57,7 @@ class DiscreteFunctionP0 : public IDiscreteFunction
{
using MeshDataType = MeshData<Dimension>;
MeshDataType& mesh_data = MeshDataManager::instance().getMeshData(*mesh);
m_cell_values =
InterpolateItemValue<DataType(TinyVector<Dimension>)>::template interpolate<ItemType::cell>(function_id,
mesh_data.xj());
......
#ifndef I_DISCRETE_FUNCTION_HPP
#define I_DISCRETE_FUNCTION_HPP
#include <memory>
class IMesh;
class IDiscreteFunctionDescriptor;
#include <language/utils/ASTNodeDataTypeTraits.hpp>
#include <memory>
class IDiscreteFunction
{
public:
virtual std::shared_ptr<const IMesh> mesh() const = 0;
virtual const IDiscreteFunctionDescriptor& descriptor() const = 0;
virtual ASTNodeDataType dataType() const = 0;
IDiscreteFunction() = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment