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

Remove useless specializations of interpolate function

parent e366b86c
Branches
Tags
1 merge request!145git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
......@@ -158,19 +158,6 @@ SchemeModule::SchemeModule()
));
this->_addBuiltinFunction(
"interpolate",
std::make_shared<BuiltinFunctionEmbedder<std::shared_ptr<
const IDiscreteFunction>(std::shared_ptr<const IMesh>, std::shared_ptr<const IDiscreteFunctionDescriptor>,
const std::vector<FunctionSymbolId>&)>>(
[](std::shared_ptr<const IMesh> mesh,
std::shared_ptr<const IDiscreteFunctionDescriptor> discrete_function_descriptor,
const std::vector<FunctionSymbolId>& function_id_list) -> std::shared_ptr<const IDiscreteFunction> {
return DiscreteFunctionVectorInterpoler{mesh, discrete_function_descriptor, function_id_list}.interpolate();
}
));
this->_addBuiltinFunction("interpolate",
std::make_shared<BuiltinFunctionEmbedder<std::shared_ptr<
const IDiscreteFunction>(std::shared_ptr<const IMesh>,
......@@ -182,57 +169,19 @@ SchemeModule::SchemeModule()
std::shared_ptr<const IDiscreteFunctionDescriptor> discrete_function_descriptor,
const std::vector<FunctionSymbolId>& function_id_list)
-> std::shared_ptr<const IDiscreteFunction> {
return DiscreteFunctionVectorInterpoler{mesh, interpolation_zone_list,
discrete_function_descriptor, function_id_list}
.interpolate();
}
));
this->_addBuiltinFunction(
"interpolate",
std::make_shared<BuiltinFunctionEmbedder<std::shared_ptr<
const IDiscreteFunction>(std::shared_ptr<const IMesh>, std::shared_ptr<const IDiscreteFunctionDescriptor>,
const FunctionSymbolId&)>>(
[](std::shared_ptr<const IMesh> mesh,
std::shared_ptr<const IDiscreteFunctionDescriptor> discrete_function_descriptor,
const FunctionSymbolId& function_id) -> std::shared_ptr<const IDiscreteFunction> {
switch (discrete_function_descriptor->type()) {
case DiscreteFunctionType::P0: {
return DiscreteFunctionInterpoler{mesh, discrete_function_descriptor, function_id}.interpolate();
}
case DiscreteFunctionType::P0Vector: {
return DiscreteFunctionVectorInterpoler{mesh, discrete_function_descriptor, {function_id}}.interpolate();
}
default: {
if (function_id_list.size() != 1) {
throw NormalError("invalid function descriptor type");
}
}
}
));
this->_addBuiltinFunction("interpolate",
std::make_shared<BuiltinFunctionEmbedder<std::shared_ptr<
const IDiscreteFunction>(std::shared_ptr<const IMesh>,
const std::vector<std::shared_ptr<const IZoneDescriptor>>&,
std::shared_ptr<const IDiscreteFunctionDescriptor>,
const FunctionSymbolId&)>>(
[](std::shared_ptr<const IMesh> mesh,
const std::vector<std::shared_ptr<const IZoneDescriptor>>& interpolation_zone_list,
std::shared_ptr<const IDiscreteFunctionDescriptor> discrete_function_descriptor,
const FunctionSymbolId& function_id) -> std::shared_ptr<const IDiscreteFunction> {
switch (discrete_function_descriptor->type()) {
case DiscreteFunctionType::P0: {
return DiscreteFunctionInterpoler{mesh, interpolation_zone_list,
discrete_function_descriptor, function_id}
discrete_function_descriptor, function_id_list[0]}
.interpolate();
}
case DiscreteFunctionType::P0Vector: {
return DiscreteFunctionVectorInterpoler{mesh,
interpolation_zone_list,
return DiscreteFunctionVectorInterpoler{mesh, interpolation_zone_list,
discrete_function_descriptor,
{function_id}}
function_id_list}
.interpolate();
}
default: {
......@@ -243,31 +192,23 @@ SchemeModule::SchemeModule()
));
this
->_addBuiltinFunction("interpolate",
std::make_shared<BuiltinFunctionEmbedder<
std::shared_ptr<const IDiscreteFunction>(std::shared_ptr<const IMesh>,
std::shared_ptr<const IZoneDescriptor>,
std::shared_ptr<const IDiscreteFunctionDescriptor>,
const FunctionSymbolId&)>>(
this->_addBuiltinFunction(
"interpolate",
std::make_shared<BuiltinFunctionEmbedder<std::shared_ptr<
const IDiscreteFunction>(std::shared_ptr<const IMesh>, std::shared_ptr<const IDiscreteFunctionDescriptor>,
const std::vector<FunctionSymbolId>&)>>(
[](std::shared_ptr<const IMesh> mesh,
std::shared_ptr<const IZoneDescriptor> interpolation_zone,
std::shared_ptr<const IDiscreteFunctionDescriptor> discrete_function_descriptor,
const FunctionSymbolId& function_id) -> std::shared_ptr<const IDiscreteFunction> {
const std::vector<FunctionSymbolId>& function_id_list) -> std::shared_ptr<const IDiscreteFunction> {
switch (discrete_function_descriptor->type()) {
case DiscreteFunctionType::P0: {
return DiscreteFunctionInterpoler{mesh,
{interpolation_zone},
discrete_function_descriptor,
function_id}
.interpolate();
if (function_id_list.size() != 1) {
throw NormalError("invalid function descriptor type");
}
return DiscreteFunctionInterpoler{mesh, discrete_function_descriptor, function_id_list[0]}.interpolate();
}
case DiscreteFunctionType::P0Vector: {
return DiscreteFunctionVectorInterpoler{mesh,
{interpolation_zone},
discrete_function_descriptor,
{function_id}}
.interpolate();
return DiscreteFunctionVectorInterpoler{mesh, discrete_function_descriptor, function_id_list}.interpolate();
}
default: {
throw NormalError("invalid function descriptor type");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment