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
1ce5ee5d
Commit
1ce5ee5d
authored
9 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[globalvectors] Add global flux and volume variables vector class
parent
3ddfe602
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dumux/implicit/fluxvariablesvector.hh
+73
-0
73 additions, 0 deletions
dumux/implicit/fluxvariablesvector.hh
dumux/implicit/volumevariablesvector.hh
+65
-0
65 additions, 0 deletions
dumux/implicit/volumevariablesvector.hh
with
138 additions
and
0 deletions
dumux/implicit/fluxvariablesvector.hh
0 → 100644
+
73
−
0
View file @
1ce5ee5d
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \brief Base class for the volume variables vector
*/
#ifndef DUMUX_IMPLICIT_FLUXVARSVECTOR_HH
#define DUMUX_IMPLICIT_FLUXVARSVECTOR_HH
#include
<dumux/implicit/properties.hh>
namespace
Dumux
{
/*!
* \ingroup ImplicitModel
* \brief Base class for the flux variables vector, we always have darcy flux variables per face
*/
template
<
class
TypeTag
>
class
FluxVariablesVector
{
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
IndexType
=
typename
GridView
::
IndexSet
::
IndexType
;
using
FluxVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluxVariables
);
public:
void
update
(
const
Problem
&
problem
)
{
fluxVars_
.
resize
(
problem
.
model
().
fvGeometries
().
numScvf
());
for
(
const
auto
&
element
:
elements
(
problem
.
gridView
()))
{
for
(
auto
&&
scvf
:
problem
.
model
().
fvGeometries
(
element
).
scvfs
())
{
(
*
this
)[
scvf
.
index
()].
update
(
problem
,
scvf
);
}
}
}
const
FluxVariables
&
operator
[](
IndexType
scvfIdx
)
const
{
return
fluxVars_
[
scvfIdx
];
}
FluxVariables
&
operator
[](
IndexType
scvfIdx
)
{
return
fluxVars_
[
scvfIdx
];
}
private
:
std
::
vector
<
FluxVariables
>
fluxVars_
;
};
}
// end namespace
#endif
This diff is collapsed.
Click to expand it.
dumux/implicit/volumevariablesvector.hh
0 → 100644
+
65
−
0
View file @
1ce5ee5d
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \brief Base class for the volume variables vector
*/
#ifndef DUMUX_IMPLICIT_VOLVARSVECTOR_HH
#define DUMUX_IMPLICIT_VOLVARSVECTOR_HH
#include
<dumux/implicit/properties.hh>
namespace
Dumux
{
/*!
* \ingroup ImplicitModel
* \brief Base class for the volume variables vector
*/
template
<
class
TypeTag
>
class
VolumeVariablesVector
:
public
std
::
vector
<
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
)
>
{
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
SubControlVolume
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolume
);
public:
void
update
(
const
Problem
&
problem
,
const
SolutionVector
&
sol
)
{
auto
gridView
=
problem
.
gridView
();
this
->
resize
(
gridView
.
size
(
0
));
for
(
const
auto
&
element
:
elements
(
gridView
))
{
for
(
auto
&&
scv
:
problem
.
model
().
fvGeometries
(
element
).
scvs
())
{
(
*
this
)[
scv
.
index
()].
update
(
sol
[
scv
.
dofIndex
()],
problem
,
element
,
scv
);
}
}
}
};
}
// end namespace
#endif
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