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
77e329c5
Commit
77e329c5
authored
4 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[functions] add ElementwiseDiameterFunction
parent
1a8c1edb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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/elementwise-diameter.hh
+98
-0
98 additions, 0 deletions
dune/xt/functions/elementwise-diameter.hh
with
98 additions
and
0 deletions
dune/xt/functions/elementwise-diameter.hh
0 → 100644
+
98
−
0
View file @
77e329c5
// This file is part of the dune-xt project:
// https://github.com/dune-community/dune-xt
// Copyright 2009-2020 dune-xt 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 (2020)
#ifndef DUNE_XT_FUNCTIONS_ELEMENTWISE_DIAMETER_HH
#define DUNE_XT_FUNCTIONS_ELEMENTWISE_DIAMETER_HH
#include
<dune/xt/functions/interfaces/grid-function.hh>
namespace
Dune
{
namespace
XT
{
namespace
Functions
{
template
<
class
E
>
class
ElementwiseDiameterFunction
:
public
GridFunctionInterface
<
E
>
{
using
ThisType
=
ElementwiseDiameterFunction
;
using
BaseType
=
GridFunctionInterface
<
E
>
;
class
LocalFunction
:
public
XT
::
Functions
::
ElementFunctionInterface
<
E
>
{
using
BaseType
=
XT
::
Functions
::
ElementFunctionInterface
<
E
>
;
public:
using
typename
BaseType
::
DerivativeRangeReturnType
;
using
typename
BaseType
::
DomainType
;
using
typename
BaseType
::
ElementType
;
using
typename
BaseType
::
RangeReturnType
;
LocalFunction
()
:
BaseType
()
,
diameter_
(
0
)
{}
protected
:
void
post_bind
(
const
ElementType
&
element
)
override
final
{
diameter_
=
Grid
::
diameter
(
element
);
}
public
:
int
order
(
const
XT
::
Common
::
Parameter
&
/*param*/
=
{})
const
override
final
{
return
0
;
}
RangeReturnType
evaluate
(
const
DomainType
&
/*xx*/
,
const
XT
::
Common
::
Parameter
&
/*param*/
=
{})
const
override
final
{
return
diameter_
;
}
DerivativeRangeReturnType
jacobian
(
const
DomainType
&
/*xx*/
,
const
XT
::
Common
::
Parameter
&
/*param*/
=
{})
const
override
final
{
return
DerivativeRangeReturnType
();
}
private
:
double
diameter_
;
};
// class LocalFunction
public
:
using
BaseType
::
d
;
using
BaseType
::
r
;
using
BaseType
::
rC
;
using
typename
BaseType
::
LocalFunctionType
;
ElementwiseDiameterFunction
(
const
std
::
string
nm
=
"ElementwiseDiameterFunction"
)
:
BaseType
()
,
name_
(
nm
)
{}
std
::
unique_ptr
<
LocalFunctionType
>
local_function
()
const
override
final
{
return
std
::
make_unique
<
LocalFunction
>
();
}
std
::
string
name
()
const
override
final
{
return
name_
;
}
private
:
std
::
string
name_
;
};
// class ElementwiseDiameterFunction
}
// namespace Functions
}
// namespace XT
}
// namespace Dune
#endif // DUNE_XT_FUNCTIONS_ELEMENTWISE_DIAMETER_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