Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-fufem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
fufem
dune-fufem
Commits
9f2d694e
Commit
9f2d694e
authored
3 months ago
by
Carsten Gräser
Browse files
Options
Downloads
Patches
Plain Diff
[forms] Generalize local products to a few more cases
parent
44633d85
No related branches found
No related tags found
No related merge requests found
Pipeline
#76056
passed
3 months ago
Stage: .pre
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/fufem/forms/localoperators.hh
+27
-0
27 additions, 0 deletions
dune/fufem/forms/localoperators.hh
with
27 additions
and
0 deletions
dune/fufem/forms/localoperators.hh
+
27
−
0
View file @
9f2d694e
...
...
@@ -96,6 +96,20 @@ namespace Dune::Fufem::Forms::LocalOperators {
return
result
;
}
template
<
class
...
V
,
class
...
W
>
auto
operator
()(
const
Dune
::
MultiTypeBlockVector
<
V
...
>&
x
,
const
Dune
::
MultiTypeBlockVector
<
W
...
>&
y
)
const
{
using
namespace
Dune
::
Hybrid
;
using
K1
=
typename
Dune
::
FieldTraits
<
Dune
::
MultiTypeBlockVector
<
V
...
>>::
field_type
;
using
K2
=
typename
Dune
::
FieldTraits
<
Dune
::
MultiTypeBlockVector
<
W
...
>>::
field_type
;
using
K
=
typename
PromotionTraits
<
K1
,
K2
>::
PromotedType
;
auto
result
=
K
(
0
);
forEach
(
integralRange
(
Hybrid
::
size
(
x
)),
[
&
](
auto
&&
i
)
{
result
+=
DotOp
()(
x
[
i
],
y
[
i
]);
});
return
result
;
}
};
struct
MultOp
{
...
...
@@ -128,6 +142,19 @@ namespace Dune::Fufem::Forms::LocalOperators {
return
x
[
0
]
*
y
;
}
template
<
class
...
Rows
,
class
...
V
>
auto
operator
()(
const
Dune
::
MultiTypeBlockMatrix
<
Rows
...
>&
A
,
const
Dune
::
MultiTypeBlockVector
<
V
...
>&
x
)
const
{
using
namespace
Dune
::
Hybrid
;
using
K1
=
typename
Dune
::
FieldTraits
<
Dune
::
MultiTypeBlockMatrix
<
Rows
...
>>::
field_type
;
using
K2
=
typename
Dune
::
FieldTraits
<
Dune
::
MultiTypeBlockVector
<
V
...
>>::
field_type
;
using
K
=
typename
PromotionTraits
<
K1
,
K2
>::
PromotedType
;
using
Result
=
typename
Dune
::
MultiTypeBlockVector
<
Dune
::
FieldVector
<
K
,
std
::
tuple_element_t
<
0
,
Rows
>::
rows
>
...
>
;
auto
y
=
Result
();
A
.
mv
(
x
,
y
);
return
y
;
}
};
...
...
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