Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
e6247c87
Commit
e6247c87
authored
Aug 06, 2010
by
Thomas Witkowski
Browse files
Several small changes.
parent
f2631315
Changes
5
Hide whitespace changes
Inline
Side-by-side
AMDiS/other/include/Makefile_AMDiS.mk
View file @
e6247c87
...
@@ -43,6 +43,7 @@ LIBS += -lboost_iostreams -lboost_filesystem -lboost_system -lboost_date_time
...
@@ -43,6 +43,7 @@ LIBS += -lboost_iostreams -lboost_filesystem -lboost_system -lboost_date_time
ifeq
($(strip $(USE_UMFPACK)), 1)
ifeq
($(strip $(USE_UMFPACK)), 1)
LIBS
+=
$(UMFPACK_LIB)
LIBS
+=
$(UMFPACK_LIB)
CPPFLAGS
+=
-DHAVE_UMFPACK
-DMTL_HAS_UMFPACK
endif
endif
ifeq
($(strip $(USE_MKL)), 1)
ifeq
($(strip $(USE_MKL)), 1)
...
@@ -104,7 +105,7 @@ endif
...
@@ -104,7 +105,7 @@ endif
ifeq
($(strip $(DEBUG)), 0)
ifeq
($(strip $(DEBUG)), 0)
CPPFLAGS
+=
-O3
CPPFLAGS
+=
-O3
else
else
CPPFLAGS
+=
-g
-O0
CPPFLAGS
+=
-g
-O0
-DDEBUG
=
1
endif
endif
ifeq
($(strip $(USE_OPENMP)), 1)
ifeq
($(strip $(USE_OPENMP)), 1)
...
...
AMDiS/src/Boundary.cc
View file @
e6247c87
...
@@ -7,24 +7,21 @@ namespace AMDiS {
...
@@ -7,24 +7,21 @@ namespace AMDiS {
BoundaryType
newBound
(
BoundaryType
oldBound
,
BoundaryType
newBound
)
BoundaryType
newBound
(
BoundaryType
oldBound
,
BoundaryType
newBound
)
{
{
if
(
newBound
<=
INTERIOR
)
{
if
(
newBound
<=
INTERIOR
)
{
/*************************************************************************/
// Face on NEUMANN-boundary or interior face; weak type.
/* face on NEUMANN-boundary or interior face; weak type */
/*************************************************************************/
return
oldBound
;
return
(
oldBound
);
}
else
{
}
else
{
/*************************************************************************/
// Node is already node on the DIRICHLET boundary.
/* node is already node on the DIRICHLET boundary */
/*************************************************************************/
if
(
oldBound
>
newBound
)
if
(
oldBound
>
newBound
)
return
(
oldBound
)
;
return
oldBound
;
else
else
return
(
newBound
)
;
return
newBound
;
}
}
/**************************************************************************/
// New face is interior face; node type is always stronger.
/* new face is interior face; node type is always stronger */
/**************************************************************************/
return
newBound
;
return
(
newBound
);
}
}
}
}
AMDiS/src/DOFMatrix.cc
View file @
e6247c87
...
@@ -245,10 +245,8 @@ namespace AMDiS {
...
@@ -245,10 +245,8 @@ namespace AMDiS {
std
::
vector
<
Operator
*>::
iterator
it
=
operators
.
begin
();
std
::
vector
<
Operator
*>::
iterator
it
=
operators
.
begin
();
std
::
vector
<
double
*>::
iterator
factorIt
=
operatorFactor
.
begin
();
std
::
vector
<
double
*>::
iterator
factorIt
=
operatorFactor
.
begin
();
for
(;
it
!=
operators
.
end
();
++
it
,
++
factorIt
)
for
(;
it
!=
operators
.
end
();
++
it
,
++
factorIt
)
if
((
*
it
)
->
getNeedDualTraverse
()
==
false
)
{
if
((
*
it
)
->
getNeedDualTraverse
()
==
false
)
// MSG("OP NO NEED DT!\n");
(
*
it
)
->
getElementMatrix
(
elInfo
,
elementMatrix
,
*
factorIt
?
**
factorIt
:
1.0
);
(
*
it
)
->
getElementMatrix
(
elInfo
,
elementMatrix
,
*
factorIt
?
**
factorIt
:
1.0
);
}
if
(
factor
!=
1.0
)
if
(
factor
!=
1.0
)
elementMatrix
*=
factor
;
elementMatrix
*=
factor
;
...
...
AMDiS/src/OEMSolver.h
View file @
e6247c87
...
@@ -73,10 +73,7 @@ namespace AMDiS {
...
@@ -73,10 +73,7 @@ namespace AMDiS {
///
///
virtual
~
OEMSolver
()
virtual
~
OEMSolver
()
{
{}
if
(
leftPrecon
)
delete
leftPrecon
;
if
(
rightPrecon
)
delete
rightPrecon
;
}
void
initParameters
()
void
initParameters
()
{
{
...
@@ -96,9 +93,7 @@ namespace AMDiS {
...
@@ -96,9 +93,7 @@ namespace AMDiS {
*/
*/
void
setLeftPrecon
(
ITL_BasePreconditioner
*
p
)
void
setLeftPrecon
(
ITL_BasePreconditioner
*
p
)
{
{
if
(
leftPrecon
)
leftPrecon
=
p
;
delete
leftPrecon
;
leftPrecon
=
p
;
}
}
/** Set right Preconditioner
/** Set right Preconditioner
...
@@ -108,24 +103,21 @@ namespace AMDiS {
...
@@ -108,24 +103,21 @@ namespace AMDiS {
*/
*/
void
setRightPrecon
(
ITL_BasePreconditioner
*
p
)
void
setRightPrecon
(
ITL_BasePreconditioner
*
p
)
{
{
if
(
rightPrecon
)
rightPrecon
=
p
;
delete
rightPrecon
;
rightPrecon
=
p
;
}
}
/// Linear System to be solved in the derived class
/// Linear System to be solved in the derived class
virtual
int
solveSystem
(
const
DOFMatrix
::
base_matrix_type
&
A
,
virtual
int
solveSystem
(
const
DOFMatrix
::
base_matrix_type
&
A
,
mtl
::
dense_vector
<
value_type
>&
x
,
mtl
::
dense_vector
<
value_type
>&
x
,
const
mtl
::
dense_vector
<
value_type
>&
b
)
=
0
;
const
mtl
::
dense_vector
<
value_type
>&
b
)
=
0
;
/// Solve a linear system for a scalar problem.
/// Solve a linear system for a scalar problem.
int
solveSystem
(
const
SolverMatrix
<
DOFMatrix
>&
A
,
int
solveSystem
(
const
SolverMatrix
<
DOFMatrix
>&
A
,
DOFVector
<
double
>&
x
,
DOFVector
<
double
>&
x
,
DOFVector
<
double
>&
b
)
DOFVector
<
double
>&
b
)
{
{
mtl
::
dense_vector
<
value_type
>
xx
(
x
.
getUsedSize
()),
mtl
::
dense_vector
<
value_type
>
xx
(
x
.
getUsedSize
()),
bb
(
b
.
getUsedSize
());
bb
(
b
.
getUsedSize
());
// Copy rhs vector
// Copy rhs vector
int
counter
=
0
;
int
counter
=
0
;
...
@@ -236,13 +228,13 @@ namespace AMDiS {
...
@@ -236,13 +228,13 @@ namespace AMDiS {
/// Returns number of iterations in last run of an iterative solver
/// Returns number of iterations in last run of an iterative solver
inline
int
getIterations
()
inline
int
getIterations
()
{
{
return
iterations
;
return
iterations
;
}
}
/// Returns error code in last run of an iterative solver
/// Returns error code in last run of an iterative solver
inline
int
getErrorCode
()
inline
int
getErrorCode
()
{
{
return
error
;
return
error
;
}
}
/// Sets \ref info
/// Sets \ref info
...
...
AMDiS/src/UmfPackSolver.h
View file @
e6247c87
...
@@ -58,7 +58,7 @@ namespace AMDiS {
...
@@ -58,7 +58,7 @@ namespace AMDiS {
};
};
/// Constructor
/// Constructor
UmfPackSolver
(
::
std
::
string
name
)
UmfPackSolver
(
std
::
string
name
)
:
OEMSolver
(
name
),
:
OEMSolver
(
name
),
solver
(
0
),
solver
(
0
),
store_symbolic
(
0
),
store_symbolic
(
0
),
...
@@ -76,9 +76,9 @@ namespace AMDiS {
...
@@ -76,9 +76,9 @@ namespace AMDiS {
}
}
/// Solves the system directly
/// Solves the system directly
int
solveSystem
(
const
DOFMatrix
::
base_matrix_type
&
A
,
int
solveSystem
(
const
DOFMatrix
::
base_matrix_type
&
A
,
mtl
::
dense_vector
<
value_type
>&
x
,
mtl
::
dense_vector
<
value_type
>&
x
,
const
mtl
::
dense_vector
<
value_type
>&
b
)
const
mtl
::
dense_vector
<
value_type
>&
b
)
{
{
if
(
!
solver
)
{
if
(
!
solver
)
{
if
(
!
symmetric_strategy
)
if
(
!
symmetric_strategy
)
...
@@ -90,10 +90,10 @@ namespace AMDiS {
...
@@ -90,10 +90,10 @@ namespace AMDiS {
if
(
store_symbolic
)
if
(
store_symbolic
)
solver
->
update_numeric
();
solver
->
update_numeric
();
else
else
solver
->
update
();
solver
->
update
();
}
}
int
code
=
(
*
solver
)(
x
,
b
);
int
code
=
(
*
solver
)(
x
,
b
);
mtl
::
dense_vector
<
value_type
>
r
(
b
);
mtl
::
dense_vector
<
value_type
>
r
(
b
);
r
-=
A
*
x
;
r
-=
A
*
x
;
residual
=
two_norm
(
r
);
residual
=
two_norm
(
r
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment