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
1b68f474
Commit
1b68f474
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
some bugfixes in indexNew and newIndex,oldIndex methods for polOrd = 0 and dimrange > 1.
[[Imported from SVN: r2303]]
parent
e427a90d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fem/lagrangebase/lagrangemapper.hh
+19
-8
19 additions, 8 deletions
fem/lagrangebase/lagrangemapper.hh
with
19 additions
and
8 deletions
fem/lagrangebase/lagrangemapper.hh
+
19
−
8
View file @
1b68f474
...
...
@@ -239,7 +239,9 @@ namespace Dune {
typedef
IndexSetImp
IndexSetType
;
LagrangeMapper
(
IndexSetType
&
is
,
int
numDofs
,
int
level
)
:
numberOfDofs_
(
numDofs
)
,
indexSet_
(
is
)
,
level_
(
level
)
{}
:
numberOfDofs_
(
numDofs
)
,
indexSet_
(
is
)
,
level_
(
level
)
{
assert
(
numberOfDofs_
==
dimrange
);
}
// we have virtual function ==> virtual destructor
virtual
~
LagrangeMapper
()
{}
...
...
@@ -261,23 +263,29 @@ namespace Dune {
//! for dof manager, to check whether it has to copy dof or not
bool
indexNew
(
int
num
)
{
int
newn
=
(
num
/
dimrange
)
+
num
%
dimrange
;
if
(
dimrange
==
1
)
assert
(
newn
==
num
);
// all numbers of one entity are maped to the one number of the set
const
int
newn
=
static_cast
<
int
>
(
num
/
dimrange
);
return
indexSet_
.
template
indexNew
(
newn
,
0
);
}
//! return old index, for dof manager only
int
oldIndex
(
int
num
)
const
{
int
newn
=
(
num
/
dimrange
)
+
num
%
dimrange
;
return
dimrange
*
indexSet_
.
oldIndex
(
newn
,
0
);
// corresponding number of set is newn
const
int
newn
=
static_cast
<
int
>
(
num
/
dimrange
);
// local number of dof is local
const
int
local
=
(
num
%
dimrange
);
return
(
dimrange
*
indexSet_
.
oldIndex
(
newn
,
0
))
+
local
;
}
//! return new index, for dof manager only
int
newIndex
(
int
num
)
const
{
int
newn
=
(
num
/
dimrange
)
+
num
%
dimrange
;
return
dimrange
*
indexSet_
.
newIndex
(
newn
,
0
);
// corresponding number of set is newn
const
int
newn
=
static_cast
<
int
>
(
num
/
dimrange
);
// local number of dof is local
const
int
local
=
(
num
%
dimrange
);
return
(
dimrange
*
indexSet_
.
newIndex
(
newn
,
0
))
+
local
;
}
//! return size of grid entities per level and codim
...
...
@@ -339,7 +347,10 @@ namespace Dune {
template
<
class
EntityType
>
int
mapToGlobal
(
EntityType
&
en
,
int
localNum
)
const
{
return
indexSet_
.
template
index
<
0
>
(
en
,
localNum
);
int
idx
=
indexSet_
.
template
index
<
0
>
(
en
,
localNum
);
assert
(
idx
>=
0
);
return
idx
;
//return indexSet_.template index<0> (en,localNum);
}
//! for dof manager, to check whether it has to copy dof or not
...
...
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