Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kirill Terekhov
INMOST
Commits
f67c2fde
Commit
f67c2fde
authored
Jan 30, 2020
by
Kirill Terekhov
Browse files
fix inproper memory release in SuperLU_dist interface
parent
31be4e1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Examples/ADMFD/diffusion.cpp
View file @
f67c2fde
...
...
@@ -213,7 +213,7 @@ int main(int argc,char ** argv)
}
//end of loop over faces
W
=
NK
*
(
NK
.
Transpose
()
*
R
).
PseudoInvert
(
1.0e-12
)
*
NK
.
Transpose
();
//stability part
W
+=
(
rMatrix
::
Unit
(
NF
)
-
R
*
(
R
.
Transpose
()
*
R
).
CholeskyInvert
()
*
R
.
Transpose
())
*
(
4
.0
/
(
static_cast
<
real
>
(
NF
)
*
volume
)
*
(
NK
*
K
.
CholeskyInvert
()
*
NK
.
Transpose
()).
Trace
());
(
1
.0
/
(
static_cast
<
real
>
(
NF
)
*
volume
)
*
(
NK
*
K
.
CholeskyInvert
()
*
NK
.
Transpose
()).
Trace
());
W
=
Areas
*
W
*
Areas
;
//access data structure for gradient matrix in mesh
real_array
store_W
=
cell
->
RealArrayDV
(
tag_W
);
...
...
Source/Solver/solver_superlu/SolverSUPERLU.cpp
View file @
f67c2fde
...
...
@@ -20,7 +20,7 @@ namespace INMOST
perm_c
=
NULL
;
perm_r
=
NULL
;
#endif //USE_SOLVER_SUPERLU_DIST
a_size
=
0
;
g_size
=
a_size
=
0
;
}
SolverInterface
*
SolverSUPERLU
::
Copy
(
const
SolverInterface
*
other
)
...
...
@@ -84,6 +84,7 @@ namespace INMOST
dCreate_CompRowLoc_Matrix_dist
(
&
(
this
->
A
),
global_size
,
global_size
,
nnz
,
local_size
,
offset
,
a
,
ja
,
ia
,
SLU_NR_loc
,
SLU_D
,
SLU_GE
);
ScalePermstructInit
(
global_size
,
global_size
,
&
ScalePermstruct
);
LUstructInit
(
global_size
,
&
LUstruct
);
g_size
=
global_size
;
a_size
=
size
;
#else //USE_SOLVER_SUPERLU_DIST
remap
=
new
int
[
mend
-
mbeg
];
...
...
@@ -175,15 +176,18 @@ namespace INMOST
bool
SolverSUPERLU
::
Clear
()
{
//~ std::cout << "call clear!" << std::endl;
#if defined(USE_SOLVER_SUPERLU_DIST)
//~ std::cout << "call clear!" << std::endl;
PStatFree
(
&
stat_
);
Destroy_CompRowLoc_Matrix_dist
(
&
A
);
ScalePermstructFree
(
&
ScalePermstruct
);
Destroy_LU
(
a
_size
,
&
grid
,
&
LUstruct
);
Destroy_LU
(
g
_size
,
&
grid
,
&
LUstruct
);
LUstructFree
(
&
LUstruct
);
if
(
options_
.
SolveInitialized
)
{
//~ std::cout << "call dSolveFinalize!" << std::endl;
dSolveFinalize
(
&
options_
,
&
SOLVEstruct
);
}
Destroy_CompRowLoc_Matrix_dist
(
&
A
);
superlu_gridexit
(
&
grid
);
#else //USE_SOLVER_SUPERLU_DIST
Destroy_CompCol_Matrix
(
&
A
);
...
...
@@ -194,6 +198,7 @@ namespace INMOST
if
(
perm_r
!=
NULL
)
delete
[]
perm_r
;
if
(
remap
!=
NULL
)
delete
[]
remap
;
//allocated outside
#endif
//~ SUPERLU_FREE(A.Store);
return
true
;
}
...
...
Source/Solver/solver_superlu/SolverSUPERLU.h
View file @
f67c2fde
...
...
@@ -20,6 +20,7 @@ namespace INMOST {
gridinfo_t
grid
;
superlu_dist_options_t
options_
;
SuperLUStat_t
stat_
;
int
g_size
;
#else //USE_SOLVER_SUPERLU_DIST
int
*
perm_r
;
int
*
perm_c
;
...
...
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