Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PuReMD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SParTA
PuReMD
Commits
81fb1bae
Commit
81fb1bae
authored
9 years ago
by
Kurt A. O'Hearn
Browse files
Options
Downloads
Patches
Plain Diff
sPuReMD: fixes to ICHOL_PAR.
parent
09df8f08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
puremd_rc_1003/sPuReMD/QEq.c
+23
-9
23 additions, 9 deletions
puremd_rc_1003/sPuReMD/QEq.c
with
23 additions
and
9 deletions
puremd_rc_1003/sPuReMD/QEq.c
+
23
−
9
View file @
81fb1bae
...
...
@@ -204,7 +204,7 @@ void ICHOLT( sparse_matrix *A, real *droptol,
}
L
->
start
[
i
]
=
Ltop
;
//
fprintf( stderr, "nnz(L): %d, max: %d\n", Ltop, L->n * 50 );
//
fprintf( stderr, "nnz(L): %d, max: %d\n", Ltop, L->n * 50 );
/* U = L^T (Cholesky factorization) */
for
(
i
=
1
;
i
<=
U
->
n
;
++
i
)
...
...
@@ -222,7 +222,7 @@ void ICHOLT( sparse_matrix *A, real *droptol,
}
}
//
fprintf( stderr, "nnz(U): %d, max: %d\n", Utop[U->n], U->n * 50 );
//
fprintf( stderr, "nnz(U): %d, max: %d\n", Utop[U->n], U->n * 50 );
free
(
Utop
);
}
...
...
@@ -289,7 +289,7 @@ static void ICHOL_PAR( const sparse_matrix * const A, const unsigned int sweeps,
for
(
i
=
0
;
i
<
sweeps
;
++
i
)
{
/* for each nonzero */
for
(
j
=
0
;
j
<
A
->
m
;
++
j
)
for
(
j
=
0
;
j
<
A
->
start
[
A
->
n
]
;
++
j
)
{
sum
=
ZERO
;
...
...
@@ -338,7 +338,12 @@ static void ICHOL_PAR( const sparse_matrix * const A, const unsigned int sweeps,
/* sanity check */
if
(
sum
<
ZERO
)
{
fprintf
(
stderr
,
"Numeric breakdown in ICHOL. Terminating.
\n
"
);
fprintf
(
stderr
,
"Numeric breakdown in ICHOL Terminating.
\n
"
);
#if defined(DEBUG_FOCUS)
fprintf
(
stderr
,
"A(%5d,%5d) = %10.3f
\n
"
,
k
-
1
,
A
->
entries
[
j
].
j
,
A
->
entries
[
j
].
val
);
fprintf
(
stderr
,
"sum = %10.3f
\n
"
,
sum
);
#endif
exit
(
NUMERIC_BREAKDOWN
);
}
...
...
@@ -363,6 +368,10 @@ static void ICHOL_PAR( const sparse_matrix * const A, const unsigned int sweeps,
}
}
#if defined(DEBUG_FOCUS)
fprintf
(
stderr
,
"nnz(L): %d, max: %d
\n
"
,
U_t
->
start
[
U_t
->
n
],
U_t
->
n
*
50
);
#endif
/* transpose U^{T} and copy into U */
for
(
i
=
0
;
i
<
U_t
->
n
;
++
i
)
{
...
...
@@ -393,6 +402,10 @@ static void ICHOL_PAR( const sparse_matrix * const A, const unsigned int sweeps,
}
}
#if defined(DEBUG_FOCUS)
fprintf
(
stderr
,
"nnz(U): %d, max: %d
\n
"
,
Utop
[
U
->
n
],
U
->
n
*
50
);
#endif
Deallocate_Matrix
(
DAD
);
free
(
D_inv
);
free
(
D
);
...
...
@@ -413,6 +426,7 @@ void Init_MatVec( reax_system *system, control_params *control,
{
//Print_Linear_System( system, control, workspace, data->step );
Sort_Matrix_Rows
(
workspace
->
H
);
Sort_Matrix_Rows
(
workspace
->
H_sp
);
//fprintf( stderr, "H matrix sorted\n" );
// Calculate_Droptol( workspace->H, workspace->droptol, control->droptol );
//fprintf( stderr, "drop tolerances calculated\n" );
...
...
@@ -441,7 +455,7 @@ void Init_MatVec( reax_system *system, control_params *control,
// ICHOLT( workspace->H, workspace->droptol, workspace->L, workspace->U );
// TODO: add parameters for sweeps to control file
ICHOL_PAR
(
workspace
->
H
,
1
,
workspace
->
L
,
workspace
->
U
);
ICHOL_PAR
(
workspace
->
H
_sp
,
1
,
workspace
->
L
,
workspace
->
U
);
#if defined(DEBUG_FOCUS)
sprintf
(
fname
,
"%s.L%d.out"
,
control
->
sim_name
,
data
->
step
);
...
...
@@ -539,10 +553,10 @@ void QEq( reax_system *system, control_params *control, simulation_data *data,
//matvecs += GMRES_HouseHolder( workspace, workspace->H,
// workspace->b_t, control->q_err, workspace->t[0], out_control->log );
// matvecs = PGMRES( workspace, workspace->H, workspace->b_s, control->q_err,
// workspace->L, workspace->U, workspace->s[0], out_control->log );
// matvecs += PGMRES( workspace, workspace->H, workspace->b_t, control->q_err,
// workspace->L, workspace->U, workspace->t[0], out_control->log );
//
matvecs = PGMRES( workspace, workspace->H, workspace->b_s, control->q_err,
//
workspace->L, workspace->U, workspace->s[0], out_control->log );
//
matvecs += PGMRES( workspace, workspace->H, workspace->b_t, control->q_err,
//
workspace->L, workspace->U, workspace->t[0], out_control->log );
matvecs
=
PGMRES_Jacobi
(
workspace
,
workspace
->
H
,
workspace
->
b_s
,
control
->
q_err
,
workspace
->
L
,
workspace
->
U
,
workspace
->
s
[
0
],
out_control
->
log
);
...
...
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