Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Timo Koch
dune-common
Commits
83cf3708
Commit
83cf3708
authored
19 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
Factored out DofStoragePolicy and related classes to own file
[[Imported from SVN: r2798]]
parent
246c4217
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fem/space/dofstorage.hh
+85
-0
85 additions, 0 deletions
fem/space/dofstorage.hh
with
85 additions
and
0 deletions
fem/space/dofstorage.hh
0 → 100644
+
85
−
0
View file @
83cf3708
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_DOFSTORAGE_HH
#define DUNE_DOFSTORAGE_HH
namespace
Dune
{
//! Indicates how the dofs shall be stored in the discrete functions
//! Point based means that all dofs belonging to one local degree in a
//! contained spaced are stored consecutively, whereas in the variable based
//! approach all dofs belonging to one subspace are stored consecutively
enum
DofStoragePolicy
{
PointBased
,
VariableBased
};
//! Utility class that helps in the transformation between dofs in the
//! combined space and its enclosed spaces
template
<
DofStoragePolicy
p
>
class
DofConversionUtility
{
public:
DofConversionUtility
(
int
size
);
void
newSize
(
int
size
);
int
component
(
int
combinedIndex
)
const
;
int
containedDof
(
int
combinedIndex
)
const
;
int
combinedDof
(
int
enclosedIndex
,
int
component
)
const
;
private:
int
size_
;
};
template
<
>
class
DofConversionUtility
<
PointBased
>
{
public:
DofConversionUtility
(
int
numComponents
)
:
numComponents_
(
numComponents
)
{}
static
DofStoragePolicy
policy
()
{
return
PointBased
;
}
void
newSize
(
int
size
)
{}
// just do nothing
int
component
(
int
combinedIndex
)
const
{
return
combinedIndex
%
numComponents_
;
}
int
containedDof
(
int
combinedIndex
)
const
{
return
combinedIndex
/
numComponents_
;
}
int
combinedDof
(
int
containedIndex
,
int
component
)
const
{
return
containedIndex
*
numComponents_
+
component
;
}
private
:
const
int
numComponents_
;
};
template
<
>
class
DofConversionUtility
<
VariableBased
>
{
public:
DofConversionUtility
(
int
size
)
:
size_
(
size
)
{}
static
DofStoragePolicy
policy
()
{
return
VariableBased
;
}
void
newSize
(
int
size
)
{
size_
=
size
;
}
int
component
(
int
combinedIndex
)
const
{
return
combinedIndex
/
size_
;
}
int
containedDof
(
int
combinedIndex
)
const
{
return
combinedIndex
%
size_
;
}
int
combinedDof
(
int
containedIndex
,
int
component
)
const
{
return
containedIndex
+
component
*
size_
;
}
private
:
int
size_
;
};
}
// end namespace Dune
#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