From ac71f1092f39416a6e01bd5a9aee4ff1ea69751e Mon Sep 17 00:00:00 2001 From: "Jostein R. Natvig" Date: Wed, 10 Nov 2010 10:29:41 +0100 Subject: [PATCH] * Move source code to src directory. * Add autotools build system for opmtransport library. --- Makefile.am | 3 ++ configure.ac | 36 +++++++++++++++ src/Makefile.am | 10 ++++ src/grid.h | 69 ++++++++++++++++++++++++++++ spu_explicit.c => src/spu_explicit.c | 0 spu_explicit.h => src/spu_explicit.h | 0 6 files changed, 118 insertions(+) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 src/Makefile.am create mode 100644 src/grid.h rename spu_explicit.c => src/spu_explicit.c (100%) rename spu_explicit.h => src/spu_explicit.h (100%) diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..26226b0a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = src + +ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..f5fe2a62 --- /dev/null +++ b/configure.ac @@ -0,0 +1,36 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +AC_PREREQ([2.50]) + +AC_INIT([opmtransport], [0.1], [Jostein.R.Natvig@sintef.no]) + +AM_INIT_AUTOMAKE([foreign -Wall]) + +LT_INIT + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([src/spu_explicit.h]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_LIBTOOL + +# Checks for libraries. + +# Checks for header files. +AC_CHECK_HEADERS([assert.h stdlib.h]) + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_CHECK_FUNCS([floor memmove memset]) + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) + +AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 00000000..203a815b --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,10 @@ +libopmtransportdir = $(includedir)/opm/transport + +lib_LTLIBRARIES = libopmtransport.la + +libopmtransport_HEADERS = \ +spu_explicit.h \ +grid.h + +libopmtransport_la_SOURCES = \ +spu_explicit.c diff --git a/src/grid.h b/src/grid.h new file mode 100644 index 00000000..4b575115 --- /dev/null +++ b/src/grid.h @@ -0,0 +1,69 @@ +/* + Copyright 2010 SINTEF ICT, Applied Mathematics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#ifndef OPM_GRID_HEADER_INCLUDED +#define OPM_GRID_HEADER_INCLUDED + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* GRID_TOPOLOGY and GRID_GEOMETRY must be at the beginning of every + * grid type. + * + * + */ +#define GRID_TOPOLOGY \ + int dimensions; \ + \ + int number_of_cells; \ + int number_of_faces; \ + int number_of_nodes; \ + \ + int *face_nodes; \ + int *face_nodepos; \ + int *face_cells; \ + \ + int *cell_faces; \ + int *cell_facepos; \ + +#define GRID_GEOMETRY \ + double *node_coordinates; \ + \ + double *face_centroids; \ + double *face_areas; \ + double *face_normals; \ + \ + double *cell_centroids; \ + double *cell_volumes; \ + + +typedef struct { + GRID_TOPOLOGY + GRID_GEOMETRY +} grid_t; + + +#ifdef __cplusplus +} +#endif + +#endif /* OPM_GRID_HEADER_INCLUDED */ diff --git a/spu_explicit.c b/src/spu_explicit.c similarity index 100% rename from spu_explicit.c rename to src/spu_explicit.c diff --git a/spu_explicit.h b/src/spu_explicit.h similarity index 100% rename from spu_explicit.h rename to src/spu_explicit.h