Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
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
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
Sander, Oliver
dune-gfe
Commits
f6facb28
Commit
f6facb28
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
use subIndex methods with dynamic codimension to avoid compiler warnings
[[Imported from SVN: r3998]]
parent
98ea0c69
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/planarrodassembler.cc
+8
-13
8 additions, 13 deletions
src/planarrodassembler.cc
src/rodassembler.cc
+9
-9
9 additions, 9 deletions
src/rodassembler.cc
with
17 additions
and
22 deletions
src/planarrodassembler.cc
+
8
−
13
View file @
f6facb28
...
...
@@ -28,10 +28,8 @@ getNeighborsPerVertex(MatrixIndexSet& nb) const
for
(
j
=
0
;
j
<
it
->
template
count
<
gridDim
>();
j
++
)
{
//int iIdx = it->template subIndex<gridDim>(i);
//int jIdx = it->template subIndex<gridDim>(j);
int
iIdx
=
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
);
int
jIdx
=
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
j
);
int
iIdx
=
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
);
int
jIdx
=
indexSet
.
subIndex
(
*
it
,
j
,
gridDim
);
nb
.
add
(
iIdx
,
jIdx
);
...
...
@@ -73,8 +71,7 @@ assembleMatrix(const BlockVector<FieldVector<double, blocksize> >& sol,
BlockVector
<
FieldVector
<
double
,
blocksize
>
>
localSolution
(
numOfBaseFct
);
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
//localSolution[i] = sol[functionSpace_.mapToGlobal(*it,i)];
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
// setup matrix
getLocalMatrix
(
*
it
,
localSolution
,
numOfBaseFct
,
mat
);
...
...
@@ -82,13 +79,11 @@ assembleMatrix(const BlockVector<FieldVector<double, blocksize> >& sol,
// Add element matrix to global stiffness matrix
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
{
//int row = functionSpace_.mapToGlobal( *it , i );
int
row
=
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
);
int
row
=
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
);
for
(
int
j
=
0
;
j
<
numOfBaseFct
;
j
++
)
{
//int col = functionSpace_.mapToGlobal( *it , j );
int
col
=
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
j
);
int
col
=
indexSet
.
subIndex
(
*
it
,
j
,
gridDim
);
matrix
[
row
][
col
]
+=
mat
[
i
][
j
];
}
...
...
@@ -293,7 +288,7 @@ assembleGradient(const BlockVector<FieldVector<double, blocksize> >& sol,
FieldVector
<
double
,
blocksize
>
localSolution
[
numOfBaseFct
];
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
// Get quadrature rule
const
QuadratureRule
<
double
,
gridDim
>&
quad
=
QuadratureRules
<
double
,
gridDim
>::
rule
(
it
->
geometry
().
type
(),
polOrd
);
...
...
@@ -349,7 +344,7 @@ assembleGradient(const BlockVector<FieldVector<double, blocksize> >& sol,
for
(
int
dof
=
0
;
dof
<
numOfBaseFct
;
dof
++
)
{
int
globalDof
=
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
dof
);
int
globalDof
=
indexSet
.
subIndex
(
*
it
,
dof
,
gridDim
);
//printf("globalDof: %d partA1: %g partA3: %g\n", globalDof, partA1, partA3);
...
...
@@ -400,7 +395,7 @@ computeEnergy(const BlockVector<FieldVector<double, blocksize> >& sol) const
FieldVector
<
double
,
blocksize
>
localSolution
[
numOfBaseFct
];
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
// Get quadrature rule
const
QuadratureRule
<
double
,
gridDim
>&
quad
=
QuadratureRules
<
double
,
gridDim
>::
rule
(
it
->
geometry
().
type
(),
polOrd
);
...
...
This diff is collapsed.
Click to expand it.
src/rodassembler.cc
+
9
−
9
View file @
f6facb28
...
...
@@ -568,8 +568,8 @@ getNeighborsPerVertex(Dune::MatrixIndexSet& nb) const
for
(
j
=
0
;
j
<
it
->
template
count
<
gridDim
>();
j
++
)
{
int
iIdx
=
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
);
int
jIdx
=
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
j
);
int
iIdx
=
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
);
int
jIdx
=
indexSet
.
subIndex
(
*
it
,
j
,
gridDim
);
nb
.
add
(
iIdx
,
jIdx
);
...
...
@@ -924,13 +924,13 @@ assembleGradient(const std::vector<Configuration>& sol,
array
<
Configuration
,
nDofs
>
localSolution
;
for
(
int
i
=
0
;
i
<
nDofs
;
i
++
)
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
// Extract local reference configuration
array
<
Configuration
,
nDofs
>
localReferenceConfiguration
;
for
(
int
i
=
0
;
i
<
nDofs
;
i
++
)
localReferenceConfiguration
[
i
]
=
referenceConfiguration_
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localReferenceConfiguration
[
i
]
=
referenceConfiguration_
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
// Assemble local gradient
array
<
FieldVector
<
double
,
blocksize
>
,
nDofs
>
localGradient
;
...
...
@@ -939,7 +939,7 @@ assembleGradient(const std::vector<Configuration>& sol,
// Add to global gradient
for
(
int
i
=
0
;
i
<
nDofs
;
i
++
)
grad
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)]
+=
localGradient
[
i
];
grad
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)]
+=
localGradient
[
i
];
}
...
...
@@ -978,8 +978,8 @@ computeEnergy(const std::vector<Configuration>& sol) const
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
localReferenceConfiguration
[
i
]
=
referenceConfiguration_
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localReferenceConfiguration
[
i
]
=
referenceConfiguration_
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
}
...
...
@@ -1032,7 +1032,7 @@ getStrain(const std::vector<Configuration>& sol,
array
<
Configuration
,
2
>
localSolution
;
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
localSolution
[
i
]
=
sol
[
indexSet
.
template
subIndex
<
gridDim
>(
*
it
,
i
)];
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
// Get quadrature rule
const
int
polOrd
=
2
;
...
...
@@ -1119,7 +1119,7 @@ getResultantForce(const BoundaryPatch<GridType>& boundary,
for
(;
nIt
!=
nEndIt
;
++
nIt
)
{
if
(
!
boundary
.
contains
(
*
eIt
,
nIt
->
numberInSelf
()))
if
(
!
boundary
.
contains
(
*
eIt
,
nIt
->
indexInInside
()))
continue
;
// //////////////////////////////////////////////
...
...
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