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
4397de87
Commit
4397de87
authored
6 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[integrands.generic] add GenericLocalUnaryElementIntegrand
parent
1262273d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gdt/local/integrands/generic.hh
+94
-0
94 additions, 0 deletions
dune/gdt/local/integrands/generic.hh
with
94 additions
and
0 deletions
dune/gdt/local/integrands/generic.hh
0 → 100644
+
94
−
0
View file @
4397de87
// This file is part of the dune-gdt project:
// https://github.com/dune-community/dune-gdt
// Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// Felix Schindler (2018)
#ifndef DUNE_GDT_LOCAL_INTEGRANDS_GENERIC_HH
#define DUNE_GDT_LOCAL_INTEGRANDS_GENERIC_HH
#include
<functional>
#include
<dune/gdt/exceptions.hh>
#include
"interfaces.hh"
namespace
Dune
{
namespace
GDT
{
template
<
class
E
,
size_t
r
=
1
,
size_t
rC
=
1
,
class
R
=
double
,
class
F
=
double
>
class
GenericLocalUnaryElementIntegrand
:
public
LocalUnaryElementIntegrandInterface
<
E
,
r
,
rC
,
R
,
F
>
{
using
ThisType
=
GenericLocalUnaryElementIntegrand
<
E
,
r
,
rC
,
R
,
F
>
;
using
BaseType
=
LocalUnaryElementIntegrandInterface
<
E
,
r
,
rC
,
R
,
F
>
;
public:
using
typename
BaseType
::
LocalBasisType
;
using
typename
BaseType
::
DomainType
;
using
GenericOrderFunctionType
=
std
::
function
<
int
(
const
LocalBasisType
&
/*basis*/
,
const
XT
::
Common
::
Parameter
&
/*param*/
)
>
;
using
GenericEvalauteFunctionType
=
std
::
function
<
void
(
const
LocalBasisType
&
/*basis*/
,
const
DomainType
&
/*point_in_reference_element*/
,
DynamicVector
<
F
>&
/*result*/
,
const
XT
::
Common
::
Parameter
&
/*param*/
)
>
;
GenericLocalUnaryElementIntegrand
(
GenericOrderFunctionType
order_function
,
GenericEvalauteFunctionType
evaluate_function
,
const
XT
::
Common
::
ParameterType
&
param_type
=
{})
:
BaseType
(
param_type
)
,
order_
(
order_function
)
,
evaluate_
(
evaluate_function
)
{
}
GenericLocalUnaryElementIntegrand
(
const
ThisType
&
other
)
:
BaseType
(
other
.
parameter_type
())
,
order_
(
other
.
order_
)
,
evaluate_
(
other
.
evaluate_
)
{
}
std
::
unique_ptr
<
BaseType
>
copy
()
const
{
return
std
::
make_unique
<
ThisType
>
(
*
this
);
}
int
order
(
const
LocalBasisType
&
basis
,
const
XT
::
Common
::
Parameter
&
param
=
{})
const
{
return
order_
(
basis
,
this
->
parse_parameter
(
param
));
}
using
BaseType
::
evaluate
;
void
evaluate
(
const
LocalBasisType
&
basis
,
const
DomainType
&
point_in_reference_element
,
DynamicVector
<
F
>&
result
,
const
XT
::
Common
::
Parameter
&
param
=
{})
const
{
// prepare storage
const
size_t
size
=
basis
.
size
(
param
);
if
(
result
.
size
()
<
size
)
result
.
resize
(
size
);
// evaluate
evaluate_
(
basis
,
point_in_reference_element
,
result
,
this
->
parse_parameter
(
param
));
// check
DUNE_THROW_IF
(
result
.
size
()
<
size
,
Exceptions
::
integrand_error
,
"basis.size(param) = "
<<
size
<<
"
\n
result.size() = "
<<
result
.
size
());
}
// ... evaluate(...)
private
:
const
GenericOrderFunctionType
order_
;
const
GenericEvalauteFunctionType
evaluate_
;
};
// class GenericLocalUnaryElementIntegrand
}
// namespace GDT
}
// namespace Dun
#endif // DUNE_GDT_LOCAL_INTEGRANDS_GENERIC_HH
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