Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
41816454
Commit
41816454
authored
2 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Remove useless specializations of interpolate function
parent
e366b86c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!145
git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/language/modules/SchemeModule.cpp
+26
-85
26 additions, 85 deletions
src/language/modules/SchemeModule.cpp
with
26 additions
and
85 deletions
src/language/modules/SchemeModule.cpp
+
26
−
85
View file @
41816454
...
...
@@ -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"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment