Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
35b11427
Commit
35b11427
authored
Jul 08, 2008
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Some more optimization and bug fixes
parent
86d20202
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
57 deletions
+44
-57
AMDiS/src/DOFMatrix.cc
AMDiS/src/DOFMatrix.cc
+0
-15
AMDiS/src/DOFMatrix.h
AMDiS/src/DOFMatrix.h
+11
-3
AMDiS/src/Preconditioner.h
AMDiS/src/Preconditioner.h
+1
-5
AMDiS/src/ProblemVec.cc
AMDiS/src/ProblemVec.cc
+4
-0
AMDiS/src/StlVector.cc
AMDiS/src/StlVector.cc
+1
-1
AMDiS/src/Traverse.cc
AMDiS/src/Traverse.cc
+27
-33
No files found.
AMDiS/src/DOFMatrix.cc
View file @
35b11427
...
...
@@ -267,21 +267,6 @@ namespace AMDiS {
}
}
DegreeOfFreedom
DOFMatrix
::
logToPhysIndex
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
)
const
{
int
j
;
for
(
j
=
0
;
j
<
static_cast
<
int
>
(
matrix
[
a
].
size
());
j
++
)
if
(
b
==
matrix
[
a
][
j
].
col
)
break
;
return
(
j
==
static_cast
<
int
>
(
matrix
[
a
].
size
()))
?
-
1
:
j
;
}
double
DOFMatrix
::
logAcc
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
)
const
{
int
j
;
...
...
AMDiS/src/DOFMatrix.h
View file @
35b11427
...
...
@@ -489,17 +489,25 @@ namespace AMDiS {
/** \brief
* Returns physical column index of logical index b in row a
*/
DegreeOfFreedom
logToPhysIndex
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
)
const
;
inline
DegreeOfFreedom
logToPhysIndex
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
)
const
{
int
size
=
static_cast
<
int
>
(
matrix
[
a
].
size
());
for
(
int
j
=
0
;
j
<
size
;
j
++
)
if
(
b
==
matrix
[
a
][
j
].
col
)
return
j
;
return
-
1
;
};
/** \brief
* Returns value at logical indices a,b
*/
double
logAcc
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
)
const
;
double
logAcc
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
)
const
;
/** \brief
* Changes col at logical indices a,b to c
*/
void
changeColOfEntry
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
,
DegreeOfFreedom
c
);
void
changeColOfEntry
(
DegreeOfFreedom
a
,
DegreeOfFreedom
b
,
DegreeOfFreedom
c
);
/** \brief
* Changes col of \ref matrix[a][b] to c
...
...
AMDiS/src/Preconditioner.h
View file @
35b11427
...
...
@@ -266,12 +266,8 @@ namespace AMDiS {
* Frees needed memory.
*/
virtual
void
exit
()
{
int
i
;
int
size
=
scalPrecons
.
getSize
();
#ifdef _OPENMP
#pragma omp parallel for num_threads(size)
#endif
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
scalPrecons
[
i
]
->
exit
();
}
};
...
...
AMDiS/src/ProblemVec.cc
View file @
35b11427
...
...
@@ -704,6 +704,8 @@ namespace AMDiS {
const
BasisFunction
*
basisFcts
=
componentSpaces_
[
i
]
->
getBasisFcts
();
for
(
int
j
=
0
;
j
<
numComponents_
;
j
++
)
{
double
wwtime
=
omp_get_wtime
();
// Only if this variable is true, the current matrix will be assembled.
bool
assembleMatrix
=
true
;
// The DOFMatrix which should be assembled (or not, if assembleMatrix
...
...
@@ -774,6 +776,8 @@ namespace AMDiS {
}
assembledMatrix_
[
i
][
j
]
=
true
;
::
std
::
cout
<<
"Komponente "
<<
i
<<
"-"
<<
j
<<
": "
<<
omp_get_wtime
()
-
wwtime
<<
::
std
::
endl
;
}
// fill boundary conditions
...
...
AMDiS/src/StlVector.cc
View file @
35b11427
...
...
@@ -72,7 +72,7 @@ namespace AMDiS {
{
::
std
::
cout
<<
"["
;
for
(
int
i
=
0
;
i
<
vec
->
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
vec
->
size
()
)
;
i
++
)
{
::
std
::
cout
<<
(
*
vec
)[
i
]
<<
" , "
;
}
...
...
AMDiS/src/Traverse.cc
View file @
35b11427
...
...
@@ -647,7 +647,7 @@ namespace AMDiS {
{
FUNCNAME
(
"TraverseStackLLtraverseNeighbour3d()"
);
Element
*
el
,
*
el2
;
Element
*
el2
;
ElInfo
*
old_elinfo
,
*
elinfo
,
*
elinfo2
;
const
DegreeOfFreedom
*
dof
;
int
i
,
nb
,
opp_vertex
,
stack2_used
,
typ
=
0
;
...
...
@@ -661,24 +661,25 @@ namespace AMDiS {
Parametric
*
parametric
=
traverse_mesh
->
getParametric
();
if
(
parametric
)
elinfo_old
=
parametric
->
removeParametricInfo
(
elinfo_old
);
if
(
parametric
)
elinfo_old
=
parametric
->
removeParametricInfo
(
elinfo_old
);
TEST_EXIT_DBG
(
elinfo_old
==
elinfo_stack
[
stack_used
])
(
"invalid old elinfo
\n
"
);
TEST_EXIT_DBG
(
elinfo_stack
[
stack_used
]
->
getFillFlag
().
isSet
(
Mesh
::
FILL_NEIGH
))
(
"FILL_NEIGH not set"
);
el
=
elinfo_stack
[
stack_used
]
->
getElement
();
Element
*
el
=
elinfo_stack
[
stack_used
]
->
getElement
();
sav_index
=
el
->
getIndex
();
/* first, goto to leaf level, if necessary... */
if
((
traverse_fill_flag
&
Mesh
::
CALL_LEAF_EL
).
isAnySet
())
{
if
((
el
->
getChild
(
0
))
&&
(
neighbour
<
2
))
{
if
(
stack_used
>=
stack_size
-
1
)
if
(
stack_used
>=
stack_size
-
1
)
enlargeTraverseStack
();
i
=
1
-
neighbour
;
elinfo_stack
[
stack_used
+
1
]
->
fillElInfo
(
i
,
elinfo_stack
[
stack_used
]);
info_stack
[
stack_used
]
=
i
+
1
;
elinfo_stack
[
stack_used
+
1
]
->
fillElInfo
(
i
,
elinfo_stack
[
stack_used
]);
info_stack
[
stack_used
]
=
i
+
1
;
stack_used
++
;
info_stack
[
stack_used
]
=
0
;
neighbour
=
3
;
...
...
@@ -688,23 +689,23 @@ namespace AMDiS {
/* save information about current element and its position in the tree */
save_traverse_mel
=
traverse_mel
;
save_stack_used
=
stack_used
;
save_stack_used
=
stack_used
;
nb
=
neighbour
;
while
(
stack_used
>
1
)
/* go up in tree until we can go down again */
{
stack_used
--
;
typ
=
dynamic_cast
<
ElInfo3d
*>
(
el
info_stack
[
stack_used
]
)
->
getType
()
;
nb
=
coarse_nb
[
typ
][
info_stack
[
stack_used
]][
nb
];
if
(
nb
==
-
1
)
break
;
TEST_EXIT_DBG
(
nb
>=
0
)(
"invalid coarse_nb %d
\n
"
,
nb
);
}
while
(
stack_used
>
1
)
{
/* go up in tree until we can go down again */
stack_used
--
;
typ
=
dynamic_cast
<
ElInfo3d
*>
(
elinfo_stack
[
stack_used
])
->
getType
()
;
nb
=
coarse_nb
[
typ
][
info_stack
[
stack_used
]
][
nb
]
;
if
(
nb
==
-
1
)
break
;
TEST_EXIT_DBG
(
nb
>=
0
)(
"invalid coarse_nb %d
\n
"
,
nb
);
}
/* save hierarchy information about current element */
for
(
i
=
stack_used
;
i
<=
save_stack_used
;
i
++
)
{
save_info_stack
[
i
]
=
info_stack
[
i
];
for
(
i
=
stack_used
;
i
<=
save_stack_used
;
i
++
)
{
save_info_stack
[
i
]
=
info_stack
[
i
];
*
(
save_elinfo_stack
[
i
])
=
*
(
elinfo_stack
[
i
]);
}
...
...
@@ -811,20 +812,12 @@ namespace AMDiS {
dof
=
el2
->
getDOF
(
1
);
if
(
dof
!=
el
->
getDOF
(
1
)
&&
dof
!=
el
->
getDOF
(
2
)
&&
!
traverse_mesh
->
associated
(
dof
[
0
],
el
->
getDOF
(
1
,
0
))
&&
!
traverse_mesh
->
associated
(
dof
[
0
],
el
->
getDOF
(
2
,
0
)))
{
stack2_used
++
;
/* go down one level in OLD hierarchy */
elinfo2
=
save_elinfo_stack
[
stack2_used
];
el2
=
elinfo2
->
getElement
();
}
// else {
// // --- debug ---
// if(dof != el->getDOF(1) && dof != el->getDOF(2)) {
// MSG("dof %d, dof1 %d, dof2 %d\n\n",
// dof[0], el->getDOF(1,0), el->getDOF(2,0));
// }
// // -------------
// }
!
traverse_mesh
->
associated
(
dof
[
0
],
el
->
getDOF
(
2
,
0
)))
{
stack2_used
++
;
/* go down one level in OLD hierarchy */
elinfo2
=
save_elinfo_stack
[
stack2_used
];
el2
=
elinfo2
->
getElement
();
}
}
}
...
...
@@ -854,8 +847,9 @@ namespace AMDiS {
else
if
((
traverse_fill_flag
&
Mesh
::
CALL_EVERY_EL_INORDER
).
isAnySet
())
info_stack
[
stack_used
]
=
1
;
/* ??? */
if
(
elinfo
)
{
if
(
parametric
)
elinfo
=
parametric
->
addParametricInfo
(
elinfo
);
if
(
elinfo
)
{
if
(
parametric
)
elinfo
=
parametric
->
addParametricInfo
(
elinfo
);
elinfo
->
fillDetGrdLambda
();
}
return
(
elinfo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment