Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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-gdt
Commits
9ff72ac0
Commit
9ff72ac0
authored
4 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[norms] update to use new operator API/products
parent
159e19bd
No related branches found
No related tags found
3 merge requests
!10
Draft: consolidate refactoring work
,
!5
Work on refactor operators bindings
,
!1
Refactor operators
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gdt/norms.hh
+72
-68
72 additions, 68 deletions
dune/gdt/norms.hh
with
72 additions
and
68 deletions
dune/gdt/norms.hh
+
72
−
68
View file @
9ff72ac0
...
...
@@ -10,100 +10,104 @@
#ifndef DUNE_GDT_NORMS_HH
#define DUNE_GDT_NORMS_HH
#include
<dune/xt/grid/type_traits.hh>
#include
<dune/gdt/local/bilinear-forms/integrals.hh>
#include
<dune/gdt/local/integrands/laplace.hh>
#include
<dune/gdt/local/integrands/product.hh>
#include
<dune/gdt/operators/bilinear-form.hh>
#include
<dune/gdt/products.hh>
namespace
Dune
{
namespace
GDT
{
template
<
class
GridViewType
,
size_t
r
,
class
SF
,
class
RF
,
class
F
=
double
>
std
::
enable_if_t
<
XT
::
Grid
::
is_view
<
GridViewType
>::
value
,
BilinearForm
<
GridViewType
,
r
,
1
,
SF
,
F
,
r
,
1
,
RF
>>
make_l2_product
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
SF
>&
left
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
RF
>&
right
,
const
int
over_integrate
=
0
)
template
<
class
GridViewType
,
size_t
r
>
double
l2_norm
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
>&
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
r
>
weight
=
1.
,
const
int
over_integrate
=
0
)
{
using
E
=
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
;
auto
product
=
make_bilinear_form
(
grid_view
,
left
,
right
);
product
+=
LocalElementIntegralBilinearForm
<
E
,
r
,
1
,
RF
,
F
,
r
,
1
,
SF
>
(
LocalProductIntegrand
<
E
,
r
,
RF
,
F
,
SF
>
(),
over_integrate
);
return
product
;
return
L2Product
<
r
>
(
grid_view
,
weight
,
over_integrate
).
norm
(
function
);
}
template
<
class
GridViewType
,
size_t
r
,
class
SF
,
class
RF
,
class
F
=
double
>
std
::
enable_if_t
<
XT
::
Grid
::
is_view
<
GridViewType
>::
value
,
F
>
l2_product
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
SF
>&
left
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
RF
>&
right
,
const
int
over_integrate
=
0
)
template
<
class
GridViewType
>
double
l2_norm
(
const
GridViewType
&
grid_view
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
weight
=
1.
,
const
int
over_integrate
=
0
)
{
return
make_l2_p
roduct
(
grid_view
,
left
,
r
ight
,
over_integrate
).
apply2
(
);
return
L2P
roduct
(
grid_view
,
we
ight
,
over_integrate
).
norm
(
function
);
}
template
<
class
GridViewType
,
size_t
r
,
class
R
,
class
F
=
double
>
std
::
enable_if_t
<
XT
::
Grid
::
is_view
<
GridViewType
>::
value
,
F
>
l2_norm
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
R
>&
func
,
const
int
over_integrate
=
0
)
template
<
class
GridViewType
,
size_t
r
>
double
h1_semi_norm
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
>&
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
GridViewType
::
dimension
,
GridViewType
::
dimension
>
weight
=
1.
,
const
int
over_integrate
=
0
)
{
return
H1SemiProduct
<
r
>
(
grid_view
,
weight
,
over_integrate
).
norm
(
function
);
}
template
<
class
GridViewType
>
double
h1_semi_norm
(
const
GridViewType
&
grid_view
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
GridViewType
::
dimension
,
GridViewType
::
dimension
>
weight
=
1.
,
const
int
over_integrate
=
0
)
{
return
std
::
sqrt
(
l2_p
roduct
(
grid_view
,
func
,
func
,
over_integrate
));
return
H1SemiP
roduct
<
1
>
(
grid_view
,
weight
,
over_integrate
)
.
norm
(
function
);
}
template
<
class
GridViewType
,
class
F
,
size_t
r
>
std
::
enable_if_t
<
XT
::
Grid
::
is_view
<
GridViewType
>::
value
,
BilinearForm
<
GridViewType
,
r
,
1
,
F
,
F
,
1
,
1
,
F
>>
make_laplace_product
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
GridViewType
::
dimension
,
GridViewType
::
dimension
,
F
>&
weight
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
F
>&
left
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
F
>&
right
,
const
int
over_integrate
=
0
)
template
<
class
GridViewType
,
size_t
r
>
std
::
enable_if_t
<
r
==
GridViewType
::
dimension
,
double
>
h1_norm
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
>&
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
r
>
weight
=
1.
,
const
int
over_integrate
=
0
)
{
using
E
=
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
;
auto
product
=
make_bilinear_form
(
grid_view
,
left
,
right
);
product
+=
LocalElementIntegralBilinearForm
<
E
,
r
,
1
,
F
,
F
,
r
,
1
,
F
>
(
LocalLaplaceIntegrand
<
E
,
r
,
F
>
(
weight
),
over_integrate
);
return
product
;
return
H1Product
<
r
>
(
grid_view
,
weight
,
over_integrate
).
norm
(
function
);
}
template
<
class
GridViewType
,
size_t
r
>
std
::
enable_if_t
<
r
!=
GridViewType
::
dimension
,
double
>
h1_norm
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
>&
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
weight
=
1.
,
const
int
over_integrate
=
0
)
{
return
H1Product
<
r
>
(
grid_view
,
weight
,
over_integrate
).
norm
(
function
);
}
template
<
class
GridViewType
,
class
F
,
size_t
r
>
std
::
enable_if_t
<
XT
::
Grid
::
is_view
<
GridViewType
>::
value
,
F
>
laplace_product
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
GridViewType
::
dimension
,
GridViewType
::
dimension
,
F
>&
weight
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
F
>&
left
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
F
>&
right
,
const
int
over_integrate
=
0
)
template
<
class
GridViewType
,
size_t
r
>
double
h1_norm
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
>&
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
r
>
l2_weight
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
GridViewType
::
dimension
,
GridViewType
::
dimension
>
h1_semi_weight
,
const
int
over_integrate
=
0
)
{
return
make_laplace_p
roduct
(
grid_view
,
weight
,
left
,
r
ight
,
over_integrate
).
apply2
(
);
return
H1P
roduct
<
r
>
(
grid_view
,
l2_
weight
,
h1_semi_we
ight
,
over_integrate
).
norm
(
function
);
}
template
<
class
GridViewType
>
double
h1_norm
(
const
GridViewType
&
grid_view
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
weight
=
1.
,
const
int
over_integrate
=
0
)
{
return
H1Product
(
grid_view
,
weight
,
over_integrate
).
norm
(
function
);
}
template
<
class
GridViewType
,
class
F
,
size_t
r
>
std
::
enable_if_t
<
XT
::
Grid
::
is_view
<
GridViewType
>::
value
,
F
>
laplace_norm
(
const
GridViewType
&
grid_view
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
GridViewType
::
dimension
,
GridViewType
::
dimension
,
F
>&
weight
,
const
XT
::
Functions
::
GridFunctionInterface
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>
,
r
,
1
,
F
>&
func
,
const
int
over_integrate
=
0
)
template
<
class
GridViewType
>
double
h1_norm
(
const
GridViewType
&
grid_view
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
function
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
l2_weight
,
XT
::
Functions
::
GridFunction
<
XT
::
Grid
::
extract_entity_t
<
GridViewType
>>
h1_semi_weight
,
const
int
over_integrate
=
0
)
{
return
std
::
sqrt
(
laplace_p
roduct
(
grid_view
,
weight
,
func
,
func
,
over_integrate
));
return
H1P
roduct
(
grid_view
,
l2_
weight
,
h1_semi_weight
,
over_integrate
)
.
norm
(
function
);
}
...
...
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