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
31be4e1c
Commit
31be4e1c
authored
Jan 30, 2020
by
Kirill Terekhov
Browse files
Some changes to SuperLU_dist script; provide rhs name in ADMFD
parent
73291432
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
31be4e1c
...
...
@@ -152,6 +152,7 @@ if(USE_PARTITIONER_PARMETIS)
"-DCMAKE_C_COMPILER=
${
CMAKE_C_COMPILER
}
"
"-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
"
)
add_dependencies
(
inmost ParMETIS
)
set
(
PARMETIS_INCLUDE_DIR
"
${
LIB_DOWNLOAD_PATH
}
/include"
CACHE PATH
"PARMETIS_INCLUDE_DIR is set"
FORCE
)
set
(
METIS_INCLUDE_DIR
"
${
LIB_DOWNLOAD_PATH
}
/include"
CACHE PATH
"METIS_INCLUDE_DIR is set"
FORCE
)
if
(
WIN32
)
...
...
@@ -261,146 +262,169 @@ endif()
if
(
USE_SOLVER_SUPERLU
)
find_package
(
SUPERLU
)
if
(
NOT SUPERLU_FOUND
)
#set(USE_SOLVER_SUPERLU OFF CACHE BOOL "Use SuperLU solver" FORCE)
MESSAGE
(
"SUPERLU NOT FOUND"
)
if
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
include
(
ExternalProject
)
message
(
"-- Download SUPERLU"
)
#string (REPLACE ";" "|" PASS_MPI "${MPI_INCLUDE_PATH}")
#message("-- Passing MPI include to ParMETIS: '${PASS_MPI}'")
ExternalProject_Add
(
SUPERLU
GIT_REPOSITORY
"https://github.com/xiaoyeli/superlu.git"
GIT_TAG
"master"
UPDATE_DISCONNECTED 1
#${EXTERNAL_NOUPDATE}
PREFIX
"
${
LIB_DOWNLOAD_PATH
}
"
#this command is responsible for update of repository from git
#UPDATE_COMMAND ""
LIST_SEPARATOR |
# Use the alternate list separator
#for the one from ibaned
#CMAKE_ARGS "-DMPI_INCLUDE_PATH:PATH='${PASS_MPI}'"
CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX=
${
LIB_DOWNLOAD_PATH
}
"
"-DCMAKE_INSTALL_INCLUDEDIR=
${
LIB_DOWNLOAD_PATH
}
/include/superlu "
"-DCMAKE_BUILD_TYPE=Release "
"-DMPI_C_COMPILER=
${
MPI_C_COMPILER
}
"
"-DMPI_CXX_COMPILER=
${
MPI_CXX_COMPILER
}
"
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON "
"-DCMAKE_C_COMPILER=
${
CMAKE_C_COMPILER
}
"
"-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
"
)
find_package
(
BLAS
)
if
(
NOT BLAS_FOUND
)
if
(
WIN32
)
set
(
BLAS_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/src/SUPERLU-build/CBLAS/blas.lib"
CACHE FILEPATH
"BLAS_LIBRARIES"
FORCE
)
else
(
WIN32
)
set
(
BLAS_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/src/SUPERLU-build/CBLAS/libblas.a"
CACHE FILEPATH
"BLAS_LIBRARIES"
FORCE
)
endif
(
WIN32
)
endif
()
set
(
SUPERLU_INCLUDES
"
${
LIB_DOWNLOAD_PATH
}
/include"
CACHE PATH
"SUPERLU_INCLUDE_DIR is set"
FORCE
)
if
(
WIN32
)
set
(
SUPERLU_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/lib/superlu.lib;
${
BLAS_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
else
(
WIN32
)
set
(
SUPERLU_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/lib/libsuperlu.a;
${
BLAS_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
endif
(
WIN32
)
message
(
"-- SUPERLU_INCLUDE_DIR:
${
SUPERLU_INCLUDES
}
"
)
message
(
"-- SUPERLU_LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
else
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
set
(
USE_SOLVER_SUPERLU OFF CACHE BOOL
"Use SuperLU solver"
FORCE
)
endif
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
else
()
MESSAGE
(
"
\n
Found SuperLU! Here are the details: "
)
MESSAGE
(
"INCLUDES:
${
SUPERLU_INCLUDES
}
"
)
MESSAGE
(
"LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
find_package
(
LAPACK
)
if
(
NOT LAPACK_FOUND
)
message
(
"-- Download LAPACK"
)
ExternalProject_Add
(
LAPACK
URL
"https://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz"
UPDATE_DISCONNECTED 1
PREFIX
"
${
LIB_DOWNLOAD_PATH
}
"
INSTALL_COMMAND true
CMAKE_ARGS
#"-DCMAKE_INSTALL_PREFIX=${LIB_DOWNLOAD_PATH} " #no install script!
"-DMPI_C_COMPILER=
${
MPI_C_COMPILER
}
"
"-DMPI_CXX_COMPILER=
${
MPI_CXX_COMPILER
}
"
"-DCMAKE_BUILD_TYPE=Release "
)
if
(
WIN32
)
set
(
LAPACK_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/src/LAPACK-build/SRC/lapack.lib"
CACHE PATH
"LAPACK_LIBRARIES is set"
FORCE
)
set
(
BLAS_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/src/LAPACK-build/BLAS/SRC/blas.lib;
${
LIB_DOWNLOAD_PATH
}
/src/LAPACK-build/F2CLIBS/libf2c/f2c.lib"
CACHE PATH
"LAPACK_LIBRARIES is set"
FORCE
)
else
(
WIN32
)
set
(
LAPACK_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/src/LAPACK-build/SRC/liblapack.a"
CACHE PATH
"LAPACK_LIBRARIES is set"
FORCE
)
set
(
BLAS_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/src/LAPACK-build/BLAS/SRC/libblas.a;
${
LIB_DOWNLOAD_PATH
}
/src/LAPACK-build/F2CLIBS/libf2c/libf2c.a"
CACHE PATH
"LAPACK_LIBRARIES is set"
FORCE
)
endif
(
WIN32
)
endif
()
find_package
(
SUPERLU_DIST
)
if
(
NOT SUPERLU_DIST_FOUND
)
#set(USE_SOLVER_SUPERLU OFF CACHE BOOL "Use SuperLU solver" FORCE)
MESSAGE
(
"SUPERLU_DIST NOT FOUND"
)
if
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
if
(
USE_MPI AND USE_PARTITIONER_PARMETIS
)
message
(
"-- Download SuperLU_DIST"
)
set
(
C_STANDARD_FLAG
"-std=c99"
)
string
(
REPLACE
";"
"|"
PASS_PARMETIS_LIBRARIES
"
${
PARMETIS_LIBRARIES
}
"
)
message
(
"-- Pass parmetis libraries
${
PASS_PARMETIS_LIBRARIES
}
"
)
#do we need blas?
find_package
(
LAPACK
)
if
(
NOT LAPACK_FOUND
)
ExternalProject_Add
(
LAPACK
URL
"https://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz"
UPDATE_DISCONNECTED 1
PREFIX
"
${
LIB_DOWNLOAD_PATH
}
"
)
if
(
WIN32
)
set
(
LAPACK_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/lib/lapack.lib"
CACHE PATH
"LAPACK_LIBRARIES is set"
FORCE
)
else
(
WIN32
)
set
(
LAPACK_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/lib/liblapack.a"
CACHE PATH
"LAPACK_LIBRARIES is set"
FORCE
)
endif
(
WIN32
)
set
(
LAPACK_LIBRARIES
"
${
SUPERLU_LIBRARIES
}
;
${
LAPACK_LIBRARIES
}
;
${
PARMETIS_LIBRARIES
}
;
${
LIB_DOWNLOAD_PATH
}
/lib/superlu_dist.lib"
CACHE PATH
"LAPACK_LIBRARIES is set"
FORCE
)
endif
()
message
(
"-- Pass lapack libraries
${
LAPACK_LIBRARIES
}
"
)
ExternalProject_Add
(
SuperLU_DIST
GIT_REPOSITORY
"https://github.com/xiaoyeli/superlu_dist.git"
string
(
REPLACE
";"
"|"
PASS_LAPACK_LIBRARIES
"
${
LAPACK_LIBRARIES
}
"
)
string
(
REPLACE
";"
"|"
PASS_BLAS_LIBRARIES
"
${
BLAS_LIBRARIES
}
"
)
if
(
NOT USE_MPI
)
find_package
(
SUPERLU
)
if
(
NOT SUPERLU_FOUND
)
#set(USE_SOLVER_SUPERLU OFF CACHE BOOL "Use SuperLU solver" FORCE)
MESSAGE
(
"SUPERLU NOT FOUND"
)
if
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
include
(
ExternalProject
)
message
(
"-- Download SUPERLU"
)
#string (REPLACE ";" "|" PASS_MPI "${MPI_INCLUDE_PATH}")
#message("-- Passing MPI include to ParMETIS: '${PASS_MPI}'")
ExternalProject_Add
(
SUPERLU
GIT_REPOSITORY
"https://github.com/xiaoyeli/superlu.git"
GIT_TAG
"master"
UPDATE_DISCONNECTED 1
UPDATE_DISCONNECTED 1
#${EXTERNAL_NOUPDATE}
PREFIX
"
${
LIB_DOWNLOAD_PATH
}
"
#this command is responsible for update of repository from git
#UPDATE_COMMAND ""
LIST_SEPARATOR |
# Use the alternate list separator
CMAKE_ARGS
"-DTPL_PARMETIS_INCLUDE_DIRS=
${
PARMETIS_INCLUDE_DIR
}
"
"-DTPL_PARMETIS_LIBRARIES=
${
PASS_PARMETIS_LIBRARIES
}
"
"-DTPL_LAPACK_LIBRARIES=
${
LAPACK_LIBRARIES
}
"
"-Denable_examples=OFF "
"-Denable_tests=OFF "
"-Denable_doc=OFF "
"-DCMAKE_INSTALL_PREFIX=
${
LIB_DOWNLOAD_PATH
}
"
"-DUSE_XSDK_DEFAULTS=TRUE "
"-DXSDK_ENABLE_Fortran=FALSE "
"-DNOFORTRAN=TRUE "
"-DCMAKE_C_FLAGS='
${
C_STANDARD_FLAG
}
-DMETIS_EXPORT=' "
"-DCMAKE_CXX_FLAGS='-DMETIS_EXPORT=' "
#for the one from ibaned
#CMAKE_ARGS "-DMPI_INCLUDE_PATH:PATH='${PASS_MPI}'"
CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX=
${
LIB_DOWNLOAD_PATH
}
"
"-DCMAKE_INSTALL_INCLUDEDIR=
${
LIB_DOWNLOAD_PATH
}
/include/superlu "
"-DBLAS_LIBRARIES=
${
PASS_BLAS_LIBRARIES
}
"
#should come from find_pacakge(LAPACK)
"-DCMAKE_BUILD_TYPE=Release "
"-DMPI_C_COMPILER=
${
MPI_C_COMPILER
}
"
"-DMPI_CXX_COMPILER=
${
MPI_CXX_COMPILER
}
"
"-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE "
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON "
"-DCMAKE_C_COMPILER=
${
CMAKE_C_COMPILER
}
"
"-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
"
)
message
(
"-- Linking SuperLU_dist and ParMETIS"
)
add_dependencies
(
SuperLU_DIST ParMETIS
)
add_definitions
(
-DUSE_SOLVER_SUPERLU_DIST
)
#same as above
#set(SUPERLU_INCLUDES "${LIB_DOWNLOAD_PATH}/include" CACHE PATH "SUPERLU_INCLUDE_DIR is set" FORCE)
#extended
#TODO: properly install lapack
#get internal blas
#find_package(BLAS)
#if (NOT BLAS_FOUND)
# if( WIN32 )
# set(BLAS_LIBRARIES "${LIB_DOWNLOAD_PATH}/src/SUPERLU-build/CBLAS/blas.lib" CACHE FILEPATH "BLAS_LIBRARIES" FORCE)
# else( WIN32 )
# set(BLAS_LIBRARIES "${LIB_DOWNLOAD_PATH}/src/SUPERLU-build/CBLAS/libblas.a" CACHE FILEPATH "BLAS_LIBRARIES" FORCE)
# endif( WIN32 )
#endif()
add_dependencies
(
inmost SUPERLU
)
set
(
SUPERLU_INCLUDES
"
${
LIB_DOWNLOAD_PATH
}
/include"
CACHE PATH
"SUPERLU_INCLUDE_DIR is set"
FORCE
)
if
(
WIN32
)
set
(
SUPERLU_LIBRARIES
"
${
SUPERLU_LIBRARIES
}
;
${
LIB_DOWNLOAD_PATH
}
/lib/superlu
_dist
.lib;
${
LA
PACK_LIBRARIES
}
;
${
PARMETI
S_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
set
(
SUPERLU_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/lib/superlu.lib;
${
B
LAS_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
else
(
WIN32
)
set
(
SUPERLU_LIBRARIES
"
${
SUPERLU_LIBRARIES
}
;
${
METIS_LIBRARIES
}
;
${
LIB_DOWNLOAD_PATH
}
/lib/libsuperlu
_dist
.a;
${
LA
PACK_LIBRARIES
}
;
${
PARMETI
S_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
set
(
SUPERLU_LIBRARIES
"
${
LIB_DOWNLOAD_PATH
}
/lib/libsuperlu.a;
${
B
LAS_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
endif
(
WIN32
)
message
(
"-- SUPERLU_INCLUDE_DIR:
${
SUPERLU_INCLUDES
}
"
)
message
(
"-- SUPERLU_LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
else
()
message
(
"-- Skip SuperLU_DIST as either USE_MPI or USE_PARTITIONER_PARMETIS are not checked for compilation"
)
endif
()
else
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
set
(
USE_SOLVER_SUPERLU OFF CACHE BOOL
"Use SuperLU solver"
FORCE
)
endif
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
message
(
"-- SUPERLU_LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
else
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
set
(
USE_SOLVER_SUPERLU OFF CACHE BOOL
"Use SuperLU solver"
FORCE
)
endif
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
else
()
MESSAGE
(
"
\n
Found SuperLU! Here are the details: "
)
MESSAGE
(
"INCLUDES:
${
SUPERLU_INCLUDES
}
"
)
MESSAGE
(
"LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
endif
()
else
()
MESSAGE
(
"
\n
Found SuperLU_DIST! Here are the details: "
)
set
(
SUPERLU_INCLUDES
"
${
SUPERLU_INCLUDES
}
;
${
SUPERLU_DIST_INCLUDES
}
"
)
set
(
SUPERLU_LIBRARIES
"
${
SUPERLU_LIBRARIES
}
;
${
SUPERLU_DIST_LIBRARIES
}
"
)
MESSAGE
(
"INCLUDES:
${
SUPERLU_INCLUDES
}
"
)
MESSAGE
(
"LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
find_package
(
SUPERLU_DIST
)
if
(
NOT SUPERLU_DIST_FOUND
)
#set(USE_SOLVER_SUPERLU OFF CACHE BOOL "Use SuperLU solver" FORCE)
MESSAGE
(
"SUPERLU_DIST NOT FOUND"
)
if
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
if
(
USE_MPI AND USE_PARTITIONER_PARMETIS
)
message
(
"-- Download SuperLU_DIST"
)
set
(
C_STANDARD_FLAG
"-std=c99"
)
string
(
REPLACE
";"
"|"
PASS_PARMETIS_LIBRARIES
"
${
PARMETIS_LIBRARIES
}
"
)
message
(
"-- Pass parmetis libraries
${
PASS_PARMETIS_LIBRARIES
}
"
)
message
(
"-- Pass lapack libraries
${
PASS_LAPACK_LIBRARIES
}
"
)
message
(
"-- Pass blas libraries
${
PASS_BLAS_LIBRARIES
}
"
)
ExternalProject_Add
(
SuperLU_DIST
GIT_REPOSITORY
"https://github.com/xiaoyeli/superlu_dist.git"
GIT_TAG
"master"
UPDATE_DISCONNECTED 1
PREFIX
"
${
LIB_DOWNLOAD_PATH
}
"
#this command is responsible for update of repository from git
#UPDATE_COMMAND ""
LIST_SEPARATOR |
# Use the alternate list separator
CMAKE_ARGS
"-DTPL_PARMETIS_INCLUDE_DIRS=
${
PARMETIS_INCLUDE_DIR
}
"
"-DTPL_PARMETIS_LIBRARIES=
${
PASS_PARMETIS_LIBRARIES
}
"
"-DTPL_LAPACK_LIBRARIES=
${
PASS_LAPACK_LIBRARIES
}
"
"-DBLAS_LIBRARIES=
${
PASS_BLAS_LIBRARIES
}
"
#should come from find_pacakge(LAPACK)
"-Denable_examples=OFF "
"-Denable_tests=OFF "
"-Denable_doc=OFF "
"-DCMAKE_INSTALL_PREFIX=
${
LIB_DOWNLOAD_PATH
}
"
"-DUSE_XSDK_DEFAULTS=TRUE "
"-DXSDK_ENABLE_Fortran=FALSE "
"-DNOFORTRAN=TRUE "
"-DCMAKE_C_FLAGS='
${
C_STANDARD_FLAG
}
-DMETIS_EXPORT=' "
"-DCMAKE_CXX_FLAGS='-DMETIS_EXPORT=' "
"-DCMAKE_BUILD_TYPE=Release "
"-DMPI_C_COMPILER=
${
MPI_C_COMPILER
}
"
"-DMPI_CXX_COMPILER=
${
MPI_CXX_COMPILER
}
"
"-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE "
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON "
)
message
(
"-- Linking SuperLU_dist and ParMETIS"
)
if
(
NOT LAPACK_FOUND
)
add_dependencies
(
SuperLU_DIST LAPACK
)
endif
()
add_dependencies
(
SuperLU_DIST ParMETIS
)
add_dependencies
(
inmost SuperLU_DIST
)
add_definitions
(
-DUSE_SOLVER_SUPERLU_DIST
)
#same as above
#set(SUPERLU_INCLUDES "${LIB_DOWNLOAD_PATH}/include" CACHE PATH "SUPERLU_INCLUDE_DIR is set" FORCE)
#extended
#TODO: properly install lapack
if
(
WIN32
)
set
(
SUPERLU_LIBRARIES
"
${
SUPERLU_LIBRARIES
}
;
${
METIS_LIBRARIES
}
;
${
LIB_DOWNLOAD_PATH
}
/lib/superlu_dist.lib;
${
LAPACK_LIBRARIES
}
;
${
BLAS_LIBRARIES
}
;
${
PARMETIS_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
else
(
WIN32
)
set
(
SUPERLU_LIBRARIES
"
${
SUPERLU_LIBRARIES
}
;
${
METIS_LIBRARIES
}
;
${
LIB_DOWNLOAD_PATH
}
/lib/libsuperlu_dist.a;
${
LAPACK_LIBRARIES
}
;
${
BLAS_LIBRARIES
}
;
${
PARMETIS_LIBRARIES
}
"
CACHE PATH
"SUPERLU_LIBRARIES is set"
FORCE
)
endif
(
WIN32
)
message
(
"-- SUPERLU_INCLUDE_DIR:
${
SUPERLU_INCLUDES
}
"
)
message
(
"-- SUPERLU_LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
else
()
message
(
"-- Skip SuperLU_DIST as either USE_MPI or USE_PARTITIONER_PARMETIS are not checked for compilation"
)
endif
()
else
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
set
(
USE_SOLVER_SUPERLU OFF CACHE BOOL
"Use SuperLU solver"
FORCE
)
endif
(
USE_SOLVER_SUPERLU_DOWNLOAD
)
else
()
MESSAGE
(
"
\n
Found SuperLU_DIST! Here are the details: "
)
set
(
SUPERLU_INCLUDES
"
${
SUPERLU_INCLUDES
}
;
${
SUPERLU_DIST_INCLUDES
}
"
)
set
(
SUPERLU_LIBRARIES
"
${
SUPERLU_LIBRARIES
}
;
${
SUPERLU_DIST_LIBRARIES
}
"
)
MESSAGE
(
"INCLUDES:
${
SUPERLU_INCLUDES
}
"
)
MESSAGE
(
"LIBRARIES:
${
SUPERLU_LIBRARIES
}
"
)
endif
()
endif
()
if
(
USE_SOLVER_SUPERLU
)
include_directories
(
${
SUPERLU_INCLUDES
}
)
endif
()
include_directories
(
${
SUPERLU_INCLUDES
}
)
endif
()
if
(
USE_OPENCL
)
...
...
Examples/ADMFD/diffusion.cpp
View file @
31be4e1c
...
...
@@ -38,7 +38,8 @@ int main(int argc,char ** argv)
#endif
if
(
argc
>
1
)
{
std
::
string
force_name
=
"FORCE"
;
int
force_comp
=
0
;
double
ttt
;
// Variable used to measure timing
bool
repartition
=
false
;
// Is it required to redistribute the mesh?
Mesh
*
m
=
new
Mesh
();
// Create an empty mesh
...
...
@@ -58,6 +59,8 @@ int main(int argc,char ** argv)
if
(
m
->
GetProcessorRank
()
==
0
)
std
::
cout
<<
"Load the mesh: "
<<
Timer
()
-
ttt
<<
std
::
endl
;
}
if
(
argc
>
2
)
force_name
=
std
::
string
(
argv
[
2
]);
if
(
argc
>
3
)
force_comp
=
atoi
(
argv
[
3
]);
#if defined(USE_PARTITIONER)
if
(
m
->
GetProcessorsNumber
()
>
1
)
//&& !repartition) // Currently only non-distributed meshes are supported by Inner_RCM partitioner
...
...
@@ -210,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
())
*
(
2
.0
/
(
static_cast
<
real
>
(
NF
)
*
volume
)
*
(
NK
*
K
.
CholeskyInvert
()
*
NK
.
Transpose
()).
Trace
());
(
4
.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
);
...
...
@@ -225,9 +228,9 @@ int main(int argc,char ** argv)
}
std
::
cout
<<
"Construct W matrix: "
<<
Timer
()
-
ttt
<<
std
::
endl
;
if
(
m
->
HaveTag
(
"FORCE"
)
)
//Is there force on the mesh?
if
(
m
->
HaveTag
(
force_name
)
)
//Is there force on the mesh?
{
tag_F
=
m
->
GetTag
(
"FORCE"
);
//initial force
tag_F
=
m
->
GetTag
(
force_name
);
//initial force
assert
(
tag_F
.
isDefined
(
CELL
));
//assuming it was defined on cells
}
// end of force
}
//end of initialize data
...
...
@@ -311,10 +314,16 @@ int main(int argc,char ** argv)
if
(
faces
[
k
].
GetStatus
()
==
Element
::
Ghost
)
continue
;
int
index
=
P
.
Index
(
faces
[
k
]);
Locks
.
Lock
(
index
);
if
(
tag_BC
.
isValid
()
&&
faces
[
k
].
HaveData
(
tag_BC
)
)
if
(
faces
[
k
].
Boundary
()
)
{
real_array
BC
=
faces
[
k
].
RealArray
(
tag_BC
);
R
[
index
]
-=
BC
[
0
]
*
P
(
faces
[
k
])
+
BC
[
1
]
*
FLUX
(
k
,
0
)
-
BC
[
2
];
double
a
=
1
,
b
=
0
,
c
=
0
;
if
(
tag_BC
.
isValid
()
&&
faces
[
k
].
HaveData
(
tag_BC
)
)
{
real_array
BC
=
faces
[
k
].
RealArray
(
tag_BC
);
a
=
BC
[
0
],
b
=
BC
[
1
],
c
=
BC
[
2
];
}
R
[
index
]
-=
a
*
P
(
faces
[
k
])
+
b
*
FLUX
(
k
,
0
)
-
c
;
}
else
R
[
index
]
-=
FLUX
(
k
,
0
);
...
...
@@ -332,9 +341,11 @@ int main(int argc,char ** argv)
{
Cell
cell
=
m
->
CellByLocalID
(
q
);
if
(
cell
.
GetStatus
()
==
Element
::
Ghost
)
continue
;
if
(
cell
->
HaveData
(
tag_F
)
)
R
[
P
.
Index
(
cell
)]
+=
cell
->
Real
(
tag_F
)
*
cell
->
Volume
();
if
(
cell
->
HaveData
(
tag_F
)
)
R
[
P
.
Index
(
cell
)]
+=
cell
->
Real
Array
(
tag_F
)
[
force_comp
]
*
cell
->
Volume
();
}
}
//R[P.Index(m->BeginCell()->self())] = P[m->BeginCell()->self()];
}
std
::
cout
<<
"assembled in "
<<
Timer
()
-
tttt
<<
"
\t\t\t
"
<<
std
::
endl
;
...
...
@@ -343,14 +354,14 @@ int main(int argc,char ** argv)
if
(
R
.
Norm
()
<
1.0e-4
)
break
;
//Solver S(Solver::INNER_ILU2);
//~
Solver S(Solver::INNER_MPTILUC);
Solver
S
(
Solver
::
K3BIILU2
);
Solver
S
(
Solver
::
INNER_MPTILUC
);
//~
Solver S(Solver::K3BIILU2);
//Solver S("superlu");
S
.
SetParameter
(
"verbosity"
,
"1"
);
S
.
SetParameter
(
"relative_tolerance"
,
"1.0e-14"
);
S
.
SetParameter
(
"absolute_tolerance"
,
"1.0e-12"
);
S
.
SetParameter
(
"drop_tolerance"
,
"1.0e-
2
"
);
S
.
SetParameter
(
"reuse_tolerance"
,
"1.0e-
3
"
);
S
.
SetParameter
(
"drop_tolerance"
,
"1.0e-
3
"
);
S
.
SetParameter
(
"reuse_tolerance"
,
"1.0e-
4
"
);
S
.
SetMatrix
(
R
.
GetJacobian
());
...
...
Examples/DrawGrid/main.cpp
View file @
31be4e1c
...
...
@@ -39,7 +39,7 @@ inline static unsigned int flip(const unsigned int * fp)
void
draw_screen
();
void
svg_draw
(
std
::
ostream
&
file
);
int
wnd
=
-
1
;
using
namespace
INMOST
;
Mesh
*
mesh
;
int
interactive
=
0
;
...
...
@@ -502,12 +502,21 @@ void keyboard(unsigned char key, int x, int y)
}
if
(
key
==
27
)
{
std
::
cout
<<
"delete volumetric clipper"
<<
std
::
endl
;
if
(
oclipper
)
delete
oclipper
;
std
::
cout
<<
"delete boundary clipper"
<<
std
::
endl
;
if
(
bclipper
)
delete
bclipper
;
std
::
cout
<<
"delete picker"
<<
std
::
endl
;
if
(
current_picker
)
delete
current_picker
;
std
::
cout
<<
"delete volumetric view"
<<
std
::
endl
;
delete
CommonVolumetricView
;
std
::
cout
<<
"delete mesh"
<<
std
::
endl
;
delete
mesh
;
std
::
cout
<<
"destroy window"
<<
std
::
endl
;
glutDestroyWindow
(
wnd
);
std
::
cout
<<
"call exit!"
<<
std
::
endl
;
exit
(
-
1
);
std
::
cout
<<
"after exit"
<<
std
::
endl
;
}
else
if
(
key
==
'='
||
key
==
'+'
)
{
...
...
@@ -2621,7 +2630,7 @@ int main(int argc, char ** argv)
glutInitDisplayMode
(
GLUT_DOUBLE
|
GLUT_RGBA
|
GLUT_DEPTH
);
glutInitWindowSize
(
width
,
height
);
glutInitWindowPosition
(
100
,
100
);
glutCreateWindow
(
"Graph"
);
wnd
=
glutCreateWindow
(
"Graph"
);
glDepthFunc
(
GL_LEQUAL
);
glClearDepth
(
1.
f
);
...
...
Source/Partitioner/partitioner.cpp
View file @
31be4e1c
...
...
@@ -1432,6 +1432,7 @@ namespace INMOST
int
Kstart
=
Kpart
*
m
->
GetProcessorRank
();
int
Kend
=
Kstart
+
Kpart
;
if
(
Kend
>
K
)
Kend
=
K
;
srand
(
0
);
for
(
int
i
=
Kstart
;
i
<
Kend
;
i
++
)
if
(
cluster_npoints
[
i
]
==
0
)
{
while
(
true
)
...
...
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