Commit 012721c6 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

new project

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1246
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 97c9767b
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.5 2002-03-01 18:15:31 forbrig Exp $
# $Id: Makefile,v 1.6 2002-12-30 13:03:40 forbrig Exp $
#
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
#
......@@ -11,6 +11,7 @@
#
# REVISIONS and CHANGES
# 01/03/2002 V1.0 Thomas Forbriger
# 30/12/2002 V1.1 added C++ directory
#
# ============================================================================
#
......@@ -43,7 +44,7 @@ clean:
edit: flist
vim flist
flist: *.f */*.f *.inc */*.inc Makefile */Makefile
flist: *.f */*.f *.inc */*.inc Makefile */Makefile */*.h */*.cc
echo $^ | tr ' ' '\n' | sort > $@
make.incdep: *.f
......@@ -85,5 +86,11 @@ wgremlin: gremlin.o gremlin_help.o
gredim: gredim.o
gcc -o gredim gredim.o $(GFLAG) $(F2CLIB)
#----------------------------------------------------------------------
# C++ interface
# -------------
libgremlin1xx.a:
cd cxx; $(MAKE) $@
# ----- END OF Makefile -----
This is a legacy version of the repository. It may be incomplete as well as
inconsistent. See README.history for details. For the old stock of the
repository copyright and licence conditions apply as specified for versions
commited after 2015-03-01. Use recent versions as a base for new development.
The legacy version is only stored to keep a record of history.
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.1 2002-12-30 13:03:40 forbrig Exp $
#
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
#
# C++ interface to gremlin1
#
# ============================================================================
#
#
# A note on header files:
# We extensively comment class declarations within the header files. The
# reduce compilation time when using the library code, comments will be
# stripped from the header files that are exportet. These stripped versions
# are placed in the source code path with name *.h.strip and will be linked to
# INCINSTALLPATH with name *.h.
#
# Although comment stripping could be done by perl with an elaborate regular
# expression, we prefer the remcmmnt command by Jari Laaksonen. You can find
# the code at
# http://www.eti.pg.gda.pl/KATEDRY/kecs/lab-cpp/snippets/
# If it is not available to you, you should set REMCMMNT=cat (see below)
#
# REVISIONS and CHANGES
# 30/12/2002 V1.0 Thomas Forbriger
#
# ============================================================================
#
# environment variables
# ---------------------
#
# You will like to set the following environment variables:
#
# LOCINCLUDEDIR Defines the path where header files will be copied for
# usage in your own projects. You will pass this path to
# the precompiler with the -I option.
# LOCLIBDIR Defines the path where the binary library will be
# placed.
# WWWBASEDIR Defines the path to your personal homepage. That's the
# place where doxygen output will be written too (see
# below).
#
# You will find the installed library header files in $(LOCINCLUDEDIR)/aff
all: install-include libgremlin1xx.a doxydoc
# files
# -----
# all header files used within this project
HEADERS=$(shell find . -name \*.h)
# all source code to be compiled to object files and to be included
# in the binary version of the library
# (see below for the configuration of a preinstantiated version of template
# code)
SRC=polymodel.cc
# test programs are placed in a subdirectory
TESTS=$(wildcard tests/*.cc)
# whereever we find a README, we will use it
README=$(shell find . -name README)
# place where we will copy header files
INCINSTALLPATH=$(LOCINCLUDEDIR)/gremlin1
# place where we will copy the binary library
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off (these are linked to your include
# directory)
STRIPHEADER=$(addsuffix .strip,$(notdir $(HEADERS)))
# name of installed (exported) header files (these are the names in your
# include directory)
INSTHEADER=$(addprefix $(INCINSTALLPATH)/,$(filter-out ./tests/%,$(HEADERS)))
# if defined, empty lines are kept in comment-stripped headers
# to synchronize line numbers (necessary during library debugging)
EMPTYPRINT=1
#EMPTYPRINT=0
# define this to be cat in case you do not have remcmmnt available
REMCMMNT=remcmmnt
#REMCMMNT=cat
# compiler and preprocessor flags
FLAGS=
CXXFLAGS=-Wall -pedantic $(FLAGS) -O3
CXXFLAGS=-Wall $(FLAGS) -O3
LDFLAGS=-L$(LOCLIBDIR)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)
# the following definition is needed to make the dependency command pass
# binarray.cc
TMPPARDEF=-D BIN_TYPE -D BIN_N -D BIN_REPR -D BIN_SUBS
# targets
# -------
# files which are to be edited
flist: Makefile doxyfull.cfg $(README) $(HEADERS) $(SRC)
echo $^ | tr ' ' '\n' | sort >> $@
# Offers you a list of files to edit (ask Thomas for appropriate vim
# configuration).
.PHONY: edit
edit: flist; vim $<
# Target clean removes everything except the source code, headers and
# documentation. (See also doxyclean)
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.o | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.h.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o install-include libgremlin1xx.a *.xxx junk*
cd tests; $(MAKE) clean
#======================================================================
# library part
# ============
#
# create the binary library
# -------------------------
LIBOBS=$(ALLOBS) $(patsubst %.cc,%.o,$(SRC))
LIBOBS=$(patsubst %.cc,%.o,$(SRC))
libgremlin1xx.a: install-include $(LIBOBS)
ar rcv $@ $(LIBOBS)
ranlib $@
cp -vpf $@ $(LIBINSTALLPATH)
#======================================================================
# dependencies
# ------------
#
# The compiler is used to create dependency files, which are included below.
%.d: %.cc
$(SHELL) -ec '$(CXX) -M $(CPPFLAGS) $(TMPPARDEF) $< \
| sed '\''s,\($(notdir $*)\)\.o[ :]*,$(dir $@)\1.o $@ : ,g'\'' \
> $@; \
[ -s $@ ] || rm -f $@'
-include $(patsubst %.cc,%.d,$(SRC))
#======================================================================
# header files
# ------------
#
# Since we extensively document the class structures within the header files,
# these should be stripped for the production version (otherwise the compiler
# has to scan all comments on each compile). Stripping is done by the rule
# below and is controlled by the variables REMCMMNT and EMPTYPRINT (see
# above).
# comment stripping
# -----------------
# awk rule assumes that the first non-comment line starts with '#'
# and that the first (copyright) comment end with pattern "^ */"
%.h.strip: %.h
awk 'BEGIN {hot=1;} /^ \*\// { if (hot) { hot=2; print; next;} }\
/^#/ { hot=0; } \
{ if (hot==2) { print ""; } else if (hot) { print; } }' $< > $@
$(REMCMMNT) $< | awk 'BEGIN {hot=0;} \
/^ *$$/ { if ((hot) && ($(EMPTYPRINT))) { print; } next; } \
/^#/ { hot=1; } { if (hot) print; }' >> $@
#----------------------------------------------------------------------
.PRECIOUS: %.h.strip
$(INCINSTALLPATH)/%.h: %.h.strip
mkdir -vp $(dir $@)
-rm -fv $@
ln -svf $$(pwd)/$< $@
# install header files
install-include: $(INSTHEADER)
echo $^ | tr ' ' '\n'
touch $@
#======================================================================
# documentation part
# ------------------
#
# targets commonly used:
# ----------------------
#
# make doxyclean removes all documentation
# make doxydoc creates doxygen documentation in the DOXYWWWPATH
# make doxyview creates doxygen documentation and launches netscape to
# browse in the documentation
# make doxyfullconf edit the doxygen configuration file
#
# The targets are prepared for two documentation configurations. There is a
# "full" configuration defined in doxyfull.cfg and a "brief" configuration in
# doxybrief.cfg. However doxygen itself does not really support to distinguish
# between brief and full just due to the config-file. So just use the doxyfull
# target.
#
# If you launch "make doxyfull" the documentation will be written to
# DOXYWWWPATH (see below). This is meant to export the documentation through
# your homepage. The doxyfull directory is just a symbolic link to this
# directory.
#
DOXYWWWPATH=$(WWWBASEDIR)/libgremlin1xx
.PHONY: doxyclean doxyview doxybriefview doxyfullconf doxybriefconf
doxyclean: ;/bin/rm -rfv docfull/* docbrief docfull
DOXYSRC=$(README) $(HEADERS) $(SRC) \
tests/f77procs.P tests/f77procs.f \
tests/f77common.inc tests/f77common_com.P
doc%/html/index.html: doxy%.cfg $(DOXYSRC)
mkdir -vp $(DOXYWWWPATH)
ln -sfv $(DOXYWWWPATH) $(patsubst doxy%.cfg,doc%,$<)
doxygen $<
doxybriefconf doxyfullconf: doxy%conf:
doxywizard $(patsubst doxy%conf,doxy%.cfg,$@)
doxyfull doxybrief: doxy%: doxyclean doc%/html/index.html
doxydoc: doxyfull
doxyfullview doxybriefview: doxy%view: doxy%
netscape doc$(patsubst doxy%view,%,$@)/html/index.html &
doxyview: doxydoc doxyfullview
#======================================================================
# delegate test targets
# ---------------------
tests/%.P:
cd tests; echo "#############################"; $(MAKE) $(notdir $@)
tests/%: tests/%.cc install-include libaff.a
cd tests; echo "#############################"; $(MAKE) $(notdir $@)
tests/bin%: tests/bin%.cc install-include libaff.a
cd tests; echo "#############################"; $(MAKE) $(notdir $@)
tests/%.run: tests/%
echo "#############################"
$< $(ARG)
/bin/rm -fv $< $<.o
# ----- END OF Makefile -----
# Doxygen configuration generated by Doxywizard version 0.1
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "GREMLIN1 C++ interface"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = docfull
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = YES
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = /home/theo1/forbrig/work/ \
/home/thof/work/
INTERNAL_DOCS = YES
CLASS_DIAGRAMS = YES
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = YES
TAB_SIZE = 8
ENABLED_SECTIONS = internal
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./
FILE_PATTERNS = README \
README.changelog \
*.h \
*.cc
RECURSIVE = YES
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH = tests
EXAMPLE_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
COMPACT_LATEX = YES
PAPER_TYPE = a4wide
EXTRA_PACKAGES = pslatex
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = YES
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_MUST_SKIP_THIS
EXPAND_AS_DEFINED =
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_PATH =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =
/*! \file polymodel.cc
* \brief polynomial subsurface model (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id: polymodel.cc,v 1.1 2002-12-30 13:03:41 forbrig Exp $
* \author Thomas Forbriger
* \date 30/12/2002
*
* polynomial subsurface model (implementation)
*
* Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
*
* REVISIONS and CHANGES
* - 30/12/2002 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TF_POLYMODEL_CC_VERSION \
"TF_POLYMODEL_CC V1.0 "
#define TF_POLYMODEL_CC_CVSID \
"$Id: polymodel.cc,v 1.1 2002-12-30 13:03:41 forbrig Exp $"
#include <gremlin1/polymodel.h>
#include <tfxx/error.h>
namespace gremlin1 {
//! default constructor
PolynomialModelFile::PolynomialModelFile():
Mpara(3,1,5), Mdepth(aff::Shaper(0,1)), Mfollow(1,5), Mnpol(1,5)
{
Mpara=0.;
Mdepth=0.;
Mfollow=false;
Mnpol=1;
check_consistency();
}
/*----------------------------------------------------------------------*/
//! check consistency
void PolynomialModelFile::check_consistency() const
{
const char[] message="PolynomialModelFile: illegal index range";
try {
// check Mpara
TFXX_assert(((Mpara.f(0)==1)&&(Mpara.l(0)==3)), message);
TFXX_assert(((Mpara.f(1)==0)&&(Mpara.l(1)>Mpara.f(1))), message);
TFXX_assert(((Mpara.f(2)==1)&&(Mpara.l(2)==5)), message);
// check Mdepth
TFXX_assert(((Mdepth.f(0)==0)&&(Mdepth.l(0)>Mdepth.f(0))), message);
// check Mfollow
TFXX_assert(((Mfollow.f(0)==0)&&(Mfollow.l(0)>Mfollow.f(0))), message);
TFXX_assert(((Mfollow.f(1)==1)&&(Mfollow.l(1)==5)), message);
// check Mnpol
TFXX_assert(((Mnpol.f(0)==0)&&(Mnpol.l(0)>Mnpol.f(0))), message);
TFXX_assert(((Mnpol.f(1)==1)&&(Mnpol.l(1)==5)), message);
// check for consistent number of sections
TFXX_assert(((Mpara.l(1)==Mdepth.l(0))&&(Mfollow.l(0)==Mdepth.l(0))&&
(Mnpol.l(0)==Mdepth.l(0))), message);
}
catch (tfxx::Exception)
{
TFXX_abort("PolynomialModelFile: internal error!");
}
}
/*----------------------------------------------------------------------*/
//! return bottom depth of section
Tvalue PolynomialModelFile::bottom(const int& i) const
{
TFXX_assert((!(ishalfspace())), "illegal section index!");
return(Mdepth(valid_section_index(i)));
}
/*----------------------------------------------------------------------*/
//! return checked section index
int PolynomialModelFile::valid_section_index(const int& i) const
{
TFXX_assert(((i>0)&&(i<=Mdepth.l(0))), "illegal section index!");
return(i);
}
/*----------------------------------------------------------------------*/
//! return checked parameter index
int PolynomialModelFile::valid_parameter_index(const int& i) const
{
TFXX_assert(((i>0)&&(i<6)), "illegal parameter index!");
return(i);
}
/*----------------------------------------------------------------------*/
//! return checked polynomial index
int PolynomialModelFile::valid_polynomial_index(const int& i) const
{
TFXX_assert(((i>0)&&(i<4)), "illegal polynomial index!");
return(i);
}
/*----------------------------------------------------------------------*/
//! find section index
int PolynomialModelFile::secindex(const Tvalue& depth) const
{
static int retval=1;
if (!((Mdepth(retval-1)<=depth)&&(depth<Mdepth(retval))))
{
if (depth>Mdepth(retval))
{
while ((depth>Mdepth(retval))&&(retval<Mdepth.l(0))) { retval++; }
} else {
while ((depth<Mdepth(retval-1))&&(retval>1)) { retval--; }
}
}
return(retval);
}
/*----------------------------------------------------------------------*/
//! calculate parameter value at given depth
Tvalue PolynomialModelFile::polyarg(const Tvalue& depth,
const int& isec) const
{
int i=valid_section_index(isec);
TFXX_assert((!(ishalfspace(isec))), "isec is in halfpsace");
return(depth-0.5(Mdepth(isec)-Msec(isec-1)));
}
/*----------------------------------------------------------------------*/
//! calculate parameter value at given depth
Tvalue PolynomialModelFile::value(const Epara& ipar,
const Tvalue& depth) const
{
int isec=secindex(depth);
int ip=valid_parameter_index(ipar);
Tvalue retval=Mpara(1,isec,ip);
if (!ishalfspace(isec))
{
Tvalue x=polyarg(depth,isec);
retval=Mpara(1,isec,ip)+x*(Mpara(2,isec,ip)+x*Mpara(3,isec,ip));
}
return(retval);
}
/*----------------------------------------------------------------------*/
//! concatenate follow-sections
void PolynomialModelFile::make_follow()
{
}
}
/* ----- END OF polymodel.cc ----- */
/*! \file polymodel.h
* \brief polynomial subsurface model (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: polymodel.h,v 1.1 2002-12-30 13:03:41 forbrig Exp $
* \author Thomas Forbriger
* \date 30/12/2002
*
* polynomial subsurface model (prototypes)
*
* Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
*
* REVISIONS and CHANGES
* - 30/12/2002 V1.0 Thomas Forbriger
*
* ============================================================================