Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
Container Registry
Model registry
Operate
Environments
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
dumux-repositories
dumux
Commits
ec239018
Commit
ec239018
authored
8 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[pointsource] Implement SolDependentPointSource. Deprecate obsolete TimeDependentPointSource
parent
c541b543
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!617
[WIP] Next
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/common/pointsource.hh
+64
-5
64 additions, 5 deletions
dumux/common/pointsource.hh
with
64 additions
and
5 deletions
dumux/common/pointsource.hh
+
64
−
5
View file @
ec239018
...
...
@@ -239,13 +239,9 @@ class TimeDependentPointSource : public PointSource<TypeTag>
typedef
typename
std
::
function
<
PrimaryVariables
(
const
TimeManager
&
,
const
GlobalPosition
&
)
>
ValueFunction
;
public:
//! Constructor for constant point sources
TimeDependentPointSource
(
GlobalPosition
pos
,
PrimaryVariables
values
,
ValueFunction
valueFunction
)
:
ParentType
(
pos
,
values
),
valueFunction_
(
valueFunction
)
{}
//! Constructor for sol dependent point sources, when there is no
// value known at the time of initialization
DUNE_DEPRECATED_MSG
(
"Will be removed after release of Dumux 3.0. Use the more general SolDependentPointSource class."
)
TimeDependentPointSource
(
GlobalPosition
pos
,
ValueFunction
valueFunction
)
:
ParentType
(
pos
,
PrimaryVariables
(
0
)),
valueFunction_
(
valueFunction
)
{}
...
...
@@ -278,6 +274,69 @@ private:
ValueFunction
valueFunction_
;
};
/*!
* \ingroup Common
* \brief A point source class for time dependent point sources
*/
template
<
class
TypeTag
>
class
SolDependentPointSource
:
public
PointSource
<
TypeTag
>
{
using
ParentType
=
PointSource
<
TypeTag
>
;
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
TimeManager
=
typename
GET_PROP_TYPE
(
TypeTag
,
TimeManager
);
using
ElementVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementVolumeVariables
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVElementGeometry
);
using
SubControlVolume
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolume
);
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
static
const
int
dimworld
=
GridView
::
dimensionworld
;
using
GlobalPosition
=
typename
Dune
::
FieldVector
<
Scalar
,
dimworld
>
;
// a function that takes a TimeManager and a GlobalPosition
// and returns the PointSource values as PrimaryVariables
using
ValueFunction
=
typename
std
::
function
<
PrimaryVariables
(
const
Problem
&
problem
,
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolume
&
scv
)
>
;
public:
//! Constructor for sol dependent point sources, when there is no
// value known at the time of initialization
SolDependentPointSource
(
GlobalPosition
pos
,
ValueFunction
valueFunction
)
:
ParentType
(
pos
,
PrimaryVariables
(
0
)),
valueFunction_
(
valueFunction
)
{}
//! an update function called before adding the value
// to the local residual in the problem in scvPointSources
// to be overloaded by derived classes
void
update
(
const
Problem
&
problem
,
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolume
&
scv
)
{
this
->
values_
=
valueFunction_
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
scv
);
}
//! Convenience = operator overload modifying only the values
SolDependentPointSource
&
operator
=
(
const
PrimaryVariables
&
values
)
{
ParentType
::
operator
=
(
values
);
return
*
this
;
}
//! Convenience = operator overload modifying only the values
SolDependentPointSource
&
operator
=
(
Scalar
s
)
{
ParentType
::
operator
=
(
s
);
return
*
this
;
}
private
:
ValueFunction
valueFunction_
;
};
/*!
* \ingroup Common
* \brief A helper class calculating a sub control volume to point source map
...
...
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