Commit d7ad98f8 authored by Edward Vigmond's avatar Edward Vigmond
Browse files

HDF5 support now included. To compile in the support, use

make HDF5=1
parent 9658f63d
......@@ -8,7 +8,7 @@ decl {\#include "ch5/ch5.h"} {private local
decl {\#include "TBmeshWin.h"} {public local
}
decl {\#define CTR(A,B,C) (A-B)/2,C,(A-B)/2,"" } {local
decl {\#define CTR(A,B,C) (A-B)/2,C,(A-B)/2,""} {private local
}
class HDF5DataBrowser {open
......@@ -53,7 +53,8 @@ dynPtBrows->select(dynPtBrows->value(),0);}
xywh {155 510 125 30}
}
}
code {if( ch5_open( fn, &hdf_in ) ) {
code {\#ifdef USE_HDF5
if( ch5_open( fn, &hdf_in ) ) {
fl_alert( "Not a valid HDF5 file: %s", fn );
return;
}
......@@ -117,7 +118,9 @@ for( int i=0; i<ch5s_nodal_grid_count( hdf_in ); i++ ){
}
ch5s_nodal_free_grid_info( &info );
}
hdf5dataWin->show();} {}
hdf5dataWin->show();
\#endif} {selected
}
}
Function {process_selections()} {open
} {
......@@ -149,8 +152,7 @@ if( ln ) {
stringstream grid;
grid << file << ":nodal/" << ((long)(dynPtBrows->data(ln)));
tbmw->read_dynamic_pts( grid.str().c_str(), tbmw->contwin->tmslider );
}} {selected
}
}} {}
}
decl {TBmeshWin *tbmw;} {private local
}
......
HOSTMACHINE := $(shell uname)
HDF5API_ROOT := ./hdf5api
COMMON_INC := -I. -O0 -g -DOBJ_CLASS -D_REENTRANT -MMD -DNOMINMAX
ifdef HDF5
LIB_CH5 := (HDF5_ROOT)/lib/libch5.a
LIB_HDF5 := -lch5 -lhdf5 -lhdf5_hl
COMMON_INC += -DUSE_HDF5
else
LIB_CH5 :=
LIB_HDF5 :=
endif
FLTK_INC := $(shell fltk-config --use-gl --cxxflags)
FLTK_LD_FLAGS := $(shell fltk-config --use-images --use-gl --ldflags)
COMMON_LIBS = -lpng -lpthread -lm -lz -lch5 -lhdf5 -lhdf5_hl
COMMON_INC = -I. -O0 -g -DOBJ_CLASS -D_REENTRANT -MMD -DNOMINMAX -DUSE_HDF5
COMMON_LIBS = -lpng -lpthread -lm -lz $(LIB_HDF5)
LIBS = -L$(HDF5API_ROOT)/lib $(FLTK_LD_FLAGS) $(COMMON_LIBS)
LDFLAGS = -L$(HDF5API_ROOT)/lib
......@@ -34,8 +43,10 @@ meshalyzer: $(LIB_CH5) $(FLTK_SOURCES:.fl=.cc) $(OBJS) $(LIB_CH5)
$(CXX) $(CFLAGS) -o meshalyzer $(sort $(OBJS)) $(LIBS)
fltk-config --post meshalyzer
ifdef HDF5
$(LIB_CH5):
cd hdf5api && make all
endif
clean:
rm -rf $(FLTK_SOURCES:.fl=.h) $(FLTK_SOURCES:.fl=.cc) *.o *.d meshalyzer meshalyzer.app
......@@ -45,7 +56,9 @@ utils:
docs:
doxygen Doxyfile
ifdef HDF5
cd hdf5api && doxygen Doxyfile
endif
%.h %.cc: %.fl
fluid -c $<
......
......@@ -180,7 +180,9 @@ static struct option longopts[] = {
main( int argc, char *argv[] )
{
Fl::gl_visual(FL_RGB|FL_DOUBLE|FL_DEPTH|FL_ALPHA);
#ifdef USE_HDF5
H5Eset_auto1(NULL, NULL);// silence HDF errors
#endif
bool iconcontrols = false;
bool no_elems = false;
......
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