Commit 83ed9754 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Png Reader/Writer included

parent 26f42781
...@@ -61,6 +61,7 @@ endif(Boost_FOUND) ...@@ -61,6 +61,7 @@ endif(Boost_FOUND)
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@) set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@) set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@) set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_NEED_PNG @ENABLE_PNG@)
set(AMDIS_NEED_BDDCML @ENABLE_BDDCML@) set(AMDIS_NEED_BDDCML @ENABLE_BDDCML@)
set(AMDIS_NEED_MKL @ENABLE_MKL@) set(AMDIS_NEED_MKL @ENABLE_MKL@)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake) set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
...@@ -102,6 +103,20 @@ if(AMDIS_NEED_UMFPACK) ...@@ -102,6 +103,20 @@ if(AMDIS_NEED_UMFPACK)
endif() endif()
endif(AMDIS_NEED_UMFPACK) 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) if(AMDIS_NEED_BDDCML)
set(AMDIS_BDDCML_PATH @BDDCML_PATH@) set(AMDIS_BDDCML_PATH @BDDCML_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_BDDCML_PATH}) list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_BDDCML_PATH})
......
...@@ -36,6 +36,7 @@ SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition ...@@ -36,6 +36,7 @@ SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition
option(USE_PETSC_DEV false) option(USE_PETSC_DEV false)
option(ENABLE_ZOLTAN false) option(ENABLE_ZOLTAN false)
option(ENABLE_UMFPACK "Use of UMFPACK solver" 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) option(ENABLE_BDDCML "Use of BDDCML library" false)
if(ENABLE_INTEL) if(ENABLE_INTEL)
...@@ -157,6 +158,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc ...@@ -157,6 +158,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/io/MacroInfo.cc ${SOURCE_DIR}/io/MacroInfo.cc
${SOURCE_DIR}/io/MacroReader.cc ${SOURCE_DIR}/io/MacroReader.cc
${SOURCE_DIR}/io/MacroWriter.cc ${SOURCE_DIR}/io/MacroWriter.cc
${SOURCE_DIR}/io/PngReader.cc
${SOURCE_DIR}/io/PngWriter.cc ${SOURCE_DIR}/io/PngWriter.cc
${SOURCE_DIR}/io/PovrayWriter.cc ${SOURCE_DIR}/io/PovrayWriter.cc
${SOURCE_DIR}/io/ValueReader.cc ${SOURCE_DIR}/io/ValueReader.cc
...@@ -277,12 +279,26 @@ if(ENABLE_UMFPACK) ...@@ -277,12 +279,26 @@ if(ENABLE_UMFPACK)
include_directories(${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH}) include_directories(${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH})
list(APPEND COMPILEFLAGS "-DHAVE_UMFPACK=1" "-DMTL_HAS_UMFPACK") list(APPEND COMPILEFLAGS "-DHAVE_UMFPACK=1" "-DMTL_HAS_UMFPACK")
else() else()
message(FATAL_ERROR "Could not find the UMFPACK headers.") message(FATAL_ERROR "Could not find the UMFPACK header umfpack.h.")
endif() endif()
SET(RPM_DEPEND_STR "blas") SET(RPM_DEPEND_STR "blas")
endif(ENABLE_UMFPACK) 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) if(ENABLE_BDDCML)
SET(BDDCML_LINK_LIST "" CACHE STRING "Further libraries to be linked with BDDCML") SET(BDDCML_LINK_LIST "" CACHE STRING "Further libraries to be linked with BDDCML")
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
// //
// See also license.opensource.txt in the distribution. // See also license.opensource.txt in the distribution.
#if defined HAVE_PNG
#include "PngReader.h" #include "PngReader.h"
#include "png.h" #include "png.h"
...@@ -64,7 +66,6 @@ namespace AMDiS { ...@@ -64,7 +66,6 @@ namespace AMDiS {
cout << "Bytes per pixel: " << bytesPerPixel << endl; cout << "Bytes per pixel: " << bytesPerPixel << endl;
double value = 0; double value = 0;
const DOFAdmin* admin = vec->getFeSpace()->getAdmin();
const BasisFunction *basFcts = vec->getFeSpace()->getBasisFcts(); const BasisFunction *basFcts = vec->getFeSpace()->getBasisFcts();
int numBasFcts = basFcts->getNumber(); int numBasFcts = basFcts->getNumber();
...@@ -111,3 +112,5 @@ namespace AMDiS { ...@@ -111,3 +112,5 @@ namespace AMDiS {
}; };
}; };
#endif
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#ifndef AMDIS_PNGREADER_H #ifndef AMDIS_PNGREADER_H
#define AMDIS_PNGREADER_H #define AMDIS_PNGREADER_H
#if defined HAVE_PNG
#include "AMDiS.h" #include "AMDiS.h"
namespace AMDiS { namespace AMDiS {
...@@ -67,3 +69,5 @@ namespace AMDiS { ...@@ -67,3 +69,5 @@ namespace AMDiS {
} }
#endif #endif
#endif
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
// See also license.opensource.txt in the distribution. // See also license.opensource.txt in the distribution.
#ifdef HAVE_PNG #if defined HAVE_PNG
#include <float.h> #include <float.h>
#include <png.h> #include <png.h>
...@@ -31,8 +31,8 @@ namespace AMDiS { ...@@ -31,8 +31,8 @@ namespace AMDiS {
TraverseStack stack; TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(dataCollector->getMesh(), -1, ElInfo *elInfo = stack.traverseFirst(dataCollector->getMesh(), -1,
Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS); Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS);
double pointdist = min(absteukl(elInfo->getCoord(0), elInfo->getCoord(1)), double pointdist = std::min(absteukl(elInfo->getCoord(0), elInfo->getCoord(1)),
min(absteukl(elInfo->getCoord(1), elInfo->getCoord(2)), std::min(absteukl(elInfo->getCoord(1), elInfo->getCoord(2)),
absteukl(elInfo->getCoord(2), elInfo->getCoord(0)))); absteukl(elInfo->getCoord(2), elInfo->getCoord(0))));
while (elInfo) { while (elInfo) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#ifndef AMDIS_PNGWRITER_H #ifndef AMDIS_PNGWRITER_H
#define AMDIS_PNGWRITER_H #define AMDIS_PNGWRITER_H
#ifdef HAVE_PNG #if defined HAVE_PNG
#include "BasisFunction.h" #include "BasisFunction.h"
#include "DataCollector.h" #include "DataCollector.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment