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
Aland, Sebastian
amdis
Commits
83ed9754
Commit
83ed9754
authored
Feb 01, 2012
by
Praetorius, Simon
Browse files
Png Reader/Writer included
parent
26f42781
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/AMDISConfig.cmake.in
View file @
83ed9754
...
...
@@ -61,6 +61,7 @@ endif(Boost_FOUND)
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_NEED_PNG @ENABLE_PNG@)
set(AMDIS_NEED_BDDCML @ENABLE_BDDCML@)
set(AMDIS_NEED_MKL @ENABLE_MKL@)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
...
...
@@ -102,6 +103,20 @@ if(AMDIS_NEED_UMFPACK)
endif()
endif(AMDIS_NEED_UMFPACK)
if(AMDIS_NEED_PNG)
set(AMDIS_PNG_PATH @PNG_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_PNG_PATH})
find_library(PNG_LIB png
HINTS ENV LIBRARY_PATH
DOC "The PNG library")
if(PNG_LIB)
list(APPEND AMDIS_LIBRARIES ${PNG_LIB})
else()
message(FATAL_ERROR "Could not find the PNG library")
endif()
endif(AMDIS_NEED_PNG)
if(AMDIS_NEED_BDDCML)
set(AMDIS_BDDCML_PATH @BDDCML_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_BDDCML_PATH})
...
...
AMDiS/CMakeLists.txt
View file @
83ed9754
...
...
@@ -36,6 +36,7 @@ SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition
option
(
USE_PETSC_DEV false
)
option
(
ENABLE_ZOLTAN false
)
option
(
ENABLE_UMFPACK
"Use of UMFPACK solver"
false
)
option
(
ENABLE_PNG
"use png reader/writer"
false
)
option
(
ENABLE_BDDCML
"Use of BDDCML library"
false
)
if
(
ENABLE_INTEL
)
...
...
@@ -157,6 +158,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${
SOURCE_DIR
}
/io/MacroInfo.cc
${
SOURCE_DIR
}
/io/MacroReader.cc
${
SOURCE_DIR
}
/io/MacroWriter.cc
${
SOURCE_DIR
}
/io/PngReader.cc
${
SOURCE_DIR
}
/io/PngWriter.cc
${
SOURCE_DIR
}
/io/PovrayWriter.cc
${
SOURCE_DIR
}
/io/ValueReader.cc
...
...
@@ -277,12 +279,26 @@ if(ENABLE_UMFPACK)
include_directories
(
${
UMFPACK_PATH
}
${
UFCONFIG_PATH
}
${
AMD_PATH
}
)
list
(
APPEND COMPILEFLAGS
"-DHAVE_UMFPACK=1"
"-DMTL_HAS_UMFPACK"
)
else
()
message
(
FATAL_ERROR
"Could not find the UMFPACK header
s
."
)
message
(
FATAL_ERROR
"Could not find the UMFPACK header
umfpack.h
."
)
endif
()
SET
(
RPM_DEPEND_STR
"blas"
)
endif
(
ENABLE_UMFPACK
)
if
(
ENABLE_PNG
)
find_file
(
PNG_H png.h
HINTS ENV CPATH /usr/include
DOC
"headerfile png.h for PNG-READER"
)
if
(
PNG_H
)
get_filename_component
(
PNG_PATH
${
PNG_H
}
PATH
)
include_directories
(
${
PNG_PATH
}
)
list
(
APPEND COMPILEFLAGS
"-DHAVE_PNG=1"
)
else
()
message
(
FATAL_ERROR
"Could not find the PNG header png.h."
)
endif
()
endif
(
ENABLE_PNG
)
if
(
ENABLE_BDDCML
)
SET
(
BDDCML_LINK_LIST
""
CACHE STRING
"Further libraries to be linked with BDDCML"
)
...
...
AMDiS/src/io/PngReader.cc
View file @
83ed9754
...
...
@@ -9,6 +9,8 @@
//
// See also license.opensource.txt in the distribution.
#if defined HAVE_PNG
#include "PngReader.h"
#include "png.h"
...
...
@@ -64,7 +66,6 @@ namespace AMDiS {
cout
<<
"Bytes per pixel: "
<<
bytesPerPixel
<<
endl
;
double
value
=
0
;
const
DOFAdmin
*
admin
=
vec
->
getFeSpace
()
->
getAdmin
();
const
BasisFunction
*
basFcts
=
vec
->
getFeSpace
()
->
getBasisFcts
();
int
numBasFcts
=
basFcts
->
getNumber
();
...
...
@@ -111,3 +112,5 @@ namespace AMDiS {
};
};
#endif
AMDiS/src/io/PngReader.h
View file @
83ed9754
...
...
@@ -23,6 +23,8 @@
#ifndef AMDIS_PNGREADER_H
#define AMDIS_PNGREADER_H
#if defined HAVE_PNG
#include "AMDiS.h"
namespace
AMDiS
{
...
...
@@ -67,3 +69,5 @@ namespace AMDiS {
}
#endif
#endif
AMDiS/src/io/PngWriter.cc
View file @
83ed9754
...
...
@@ -10,7 +10,7 @@
// See also license.opensource.txt in the distribution.
#ifdef HAVE_PNG
#if
def
ined
HAVE_PNG
#include <float.h>
#include <png.h>
...
...
@@ -31,8 +31,8 @@ namespace AMDiS {
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
dataCollector
->
getMesh
(),
-
1
,
Mesh
::
CALL_LEAF_EL
|
Mesh
::
FILL_COORDS
);
double
pointdist
=
min
(
absteukl
(
elInfo
->
getCoord
(
0
),
elInfo
->
getCoord
(
1
)),
min
(
absteukl
(
elInfo
->
getCoord
(
1
),
elInfo
->
getCoord
(
2
)),
double
pointdist
=
std
::
min
(
absteukl
(
elInfo
->
getCoord
(
0
),
elInfo
->
getCoord
(
1
)),
std
::
min
(
absteukl
(
elInfo
->
getCoord
(
1
),
elInfo
->
getCoord
(
2
)),
absteukl
(
elInfo
->
getCoord
(
2
),
elInfo
->
getCoord
(
0
))));
while
(
elInfo
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
...
...
AMDiS/src/io/PngWriter.h
View file @
83ed9754
...
...
@@ -23,7 +23,7 @@
#ifndef AMDIS_PNGWRITER_H
#define AMDIS_PNGWRITER_H
#ifdef HAVE_PNG
#if
def
ined
HAVE_PNG
#include "BasisFunction.h"
#include "DataCollector.h"
...
...
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