Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
979106b8
Commit
979106b8
authored
Dec 01, 2010
by
Naumann, Andreas
Browse files
enabled out-of-source builds and cannot load simple meshes. See meshtest
parent
ff7943ee
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/CMakeLists.txt
View file @
979106b8
...
...
@@ -2,11 +2,10 @@ project(AMDiS)
cmake_minimum_required
(
VERSION 2.8
)
set
(
AMDiS_SOURCE_DIR
"
${
AMDiS_SOURCE_DIR
}
/src"
)
#needs: --enable-debug, enable-intel --enable-openmp --enable-parmetis --enable-parallel-domain --enable-umfpack --enable-mkl --enable-boost --enable-marmot
SET
(
LIB_DIR
.
/lib
)
SET
(
SOURCE_DIR
${
AMDiS_SOURCE_DIR
}
)
SET
(
LIB_DIR
${
AMDiS_SOURCE_DIR
}
/lib
)
SET
(
SOURCE_DIR
${
AMDiS_SOURCE_DIR
}
/src
)
#TODO: use the cmake build type
SET
(
MTL_DIR
${
LIB_DIR
}
/mtl4/ CACHE PATH
"mtl4 directory"
)
...
...
@@ -50,8 +49,6 @@ if(Boost_FOUND)
link_directories
(
${
Boost_LIBRARY_DIRS
}
)
endif
(
Boost_FOUND
)
SET
(
LIB_DIR ./lib
)
SET
(
SOURCE_DIR
${
AMDiS_SOURCE_DIR
}
)
SET
(
AMDIS_SRC
${
SOURCE_DIR
}
/DOFIndexed.cc
${
SOURCE_DIR
}
/io/GNUPlotWriter.cc
${
SOURCE_DIR
}
/VertexVector.cc
...
...
@@ -268,39 +265,39 @@ endif(ENABLE_MARMOT)
install
(
TARGETS amdis compositeFEM
LIBRARY DESTINATION lib/amdis/
)
FILE
(
GLOB HEADERS
"
${
AMDiS_
SOURCE_DIR
}
/*.h"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/*.h"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/
)
FILE
(
GLOB HEADERS
"
${
AMDiS_
SOURCE_DIR
}
/*.hh"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/*.hh"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/
)
FILE
(
GLOB HEADERS
"
${
AMDiS_
SOURCE_DIR
}
/parallel/*.h"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/parallel/*.h"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/parallel/
)
FILE
(
GLOB HEADERS
"
${
AMDiS_
SOURCE_DIR
}
/time/*.h"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/time/*.h"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/time/
)
FILE
(
GLOB HEADERS
"
${
AMDiS_
SOURCE_DIR
}
/itl/*.hpp"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/itl/*.hpp"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/itl
)
FILE
(
GLOB HEADERS
"
${
AMDiS_
SOURCE_DIR
}
/io/*.h"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/io/*.h"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/io
)
FILE
(
GLOB HEADERS
"
${
AMDiS_
SOURCE_DIR
}
/io/*.hh"
)
FILE
(
GLOB HEADERS
"
${
SOURCE_DIR
}
/io/*.hh"
)
INSTALL
(
FILES
${
HEADERS
}
DESTINATION include/amdis/io
)
configure_file
(
${
AMDiS_
BINARY
_DIR
}
/AMDiSConfig.cmake.in
configure_file
(
${
AMDiS_
SOURCE
_DIR
}
/AMDiSConfig.cmake.in
${
AMDiS_BINARY_DIR
}
/AMDiSConfig.cmake
@ONLY
)
INSTALL
(
FILES
${
AMDiS_BINARY_DIR
}
/AMDiSConfig.cmake
DESTINATION share/amdis/
)
INSTALL
(
FILES
${
AMDiS_
BINARY
_DIR
}
/AMDiSUse.cmake
INSTALL
(
FILES
${
AMDiS_
SOURCE
_DIR
}
/AMDiSUse.cmake
DESTINATION share/amdis/
)
#install mtl
INSTALL
(
DIRECTORY
${
CMAKE_BINARY
_DIR
}
/lib/mtl4/
INSTALL
(
DIRECTORY
${
AMDiS_SOURCE
_DIR
}
/lib/mtl4/
DESTINATION include/amdis/mtl4/
FILES_MATCHING PATTERN
"*.hpp"
PATTERN
".svn"
EXCLUDE
...
...
@@ -313,7 +310,7 @@ INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/lib/mtl4/
#let cmake look for the svn-version
find_package
(
Subversion
)
if
(
Subversion_FOUND
)
Subversion_WC_INFO
(
${
CMAKE_CURRENT_BINARY
_DIR
}
mtlSubinfo
)
Subversion_WC_INFO
(
${
AMDiS_SOURCE
_DIR
}
mtlSubinfo
)
set
(
CurrentRevision
${
mtlSubinfo_WC_REVISION
}
)
# message("current revision: ${mtlSubinfo_WC_REVISION}")
else
(
Subversion_FOUND
)
...
...
AMDiS/test/CMakeLists.txt
View file @
979106b8
project
(
tests
)
add_subdirectory
(
Meshtest
)
add_subdirectory
(
demoimpl
)
add_subdirectory
(
demotest
)
add_subdirectory
(
demotest
EXCLUDE_FROM_ALL
)
add_subdirectory
(
datacreation EXCLUDE_FROM_ALL
)
AMDiS/test/Meshtest/CMakeLists.txt
0 → 100644
View file @
979106b8
project
(
Meshtest
)
add_executable
(
Meshtest src/Meshtest.cpp
)
target_link_libraries
(
Meshtest
${
AMDiS_LIBS
}
)
add_test
(
Meshtest Meshtest
)
AMDiS/test/Meshtest/src/Meshtest.cpp
0 → 100644
View file @
979106b8
#include "Mesh.h"
#include "Parameters.h"
using
namespace
AMDiS
;
int
main
(
int
argc
,
char
**
argv
)
{
FUNCNAME
(
"no function"
);
//cannot use Parameters::addGlobalParameter(...) because of some string errors
// ADD_PARAMETER(1,"dimension of world","1");
// ADD_PARAMETER(1,"testMesh1->macro file name","macro/macro.stand.1d");
// ADD_PARAMETER(1,"testMesh2->macro file name","macro/macro.stand.2d");
// ADD_PARAMETER(1,"testMesh3->macro file name","macro/macro.stand.3d");
Parameters
::
init
(
1
,
"init/ball.dat.2d"
);
Global
::
init
();
Mesh
mesh1
(
"ballMesh"
,
2
);
Mesh
mesh2
(
"testMesh1"
,
2
);
Mesh
mesh3
(
"testMesh1"
,
3
);
mesh1
.
initialize
();
mesh2
.
initialize
();
mesh3
.
initialize
();
return
0
;
}
AMDiS/test/demotest/CMakeLists.txt
View file @
979106b8
project
(
demotest
)
ENABLE_TESTING
()
include_directories
(
${
AMDiS_SOURCE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src
)
add_library
(
comparer src/Comparer.cpp
)
file
(
GLOB PROJECTFILES
${
CMAKE_CURRENT_SOURCE_DIR
}
/../demoimpl/src/*Project.cpp
)
foreach
(
projectfile
${
PROJECTFILES
}
)
#create creatorname
...
...
@@ -11,12 +13,13 @@ project(demotest)
string
(
TOLOWER
"
${
creatorsuffix
}
"
creatorsuffix_lower
)
set
(
BASENAME
"
${
creatorsuffix_lower
}
"
)
configure_file
(
src/tester_base.cpp src/tester
${
creatorsuffix
}
.cpp @ONLY
)
add_executable
(
tester
${
creatorsuffix
}
src/tester
${
creatorsuffix
}
.cpp
src/Comparer.cpp
)
target_link_libraries
(
tester
${
creatorsuffix
}
${
AMDiS_LIBS
}
demoimpl
)
add_executable
(
tester
${
creatorsuffix
}
src/tester
${
creatorsuffix
}
.cpp
)
target_link_libraries
(
tester
${
creatorsuffix
}
${
AMDiS_LIBS
}
demoimpl
comparer
)
file
(
GLOB initfiles RELATIVE
${
CMAKE_CURRENT_BINARY_DIR
}
init/
${
creatorsuffix_lower
}
*.dat*
)
foreach
(
initfile
${
initfiles
}
)
get_filename_component
(
initfile_ext
${
initfile
}
EXT
)
string
(
REPLACE
".dat."
""
initfile_ext
"
${
initfile_ext
}
"
)
set
(
curoutputdatafile
"../testdata/
${
creatorsuffix_lower
}
_
${
initfile_ext
}
.arh"
)
add_test
(
${
creatorsuffix
}
_
${
initfile_ext
}
_Test tester
${
creatorsuffix
}
${
initfile
}
${
curoutputdatafile
}
)
endforeach
(
initfile
)
endforeach
(
projectfile
)
AMDiS/test/demotest/src/Comparer.cpp
View file @
979106b8
#include "Project.h"
#include "io/ArhReader.h"
#include "MeshStructure.h"
#include "Global.h"
bool
operator
==
(
DOFVector
<
double
>&
l
,
DOFVector
<
double
>&
r
)
{
if
(
l
.
getUsedSize
()
!=
r
.
getUsedSize
())
return
false
;
DOFIterator
<
double
>
lit
(
&
l
,
USED_DOFS
);
DOFIterator
<
double
>
rit
(
&
r
,
USED_DOFS
);
lit
.
reset
();
rit
.
reset
();
while
(
!
lit
.
end
())
{
if
(
abs
(
*
lit
-
*
rit
)
>
1e-12
)
return
false
;
++
lit
;
++
rit
;
}
return
true
;
}
bool
compare
(
SolutionInformation
&
info
,
std
::
string
filename
)
{
if
(
info
.
sysVec
!=
NULL
)
{
assert
(
false
);
}
else
if
(
info
.
dofVec
!=
NULL
)
{
DOFVector
<
double
>
fileVec
(
info
.
dofVec
->
getFeSpace
(),
"fileVec"
);
Mesh
fileMesh
(
""
,
2
);
fileMesh
=
*
(
info
.
dofVec
->
getFeSpace
()
->
getMesh
());
ArhReader
::
read
(
filename
,
&
fileMesh
,
&
fileVec
);
DOFVector
<
double
>
filevec
(
info
.
dofVec
->
getFeSpace
(),
"fileVec"
);
Mesh
*
solMesh
=
info
.
dofVec
->
getFeSpace
()
->
getMesh
();
std
::
cout
<<
"initing swap mesh with name "
<<
solMesh
->
getName
()
<<
"
\n
"
;
std
::
cout
<<
"swap dimension: "
<<
solMesh
->
getDim
()
<<
"
\n
"
;
Mesh
fileMesh
(
solMesh
->
getName
(),
solMesh
->
getDim
());
fileMesh
.
initialize
();
std
::
cout
<<
"reading mesh from file "
<<
filename
<<
"
\n
"
;
ArhReader
::
read
(
filename
,
&
fileMesh
,
&
filevec
);
DOFVector
<
double
>
nsolvec
(
*
(
info
.
dofVec
));
MeshStructure
nsolvestructure
;
nsolvestructure
.
init
(
solMesh
);
MeshStructure
filestructure
;
filestructure
.
init
(
&
fileMesh
);
return
nsolvec
==
filevec
&&
nsolvestructure
.
compare
(
filestructure
);
}
else
assert
(
false
);
return
false
;
...
...
Write
Preview
Supports
Markdown
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