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

Png Reader/Writer included

parent 26f42781
......@@ -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})
......
......@@ -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 headers.")
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")
......
......@@ -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
......@@ -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
......@@ -10,7 +10,7 @@
// See also license.opensource.txt in the distribution.
#ifdef HAVE_PNG
#if defined 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++) {
......
......@@ -23,7 +23,7 @@
#ifndef AMDIS_PNGWRITER_H
#define AMDIS_PNGWRITER_H
#ifdef HAVE_PNG
#if defined HAVE_PNG
#include "BasisFunction.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