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

Prepare use of R^d -> (R) function for P0 vector interpolation

parent 063dc78a
Branches
Tags
1 merge request!167Improve fluxing based remapping
......@@ -96,11 +96,7 @@ template <size_t Dimension>
DiscreteFunctionVariant
DiscreteFunctionVectorInterpoler::_interpolate() const
{
for (const auto& function_id : m_function_id_list) {
const auto& function_descriptor = function_id.descriptor();
Assert(function_descriptor.domainMappingNode().children[1]->m_data_type == ASTNodeDataType::typename_t);
const ASTNodeDataType& data_type = function_descriptor.domainMappingNode().children[1]->m_data_type.contentType();
auto check_data_type = [](const ASTNodeDataType& data_type) {
switch (data_type) {
case ASTNodeDataType::bool_t:
case ASTNodeDataType::unsigned_int_t:
......@@ -115,7 +111,32 @@ DiscreteFunctionVectorInterpoler::_interpolate() const
throw NormalError(os.str());
}
}
};
if (m_function_id_list.size() == 1) {
const auto& function_descriptor = m_function_id_list[0].descriptor();
if ((function_descriptor.domainMappingNode().children[1]->m_data_type == ASTNodeDataType::typename_t) or
(function_descriptor.domainMappingNode().children[1]->m_data_type == ASTNodeDataType::tuple_t)) {
const ASTNodeDataType& data_type = function_descriptor.domainMappingNode().children[1]->m_data_type.contentType();
check_data_type(data_type);
} else {
throw UnexpectedError("incorrect function");
}
} else {
for (const auto& function_id : m_function_id_list) {
const auto& function_descriptor = function_id.descriptor();
if (function_descriptor.domainMappingNode().children[1]->m_data_type == ASTNodeDataType::typename_t) {
const ASTNodeDataType& data_type =
function_descriptor.domainMappingNode().children[1]->m_data_type.contentType();
check_data_type(data_type);
} else {
throw UnexpectedError("incorrect function");
}
}
}
return this->_interpolate<Dimension, double>();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment