Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
da91ced5
Commit
da91ced5
authored
4 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[functions.inverse] update
parent
8c82a64f
No related branches found
No related tags found
3 merge requests
!41
Fix compilation with icc, several other changes
,
!39
Make functions copyable
,
!35
dailywork-ftschindler
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/xt/functions/inverse.hh
+22
-13
22 additions, 13 deletions
dune/xt/functions/inverse.hh
with
22 additions
and
13 deletions
dune/xt/functions/inverse.hh
+
22
−
13
View file @
da91ced5
...
...
@@ -15,7 +15,10 @@
#include
<dune/xt/common/float_cmp.hh>
#include
<dune/xt/common/memory.hh>
#include
<dune/xt/la/matrix-inverter.hh>
#include
<dune/xt/functions/grid-function.hh>
#include
<dune/xt/functions/interfaces/element-functions.hh>
#include
<dune/xt/functions/interfaces/function.hh>
#include
<dune/xt/functions/interfaces/grid-function.hh>
#include
<dune/xt/functions/exceptions.hh>
#include
<dune/xt/functions/type_traits.hh>
...
...
@@ -53,7 +56,7 @@ public:
static
RangeReturnType
compute
(
const
FunctionType
&
func
,
const
DomainType
&
xx
,
const
XT
::
Common
::
Parameter
&
param
)
{
auto
value_to_invert
=
func
.
evaluate
(
xx
,
param
);
auto
value_to_invert
=
func
.
evaluate
(
xx
,
param
)
[
0
]
;
DUNE_THROW_IF
(
XT
::
Common
::
FloatCmp
::
eq
(
value_to_invert
,
0.
),
Exceptions
::
wrong_input_given
,
"Scalar function value was not invertible!
\n\n
value_to_invert = "
<<
value_to_invert
);
...
...
@@ -129,7 +132,7 @@ public:
{}
protected
:
void
post_bind
(
const
ElementType
&
element
)
void
post_bind
(
const
ElementType
&
element
)
override
final
{
func_
.
access
().
bind
(
element
);
}
...
...
@@ -207,46 +210,52 @@ class InverseGridFunction
internal
::
InverseFunctionHelper
<
GridFunctionType
>::
rC
,
typename
internal
::
InverseFunctionHelper
<
GridFunctionType
>::
R
>
{
using
Helper
=
internal
::
InverseFunctionHelper
<
GridFunctionType
>
;
static
const
constexpr
size_t
r_
=
GridFunctionType
::
r
;
static
const
constexpr
size_t
rC_
=
GridFunctionType
::
rC
;
public:
using
BaseType
=
GridFunctionInterface
<
typename
GridFunctionType
::
E
,
internal
::
InverseFunctionHelper
<
GridFunctionType
>::
r
,
internal
::
InverseFunctionHelper
<
GridFunctionType
>::
rC
,
typename
internal
::
InverseFunctionHelper
<
GridFunctionType
>::
R
>
;
using
Helper
=
internal
::
InverseFunctionHelper
<
GridFunctionType
>
;
public:
using
typename
BaseType
::
E
;
using
typename
BaseType
::
LocalFunctionType
;
using
typename
BaseType
::
R
;
InverseGridFunction
(
const
GridFunction
Type
&
func
,
const
int
ord
)
InverseGridFunction
(
GridFunction
<
E
,
r_
,
rC_
,
R
>
func
,
const
int
ord
,
const
std
::
string
nm
=
""
)
:
func_
(
func
)
,
order_
(
ord
)
,
name_
(
nm
.
empty
()
?
(
"inverse of "
+
func_
.
name
())
:
nm
)
{}
InverseGridFunction
(
std
::
shared_ptr
<
const
GridFunctionType
>
func
,
const
int
ord
)
InverseGridFunction
(
std
::
shared_ptr
<
const
GridFunctionType
>
func
,
const
int
ord
,
const
std
::
string
nm
=
""
)
:
func_
(
func
)
,
order_
(
ord
)
,
name_
(
nm
.
empty
()
?
(
"inverse of "
+
func_
.
name
())
:
nm
)
{}
InverseGridFunction
(
std
::
unique_ptr
<
const
GridFunctionType
>&&
func
,
const
int
ord
)
InverseGridFunction
(
std
::
unique_ptr
<
const
GridFunctionType
>&&
func
,
const
int
ord
,
const
std
::
string
nm
=
""
)
:
func_
(
std
::
move
(
func
))
,
order_
(
ord
)
,
name_
(
nm
.
empty
()
?
(
"inverse of "
+
func_
.
name
())
:
nm
)
{}
std
::
unique_ptr
<
LocalFunctionType
>
local_function
()
const
override
final
{
using
LocalFunction
=
InverseElementFunction
<
typename
GridFunctionType
::
LocalFunctionType
>
;
return
std
::
unique_ptr
<
LocalFunction
>
(
new
LocalFunction
(
std
::
move
(
func_
.
access
()
.
local_function
()
)
,
order_
));
return
std
::
unique_ptr
<
LocalFunction
>
(
new
LocalFunction
(
func_
.
local_function
(),
order_
));
}
std
::
string
name
()
const
override
final
{
auto
func_name
=
func_
.
access
().
name
();
return
func_name
.
empty
()
?
(
"dune.xt.functions.inversegridfunction"
)
:
(
"inverse of "
+
func_name
);
return
name_
;
}
private
:
const
XT
::
Common
::
ConstStorageProvider
<
GridFunctionType
>
func_
;
const
GridFunction
<
E
,
r_
,
rC_
,
R
>
func_
;
const
int
order_
;
const
std
::
string
name_
;
};
// class InverseGridFunction
...
...
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