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
eb61212e
Commit
eb61212e
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
simplification: hardwire the local matrix type
[[Imported from SVN: r5727]]
parent
c031427a
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/rodassembler.cc
+7
-11
7 additions, 11 deletions
src/rodassembler.cc
src/rodassembler.hh
+1
-2
1 addition, 2 deletions
src/rodassembler.hh
with
8 additions
and
13 deletions
src/rodassembler.cc
+
7
−
11
View file @
eb61212e
...
@@ -235,8 +235,6 @@ assembleMatrix(const std::vector<RigidBodyMotion<2> >& sol,
...
@@ -235,8 +235,6 @@ assembleMatrix(const std::vector<RigidBodyMotion<2> >& sol,
const
int
numOfBaseFct
=
2
;
const
int
numOfBaseFct
=
2
;
mat
.
setSize
(
numOfBaseFct
,
numOfBaseFct
);
// Extract local solution
// Extract local solution
std
::
vector
<
RigidBodyMotion
<
2
>
>
localSolution
(
numOfBaseFct
);
std
::
vector
<
RigidBodyMotion
<
2
>
>
localSolution
(
numOfBaseFct
);
...
@@ -244,7 +242,7 @@ assembleMatrix(const std::vector<RigidBodyMotion<2> >& sol,
...
@@ -244,7 +242,7 @@ assembleMatrix(const std::vector<RigidBodyMotion<2> >& sol,
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
localSolution
[
i
]
=
sol
[
indexSet
.
subIndex
(
*
it
,
i
,
gridDim
)];
// setup matrix
// setup matrix
getLocalMatrix
(
*
it
,
localSolution
,
numOfBaseFct
,
mat
);
getLocalMatrix
(
*
it
,
localSolution
,
mat
);
// Add element matrix to global stiffness matrix
// Add element matrix to global stiffness matrix
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numOfBaseFct
;
i
++
)
{
...
@@ -269,20 +267,18 @@ assembleMatrix(const std::vector<RigidBodyMotion<2> >& sol,
...
@@ -269,20 +267,18 @@ assembleMatrix(const std::vector<RigidBodyMotion<2> >& sol,
template
<
class
GridView
>
template
<
class
GridView
>
template
<
class
MatrixType
>
void
RodAssembler
<
GridView
,
2
>::
void
RodAssembler
<
GridView
,
2
>::
getLocalMatrix
(
EntityType
&
entity
,
getLocalMatrix
(
EntityType
&
entity
,
const
std
::
vector
<
RigidBodyMotion
<
2
>
>&
localSolution
,
const
std
::
vector
<
RigidBodyMotion
<
2
>
>&
localSolution
,
const
int
matSize
,
MatrixType
&
localMat
)
const
Dune
::
Matrix
<
MatrixBlock
>
&
localMat
)
const
{
{
const
typename
GridView
::
IndexSet
&
indexSet
=
this
->
gridView_
.
indexSet
();
const
typename
GridView
::
IndexSet
&
indexSet
=
this
->
gridView_
.
indexSet
();
/* ndof is the number of vectors of the element */
/* ndof is the number of vectors of the element */
int
ndof
=
matS
ize
;
int
ndof
=
localSolution
.
s
ize
()
;
for
(
int
i
=
0
;
i
<
matSize
;
i
++
)
localMat
.
setSize
(
ndof
,
ndof
);
for
(
int
j
=
0
;
j
<
matSize
;
j
++
)
localMat
=
0
;
localMat
[
i
][
j
]
=
0
;
Dune
::
P1LocalFiniteElement
<
double
,
double
,
gridDim
>
localFiniteElement
;
Dune
::
P1LocalFiniteElement
<
double
,
double
,
gridDim
>
localFiniteElement
;
...
@@ -327,9 +323,9 @@ getLocalMatrix( EntityType &entity,
...
@@ -327,9 +323,9 @@ getLocalMatrix( EntityType &entity,
double
theta
=
localSolution
[
0
].
q
.
angle_
*
shapeFunction
[
0
]
+
localSolution
[
1
].
q
.
angle_
*
shapeFunction
[
1
];
double
theta
=
localSolution
[
0
].
q
.
angle_
*
shapeFunction
[
0
]
+
localSolution
[
1
].
q
.
angle_
*
shapeFunction
[
1
];
for
(
int
i
=
0
;
i
<
matSize
;
i
++
)
{
for
(
int
i
=
0
;
i
<
localMat
.
N
()
;
i
++
)
{
for
(
int
j
=
0
;
j
<
matSize
;
j
++
)
{
for
(
int
j
=
0
;
j
<
localMat
.
M
()
;
j
++
)
{
// \partial J^2 / \partial x_i \partial x_j
// \partial J^2 / \partial x_i \partial x_j
localMat
[
i
][
j
][
0
][
0
]
+=
weight
*
shapeGrad
[
i
][
0
]
*
shapeGrad
[
j
][
0
]
localMat
[
i
][
j
][
0
][
0
]
+=
weight
*
shapeGrad
[
i
][
0
]
*
shapeGrad
[
j
][
0
]
...
...
This diff is collapsed.
Click to expand it.
src/rodassembler.hh
+
1
−
2
View file @
eb61212e
...
@@ -144,10 +144,9 @@ public:
...
@@ -144,10 +144,9 @@ public:
protected
:
protected
:
/** \brief Compute the element tangent stiffness matrix */
/** \brief Compute the element tangent stiffness matrix */
template
<
class
MatrixType
>
void
getLocalMatrix
(
EntityType
&
entity
,
void
getLocalMatrix
(
EntityType
&
entity
,
const
std
::
vector
<
RigidBodyMotion
<
2
>
>&
localSolution
,
const
std
::
vector
<
RigidBodyMotion
<
2
>
>&
localSolution
,
const
int
matSize
,
MatrixType
&
mat
)
const
;
Dune
::
Matrix
<
MatrixBlock
>
&
mat
)
const
;
};
// end class
};
// end class
...
...
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