Added ERT as source code based on https://github.com/Ensembles/ert/ and commit 7b53b5f61f5b47e8169b72098b562071df394bc3

This is SVN commit 4117
Updated ResInsight cmakelists to build ERT and link directly
Removed precompiled ERT binaries
p4#: 20183
This commit is contained in:
Magne Sjaastad 2013-01-17 13:33:59 +01:00
parent 8a5ac934c8
commit 04006370ac
1266 changed files with 244003 additions and 13400 deletions

View File

@ -23,85 +23,6 @@ include_directories(
)
#-----------------------------------------------------------------
# Configuration of ERT depdendence
#-----------------------------------------------------------------
# By default the ERT_ROOT_PATH variable will point to the ERT distribution which
# is embedded in the ThirdParty/ directory, but by using the ERT_ROOT_PATH
# variable you can point to a different ERT distribution.
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(ERT_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Ert")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (CMAKE_CL_64)
set(ERT_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Ert-windows-x64")
else()
set(ERT_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Ert-windows")
endif()
endif()
# The ERT binary distribution consists of four libraries, libwell, libecl,
# libutil and libgeometry and their accompanying header files. There has been a
# bit of mess of how this has been organized; either it has been on per
# directory basis as:
#
# ${ERT_ROOT_PATH}/ecl/lib/libecl.so
# ${ERT_ROOT_PATH}/ecl/include/ecl_xxx.h
#
# ${ERT_ROOT_PATH}/well/lib/libwell.so
# ${ERT_ROOT_PATH}/well/include/well_xxx.h
# ....
#
# Or alternatively everything has been in common include/ and lib/ directories.
#
# ${ERT_ROOT_PATH}/lib
# ${ERT_ROOT_PATH}/include
#
# This is indirectly goverened by the ERT_XXX_PREFIX variables. If these are
# set to blank if everything will be collected from common include/ and lib/
# dierectories.
set( ERT_ECL_PREFIX "ecl" CACHE STRING "Prefix path to use for ecl code in ert")
set( ERT_UTIL_PREFIX "util" CACHE STRING "Prefix path to use for util code in ert")
set( ERT_WELL_PREFIX "well" CACHE STRING "Prefix path to use for well code in ert")
set( ERT_GEO_PREFIX "geometry" CACHE STRING "Prefix path to use for geometry code in ert")
mark_as_advanced( ERT_UTIL_PREFIX ERT_ECL_PREFIX ERT_WELL_PREFIX ERT_GEO_PREFIX)
# Setting up include directories for ERT
set( ERT_INCLUDE_LIST
${ERT_ROOT_PATH}/include
${ERT_ROOT_PATH}/${ERT_ECL_PREFIX}/include
${ERT_ROOT_PATH}/${ERT_UTIL_PREFIX}/include
${ERT_ROOT_PATH}/${ERT_WELL_PREFIX}/include
${ERT_ROOT_PATH}/${ERT_GEO_PREFIX}/include )
# Link to these ERT libraries
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( ERT_LIBRARY_LIST
${ERT_ROOT_PATH}/lib/libecl.a
${ERT_ROOT_PATH}/lib/libert_util.a
${ERT_ROOT_PATH}/lib/libgeometry.a
${ERT_ROOT_PATH}/lib/libwell.a )
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set( ERT_LIBRARY_LIST
${ERT_ROOT_PATH}/lib/ecl.lib
${ERT_ROOT_PATH}/lib/ert_util.lib
${ERT_ROOT_PATH}/lib/geometry.lib
${ERT_ROOT_PATH}/lib/well.lib )
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
list(APPEND ERT_LIBRARY_LIST lapack z)
endif()
include_directories( ${ERT_INCLUDE_LIST} )
# Ert configuration complete
#-----------------------------------------------------------------
# Use all cpp and h files in the subdirectories
file( GLOB_RECURSE HEADER_FILES *.h )
@ -295,6 +216,12 @@ set( LINK_LIBRARIES
LibRender
LibGeometry
LibCore
ecl
util
geometry
well
${OPENGL_LIBRARIES}
${QT_LIBRARIES}
)

View File

@ -24,50 +24,6 @@ include_directories(
${ResInsight_SOURCE_DIR}/CommonCode
)
#-----------------------------------------------------------------
# Ert configuration
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(ERT_ROOT_PATH "${ResInsight_SOURCE_DIR}/ThirdParty/Ert")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (CMAKE_CL_64)
set(ERT_ROOT_PATH "${ResInsight_SOURCE_DIR}/ThirdParty/Ert-windows-x64")
else()
set(ERT_ROOT_PATH "${ResInsight_SOURCE_DIR}/ThirdParty/Ert-windows")
endif()
endif()
set( ERT_ECL_PREFIX "ecl" CACHE STRING "Prefix path to use for ecl code in ert")
set( ERT_UTIL_PREFIX "util" CACHE STRING "Prefix path to use for util code in ert")
set( ERT_WELL_PREFIX "well" CACHE STRING "Prefix path to use for well code in ert")
set( ERT_INCLUDE_LIST
${ERT_ROOT_PATH}/include
${ERT_ROOT_PATH}/${ERT_ECL_PREFIX}/include
${ERT_ROOT_PATH}/${ERT_UTIL_PREFIX}/include
${ERT_ROOT_PATH}/${ERT_WELL_PREFIX}/include )
# Link to these ERT libraries
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( ERT_LIBRARY_LIST
${ERT_ROOT_PATH}/lib/libecl.a
${ERT_ROOT_PATH}/lib/libert_util.a
${ERT_ROOT_PATH}/lib/libgeometry.a
${ERT_ROOT_PATH}/lib/libwell.a )
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set( ERT_LIBRARY_LIST
${ERT_ROOT_PATH}/lib/ecl.lib
${ERT_ROOT_PATH}/lib/ert_util.lib
${ERT_ROOT_PATH}/lib/geometry.lib
${ERT_ROOT_PATH}/lib/well.lib )
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
list(APPEND ERT_LIBRARY_LIST lapack z)
endif()
#-----------------------------------------------------------------
include_directories( ${ERT_INCLUDE_LIST} )
set( FILEINTERFACE_CPP_SOURCES
../RifEclipseInputFileTools.cpp
../RifEclipseOutputFileTools.cpp
@ -114,6 +70,11 @@ set( LINK_LIBRARIES
LibGeometry
LibCore
ecl
util
geometry
well
${QT_LIBRARIES}
)

View File

@ -42,6 +42,11 @@ set(STRPRODUCTVER ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VE
################################################################################
# ERT
################################################################################
add_subdirectory(ThirdParty/Ert/devel)
################################################################################
# Qt
################################################################################

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __bool_VECTOR_H__
#define __bool_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct bool_vector_struct bool_vector_type;
typedef bool (bool_ftype) (bool);
int bool_vector_lookup_bin( const bool_vector_type * limits , bool value , int guess);
int bool_vector_lookup_bin__( const bool_vector_type * limits , bool value , int guess);
void bool_vector_inplace_div( bool_vector_type * vector , const bool_vector_type * inv_factor);
void bool_vector_inplace_mul( bool_vector_type * vector , const bool_vector_type * factor);
void bool_vector_inplace_add( bool_vector_type * vector , const bool_vector_type * delta);
void bool_vector_set_read_only( bool_vector_type * vector , bool read_only);
bool bool_vector_get_read_only( const bool_vector_type * vector );
void bool_vector_resize( bool_vector_type * vector , int new_alloc_size );
void bool_vector_memcpy_data( bool * target, const bool_vector_type * src );
void bool_vector_memcpy( bool_vector_type * target , const bool_vector_type * src);
void bool_vector_memcpy_data_block( bool_vector_type * target , const bool_vector_type * src , int target_offset , int src_offset , int len);
bool bool_vector_growable( const bool_vector_type * vector);
void bool_vector_select_unique(bool_vector_type * vector);
bool_vector_type * bool_vector_alloc( int init_size , bool );
bool_vector_type * bool_vector_alloc_private_wrapper(int init_size, bool default_value , bool * data , int alloc_size);
bool_vector_type * bool_vector_alloc_shared_wrapper(int init_size, bool default_value , bool * data , int alloc_size);
bool_vector_type * bool_vector_alloc_strided_copy( const bool_vector_type * src , int start , int stop , int stride );
bool_vector_type * bool_vector_alloc_copy( const bool_vector_type * src);
void bool_vector_imul(bool_vector_type * vector, int index, bool factor);
void bool_vector_scale(bool_vector_type * vector, bool factor);
bool bool_vector_iget(const bool_vector_type * , int);
bool bool_vector_safe_iget(const bool_vector_type * , int);
bool bool_vector_get_min(const bool_vector_type * vector);
bool bool_vector_get_max(const bool_vector_type * vector);
int bool_vector_get_min_index(const bool_vector_type * vector, bool reverse);
int bool_vector_get_max_index(const bool_vector_type * vector, bool reverse);
bool bool_vector_iadd( bool_vector_type * vector , int index , bool delta);
void bool_vector_iset(bool_vector_type * , int , bool);
void bool_vector_idel_block( bool_vector_type * vector , int index , int block_size);
bool bool_vector_idel( bool_vector_type * vector , int index);
void bool_vector_append(bool_vector_type * , bool);
void bool_vector_free(bool_vector_type *);
void bool_vector_free__(void *);
void bool_vector_free_data(bool_vector_type *);
void bool_vector_reset(bool_vector_type *);
void bool_vector_reset__(void * __vector);
int bool_vector_size(const bool_vector_type * );
bool bool_vector_pop(bool_vector_type * vector);
bool bool_vector_get_first(const bool_vector_type * vector);
bool bool_vector_get_last(const bool_vector_type * );
bool * bool_vector_get_ptr(const bool_vector_type * );
bool * bool_vector_alloc_data_copy( const bool_vector_type * vector );
const bool * bool_vector_get_const_ptr(const bool_vector_type * );
void bool_vector_set_many(bool_vector_type * , int , const bool * , int );
void bool_vector_set_all(bool_vector_type * vector , bool value);
void bool_vector_append_many(bool_vector_type * vector , const bool * data , int length);
void bool_vector_shrink(bool_vector_type * );
bool bool_vector_sum(const bool_vector_type * );
bool bool_vector_get_default(const bool_vector_type * );
void bool_vector_set_default(bool_vector_type * vector, bool default_value);
void bool_vector_append_default(bool_vector_type * vector , bool default_value);
void bool_vector_iset_default(bool_vector_type * vector , int index , bool default_value);
bool bool_vector_is_sorted( const bool_vector_type * vector , bool reverse);
int bool_vector_index(const bool_vector_type * vector , bool value);
int bool_vector_index_sorted(const bool_vector_type * vector , bool value);
void bool_vector_sort(bool_vector_type * vector);
void bool_vector_rsort(bool_vector_type * vector);
void bool_vector_permute(bool_vector_type * vector , const int * perm);
int * bool_vector_alloc_sort_perm(const bool_vector_type * vector);
int * bool_vector_alloc_rsort_perm(const bool_vector_type * vector);
void bool_vector_fprintf(const bool_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void bool_vector_fwrite(const bool_vector_type * vector , FILE * stream);
void bool_vector_buffer_fread(bool_vector_type * vector , buffer_type * buffer);
bool_vector_type * bool_vector_fread_alloc( FILE * stream );
bool_vector_type * bool_vector_buffer_fread_alloc( buffer_type * buffer );
void bool_vector_buffer_fwrite(const bool_vector_type * vector , buffer_type * buffer);
void bool_vector_fread( bool_vector_type * vector , FILE * stream );
void bool_vector_fwrite_data( const bool_vector_type * vector , FILE * stream );
void bool_vector_fread_data( bool_vector_type * vector , int size, FILE * stream);
bool bool_vector_equal(const bool_vector_type * vector1 , const bool_vector_type * vector2);
void bool_vector_apply(bool_vector_type * vector , bool_ftype *func);
int bool_vector_count_equal( const bool_vector_type * vector , bool cmp_value);
int bool_vector_element_size( const bool_vector_type * vector );
UTIL_SAFE_CAST_HEADER( bool_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __double_VECTOR_H__
#define __double_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct double_vector_struct double_vector_type;
typedef double (double_ftype) (double);
int double_vector_lookup_bin( const double_vector_type * limits , double value , int guess);
int double_vector_lookup_bin__( const double_vector_type * limits , double value , int guess);
void double_vector_inplace_div( double_vector_type * vector , const double_vector_type * inv_factor);
void double_vector_inplace_mul( double_vector_type * vector , const double_vector_type * factor);
void double_vector_inplace_add( double_vector_type * vector , const double_vector_type * delta);
void double_vector_set_read_only( double_vector_type * vector , bool read_only);
bool double_vector_get_read_only( const double_vector_type * vector );
void double_vector_resize( double_vector_type * vector , int new_alloc_size );
void double_vector_memcpy_data( double * target, const double_vector_type * src );
void double_vector_memcpy( double_vector_type * target , const double_vector_type * src);
void double_vector_memcpy_data_block( double_vector_type * target , const double_vector_type * src , int target_offset , int src_offset , int len);
bool double_vector_growable( const double_vector_type * vector);
void double_vector_select_unique(double_vector_type * vector);
double_vector_type * double_vector_alloc( int init_size , double );
double_vector_type * double_vector_alloc_private_wrapper(int init_size, double default_value , double * data , int alloc_size);
double_vector_type * double_vector_alloc_shared_wrapper(int init_size, double default_value , double * data , int alloc_size);
double_vector_type * double_vector_alloc_strided_copy( const double_vector_type * src , int start , int stop , int stride );
double_vector_type * double_vector_alloc_copy( const double_vector_type * src);
void double_vector_imul(double_vector_type * vector, int index, double factor);
void double_vector_scale(double_vector_type * vector, double factor);
double double_vector_iget(const double_vector_type * , int);
double double_vector_safe_iget(const double_vector_type * , int);
double double_vector_get_min(const double_vector_type * vector);
double double_vector_get_max(const double_vector_type * vector);
int double_vector_get_min_index(const double_vector_type * vector, bool reverse);
int double_vector_get_max_index(const double_vector_type * vector, bool reverse);
double double_vector_iadd( double_vector_type * vector , int index , double delta);
void double_vector_iset(double_vector_type * , int , double);
void double_vector_idel_block( double_vector_type * vector , int index , int block_size);
double double_vector_idel( double_vector_type * vector , int index);
void double_vector_append(double_vector_type * , double);
void double_vector_free(double_vector_type *);
void double_vector_free__(void *);
void double_vector_free_data(double_vector_type *);
void double_vector_reset(double_vector_type *);
void double_vector_reset__(void * __vector);
int double_vector_size(const double_vector_type * );
double double_vector_pop(double_vector_type * vector);
double double_vector_get_first(const double_vector_type * vector);
double double_vector_get_last(const double_vector_type * );
double * double_vector_get_ptr(const double_vector_type * );
double * double_vector_alloc_data_copy( const double_vector_type * vector );
const double * double_vector_get_const_ptr(const double_vector_type * );
void double_vector_set_many(double_vector_type * , int , const double * , int );
void double_vector_set_all(double_vector_type * vector , double value);
void double_vector_append_many(double_vector_type * vector , const double * data , int length);
void double_vector_shrink(double_vector_type * );
double double_vector_sum(const double_vector_type * );
double double_vector_get_default(const double_vector_type * );
void double_vector_set_default(double_vector_type * vector, double default_value);
void double_vector_append_default(double_vector_type * vector , double default_value);
void double_vector_iset_default(double_vector_type * vector , int index , double default_value);
bool double_vector_is_sorted( const double_vector_type * vector , bool reverse);
int double_vector_index(const double_vector_type * vector , double value);
int double_vector_index_sorted(const double_vector_type * vector , double value);
void double_vector_sort(double_vector_type * vector);
void double_vector_rsort(double_vector_type * vector);
void double_vector_permute(double_vector_type * vector , const int * perm);
int * double_vector_alloc_sort_perm(const double_vector_type * vector);
int * double_vector_alloc_rsort_perm(const double_vector_type * vector);
void double_vector_fprintf(const double_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void double_vector_fwrite(const double_vector_type * vector , FILE * stream);
void double_vector_buffer_fread(double_vector_type * vector , buffer_type * buffer);
double_vector_type * double_vector_fread_alloc( FILE * stream );
double_vector_type * double_vector_buffer_fread_alloc( buffer_type * buffer );
void double_vector_buffer_fwrite(const double_vector_type * vector , buffer_type * buffer);
void double_vector_fread( double_vector_type * vector , FILE * stream );
void double_vector_fwrite_data( const double_vector_type * vector , FILE * stream );
void double_vector_fread_data( double_vector_type * vector , int size, FILE * stream);
bool double_vector_equal(const double_vector_type * vector1 , const double_vector_type * vector2);
void double_vector_apply(double_vector_type * vector , double_ftype *func);
int double_vector_count_equal( const double_vector_type * vector , double cmp_value);
int double_vector_element_size( const double_vector_type * vector );
UTIL_SAFE_CAST_HEADER( double_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __float_VECTOR_H__
#define __float_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct float_vector_struct float_vector_type;
typedef float (float_ftype) (float);
int float_vector_lookup_bin( const float_vector_type * limits , float value , int guess);
int float_vector_lookup_bin__( const float_vector_type * limits , float value , int guess);
void float_vector_inplace_div( float_vector_type * vector , const float_vector_type * inv_factor);
void float_vector_inplace_mul( float_vector_type * vector , const float_vector_type * factor);
void float_vector_inplace_add( float_vector_type * vector , const float_vector_type * delta);
void float_vector_set_read_only( float_vector_type * vector , bool read_only);
bool float_vector_get_read_only( const float_vector_type * vector );
void float_vector_resize( float_vector_type * vector , int new_alloc_size );
void float_vector_memcpy_data( float * target, const float_vector_type * src );
void float_vector_memcpy( float_vector_type * target , const float_vector_type * src);
void float_vector_memcpy_data_block( float_vector_type * target , const float_vector_type * src , int target_offset , int src_offset , int len);
bool float_vector_growable( const float_vector_type * vector);
void float_vector_select_unique(float_vector_type * vector);
float_vector_type * float_vector_alloc( int init_size , float );
float_vector_type * float_vector_alloc_private_wrapper(int init_size, float default_value , float * data , int alloc_size);
float_vector_type * float_vector_alloc_shared_wrapper(int init_size, float default_value , float * data , int alloc_size);
float_vector_type * float_vector_alloc_strided_copy( const float_vector_type * src , int start , int stop , int stride );
float_vector_type * float_vector_alloc_copy( const float_vector_type * src);
void float_vector_imul(float_vector_type * vector, int index, float factor);
void float_vector_scale(float_vector_type * vector, float factor);
float float_vector_iget(const float_vector_type * , int);
float float_vector_safe_iget(const float_vector_type * , int);
float float_vector_get_min(const float_vector_type * vector);
float float_vector_get_max(const float_vector_type * vector);
int float_vector_get_min_index(const float_vector_type * vector, bool reverse);
int float_vector_get_max_index(const float_vector_type * vector, bool reverse);
float float_vector_iadd( float_vector_type * vector , int index , float delta);
void float_vector_iset(float_vector_type * , int , float);
void float_vector_idel_block( float_vector_type * vector , int index , int block_size);
float float_vector_idel( float_vector_type * vector , int index);
void float_vector_append(float_vector_type * , float);
void float_vector_free(float_vector_type *);
void float_vector_free__(void *);
void float_vector_free_data(float_vector_type *);
void float_vector_reset(float_vector_type *);
void float_vector_reset__(void * __vector);
int float_vector_size(const float_vector_type * );
float float_vector_pop(float_vector_type * vector);
float float_vector_get_first(const float_vector_type * vector);
float float_vector_get_last(const float_vector_type * );
float * float_vector_get_ptr(const float_vector_type * );
float * float_vector_alloc_data_copy( const float_vector_type * vector );
const float * float_vector_get_const_ptr(const float_vector_type * );
void float_vector_set_many(float_vector_type * , int , const float * , int );
void float_vector_set_all(float_vector_type * vector , float value);
void float_vector_append_many(float_vector_type * vector , const float * data , int length);
void float_vector_shrink(float_vector_type * );
float float_vector_sum(const float_vector_type * );
float float_vector_get_default(const float_vector_type * );
void float_vector_set_default(float_vector_type * vector, float default_value);
void float_vector_append_default(float_vector_type * vector , float default_value);
void float_vector_iset_default(float_vector_type * vector , int index , float default_value);
bool float_vector_is_sorted( const float_vector_type * vector , bool reverse);
int float_vector_index(const float_vector_type * vector , float value);
int float_vector_index_sorted(const float_vector_type * vector , float value);
void float_vector_sort(float_vector_type * vector);
void float_vector_rsort(float_vector_type * vector);
void float_vector_permute(float_vector_type * vector , const int * perm);
int * float_vector_alloc_sort_perm(const float_vector_type * vector);
int * float_vector_alloc_rsort_perm(const float_vector_type * vector);
void float_vector_fprintf(const float_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void float_vector_fwrite(const float_vector_type * vector , FILE * stream);
void float_vector_buffer_fread(float_vector_type * vector , buffer_type * buffer);
float_vector_type * float_vector_fread_alloc( FILE * stream );
float_vector_type * float_vector_buffer_fread_alloc( buffer_type * buffer );
void float_vector_buffer_fwrite(const float_vector_type * vector , buffer_type * buffer);
void float_vector_fread( float_vector_type * vector , FILE * stream );
void float_vector_fwrite_data( const float_vector_type * vector , FILE * stream );
void float_vector_fread_data( float_vector_type * vector , int size, FILE * stream);
bool float_vector_equal(const float_vector_type * vector1 , const float_vector_type * vector2);
void float_vector_apply(float_vector_type * vector , float_ftype *func);
int float_vector_count_equal( const float_vector_type * vector , float cmp_value);
int float_vector_element_size( const float_vector_type * vector );
UTIL_SAFE_CAST_HEADER( float_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __int_VECTOR_H__
#define __int_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct int_vector_struct int_vector_type;
typedef int (int_ftype) (int);
int int_vector_lookup_bin( const int_vector_type * limits , int value , int guess);
int int_vector_lookup_bin__( const int_vector_type * limits , int value , int guess);
void int_vector_inplace_div( int_vector_type * vector , const int_vector_type * inv_factor);
void int_vector_inplace_mul( int_vector_type * vector , const int_vector_type * factor);
void int_vector_inplace_add( int_vector_type * vector , const int_vector_type * delta);
void int_vector_set_read_only( int_vector_type * vector , bool read_only);
bool int_vector_get_read_only( const int_vector_type * vector );
void int_vector_resize( int_vector_type * vector , int new_alloc_size );
void int_vector_memcpy_data( int * target, const int_vector_type * src );
void int_vector_memcpy( int_vector_type * target , const int_vector_type * src);
void int_vector_memcpy_data_block( int_vector_type * target , const int_vector_type * src , int target_offset , int src_offset , int len);
bool int_vector_growable( const int_vector_type * vector);
void int_vector_select_unique(int_vector_type * vector);
int_vector_type * int_vector_alloc( int init_size , int );
int_vector_type * int_vector_alloc_private_wrapper(int init_size, int default_value , int * data , int alloc_size);
int_vector_type * int_vector_alloc_shared_wrapper(int init_size, int default_value , int * data , int alloc_size);
int_vector_type * int_vector_alloc_strided_copy( const int_vector_type * src , int start , int stop , int stride );
int_vector_type * int_vector_alloc_copy( const int_vector_type * src);
void int_vector_imul(int_vector_type * vector, int index, int factor);
void int_vector_scale(int_vector_type * vector, int factor);
int int_vector_iget(const int_vector_type * , int);
int int_vector_safe_iget(const int_vector_type * , int);
int int_vector_get_min(const int_vector_type * vector);
int int_vector_get_max(const int_vector_type * vector);
int int_vector_get_min_index(const int_vector_type * vector, bool reverse);
int int_vector_get_max_index(const int_vector_type * vector, bool reverse);
int int_vector_iadd( int_vector_type * vector , int index , int delta);
void int_vector_iset(int_vector_type * , int , int);
void int_vector_idel_block( int_vector_type * vector , int index , int block_size);
int int_vector_idel( int_vector_type * vector , int index);
void int_vector_append(int_vector_type * , int);
void int_vector_free(int_vector_type *);
void int_vector_free__(void *);
void int_vector_free_data(int_vector_type *);
void int_vector_reset(int_vector_type *);
void int_vector_reset__(void * __vector);
int int_vector_size(const int_vector_type * );
int int_vector_pop(int_vector_type * vector);
int int_vector_get_first(const int_vector_type * vector);
int int_vector_get_last(const int_vector_type * );
int * int_vector_get_ptr(const int_vector_type * );
int * int_vector_alloc_data_copy( const int_vector_type * vector );
const int * int_vector_get_const_ptr(const int_vector_type * );
void int_vector_set_many(int_vector_type * , int , const int * , int );
void int_vector_set_all(int_vector_type * vector , int value);
void int_vector_append_many(int_vector_type * vector , const int * data , int length);
void int_vector_shrink(int_vector_type * );
int int_vector_sum(const int_vector_type * );
int int_vector_get_default(const int_vector_type * );
void int_vector_set_default(int_vector_type * vector, int default_value);
void int_vector_append_default(int_vector_type * vector , int default_value);
void int_vector_iset_default(int_vector_type * vector , int index , int default_value);
bool int_vector_is_sorted( const int_vector_type * vector , bool reverse);
int int_vector_index(const int_vector_type * vector , int value);
int int_vector_index_sorted(const int_vector_type * vector , int value);
void int_vector_sort(int_vector_type * vector);
void int_vector_rsort(int_vector_type * vector);
void int_vector_permute(int_vector_type * vector , const int * perm);
int * int_vector_alloc_sort_perm(const int_vector_type * vector);
int * int_vector_alloc_rsort_perm(const int_vector_type * vector);
void int_vector_fprintf(const int_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void int_vector_fwrite(const int_vector_type * vector , FILE * stream);
void int_vector_buffer_fread(int_vector_type * vector , buffer_type * buffer);
int_vector_type * int_vector_fread_alloc( FILE * stream );
int_vector_type * int_vector_buffer_fread_alloc( buffer_type * buffer );
void int_vector_buffer_fwrite(const int_vector_type * vector , buffer_type * buffer);
void int_vector_fread( int_vector_type * vector , FILE * stream );
void int_vector_fwrite_data( const int_vector_type * vector , FILE * stream );
void int_vector_fread_data( int_vector_type * vector , int size, FILE * stream);
bool int_vector_equal(const int_vector_type * vector1 , const int_vector_type * vector2);
void int_vector_apply(int_vector_type * vector , int_ftype *func);
int int_vector_count_equal( const int_vector_type * vector , int cmp_value);
int int_vector_element_size( const int_vector_type * vector );
UTIL_SAFE_CAST_HEADER( int_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __long_VECTOR_H__
#define __long_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct long_vector_struct long_vector_type;
typedef long (long_ftype) (long);
int long_vector_lookup_bin( const long_vector_type * limits , long value , int guess);
int long_vector_lookup_bin__( const long_vector_type * limits , long value , int guess);
void long_vector_inplace_div( long_vector_type * vector , const long_vector_type * inv_factor);
void long_vector_inplace_mul( long_vector_type * vector , const long_vector_type * factor);
void long_vector_inplace_add( long_vector_type * vector , const long_vector_type * delta);
void long_vector_set_read_only( long_vector_type * vector , bool read_only);
bool long_vector_get_read_only( const long_vector_type * vector );
void long_vector_resize( long_vector_type * vector , int new_alloc_size );
void long_vector_memcpy_data( long * target, const long_vector_type * src );
void long_vector_memcpy( long_vector_type * target , const long_vector_type * src);
void long_vector_memcpy_data_block( long_vector_type * target , const long_vector_type * src , int target_offset , int src_offset , int len);
bool long_vector_growable( const long_vector_type * vector);
void long_vector_select_unique(long_vector_type * vector);
long_vector_type * long_vector_alloc( int init_size , long );
long_vector_type * long_vector_alloc_private_wrapper(int init_size, long default_value , long * data , int alloc_size);
long_vector_type * long_vector_alloc_shared_wrapper(int init_size, long default_value , long * data , int alloc_size);
long_vector_type * long_vector_alloc_strided_copy( const long_vector_type * src , int start , int stop , int stride );
long_vector_type * long_vector_alloc_copy( const long_vector_type * src);
void long_vector_imul(long_vector_type * vector, int index, long factor);
void long_vector_scale(long_vector_type * vector, long factor);
long long_vector_iget(const long_vector_type * , int);
long long_vector_safe_iget(const long_vector_type * , int);
long long_vector_get_min(const long_vector_type * vector);
long long_vector_get_max(const long_vector_type * vector);
int long_vector_get_min_index(const long_vector_type * vector, bool reverse);
int long_vector_get_max_index(const long_vector_type * vector, bool reverse);
long long_vector_iadd( long_vector_type * vector , int index , long delta);
void long_vector_iset(long_vector_type * , int , long);
void long_vector_idel_block( long_vector_type * vector , int index , int block_size);
long long_vector_idel( long_vector_type * vector , int index);
void long_vector_append(long_vector_type * , long);
void long_vector_free(long_vector_type *);
void long_vector_free__(void *);
void long_vector_free_data(long_vector_type *);
void long_vector_reset(long_vector_type *);
void long_vector_reset__(void * __vector);
int long_vector_size(const long_vector_type * );
long long_vector_pop(long_vector_type * vector);
long long_vector_get_first(const long_vector_type * vector);
long long_vector_get_last(const long_vector_type * );
long * long_vector_get_ptr(const long_vector_type * );
long * long_vector_alloc_data_copy( const long_vector_type * vector );
const long * long_vector_get_const_ptr(const long_vector_type * );
void long_vector_set_many(long_vector_type * , int , const long * , int );
void long_vector_set_all(long_vector_type * vector , long value);
void long_vector_append_many(long_vector_type * vector , const long * data , int length);
void long_vector_shrink(long_vector_type * );
long long_vector_sum(const long_vector_type * );
long long_vector_get_default(const long_vector_type * );
void long_vector_set_default(long_vector_type * vector, long default_value);
void long_vector_append_default(long_vector_type * vector , long default_value);
void long_vector_iset_default(long_vector_type * vector , int index , long default_value);
bool long_vector_is_sorted( const long_vector_type * vector , bool reverse);
int long_vector_index(const long_vector_type * vector , long value);
int long_vector_index_sorted(const long_vector_type * vector , long value);
void long_vector_sort(long_vector_type * vector);
void long_vector_rsort(long_vector_type * vector);
void long_vector_permute(long_vector_type * vector , const int * perm);
int * long_vector_alloc_sort_perm(const long_vector_type * vector);
int * long_vector_alloc_rsort_perm(const long_vector_type * vector);
void long_vector_fprintf(const long_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void long_vector_fwrite(const long_vector_type * vector , FILE * stream);
void long_vector_buffer_fread(long_vector_type * vector , buffer_type * buffer);
long_vector_type * long_vector_fread_alloc( FILE * stream );
long_vector_type * long_vector_buffer_fread_alloc( buffer_type * buffer );
void long_vector_buffer_fwrite(const long_vector_type * vector , buffer_type * buffer);
void long_vector_fread( long_vector_type * vector , FILE * stream );
void long_vector_fwrite_data( const long_vector_type * vector , FILE * stream );
void long_vector_fread_data( long_vector_type * vector , int size, FILE * stream);
bool long_vector_equal(const long_vector_type * vector1 , const long_vector_type * vector2);
void long_vector_apply(long_vector_type * vector , long_ftype *func);
int long_vector_count_equal( const long_vector_type * vector , long cmp_value);
int long_vector_element_size( const long_vector_type * vector );
UTIL_SAFE_CAST_HEADER( long_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __size_t_VECTOR_H__
#define __size_t_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct size_t_vector_struct size_t_vector_type;
typedef size_t (size_t_ftype) (size_t);
int size_t_vector_lookup_bin( const size_t_vector_type * limits , size_t value , int guess);
int size_t_vector_lookup_bin__( const size_t_vector_type * limits , size_t value , int guess);
void size_t_vector_inplace_div( size_t_vector_type * vector , const size_t_vector_type * inv_factor);
void size_t_vector_inplace_mul( size_t_vector_type * vector , const size_t_vector_type * factor);
void size_t_vector_inplace_add( size_t_vector_type * vector , const size_t_vector_type * delta);
void size_t_vector_set_read_only( size_t_vector_type * vector , bool read_only);
bool size_t_vector_get_read_only( const size_t_vector_type * vector );
void size_t_vector_resize( size_t_vector_type * vector , int new_alloc_size );
void size_t_vector_memcpy_data( size_t * target, const size_t_vector_type * src );
void size_t_vector_memcpy( size_t_vector_type * target , const size_t_vector_type * src);
void size_t_vector_memcpy_data_block( size_t_vector_type * target , const size_t_vector_type * src , int target_offset , int src_offset , int len);
bool size_t_vector_growable( const size_t_vector_type * vector);
void size_t_vector_select_unique(size_t_vector_type * vector);
size_t_vector_type * size_t_vector_alloc( int init_size , size_t );
size_t_vector_type * size_t_vector_alloc_private_wrapper(int init_size, size_t default_value , size_t * data , int alloc_size);
size_t_vector_type * size_t_vector_alloc_shared_wrapper(int init_size, size_t default_value , size_t * data , int alloc_size);
size_t_vector_type * size_t_vector_alloc_strided_copy( const size_t_vector_type * src , int start , int stop , int stride );
size_t_vector_type * size_t_vector_alloc_copy( const size_t_vector_type * src);
void size_t_vector_imul(size_t_vector_type * vector, int index, size_t factor);
void size_t_vector_scale(size_t_vector_type * vector, size_t factor);
size_t size_t_vector_iget(const size_t_vector_type * , int);
size_t size_t_vector_safe_iget(const size_t_vector_type * , int);
size_t size_t_vector_get_min(const size_t_vector_type * vector);
size_t size_t_vector_get_max(const size_t_vector_type * vector);
int size_t_vector_get_min_index(const size_t_vector_type * vector, bool reverse);
int size_t_vector_get_max_index(const size_t_vector_type * vector, bool reverse);
size_t size_t_vector_iadd( size_t_vector_type * vector , int index , size_t delta);
void size_t_vector_iset(size_t_vector_type * , int , size_t);
void size_t_vector_idel_block( size_t_vector_type * vector , int index , int block_size);
size_t size_t_vector_idel( size_t_vector_type * vector , int index);
void size_t_vector_append(size_t_vector_type * , size_t);
void size_t_vector_free(size_t_vector_type *);
void size_t_vector_free__(void *);
void size_t_vector_free_data(size_t_vector_type *);
void size_t_vector_reset(size_t_vector_type *);
void size_t_vector_reset__(void * __vector);
int size_t_vector_size(const size_t_vector_type * );
size_t size_t_vector_pop(size_t_vector_type * vector);
size_t size_t_vector_get_first(const size_t_vector_type * vector);
size_t size_t_vector_get_last(const size_t_vector_type * );
size_t * size_t_vector_get_ptr(const size_t_vector_type * );
size_t * size_t_vector_alloc_data_copy( const size_t_vector_type * vector );
const size_t * size_t_vector_get_const_ptr(const size_t_vector_type * );
void size_t_vector_set_many(size_t_vector_type * , int , const size_t * , int );
void size_t_vector_set_all(size_t_vector_type * vector , size_t value);
void size_t_vector_append_many(size_t_vector_type * vector , const size_t * data , int length);
void size_t_vector_shrink(size_t_vector_type * );
size_t size_t_vector_sum(const size_t_vector_type * );
size_t size_t_vector_get_default(const size_t_vector_type * );
void size_t_vector_set_default(size_t_vector_type * vector, size_t default_value);
void size_t_vector_append_default(size_t_vector_type * vector , size_t default_value);
void size_t_vector_iset_default(size_t_vector_type * vector , int index , size_t default_value);
bool size_t_vector_is_sorted( const size_t_vector_type * vector , bool reverse);
int size_t_vector_index(const size_t_vector_type * vector , size_t value);
int size_t_vector_index_sorted(const size_t_vector_type * vector , size_t value);
void size_t_vector_sort(size_t_vector_type * vector);
void size_t_vector_rsort(size_t_vector_type * vector);
void size_t_vector_permute(size_t_vector_type * vector , const int * perm);
int * size_t_vector_alloc_sort_perm(const size_t_vector_type * vector);
int * size_t_vector_alloc_rsort_perm(const size_t_vector_type * vector);
void size_t_vector_fprintf(const size_t_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void size_t_vector_fwrite(const size_t_vector_type * vector , FILE * stream);
void size_t_vector_buffer_fread(size_t_vector_type * vector , buffer_type * buffer);
size_t_vector_type * size_t_vector_fread_alloc( FILE * stream );
size_t_vector_type * size_t_vector_buffer_fread_alloc( buffer_type * buffer );
void size_t_vector_buffer_fwrite(const size_t_vector_type * vector , buffer_type * buffer);
void size_t_vector_fread( size_t_vector_type * vector , FILE * stream );
void size_t_vector_fwrite_data( const size_t_vector_type * vector , FILE * stream );
void size_t_vector_fread_data( size_t_vector_type * vector , int size, FILE * stream);
bool size_t_vector_equal(const size_t_vector_type * vector1 , const size_t_vector_type * vector2);
void size_t_vector_apply(size_t_vector_type * vector , size_t_ftype *func);
int size_t_vector_count_equal( const size_t_vector_type * vector , size_t cmp_value);
int size_t_vector_element_size( const size_t_vector_type * vector );
UTIL_SAFE_CAST_HEADER( size_t_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,21 +0,0 @@
/*
When building with MSVC this file is renamed to stdbool.h and copied into the
list of headers. The situation is as follows:
- The ERT code makes use of stdbool in many places. The msvc C
compiler does not have a stdbool header, i.e. the #include <stdbool.h>
statements fail when compiling.
- When included in a C++ project the compiler already has a bool
defined; it is therefor important not to redifine this symbol if
we are compiling C++.
*/
#ifndef __cplusplus
typedef int bool;
#define true 1
#define false 0
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __time_t_VECTOR_H__
#define __time_t_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct time_t_vector_struct time_t_vector_type;
typedef time_t (time_t_ftype) (time_t);
int time_t_vector_lookup_bin( const time_t_vector_type * limits , time_t value , int guess);
int time_t_vector_lookup_bin__( const time_t_vector_type * limits , time_t value , int guess);
void time_t_vector_inplace_div( time_t_vector_type * vector , const time_t_vector_type * inv_factor);
void time_t_vector_inplace_mul( time_t_vector_type * vector , const time_t_vector_type * factor);
void time_t_vector_inplace_add( time_t_vector_type * vector , const time_t_vector_type * delta);
void time_t_vector_set_read_only( time_t_vector_type * vector , bool read_only);
bool time_t_vector_get_read_only( const time_t_vector_type * vector );
void time_t_vector_resize( time_t_vector_type * vector , int new_alloc_size );
void time_t_vector_memcpy_data( time_t * target, const time_t_vector_type * src );
void time_t_vector_memcpy( time_t_vector_type * target , const time_t_vector_type * src);
void time_t_vector_memcpy_data_block( time_t_vector_type * target , const time_t_vector_type * src , int target_offset , int src_offset , int len);
bool time_t_vector_growable( const time_t_vector_type * vector);
void time_t_vector_select_unique(time_t_vector_type * vector);
time_t_vector_type * time_t_vector_alloc( int init_size , time_t );
time_t_vector_type * time_t_vector_alloc_private_wrapper(int init_size, time_t default_value , time_t * data , int alloc_size);
time_t_vector_type * time_t_vector_alloc_shared_wrapper(int init_size, time_t default_value , time_t * data , int alloc_size);
time_t_vector_type * time_t_vector_alloc_strided_copy( const time_t_vector_type * src , int start , int stop , int stride );
time_t_vector_type * time_t_vector_alloc_copy( const time_t_vector_type * src);
void time_t_vector_imul(time_t_vector_type * vector, int index, time_t factor);
void time_t_vector_scale(time_t_vector_type * vector, time_t factor);
time_t time_t_vector_iget(const time_t_vector_type * , int);
time_t time_t_vector_safe_iget(const time_t_vector_type * , int);
time_t time_t_vector_get_min(const time_t_vector_type * vector);
time_t time_t_vector_get_max(const time_t_vector_type * vector);
int time_t_vector_get_min_index(const time_t_vector_type * vector, bool reverse);
int time_t_vector_get_max_index(const time_t_vector_type * vector, bool reverse);
time_t time_t_vector_iadd( time_t_vector_type * vector , int index , time_t delta);
void time_t_vector_iset(time_t_vector_type * , int , time_t);
void time_t_vector_idel_block( time_t_vector_type * vector , int index , int block_size);
time_t time_t_vector_idel( time_t_vector_type * vector , int index);
void time_t_vector_append(time_t_vector_type * , time_t);
void time_t_vector_free(time_t_vector_type *);
void time_t_vector_free__(void *);
void time_t_vector_free_data(time_t_vector_type *);
void time_t_vector_reset(time_t_vector_type *);
void time_t_vector_reset__(void * __vector);
int time_t_vector_size(const time_t_vector_type * );
time_t time_t_vector_pop(time_t_vector_type * vector);
time_t time_t_vector_get_first(const time_t_vector_type * vector);
time_t time_t_vector_get_last(const time_t_vector_type * );
time_t * time_t_vector_get_ptr(const time_t_vector_type * );
time_t * time_t_vector_alloc_data_copy( const time_t_vector_type * vector );
const time_t * time_t_vector_get_const_ptr(const time_t_vector_type * );
void time_t_vector_set_many(time_t_vector_type * , int , const time_t * , int );
void time_t_vector_set_all(time_t_vector_type * vector , time_t value);
void time_t_vector_append_many(time_t_vector_type * vector , const time_t * data , int length);
void time_t_vector_shrink(time_t_vector_type * );
time_t time_t_vector_sum(const time_t_vector_type * );
time_t time_t_vector_get_default(const time_t_vector_type * );
void time_t_vector_set_default(time_t_vector_type * vector, time_t default_value);
void time_t_vector_append_default(time_t_vector_type * vector , time_t default_value);
void time_t_vector_iset_default(time_t_vector_type * vector , int index , time_t default_value);
bool time_t_vector_is_sorted( const time_t_vector_type * vector , bool reverse);
int time_t_vector_index(const time_t_vector_type * vector , time_t value);
int time_t_vector_index_sorted(const time_t_vector_type * vector , time_t value);
void time_t_vector_sort(time_t_vector_type * vector);
void time_t_vector_rsort(time_t_vector_type * vector);
void time_t_vector_permute(time_t_vector_type * vector , const int * perm);
int * time_t_vector_alloc_sort_perm(const time_t_vector_type * vector);
int * time_t_vector_alloc_rsort_perm(const time_t_vector_type * vector);
void time_t_vector_fprintf(const time_t_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void time_t_vector_fwrite(const time_t_vector_type * vector , FILE * stream);
void time_t_vector_buffer_fread(time_t_vector_type * vector , buffer_type * buffer);
time_t_vector_type * time_t_vector_fread_alloc( FILE * stream );
time_t_vector_type * time_t_vector_buffer_fread_alloc( buffer_type * buffer );
void time_t_vector_buffer_fwrite(const time_t_vector_type * vector , buffer_type * buffer);
void time_t_vector_fread( time_t_vector_type * vector , FILE * stream );
void time_t_vector_fwrite_data( const time_t_vector_type * vector , FILE * stream );
void time_t_vector_fread_data( time_t_vector_type * vector , int size, FILE * stream);
bool time_t_vector_equal(const time_t_vector_type * vector1 , const time_t_vector_type * vector2);
void time_t_vector_apply(time_t_vector_type * vector , time_t_ftype *func);
int time_t_vector_count_equal( const time_t_vector_type * vector , time_t cmp_value);
int time_t_vector_element_size( const time_t_vector_type * vector );
UTIL_SAFE_CAST_HEADER( time_t_vector );
#ifdef __cplusplus
}
#endif
#endif
//

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,59 +0,0 @@
# System requirements
MINGW
Install MINGW, and make sure c++, fortran and MSYS are installed
http://www.mingw.org/wiki/Getting_Started
LAPACK/BLAS
http://icl.cs.utk.edu/lapack-for-windows/lapack/
Download relevant DLLs
# Create a folder for ERT source code
# For an initial checkout of code, see here
# http://ert.nr.no/wiki/index.php/Download
# svn co http://ert.nr.no/repos/ert
cd /ert/devel/
# First you might want to check what has happened since last update:
svn log -r BASE:HEAD
# Then update and build the code:
svn up
# using cmake
cmake-gui
Select MSYS toolchain
# Enter the following in the gui:
# Source code: /devel/
# Binaries: c:/cmakebuild/ErtCmakeBuild
# Then press configure, and edit the following variables:
# BLAS_LIBRARY: libblas.dll
# CMAKE_BUILD_TYPE: Release
# CMAKE_GNUtoMS : True
# CMAKE_INSTALL_PREFIX : /Projects/ResInsight/dev/ThirdParty/Ert-windows/
# LAPACK_LIBRARY: liblapack.dll
# USE_ZLIB: False
# then press Configure and then Generate
# If you want to, you can start a start MINGW shell, if you want the common Windows way, start a command line window
cd /c/cmakebuild/ErtCmakeBuild
make clean
make
# make your copy of the library editable by checking it out
#p4 edit -c default /home/builder/Projects/ResInsight/ThirdParty/Ert-windows/...
make install
# Then check in if appropriate
# Finished.

View File

@ -1,91 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'arg_pack.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ARG_PACK_H__
#define __ARG_PACK_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdbool.h>
#include <node_ctype.h>
#include <type_macros.h>
typedef struct arg_pack_struct arg_pack_type;
typedef void (arg_node_free_ftype) (void *);
typedef void * (arg_node_copyc_ftype) (void *);
arg_pack_type * arg_pack_alloc();
UTIL_SAFE_CAST_HEADER( arg_pack );
void arg_pack_free(arg_pack_type * );
void arg_pack_free__(void *);
void arg_pack_clear(arg_pack_type *);
void arg_pack_lock(arg_pack_type *);
void arg_pack_fscanf(arg_pack_type * arg , FILE * stream);
void arg_pack_fprintf(const arg_pack_type * , FILE * );
void arg_pack_append_ptr(arg_pack_type * , const void *);
void arg_pack_append_owned_ptr(arg_pack_type * , void * , arg_node_free_ftype *);
void arg_pack_append_copy(arg_pack_type * , void * , arg_node_copyc_ftype * , arg_node_free_ftype *);
void arg_pack_iset_copy(arg_pack_type * arg_pack , int index , void * ptr, arg_node_copyc_ftype * copyc , arg_node_free_ftype * freef);
void arg_pack_iset_ptr(arg_pack_type * arg_pack, int index , const void * ptr);
void arg_pack_iset_owned_ptr(arg_pack_type * arg_pack, int index , void * ptr, arg_node_free_ftype * freef);
void * arg_pack_iget_ptr(const arg_pack_type * , int);
void * arg_pack_iget_adress(const arg_pack_type * , int);
node_ctype arg_pack_iget_ctype(const arg_pack_type * arg_pack ,int index);
/*****************************************************************/
#define APPEND_TYPED_HEADER(type) void arg_pack_append_ ## type (arg_pack_type * , type);
#define IGET_TYPED_HEADER(type) type arg_pack_iget_ ## type( const arg_pack_type * , int );
#define ISET_TYPED_HEADER(type) void arg_pack_iset_ ## type( arg_pack_type * , int , type value);
APPEND_TYPED_HEADER(int)
APPEND_TYPED_HEADER(bool)
APPEND_TYPED_HEADER(char)
APPEND_TYPED_HEADER(float)
APPEND_TYPED_HEADER(double)
APPEND_TYPED_HEADER(size_t)
IGET_TYPED_HEADER(int)
IGET_TYPED_HEADER(bool)
IGET_TYPED_HEADER(char)
IGET_TYPED_HEADER(float)
IGET_TYPED_HEADER(double)
IGET_TYPED_HEADER(size_t)
ISET_TYPED_HEADER(int)
ISET_TYPED_HEADER(bool)
ISET_TYPED_HEADER(char)
ISET_TYPED_HEADER(float)
ISET_TYPED_HEADER(double)
ISET_TYPED_HEADER(size_t)
#undef APPEND_TYPED_HEADER
#undef GET_TYPED_HEADER
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __bool_VECTOR_H__
#define __bool_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct bool_vector_struct bool_vector_type;
typedef bool (bool_ftype) (bool);
int bool_vector_lookup_bin( const bool_vector_type * limits , bool value , int guess);
int bool_vector_lookup_bin__( const bool_vector_type * limits , bool value , int guess);
void bool_vector_inplace_div( bool_vector_type * vector , const bool_vector_type * inv_factor);
void bool_vector_inplace_mul( bool_vector_type * vector , const bool_vector_type * factor);
void bool_vector_inplace_add( bool_vector_type * vector , const bool_vector_type * delta);
void bool_vector_set_read_only( bool_vector_type * vector , bool read_only);
bool bool_vector_get_read_only( const bool_vector_type * vector );
void bool_vector_resize( bool_vector_type * vector , int new_alloc_size );
void bool_vector_memcpy_data( bool * target, const bool_vector_type * src );
void bool_vector_memcpy( bool_vector_type * target , const bool_vector_type * src);
void bool_vector_memcpy_data_block( bool_vector_type * target , const bool_vector_type * src , int target_offset , int src_offset , int len);
bool bool_vector_growable( const bool_vector_type * vector);
void bool_vector_select_unique(bool_vector_type * vector);
bool_vector_type * bool_vector_alloc( int init_size , bool );
bool_vector_type * bool_vector_alloc_private_wrapper(int init_size, bool default_value , bool * data , int alloc_size);
bool_vector_type * bool_vector_alloc_shared_wrapper(int init_size, bool default_value , bool * data , int alloc_size);
bool_vector_type * bool_vector_alloc_strided_copy( const bool_vector_type * src , int start , int stop , int stride );
bool_vector_type * bool_vector_alloc_copy( const bool_vector_type * src);
void bool_vector_imul(bool_vector_type * vector, int index, bool factor);
void bool_vector_scale(bool_vector_type * vector, bool factor);
bool bool_vector_iget(const bool_vector_type * , int);
bool bool_vector_safe_iget(const bool_vector_type * , int);
bool bool_vector_get_min(const bool_vector_type * vector);
bool bool_vector_get_max(const bool_vector_type * vector);
int bool_vector_get_min_index(const bool_vector_type * vector, bool reverse);
int bool_vector_get_max_index(const bool_vector_type * vector, bool reverse);
bool bool_vector_iadd( bool_vector_type * vector , int index , bool delta);
void bool_vector_iset(bool_vector_type * , int , bool);
void bool_vector_idel_block( bool_vector_type * vector , int index , int block_size);
bool bool_vector_idel( bool_vector_type * vector , int index);
void bool_vector_append(bool_vector_type * , bool);
void bool_vector_free(bool_vector_type *);
void bool_vector_free__(void *);
void bool_vector_free_data(bool_vector_type *);
void bool_vector_reset(bool_vector_type *);
void bool_vector_reset__(void * __vector);
int bool_vector_size(const bool_vector_type * );
bool bool_vector_pop(bool_vector_type * vector);
bool bool_vector_get_first(const bool_vector_type * vector);
bool bool_vector_get_last(const bool_vector_type * );
bool * bool_vector_get_ptr(const bool_vector_type * );
bool * bool_vector_alloc_data_copy( const bool_vector_type * vector );
const bool * bool_vector_get_const_ptr(const bool_vector_type * );
void bool_vector_set_many(bool_vector_type * , int , const bool * , int );
void bool_vector_set_all(bool_vector_type * vector , bool value);
void bool_vector_append_many(bool_vector_type * vector , const bool * data , int length);
void bool_vector_shrink(bool_vector_type * );
bool bool_vector_sum(const bool_vector_type * );
bool bool_vector_get_default(const bool_vector_type * );
void bool_vector_set_default(bool_vector_type * vector, bool default_value);
void bool_vector_append_default(bool_vector_type * vector , bool default_value);
void bool_vector_iset_default(bool_vector_type * vector , int index , bool default_value);
bool bool_vector_is_sorted( const bool_vector_type * vector , bool reverse);
int bool_vector_index(const bool_vector_type * vector , bool value);
int bool_vector_index_sorted(const bool_vector_type * vector , bool value);
void bool_vector_sort(bool_vector_type * vector);
void bool_vector_rsort(bool_vector_type * vector);
void bool_vector_permute(bool_vector_type * vector , const int * perm);
int * bool_vector_alloc_sort_perm(const bool_vector_type * vector);
int * bool_vector_alloc_rsort_perm(const bool_vector_type * vector);
void bool_vector_fprintf(const bool_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void bool_vector_fwrite(const bool_vector_type * vector , FILE * stream);
void bool_vector_buffer_fread(bool_vector_type * vector , buffer_type * buffer);
bool_vector_type * bool_vector_fread_alloc( FILE * stream );
bool_vector_type * bool_vector_buffer_fread_alloc( buffer_type * buffer );
void bool_vector_buffer_fwrite(const bool_vector_type * vector , buffer_type * buffer);
void bool_vector_fread( bool_vector_type * vector , FILE * stream );
void bool_vector_fwrite_data( const bool_vector_type * vector , FILE * stream );
void bool_vector_fread_data( bool_vector_type * vector , int size, FILE * stream);
bool bool_vector_equal(const bool_vector_type * vector1 , const bool_vector_type * vector2);
void bool_vector_apply(bool_vector_type * vector , bool_ftype *func);
int bool_vector_count_equal( const bool_vector_type * vector , bool cmp_value);
int bool_vector_element_size( const bool_vector_type * vector );
UTIL_SAFE_CAST_HEADER( bool_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,103 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'buffer.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __BUFFER_H__
#define __BUFFER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include <ssize_t.h>
typedef struct buffer_struct buffer_type;
buffer_type * buffer_alloc( size_t buffer_size );
buffer_type * buffer_alloc_private_wrapper(void * data , size_t buffer_size );
bool buffer_search_replace( buffer_type * buffer , const char * old_string , const char * new_string);
void buffer_shrink_to_fit( buffer_type * buffer );
void buffer_memshift(buffer_type * buffer , size_t offset, ssize_t shift);
bool buffer_strstr( buffer_type * buffer , const char * expr );
bool buffer_strchr( buffer_type * buffer , int c);
void buffer_replace_string( buffer_type * buffer , size_t offset , size_t old_size , const char * new_string);
void buffer_replace_data(buffer_type * buffer , size_t offset , size_t old_size , const void * new_data , size_t new_size);
void buffer_free_container( buffer_type * buffer );
void buffer_free( buffer_type * buffer);
size_t buffer_safe_fread(buffer_type * buffer , void * target_ptr , size_t item_size , size_t items);
size_t buffer_fread(buffer_type * buffer , void * target_ptr , size_t item_size , size_t items);
size_t buffer_safe_fwrite(buffer_type * buffer , const void * src_ptr , size_t item_size , size_t items);
size_t buffer_fwrite(buffer_type * buffer , const void * src_ptr , size_t item_size , size_t items);
const char * buffer_fread_string(buffer_type * buffer);
char * buffer_fread_alloc_string(buffer_type * buffer);
void buffer_fwrite_string(buffer_type * buffer , const char * string);
void buffer_summarize(const buffer_type * buffer , const char *);
void buffer_fwrite_char_ptr(buffer_type * buffer , const char * string_ptr );
void buffer_terminate_char_ptr( buffer_type * buffer );
void buffer_fwrite_char(buffer_type * buffer , char value);
void buffer_fwrite_int(buffer_type * buffer , int value);
void buffer_fskip_bool(buffer_type * buffer);
void buffer_fwrite_bool(buffer_type * buffer , bool value);
int buffer_fread_int(buffer_type * buffer );
bool buffer_fread_bool(buffer_type * buffer);
long int buffer_fread_long(buffer_type * buffer);
void buffer_fskip_long(buffer_type * buffer);
void buffer_store(const buffer_type * buffer , const char * filename);
size_t buffer_get_offset(const buffer_type * buffer);
size_t buffer_get_alloc_size(const buffer_type * buffer);
size_t buffer_get_size(const buffer_type * buffer);
size_t buffer_get_string_size( const buffer_type * buffer );
size_t buffer_get_remaining_size(const buffer_type * buffer);
void * buffer_get_data(const buffer_type * buffer);
void * buffer_alloc_data_copy(const buffer_type * buffer);
void buffer_stream_fwrite( const buffer_type * buffer , FILE * stream );
int buffer_fgetc( buffer_type * buffer );
void buffer_fseek(buffer_type * buffer , ssize_t offset , int whence);
void buffer_fskip(buffer_type * buffer, ssize_t offset);
void buffer_clear( buffer_type * buffer );
void buffer_fskip_int(buffer_type * buffer);
void buffer_fskip_time_t(buffer_type * buffer);
time_t buffer_fread_time_t(buffer_type * buffer);
void buffer_fwrite_time_t(buffer_type * buffer , time_t value);
void buffer_rewind(buffer_type * buffer );
double buffer_fread_double(buffer_type * buffer);
void buffer_fwrite_double(buffer_type * buffer , double value);
size_t buffer_stream_fwrite_n( const buffer_type * buffer , size_t offset , ssize_t write_size , FILE * stream );
void buffer_stream_fprintf( const buffer_type * buffer , FILE * stream );
void buffer_stream_fread( buffer_type * buffer , size_t byte_size , FILE * stream);
buffer_type * buffer_fread_alloc(const char * filename);
void buffer_fread_realloc(buffer_type * buffer , const char * filename);
#ifdef WITH_ZLIB
size_t buffer_fwrite_compressed(buffer_type * buffer, const void * ptr , size_t byte_size);
size_t buffer_fread_compressed(buffer_type * buffer , size_t compressed_size , void * target_ptr , size_t target_size);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __double_VECTOR_H__
#define __double_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct double_vector_struct double_vector_type;
typedef double (double_ftype) (double);
int double_vector_lookup_bin( const double_vector_type * limits , double value , int guess);
int double_vector_lookup_bin__( const double_vector_type * limits , double value , int guess);
void double_vector_inplace_div( double_vector_type * vector , const double_vector_type * inv_factor);
void double_vector_inplace_mul( double_vector_type * vector , const double_vector_type * factor);
void double_vector_inplace_add( double_vector_type * vector , const double_vector_type * delta);
void double_vector_set_read_only( double_vector_type * vector , bool read_only);
bool double_vector_get_read_only( const double_vector_type * vector );
void double_vector_resize( double_vector_type * vector , int new_alloc_size );
void double_vector_memcpy_data( double * target, const double_vector_type * src );
void double_vector_memcpy( double_vector_type * target , const double_vector_type * src);
void double_vector_memcpy_data_block( double_vector_type * target , const double_vector_type * src , int target_offset , int src_offset , int len);
bool double_vector_growable( const double_vector_type * vector);
void double_vector_select_unique(double_vector_type * vector);
double_vector_type * double_vector_alloc( int init_size , double );
double_vector_type * double_vector_alloc_private_wrapper(int init_size, double default_value , double * data , int alloc_size);
double_vector_type * double_vector_alloc_shared_wrapper(int init_size, double default_value , double * data , int alloc_size);
double_vector_type * double_vector_alloc_strided_copy( const double_vector_type * src , int start , int stop , int stride );
double_vector_type * double_vector_alloc_copy( const double_vector_type * src);
void double_vector_imul(double_vector_type * vector, int index, double factor);
void double_vector_scale(double_vector_type * vector, double factor);
double double_vector_iget(const double_vector_type * , int);
double double_vector_safe_iget(const double_vector_type * , int);
double double_vector_get_min(const double_vector_type * vector);
double double_vector_get_max(const double_vector_type * vector);
int double_vector_get_min_index(const double_vector_type * vector, bool reverse);
int double_vector_get_max_index(const double_vector_type * vector, bool reverse);
double double_vector_iadd( double_vector_type * vector , int index , double delta);
void double_vector_iset(double_vector_type * , int , double);
void double_vector_idel_block( double_vector_type * vector , int index , int block_size);
double double_vector_idel( double_vector_type * vector , int index);
void double_vector_append(double_vector_type * , double);
void double_vector_free(double_vector_type *);
void double_vector_free__(void *);
void double_vector_free_data(double_vector_type *);
void double_vector_reset(double_vector_type *);
void double_vector_reset__(void * __vector);
int double_vector_size(const double_vector_type * );
double double_vector_pop(double_vector_type * vector);
double double_vector_get_first(const double_vector_type * vector);
double double_vector_get_last(const double_vector_type * );
double * double_vector_get_ptr(const double_vector_type * );
double * double_vector_alloc_data_copy( const double_vector_type * vector );
const double * double_vector_get_const_ptr(const double_vector_type * );
void double_vector_set_many(double_vector_type * , int , const double * , int );
void double_vector_set_all(double_vector_type * vector , double value);
void double_vector_append_many(double_vector_type * vector , const double * data , int length);
void double_vector_shrink(double_vector_type * );
double double_vector_sum(const double_vector_type * );
double double_vector_get_default(const double_vector_type * );
void double_vector_set_default(double_vector_type * vector, double default_value);
void double_vector_append_default(double_vector_type * vector , double default_value);
void double_vector_iset_default(double_vector_type * vector , int index , double default_value);
bool double_vector_is_sorted( const double_vector_type * vector , bool reverse);
int double_vector_index(const double_vector_type * vector , double value);
int double_vector_index_sorted(const double_vector_type * vector , double value);
void double_vector_sort(double_vector_type * vector);
void double_vector_rsort(double_vector_type * vector);
void double_vector_permute(double_vector_type * vector , const int * perm);
int * double_vector_alloc_sort_perm(const double_vector_type * vector);
int * double_vector_alloc_rsort_perm(const double_vector_type * vector);
void double_vector_fprintf(const double_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void double_vector_fwrite(const double_vector_type * vector , FILE * stream);
void double_vector_buffer_fread(double_vector_type * vector , buffer_type * buffer);
double_vector_type * double_vector_fread_alloc( FILE * stream );
double_vector_type * double_vector_buffer_fread_alloc( buffer_type * buffer );
void double_vector_buffer_fwrite(const double_vector_type * vector , buffer_type * buffer);
void double_vector_fread( double_vector_type * vector , FILE * stream );
void double_vector_fwrite_data( const double_vector_type * vector , FILE * stream );
void double_vector_fread_data( double_vector_type * vector , int size, FILE * stream);
bool double_vector_equal(const double_vector_type * vector1 , const double_vector_type * vector2);
void double_vector_apply(double_vector_type * vector , double_ftype *func);
int double_vector_count_equal( const double_vector_type * vector , double cmp_value);
int double_vector_element_size( const double_vector_type * vector );
UTIL_SAFE_CAST_HEADER( double_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,48 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_box.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_BOX_H__
#define __ECL_BOX_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <ecl_grid.h>
typedef struct ecl_box_struct ecl_box_type;
void ecl_box_set_size (ecl_box_type * , int , int , int , int , int , int );
ecl_box_type * ecl_box_alloc(const ecl_grid_type * ecl_grid , int i1,int i2 , int j1 , int j2 , int k1, int k2);
void ecl_box_free (ecl_box_type * );
void ecl_box_set_values(const ecl_box_type * , char * , const char * , int );
int ecl_box_get_total_size(const ecl_box_type * );
int ecl_box_get_active_size( const ecl_box_type * ecl_box );
const int * ecl_box_get_active_list( const ecl_box_type * ecl_box );
int ecl_box_get_global_size( const ecl_box_type * ecl_box );
const int * ecl_box_get_global_list( const ecl_box_type * ecl_box );
bool ecl_box_contains(const ecl_box_type * box , int i , int j , int k);
UTIL_IS_INSTANCE_HEADER( ecl_box );
UTIL_SAFE_CAST_HEADER( ecl_box );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,62 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_endian_flip.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_ENDIAN_FLIP_H__
#define __ECL_ENDIAN_FLIP_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
/**
This header file checks if the ECLIPSE endianness and the hardware
endianness are equal, and defines the macro ECL_ENDIAN_FLIP
accordingly.
All the ecl_xxx functions will use the ECL_ENDIAN_FLIP macro to
determine whether the endian flip should be performed. When opening
a fortio instance explicitly you can use the ECL_ENDIAN_FLIP macro
to get the endianness correct (for ECLIPSE usage that is).
*/
#define ECLIPSE_BYTE_ORDER __BIG_ENDIAN // Alternatively: __LITTLE_ENDIAN
#define WIN32 1
#ifdef BYTE_ORDER
#if BYTE_ORDER == ECLIPSE_BYTE_ORDER
#define ECL_ENDIAN_FLIP false
#else
#define ECL_ENDIAN_FLIP true
#endif
#else
#ifdef WIN32
#define ECL_ENDIAN_FLIP true // Unconditional byte flip on Windows.
#else
#error: The macro BYTE_ORDER is not defined?
#endif
#endif
#undef ECLIPSE_BYTE_ORDER
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,114 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_file.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_FILE_H__
#define __ECL_FILE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <time.h>
#include <ecl_kw.h>
#include <ecl_file_kw.h>
#include <fortio.h>
#include <ecl_util.h>
typedef struct ecl_file_struct ecl_file_type;
void ecl_file_load_all( ecl_file_type * ecl_file );
void ecl_file_push_block( ecl_file_type * ecl_file );
void ecl_file_pop_block( ecl_file_type * ecl_file );
ecl_file_type * ecl_file_open( const char * filename );
ecl_file_type * ecl_file_open_writable( const char * filename );
void ecl_file_close( ecl_file_type * ecl_file );
void ecl_file_fortio_detach( ecl_file_type * ecl_file );
void ecl_file_free__(void * arg);
ecl_kw_type * ecl_file_icopy_named_kw( const ecl_file_type * ecl_file , const char * kw, int ith);
ecl_kw_type * ecl_file_icopy_kw( const ecl_file_type * ecl_file , int index);
bool ecl_file_has_kw( const ecl_file_type * ecl_file , const char * kw);
int ecl_file_get_num_named_kw(const ecl_file_type * ecl_file , const char * kw);
int ecl_file_get_size( const ecl_file_type * ecl_file );
int ecl_file_get_num_distinct_kw(const ecl_file_type * ecl_file);
const char * ecl_file_iget_distinct_kw(const ecl_file_type * ecl_file , int index);
const char * ecl_file_get_src_file( const ecl_file_type * ecl_file );
int ecl_file_iget_occurence( const ecl_file_type * ecl_file , int index);
ecl_version_enum ecl_file_get_ecl_version( const ecl_file_type * file );
void ecl_file_fwrite_fortio(const ecl_file_type * ec_file , fortio_type * fortio , int offset);
void ecl_file_fwrite(const ecl_file_type * ecl_file , const char * , bool fmt_file );
void ecl_file_replace_kw( ecl_file_type * ecl_file , ecl_kw_type * old_kw , ecl_kw_type * new_kw , bool insert_copy);
int ecl_file_get_phases( const ecl_file_type * init_file );
void ecl_file_fprintf_kw_list( const ecl_file_type * ecl_file , FILE * stream );
ecl_file_kw_type * ecl_file_iget_file_kw( const ecl_file_type * file , int global_index);
ecl_file_kw_type * ecl_file_iget_named_file_kw( const ecl_file_type * file , const char * kw, int ith);
ecl_kw_type * ecl_file_iget_kw( const ecl_file_type * file , int global_index);
ecl_type_enum ecl_file_iget_type( const ecl_file_type * file , int global_index);
int ecl_file_iget_size( const ecl_file_type * file , int global_index);
const char * ecl_file_iget_header( const ecl_file_type * file , int global_index);
ecl_kw_type * ecl_file_iget_named_kw( const ecl_file_type * file , const char * kw, int ith);
ecl_type_enum ecl_file_iget_named_type( const ecl_file_type * file , const char * kw , int ith);
int ecl_file_iget_named_size( const ecl_file_type * file , const char * kw , int ith);
bool ecl_file_subselect_block( ecl_file_type * ecl_file , const char * kw , int occurence);
bool ecl_file_select_block( ecl_file_type * ecl_file , const char * kw , int occurence);
void ecl_file_select_global( ecl_file_type * ecl_file );
bool ecl_file_writable( const ecl_file_type * ecl_file );
void ecl_file_save_kw( const ecl_file_type * ecl_file , const ecl_kw_type * ecl_kw);
bool ecl_file_has_kw_ptr( const ecl_file_type * ecl_file , const ecl_kw_type * ecl_kw);
/*****************************************************************/
/* R E S T A R T F I L E S */
time_t ecl_file_iget_restart_sim_date( const ecl_file_type * restart_file , int occurence );
int ecl_file_get_restart_index( const ecl_file_type * restart_file , time_t sim_time);
bool ecl_file_has_report_step( const ecl_file_type * ecl_file , int report_step);
bool ecl_file_has_sim_time( const ecl_file_type * ecl_file , time_t sim_time);
bool ecl_file_select_rstblock_sim_time( ecl_file_type * ecl_file , time_t sim_time);
bool ecl_file_select_rstblock_report_step( ecl_file_type * ecl_file , int report_step);
bool ecl_file_iselect_rstblock( ecl_file_type * ecl_file , int seqnum_index );
ecl_file_type * ecl_file_open_rstblock_report_step( const char * filename , int report_step );
ecl_file_type * ecl_file_open_rstblock_sim_time( const char * filename , time_t sim_time);
ecl_file_type * ecl_file_iopen_rstblock( const char * filename , int seqnum_index);
ecl_file_type * ecl_file_open_rstblock_report_step_writable( const char * filename , int report_step );
ecl_file_type * ecl_file_open_rstblock_sim_time_writable( const char * filename , time_t sim_time);
ecl_file_type * ecl_file_iopen_rstblock_writable( const char * filename , int seqnum_index);
/*****************************************************************/
/* SUMMARY FILES */
bool ecl_file_select_smryblock( ecl_file_type * ecl_file , int ministep_nr );
ecl_file_type * ecl_file_open_smryblock( const char * filename , int ministep_nr );
UTIL_IS_INSTANCE_HEADER( ecl_file );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,55 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_file_kw.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_FILE_KW_H__
#define __ECL_FILE_KW_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <ecl_kw.h>
#include <fortio.h>
typedef struct ecl_file_kw_struct ecl_file_kw_type;
typedef struct inv_map_struct inv_map_type;
inv_map_type * inv_map_alloc();
ecl_file_kw_type * inv_map_get_file_kw( inv_map_type * inv_map , const ecl_kw_type * ecl_kw );
void inv_map_free( inv_map_type * map );
ecl_file_kw_type * ecl_file_kw_alloc( const ecl_kw_type * ecl_kw , long offset);
void ecl_file_kw_free( ecl_file_kw_type * file_kw );
void ecl_file_kw_free__( void * arg );
ecl_kw_type * ecl_file_kw_get_kw( ecl_file_kw_type * file_kw , fortio_type * fortio, inv_map_type * inv_map);
ecl_file_kw_type * ecl_file_kw_alloc_copy( const ecl_file_kw_type * src );
const char * ecl_file_kw_get_header( const ecl_file_kw_type * file_kw );
int ecl_file_kw_get_size( const ecl_file_kw_type * file_kw );
ecl_type_enum ecl_file_kw_get_type( const ecl_file_kw_type * file_kw);
bool ecl_file_kw_ptr_eq( const ecl_file_kw_type * file_kw , const ecl_kw_type * ecl_kw);
void ecl_file_kw_replace_kw( ecl_file_kw_type * file_kw , fortio_type * target , ecl_kw_type * new_kw );
void ecl_file_kw_fskip_data( const ecl_file_kw_type * file_kw , fortio_type * fortio);
void ecl_file_kw_inplace_fwrite( ecl_file_kw_type * file_kw , fortio_type * fortio);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,46 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_grav.h' is part of ERT - Ensemble based
Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_GRAV_H__
#define __ECL_GRAV_H__
#ifdef __plusplus
extern "C" {
#endif
#include <ecl_file.h>
#include <ecl_grid.h>
#include <ecl_region.h>
typedef struct ecl_grav_struct ecl_grav_type;
typedef struct ecl_grav_survey_struct ecl_grav_survey_type;
void ecl_grav_free( ecl_grav_type * ecl_grav_config );
ecl_grav_type * ecl_grav_alloc( const ecl_grid_type * ecl_grid, const ecl_file_type * init_file );
ecl_grav_survey_type * ecl_grav_add_survey_FIP( ecl_grav_type * grav , const char * name , const ecl_file_type * restart_file );
ecl_grav_survey_type * ecl_grav_add_survey_PORMOD( ecl_grav_type * grav , const char * name , const ecl_file_type * restart_file );
ecl_grav_survey_type * ecl_grav_add_survey_RPORV( ecl_grav_type * grav , const char * name , const ecl_file_type * restart_file );
double ecl_grav_eval( const ecl_grav_type * grav , const char * base, const char * monitor , ecl_region_type * region , double utm_x, double utm_y , double depth, int phase_mask);
void ecl_grav_new_std_density( ecl_grav_type * grav , ecl_phase_enum phase , double default_density);
void ecl_grav_add_std_density( ecl_grav_type * grav , ecl_phase_enum phase , int pvtnum , double density);
#ifdef __plusplus
}
#endif
#endif

View File

@ -1,47 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_grav.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_GRAV_CALC_H__
#define __ECL_GRAV_CALC_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <ecl_kw.h>
#include <ecl_grid.h>
#include <ecl_file.h>
double ecl_grav_phase_deltag( double utm_x ,
double utm_y ,
double tvd,
const ecl_grid_type * grid,
const ecl_file_type * init_file ,
const ecl_kw_type * sat_kw1,
const ecl_kw_type * rho_kw1,
const ecl_kw_type * porv_kw1,
const ecl_kw_type * sat_kw2,
const ecl_kw_type * rho_kw2,
const ecl_kw_type * porv_kw2);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,161 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_grid.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_GRID_H__
#define __ECL_GRID_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <double_vector.h>
#include <int_vector.h>
#include <stringlist.h>
#include <ecl_kw.h>
typedef double (block_function_ftype) ( const double_vector_type *);
typedef struct ecl_grid_struct ecl_grid_type;
void ecl_grid_get_column_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j, double_vector_type * column);
int ecl_grid_get_global_index_from_xy_top( const ecl_grid_type * ecl_grid , double x , double y);
int ecl_grid_get_global_index_from_xy_bottom( const ecl_grid_type * ecl_grid , double x , double y);
void ecl_grid_get_corner_xyz3(const ecl_grid_type * grid , int i , int j , int k, int corner_nr , double * xpos , double * ypos , double * zpos );
void ecl_grid_get_corner_xyz1(const ecl_grid_type * grid , int global_index , int corner_nr , double * xpos , double * ypos , double * zpos );
double ecl_grid_get_cell_thickness3( const ecl_grid_type * grid , int i , int j , int k);
double ecl_grid_get_cell_thickness1( const ecl_grid_type * grid , int global_index );
double ecl_grid_get_cdepth1(const ecl_grid_type * grid , int global_index);
double ecl_grid_get_cdepth3(const ecl_grid_type * grid , int i, int j , int k);
double ecl_grid_get_depth3(const ecl_grid_type * grid , int i, int j , int k);
int ecl_grid_get_global_index_from_xy( const ecl_grid_type * ecl_grid , int k , bool lower_layer , double x , double y);
bool ecl_grid_cell_contains_xyz1( const ecl_grid_type * ecl_grid , int global_index , double x , double y , double z);
bool ecl_grid_cell_contains_xyz3( const ecl_grid_type * ecl_grid , int i , int j , int k, double x , double y , double z );
double ecl_grid_get_cell_volume1( const ecl_grid_type * ecl_grid, int global_index );
double ecl_grid_get_cell_volume3( const ecl_grid_type * ecl_grid, int i , int j , int k);
bool ecl_grid_cell_contains1(const ecl_grid_type * grid , int global_index , double x , double y , double z);
bool ecl_grid_cell_contains3(const ecl_grid_type * grid , int i , int j ,int k , double x , double y , double z);
int ecl_grid_get_global_index_from_xyz(ecl_grid_type * grid , double x , double y , double z , int start_index);
const char * ecl_grid_get_name( const ecl_grid_type * );
int ecl_grid_get_active_index3(const ecl_grid_type * ecl_grid , int i , int j , int k);
int ecl_grid_get_active_index1(const ecl_grid_type * ecl_grid , int global_index);
bool ecl_grid_cell_active3(const ecl_grid_type * , int , int , int );
bool ecl_grid_cell_active1(const ecl_grid_type * , int);
bool ecl_grid_ijk_valid(const ecl_grid_type * , int , int , int );
int ecl_grid_get_global_index3(const ecl_grid_type * , int , int , int );
int ecl_grid_get_global_index1A(const ecl_grid_type * ecl_grid , int active_index);
ecl_grid_type * ecl_grid_alloc_GRDECL_kw( int nx, int ny , int nz , const ecl_kw_type * zcorn_kw , const ecl_kw_type * coord_kw , const ecl_kw_type * actnum_kw , const ecl_kw_type * mapaxes_kw );
ecl_grid_type * ecl_grid_alloc_GRDECL_data(int , int , int , const float * , const float * , const int * , const float * mapaxes);
ecl_grid_type * ecl_grid_alloc_GRID_data(int num_coords , int nx, int ny , int nz , int coords_size , int ** coords , float ** corners , const float * mapaxes);
ecl_grid_type * ecl_grid_alloc(const char * );
ecl_grid_type * ecl_grid_load_case( const char * case_input );
ecl_grid_type * ecl_grid_alloc_rectangular( int nx , int ny , int nz , double dx , double dy , double dz , const int * actnum);
ecl_grid_type * ecl_grid_alloc_regular( int nx, int ny , int nz , const double * ivec, const double * jvec , const double * kvec , const int * actnum);
bool ecl_grid_exists( const char * case_input );
char * ecl_grid_alloc_case_filename( const char * case_input );
void ecl_grid_free(ecl_grid_type * );
void ecl_grid_free__( void * arg );
void ecl_grid_get_dims(const ecl_grid_type * , int *, int * , int * , int *);
int ecl_grid_get_nz( const ecl_grid_type * grid );
int ecl_grid_get_nx( const ecl_grid_type * grid );
int ecl_grid_get_ny( const ecl_grid_type * grid );
int ecl_grid_get_nactive( const ecl_grid_type * grid );
int ecl_grid_get_active_index(const ecl_grid_type * , int , int , int );
void ecl_grid_summarize(const ecl_grid_type * );
void ecl_grid_get_ijk1(const ecl_grid_type * , int global_index , int *, int * , int *);
void ecl_grid_get_ijk1A(const ecl_grid_type * , int active_index, int *, int * , int *);
void ecl_grid_get_ijk_from_active_index(const ecl_grid_type *, int , int *, int * , int * );
void ecl_grid_get_xyz3(const ecl_grid_type * , int , int , int , double * , double * , double *);
void ecl_grid_get_xyz1(const ecl_grid_type * grid , int global_index , double *xpos , double *ypos , double *zpos);
void ecl_grid_get_xyz1A(const ecl_grid_type * grid , int active_index , double *xpos , double *ypos , double *zpos);
int ecl_grid_get_global_size( const ecl_grid_type * ecl_grid );
bool ecl_grid_compare(const ecl_grid_type * g1 , const ecl_grid_type * g2 , bool include_lgr);
int ecl_grid_get_active_size( const ecl_grid_type * ecl_grid );
double ecl_grid_get_bottom1(const ecl_grid_type * grid , int global_index);
double ecl_grid_get_bottom3(const ecl_grid_type * grid , int i, int j , int k);
double ecl_grid_get_bottom1A(const ecl_grid_type * grid , int active_index);
double ecl_grid_get_top1(const ecl_grid_type * grid , int global_index);
double ecl_grid_get_top3(const ecl_grid_type * grid , int i, int j , int k);
double ecl_grid_get_top1A(const ecl_grid_type * grid , int active_index);
double ecl_grid_get_top2(const ecl_grid_type * grid , int i, int j);
double ecl_grid_get_bottom2(const ecl_grid_type * grid , int i, int j);
int ecl_grid_locate_depth( const ecl_grid_type * grid , double depth , int i , int j );
void ecl_grid_alloc_blocking_variables(ecl_grid_type * , int );
void ecl_grid_init_blocking(ecl_grid_type * );
double ecl_grid_block_eval3d(ecl_grid_type * grid , int i, int j , int k ,block_function_ftype * blockf );
int ecl_grid_get_block_count3d(const ecl_grid_type * ecl_grid , int i , int j, int k);
bool ecl_grid_block_value_3d(ecl_grid_type * , double , double ,double , double);
bool ecl_grid_cell_invalid1(const ecl_grid_type * ecl_grid , int global_index);
bool ecl_grid_cell_invalid3(const ecl_grid_type * ecl_grid , int i , int j , int k);
double ecl_grid_cell_invalid1A(const ecl_grid_type * grid , int active_index);
void ecl_grid_dump(const ecl_grid_type * grid , FILE * stream);
void ecl_grid_dump_ascii(const ecl_grid_type * grid , bool active_only , FILE * stream);
/* lgr related functions */
const ecl_grid_type * ecl_grid_get_cell_lgr3(const ecl_grid_type * grid , int i, int j , int k);
const ecl_grid_type * ecl_grid_get_cell_lgr1A(const ecl_grid_type * grid , int active_index);
const ecl_grid_type * ecl_grid_get_cell_lgr1(const ecl_grid_type * grid , int global_index );
int ecl_grid_get_num_lgr(const ecl_grid_type * main_grid );
int ecl_grid_get_grid_nr( const ecl_grid_type * ecl_grid );
ecl_grid_type * ecl_grid_iget_lgr(const ecl_grid_type * main_grid , int lgr_nr);
ecl_grid_type * ecl_grid_get_lgr(const ecl_grid_type * main_grid, const char * __lgr_name);
bool ecl_grid_has_lgr(const ecl_grid_type * main_grid, const char * __lgr_name);
stringlist_type * ecl_grid_alloc_lgr_name_list(const ecl_grid_type * ecl_grid);
int ecl_grid_get_parent_cell1( const ecl_grid_type * grid , int global_index);
int ecl_grid_get_parent_cell3( const ecl_grid_type * grid , int i , int j , int k);
const ecl_grid_type * ecl_grid_get_global_grid( const ecl_grid_type * grid );
bool ecl_grid_is_lgr( const ecl_grid_type * ecl_grid );
double ecl_grid_get_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k);
float ecl_grid_get_float_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k);
double ecl_grid_get_double_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k);
int ecl_grid_get_int_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k);
void ecl_grid_grdecl_fprintf_kw( const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , FILE * stream , double double_default);
bool ecl_grid_test_lgr_consistency( const ecl_grid_type * ecl_grid );
void ecl_grid_fwrite_EGRID( const ecl_grid_type * grid , const char * filename);
void ecl_grid_fwrite_GRID( const ecl_grid_type * grid , const char * filename);
void ecl_grid_fprintf_grdecl( const ecl_grid_type * grid , FILE * stream );
void ecl_grid_fwrite_EGRID_header( int dims[3] , const float mapaxes[6], fortio_type * fortio);
float * ecl_grid_alloc_coord_data( const ecl_grid_type * grid );
ecl_kw_type * ecl_grid_alloc_coord_kw( const ecl_grid_type * grid );
float * ecl_grid_alloc_zcorn_data( const ecl_grid_type * grid );
ecl_kw_type * ecl_grid_alloc_zcorn_kw( const ecl_grid_type * grid );
int * ecl_grid_alloc_actnum_data( const ecl_grid_type * grid );
ecl_kw_type * ecl_grid_alloc_actnum_kw( const ecl_grid_type * grid );
ecl_kw_type * ecl_grid_alloc_hostnum_kw( const ecl_grid_type * grid );
ecl_kw_type * ecl_grid_alloc_gridhead_kw( int nx, int ny , int nz , int grid_nr);
void ecl_grid_ri_export( const ecl_grid_type * ecl_grid , double * ri_points);
void ecl_grid_cell_ri_export( const ecl_grid_type * ecl_grid , int global_index , double * ri_points);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,46 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_grid_cache.h' is part of ERT - Ensemble based
Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_GRID_CACHE_H__
#define __ECL_GRID_CACHE_H__
#include <ecl_grid.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ecl_grid_cache_struct ecl_grid_cache_type;
ecl_grid_cache_type * ecl_grid_cache_alloc( const ecl_grid_type * grid );
int ecl_grid_cache_get_size( const ecl_grid_cache_type * grid_cache );
int ecl_grid_cache_iget_global_index( const ecl_grid_cache_type * grid_cache , int active_index);
const int * ecl_grid_cache_get_global_index( const ecl_grid_cache_type * grid_cache );
const double * ecl_grid_cache_get_xpos( const ecl_grid_cache_type * grid_cache );
const double * ecl_grid_cache_get_ypos( const ecl_grid_cache_type * grid_cache );
const double * ecl_grid_cache_get_zpos( const ecl_grid_cache_type * grid_cache );
void ecl_grid_cache_free( ecl_grid_cache_type * grid_cache );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,77 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_INTEHEAD.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_INTEHEAD_H__
#define __ECL_INTEHEAD_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include <ecl_kw.h>
#define INTEHEAD_KW "INTEHEAD" /* Long array with lots of data. */
typedef struct {
int day;
int year;
int month;
time_t sim_time;
int version; // 100, 300, 500 (Eclipse300-Thermal)
int phase_sum; // Oil = 1 Gas = 2 Water = 4
int nx;
int ny;
int nz;
int nactive;
/*-----------------------------------------------------------------*/
/* All fields below the line are taken literally (apart from
lowercasing) from the section about restart files in the
ECLIPSE File Formats Reference Manual. The elements typically
serve as dimensions in the ?WEL, ?SEG and ?CON arrays.
*/
// Pure well properties
int nwells; // Number of wells
int niwelz; // Number of elements pr well in IWEL array
int nzwelz; // Number of 8 character words pr well in ZWEL array
// Connection properties
int niconz; // Number of elements per completion in ICON array
int ncwmax; // Maximum number of completions per well
// Segment properties
int nisegz; // Number of entries pr segment in the ISEG array
int nsegmx; // The maximum number of segments pr well
int nswlmx; // The maximum number of segmented wells
int nlbrmx; // The maximum number of lateral branches pr well
int nilbrz; // The number of entries pr segment in ILBR array
} ecl_intehead_type;
void ecl_intehead_free( ecl_intehead_type * intehead );
ecl_intehead_type * ecl_intehead_alloc( const ecl_kw_type * intehead_kw );
time_t ecl_intehead_date( const ecl_kw_type * intehead_kw );
void ecl_intehead_fprintf( const ecl_intehead_type * header , FILE * stream);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,41 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_io_config.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_IO_CONFIG_H__
#define __ECL_IO_CONFIG_H__
typedef struct ecl_io_config_struct ecl_io_config_type;
/* Modifiers */
void ecl_io_config_set_formatted(ecl_io_config_type *, bool );
void ecl_io_config_set_unified_restart(ecl_io_config_type *, bool );
void ecl_io_config_set_unified_summary(ecl_io_config_type *, bool );
/* Accesors */
bool ecl_io_config_get_formatted(ecl_io_config_type *);
bool ecl_io_config_get_unified_restart(ecl_io_config_type *);
bool ecl_io_config_get_unified_summary(ecl_io_config_type *);
/* Allocater & destructor */
ecl_io_config_type * ecl_io_config_alloc(bool ,bool ,bool);
void ecl_io_config_free(ecl_io_config_type * );
#endif

View File

@ -1,225 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_kw.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_KW_H__
#define __ECL_KW_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <buffer.h>
#include <fortio.h>
#include <ecl_util.h>
UTIL_IS_INSTANCE_HEADER(ecl_kw);
typedef struct ecl_kw_struct ecl_kw_type;
size_t ecl_kw_fortio_size( const ecl_kw_type * ecl_kw );
void * ecl_kw_get_ptr(const ecl_kw_type *ecl_kw);
void ecl_kw_set_data_ptr(ecl_kw_type * ecl_kw , void * data);
void ecl_kw_fwrite_data(const ecl_kw_type *_ecl_kw , fortio_type *fortio);
void ecl_kw_fread_realloc_data(ecl_kw_type *ecl_kw, fortio_type *fortio);
ecl_type_enum ecl_kw_get_type(const ecl_kw_type *);
const char * ecl_kw_get_header8(const ecl_kw_type *);
const char * ecl_kw_get_header(const ecl_kw_type * ecl_kw );
ecl_kw_type * ecl_kw_alloc_empty();
bool ecl_kw_fread_header(ecl_kw_type *, fortio_type *);
void ecl_kw_set_header_name(ecl_kw_type * , const char * );
void ecl_kw_set_header(ecl_kw_type * , const char * , int , const char *);
void ecl_kw_set_header_alloc(ecl_kw_type * , const char * , int , const char *);
bool ecl_kw_fseek_kw(const char * , bool , bool , fortio_type *);
bool ecl_kw_fseek_last_kw(const char * , bool , fortio_type *);
void ecl_kw_inplace_update_file(const ecl_kw_type * , const char * , int ) ;
void ecl_kw_fskip(fortio_type *);
void ecl_kw_alloc_data(ecl_kw_type *);
void ecl_kw_alloc_double_data(ecl_kw_type * ecl_kw , double * values);
void ecl_kw_alloc_float_data(ecl_kw_type * ecl_kw , float * values);
bool ecl_kw_fread_realloc(ecl_kw_type *, fortio_type *);
void ecl_kw_fread(ecl_kw_type * , fortio_type * );
ecl_kw_type * ecl_kw_fread_alloc(fortio_type *);
void ecl_kw_free_data(ecl_kw_type *);
void ecl_kw_free(ecl_kw_type *);
void ecl_kw_free__(void *);
ecl_kw_type * ecl_kw_alloc_copy (const ecl_kw_type *);
const void * ecl_kw_copyc__(const void *);
ecl_kw_type * ecl_kw_alloc_slice_copy( const ecl_kw_type * src, int index1, int index2, int stride);
//void * ecl_kw_get_data_ref(const ecl_kw_type *);
void * ecl_kw_alloc_data_copy(const ecl_kw_type * );
void ecl_kw_memcpy(ecl_kw_type *, const ecl_kw_type *);
void ecl_kw_get_memcpy_data(const ecl_kw_type *, void *);
void ecl_kw_get_memcpy_float_data(const ecl_kw_type *ecl_kw , float *target);
void ecl_kw_get_memcpy_double_data(const ecl_kw_type *ecl_kw , double *target);
void ecl_kw_get_memcpy_int_data(const ecl_kw_type *ecl_kw , int *target);
void ecl_kw_set_memcpy_data(ecl_kw_type * , const void *);
void ecl_kw_fwrite(const ecl_kw_type *, fortio_type *);
void ecl_kw_iget(const ecl_kw_type *, int , void *);
void ecl_kw_iset(ecl_kw_type *ecl_kw , int i , const void *iptr);
void ecl_kw_iset_char_ptr( ecl_kw_type * ecl_kw , int index, const char * s);
void ecl_kw_iset_string8(ecl_kw_type * ecl_kw , int index , const char *s8);
const char * ecl_kw_iget_char_ptr( const ecl_kw_type * ecl_kw , int i);
void * ecl_kw_iget_ptr(const ecl_kw_type *, int);
int ecl_kw_get_size(const ecl_kw_type *);
bool ecl_kw_ichar_eq(const ecl_kw_type *, int , const char *);
ecl_kw_type * ecl_kw_alloc( const char * header , int size , ecl_type_enum ecl_type );
ecl_kw_type * ecl_kw_alloc_new(const char * , int , ecl_type_enum , const void * );
ecl_kw_type * ecl_kw_alloc_new_shared(const char * , int , ecl_type_enum , void * );
void ecl_kw_fwrite_param(const char * , bool , const char * , ecl_type_enum , int , void * );
void ecl_kw_fwrite_param_fortio(fortio_type *, const char * , ecl_type_enum , int , void * );
void ecl_kw_summarize(const ecl_kw_type * ecl_kw);
void ecl_kw_fread_double_param(const char * , bool , double *);
float ecl_kw_iget_as_float(const ecl_kw_type * ecl_kw , int i);
double ecl_kw_iget_as_double(const ecl_kw_type * ecl_kw , int i);
void ecl_kw_get_data_as_double(const ecl_kw_type *, double *);
void ecl_kw_get_data_as_float(const ecl_kw_type * ecl_kw , float * float_data);
bool ecl_kw_equal(const ecl_kw_type *ecl_kw1, const ecl_kw_type *ecl_kw2);
bool ecl_kw_block_equal( const ecl_kw_type * ecl_kw1 , const ecl_kw_type * ecl_kw2 , int cmp_elements);
bool ecl_kw_data_equal( const ecl_kw_type * ecl_kw , const void * data);
void ecl_kw_fskip_data__( ecl_type_enum ecl_type , int size , fortio_type * fortio);
void ecl_kw_fskip_data(ecl_kw_type *ecl_kw, fortio_type *fortio);
void ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio);
void ecl_kw_fskip_header( fortio_type * fortio);
bool ecl_kw_is_grdecl_file(FILE * );
bool ecl_kw_is_kw_file(FILE * , bool );
double ecl_kw_element_sum_float( const ecl_kw_type * ecl_kw );
void ecl_kw_inplace_inv(ecl_kw_type * my_kw);
void ecl_kw_element_sum(const ecl_kw_type * , void * );
void ecl_kw_max_min(const ecl_kw_type * , void * , void *);
void * ecl_kw_get_void_ptr(const ecl_kw_type * ecl_kw);
ecl_kw_type * ecl_kw_buffer_alloc(buffer_type * buffer);
void ecl_kw_buffer_store(const ecl_kw_type * ecl_kw , buffer_type * buffer);
void ecl_kw_fprintf_data( const ecl_kw_type * ecl_kw , const char * fmt , FILE * stream);
void ecl_kw_memcpy_data( ecl_kw_type * target , const ecl_kw_type * src);
bool ecl_kw_assert_numeric( const ecl_kw_type * kw );
bool ecl_kw_assert_binary( const ecl_kw_type * kw1, const ecl_kw_type * kw2);
void ecl_kw_scalar_set_bool( ecl_kw_type * ecl_kw , bool bool_value);
void ecl_kw_scalar_set__(ecl_kw_type * ecl_kw , const void * value);
void ecl_kw_scalar_set_float_or_double( ecl_kw_type * ecl_kw , double value );
#define ECL_KW_SCALAR_SET_TYPED_HEADER( ctype ) void ecl_kw_scalar_set_ ## ctype( ecl_kw_type * ecl_kw , ctype value);
ECL_KW_SCALAR_SET_TYPED_HEADER( int )
ECL_KW_SCALAR_SET_TYPED_HEADER( float )
ECL_KW_SCALAR_SET_TYPED_HEADER( double )
#undef ECL_KW_SCALAR_SET_TYPED_HEADER
ecl_kw_type * ecl_kw_alloc_scatter_copy( const ecl_kw_type * src_kw , int target_size , const int * mapping, void * def_value);
void ecl_kw_inplace_add( ecl_kw_type * target_kw , const ecl_kw_type * add_kw);
void ecl_kw_inplace_sub( ecl_kw_type * target_kw , const ecl_kw_type * sub_kw);
void ecl_kw_inplace_div( ecl_kw_type * target_kw , const ecl_kw_type * div_kw);
void ecl_kw_inplace_mul( ecl_kw_type * target_kw , const ecl_kw_type * mul_kw);
void ecl_kw_inplace_add_indexed( ecl_kw_type * target_kw , const int_vector_type * index_set , const ecl_kw_type * add_kw);
void ecl_kw_inplace_sub_indexed( ecl_kw_type * target_kw , const int_vector_type * index_set , const ecl_kw_type * sub_kw);
void ecl_kw_inplace_mul_indexed( ecl_kw_type * target_kw , const int_vector_type * index_set , const ecl_kw_type * mul_kw);
void ecl_kw_inplace_div_indexed( ecl_kw_type * target_kw , const int_vector_type * index_set , const ecl_kw_type * div_kw);
void ecl_kw_copy_indexed( ecl_kw_type * target_kw , const int_vector_type * index_set , const ecl_kw_type * src_kw);
bool ecl_kw_assert_binary_numeric( const ecl_kw_type * kw1, const ecl_kw_type * kw2);
#define ECL_KW_ASSERT_TYPED_BINARY_OP_HEADER( ctype ) bool ecl_kw_assert_binary_ ## ctype( const ecl_kw_type * kw1 , const ecl_kw_type * kw2)
ECL_KW_ASSERT_TYPED_BINARY_OP_HEADER( int );
ECL_KW_ASSERT_TYPED_BINARY_OP_HEADER( float );
ECL_KW_ASSERT_TYPED_BINARY_OP_HEADER( double );
#undef ECL_KW_ASSERT_TYPED_BINARY_OP_HEADER
#define ECL_KW_SCALE_TYPED_HEADER( ctype ) void ecl_kw_scale_ ## ctype (ecl_kw_type * ecl_kw , ctype scale_factor)
ECL_KW_SCALE_TYPED_HEADER( int );
ECL_KW_SCALE_TYPED_HEADER( float );
ECL_KW_SCALE_TYPED_HEADER( double );
#undef ECL_KW_SCALE_TYPED_HEADER
void ecl_kw_scale_float_or_double( ecl_kw_type * ecl_kw , double scale_factor );
#define ECL_KW_SHIFT_TYPED_HEADER( ctype ) void ecl_kw_shift_ ## ctype (ecl_kw_type * ecl_kw , ctype shift_factor)
ECL_KW_SHIFT_TYPED_HEADER( int );
ECL_KW_SHIFT_TYPED_HEADER( float );
ECL_KW_SHIFT_TYPED_HEADER( double );
#undef ECL_KW_SHIFT_TYPED_HEADER
void ecl_kw_shift_float_or_double( ecl_kw_type * ecl_kw , double shift_value );
#define ECL_KW_IGET_TYPED_HEADER(type) type ecl_kw_iget_ ## type(const ecl_kw_type * , int)
ECL_KW_IGET_TYPED_HEADER(double);
ECL_KW_IGET_TYPED_HEADER(float);
ECL_KW_IGET_TYPED_HEADER(int);
#undef ECL_KW_IGET_TYPED_HEADER
bool ecl_kw_iget_bool( const ecl_kw_type * ecl_kw , int i );
#define ECL_KW_ISET_TYPED_HEADER(type) void ecl_kw_iset_ ## type(ecl_kw_type * , int , type )
ECL_KW_ISET_TYPED_HEADER(double);
ECL_KW_ISET_TYPED_HEADER(float);
ECL_KW_ISET_TYPED_HEADER(int);
#undef ECL_KW_ISET_TYPED_HEADER
void ecl_kw_iset_bool( ecl_kw_type * ecl_kw , int i , bool bool_value);
#define ECL_KW_GET_TYPED_PTR_HEADER(type) type * ecl_kw_get_ ## type ## _ptr(const ecl_kw_type *)
ECL_KW_GET_TYPED_PTR_HEADER(double);
ECL_KW_GET_TYPED_PTR_HEADER(float);
ECL_KW_GET_TYPED_PTR_HEADER(int);
ECL_KW_GET_TYPED_PTR_HEADER(bool);
#undef ECL_KW_GET_TYPED_PTR_HEADER
#define ECL_KW_SET_INDEXED_HEADER(ctype ) void ecl_kw_set_indexed_ ## ctype( ecl_kw_type * ecl_kw, const int_vector_type * index_list , ctype value)
ECL_KW_SET_INDEXED_HEADER( double );
ECL_KW_SET_INDEXED_HEADER( float );
ECL_KW_SET_INDEXED_HEADER( int );
#undef ECL_KW_SET_INDEXED_HEADER
#define ECL_KW_SHIFT_INDEXED_HEADER(ctype) void ecl_kw_shift_indexed_ ## ctype( ecl_kw_type * ecl_kw, const int_vector_type * index_list , ctype shift)
ECL_KW_SHIFT_INDEXED_HEADER( int );
ECL_KW_SHIFT_INDEXED_HEADER( float );
ECL_KW_SHIFT_INDEXED_HEADER( double );
#undef ECL_KW_SHIFT_INDEXED_HEADER
#define ECL_KW_SCALE_INDEXED_HEADER(ctype) void ecl_kw_scale_indexed_ ## ctype( ecl_kw_type * ecl_kw, const int_vector_type * index_list , ctype scale)
ECL_KW_SCALE_INDEXED_HEADER( int );
ECL_KW_SCALE_INDEXED_HEADER( float );
ECL_KW_SCALE_INDEXED_HEADER( double );
#undef ECL_KW_SCALE_INDEXED_HEADER
#define ECL_KW_MAX_MIN_HEADER( ctype ) void ecl_kw_max_min_ ## ctype( const ecl_kw_type * ecl_kw , ctype * _max , ctype * _min)
ECL_KW_MAX_MIN_HEADER( int );
ECL_KW_MAX_MIN_HEADER( float );
ECL_KW_MAX_MIN_HEADER( double );
#undef ECL_KW_MAX_MIN_HEADER
#include <ecl_kw_grdecl.h>
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,56 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_kw_grdecl.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
/*
This header does not define datatypes; just a couple of functions. It should
be included from the ecl_kw.h header, so applications do not need to include this
header explicitly.
*/
#ifndef __ECL_KW_GRDECL_H__
#define __ECL_KW_GRDECL_H__
#ifdef __cplusplus
extern "C" {
#endif
bool ecl_kw_grdecl_fseek_kw(const char * , bool , FILE * );
ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic__( FILE * stream , const char * kw , bool strict , ecl_type_enum ecl_type);
ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic( FILE * stream , const char * kw , ecl_type_enum ecl_type);
ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data__(FILE * stream , bool strict , int size, ecl_type_enum ecl_type );
ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data( FILE * stream , int size , ecl_type_enum ecl_type);
ecl_kw_type * ecl_kw_fscanf_alloc_grdecl__(FILE * stream, const char * kw , bool strict , int size, ecl_type_enum ecl_type);
ecl_kw_type * ecl_kw_fscanf_alloc_grdecl(FILE * stream , const char * kw, int size, ecl_type_enum ecl_type);
ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl__( FILE * stream , bool strict , ecl_type_enum ecl_type);
ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl( FILE * stream , ecl_type_enum ecl_type);
bool ecl_kw_grdecl_fseek_next_kw( FILE * stream );
char * ecl_kw_grdecl_alloc_next_header( FILE * stream );
void ecl_kw_fprintf_grdecl(const ecl_kw_type * ecl_kw , FILE * stream);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,318 +0,0 @@
#ifndef __ECL_KW_MAGIC_H__
#define __ECL_KW_MAGIC_H__
#ifdef __cplusplus
extern "C" {
#endif
/*
This header file contains names and indices of ECLIPSE keywords
which have special significance in various files. Observe that many
of the keywords like e.g. INTEHEAD occur in many different file
types, with partly overlapping layout and values.
*/
/*****************************************************************/
/* INIT files: */
/*****************************************************************/
#define PORO_KW "PORO"
#define PORV_KW "PORV"
#define AQUIFER_KW "AQUIFERN"
#define INTEHEAD_KW "INTEHEAD"
#define LOGIHEAD_KW "LOGIHEAD"
#define DOUBHEAD_KW "DOUBHEAD"
#define RPORV_KW "RPORV"
#define PORV_KW "PORV"
#define PORMOD_KW "PORV_MOD"
#define PVTNUM_KW "PVTNUM"
/*
Observe that many of the elements in the INTEHEAD keyword is shared
between the restart and init files. The ones listed below here are
in both the INIT and the restart files. In addition the restart
files have many well related items which are only in the restart
files.
*/
#define INTEHEAD_UNIT_INDEX 2
#define INTEHEAD_NX_INDEX 8
#define INTEHEAD_NY_INDEX 9
#define INTEHEAD_NZ_INDEX 10
#define INTEHEAD_NACTIVE_INDEX 11
#define INTEHEAD_PHASE_INDEX 14
#define INTEHEAD_DAY_INDEX 64
#define INTEHEAD_MONTH_INDEX 65
#define INTEHEAD_YEAR_INDEX 66
#define INTEHEAD_IPROG_INDEX 94
#define INTEHEAD_METRIC_VALUE 1
#define INTEHEAD_ECLIPSE100_VALUE 100
#define INTEHEAD_ECLIPSE300_VALUE 300
#define INTEHEAD_ECLIPSE300THERMAL_VALUE 500
#define INTEHEAD_INIT_SIZE 95
#define INTEHEAD_RESTART_SIZE 180
#define LOGIHEAD_ECLIPSE300_RADIAL_INDEX 3
#define LOGIHEAD_ECLIPSE100_RADIAL_INDEX 4
#define LOGIHEAD_DUALP_INDEX 14
#define LOGIHEAD_INIT_SIZE 80
#define LOGIHEAD_RESTART_SIZE 15
#define LOGIHEAD_RS_INDEX 0
#define LOGIHEAD_RV_INDEX 1
#define LOGIHEAD_DIR_RELPERM_INDEX 2
/*-----------------------------------------------------------------*/
#define LOGIHEAD_REV_RELPERM100_INDEX 3 /* The indices for reversible relperm and */
#define LOGIHEAD_RADIAL100_INDEX 4 /* use of radial grids is interchanged between */
#define LOGIHEAD_REV_RELPERM300_INDEX 4 /* ECLIPSE100 and ECLIPSE300. */
#define LOGIHEAD_RADIAL300_INDEX 3
/*-----------------------------------------------------------------*/
#define LOGIHEAD_HYSTERISIS_INDEX 6
#define LOGIHEAD_DUALP_INDEX 14
#define LOGIHEAD_ENDPOINT_SCALING_INDEX 16
#define LOGIHEAD_DIR_ENDPOINT_SCALING_INDEX 17
#define LOGIHEAD_REV_ENDPOINT_SCALING_INDEX 18
#define LOGIHEAD_ALT_ENDPOINT_SCALING_INDEX 19
#define LOGIHEAD_MISC_DISPLACEMENT_INDEX 35
#define LOGIHEAD_SCALE_WATER_PC_AT_MAX_SAT_INDEX 55
#define LOGIHEAD_SCALE_GAS_PC_AT_MAX_SAT_INDEX 56
#define DOUBHEAD_INIT_SIZE 1
#define DOUBHEAD_RESTART_SIZE 1
/*****************************************************************/
/* RESTART files: */
/*****************************************************************/
#define SEQNUM_KW "SEQNUM" /* Contains the report step as the only data; not
present in non-unified files, where the report
step must be inferred from the filename. */
#define STARTSOL_KW "STARTSOL"
#define ENDSOL_KW "ENDSOL"
#define IWEL_KW "IWEL"
#define ZWEL_KW "ZWEL"
#define ICON_KW "ICON"
#define ISEG_KW "ISEG"
#define ECLIPSE100_OIL_DEN_KW "OIL_DEN"
#define ECLIPSE100_GAS_DEN_KW "GAS_DEN"
#define ECLIPSE100_WATER_DEN_KW "WAT_DEN"
#define ECLIPSE300_OIL_DEN_KW "DENO"
#define ECLIPSE300_GAS_DEN_KW "DENG"
#define ECLIPSE300_WATER_DEN_KW "DENW"
#define FIPGAS_KW "FIPGAS"
#define FIPWAT_KW "FIPWAT"
#define FIPOIL_KW "FIPOIL"
#define RFIPGAS_KW "RFIPGAS"
#define RFIPWAT_KW "RFIPWAT"
#define RFIPOIL_KW "RFIPOIL"
#define INTEHEAD_NWELLS_INDEX 16 // Number of wells
#define INTEHEAD_NIWELZ_INDEX 24 // Number of elements pr. well in the IWEL array.
#define INTEHEAD_NZWELZ_INDEX 27 // Number of 8 character words pr. well
#define INTEHEAD_NCWMAX_INDEX 17 // Maximum number of completions per well
#define INTEHEAD_NWGMAX_INDEX 19 // Maximum number of wells in any group
#define INTEHEAD_NGMAXZ_INDEX 20 // Maximum number of groups in field
#define INTEHEAD_NICONZ_INDEX 32 // Number of elements pr completion in the ICON arra.y
#define INTEHEAD_NIGRPZ_INDEX 36 // Number of elements pr group in the IGRP array.
#define INTEHEAD_NSWLMX_INDEX 175
#define INTEHEAD_NSEGMX_INDEX 176
#define INTEHEAD_NLBRMX_INDEX 177
#define INTEHEAD_NISEGZ_INDEX 178
#define INTEHEAD_NILBRZ_INDEX 180
#define DOUBHEAD_DAYS_INDEX 0
/*****************************************************************/
/* Summary files */
/*****************************************************************/
/* Summary header file */
#define MINISTEP_KW "MINISTEP"
#define STARTDAT_KW "STARTDAT" /* Intgere keyword containing day,month,year. */
#define WGNAMES_KW "WGNAMES" /* The names of wells/groups for the summary vectors. */
#define KEYWORDS_KW "KEYWORDS" /* The variable type for the various summary vectors. */
#define UNITS_KW "UNITS" /* The units, i.e SM^3/DAY the summary vectors. */
#define DIMENS_KW "DIMENS" /* The dimensions of the grid - also used in the GRID files. */
#define NUMS_KW "NUMS" /* Extra numeric qualifiers for the summary variables, like cell number. */
#define LGRS_KW "LGRS" /* The lgr name for a vector originating from an lgr. */
#define NUMLX_KW "NUMLX" /* For block variables defined in a an lgr this is i coordinate in the lgr. */
#define NUMLY_KW "NUMLY" /* ... j coordinate in the lgr. */
#define NUMLZ_KW "NUMLZ" /* ... k coordinate in the lgr. */
/* Magic indices used to locate day,month,year from the STARTDAT keyword. */
#define STARTDAT_DAY_INDEX 0
#define STARTDAT_MONTH_INDEX 1
#define STARTDAT_YEAR_INDEX 2
#define STARTDAT_SIZE 3
/* Magic indices uset to locate the grid dimensions from the DIMENS
keyword in the SMSPEC files. Observe that these magic indices
differ from the magic indices used to look up grid dimensions from
the DIMENS keyword in GRID files. */
#define DIMENS_SMSPEC_SIZE_INDEX 0
#define DIMENS_SMSPEC_NX_INDEX 1
#define DIMENS_SMSPEC_NY_INDEX 2
#define DIMENS_SMSPEC_NZ_INDEX 3
#define DIMENS_SIZE 6 // Do not know what the two last items are?
/* Summary data files: */
#define SEQHDR_KW "SEQHDR" // Contains a single 'magic' integer - not used in libecl.
#define PARAMS_KW "PARAMS" // Contains the actual summary data for one timestep.
#define MINISTEP_KW "MINISTEP" // Scalar integer - contains the timestep number.
#define SEQHDR_SIZE 1
#define RESTART_KW "RESTART"
#define SUMMARY_RESTART_SIZE 8
/*
There are no magic indices in the summary data files, for all
interesting data the table created from the ecl_smspec file must be
consulted.
*/
/*****************************************************************/
/* RFT Files */
/*****************************************************************/
/* The files with extension .RFT can contain three quite different
types of information: RFT / PLT / SEGMENT, this is indicated by an
element of the WELLETC keyword. The keywords below are organized in
common keywords, keywords for RFTs and keywords for PLTs. The
special information for SEGMENT data is not internalized at all,
and there are also several additional keywords for the PLTs which
are not internalized. */
/* Common keywords */
#define TIME_KW "TIME" /* The days since simulation start when
an RFT is performed, also used as
block header when splitting an RFT
file into different wells and timesteps. */
#define DATE_KW "DATE" /* The date of an RFT as integers: (day,month,year). */
#define WELLETC_KW "WELLETC" /* The type of date RFT|PLT|SEGMENT and well name are
extracted from this keyword. */
#define CONIPOS_KW "CONIPOS" /* The i-index of the connections in the well. */
#define CONJPOS_KW "CONJPOS" /* The j-index ... */
#define CONKPOS_KW "CONKPOS" /* The k-index ... */
/* RFT keywords */
#define SWAT_KW "SWAT" /* The kewyord containing SWAT. */
#define SGAS_KW "SGAS" /* The kewyord containing SGAS. */
#define PRESSURE_KW "PRESSURE" /* The kewyord containing PRESSURE. */
#define DEPTH_KW "DEPTH" /* The depth of the connection. */
/* PLT keywords */
#define CONDEPTH_KW "CONDEPTH" /* The depth of the connection. */
#define CONWRAT_KW "CONWRAT" /* Water rate in a connection. */
#define CONGRAT_KW "CONGRAT" /* Gas ... */
#define CONORAT_KW "CONORAT" /* Oil ... */
#define CONPRES_KW "CONPRES" /* Pressure ... */
#define WELLETC_TYPE_INDEX 5 /* At this keyword the WELLETC keyword contains a string
containing 'R', 'P' , or 'S' for RFT, PLT or SEGMENT data
respectively.*/
#define WELLETC_NAME_INDEX 1 /* The name of well being investigated is on this index of
the WELLETC keyword. */
/* Magic indices used to get day,month,year from the DATE
keyword. */
#define DATE_DAY_INDEX 0
#define DATE_MONTH_INDEX 1
#define DATE_YEAR_INDEX 2
/*****************************************************************/
/* GRID and EGRID files. */
/*****************************************************************/
/* GRID and EGRID files have very different structure, and only a few
keywords are shared. */
/* Common keywords */
#define SPECGRID_KW "SPECGRID"
#define SPECGRID_NX_INDEX 0
#define SPECGRID_NY_INDEX 1
#define SPECGRID_NZ_INDEX 2
#define MAPAXES_KW "MAPAXES" /* Keyword used to transform from grid coordinates to
world coordinates. */
#define LGR_KW "LGR" /* Name of LGR; for GRID files it can contain two elements,
the second element will be the name of the parent. */
#define MAPUNITS_KW "MAPUNITS"
#define GRIDUNIT_KW "GRIDUNIT"
/* EGRID keywords */
#define LGR_PARENT_KW "LGRPARNT" /* The name of the parent for an LGR. */
#define COORDS_KW "COORDS" /* The (x,y) coordinates of the top and bottom of the pillars constituting the grid. */
#define ZCORN_KW "ZCORN" /* Z coordinate where pillars cross planes. */
#define ACTNUM_KW "ACTNUM" /* Integer flag of with active=0,1. */
#define HOSTNUM_KW "HOSTNUM" /* For cells in LGR - pointing back to cell nr in
parent grid. */
#define FILEHEAD_KW "FILEHEAD"
#define ENDGRID_KW "ENDGRID"
#define ENDLGR_KW "ENDLGR"
/* GRID keywords */
#define GRIDHEAD_KW "GRIDHEAD" /* Header information for GRID files. */
#define COORD_KW "COORD" /* Header information for one cell in GRID file. */
#define CORNERS_KW "CORNERS" /* Vector containing (x,y,z) x 8 elements - all corners in a cell. */
#define DIMENS_KW "DIMENS" /* The dimensions of the grid. */
#define RADIAL_KW "RADIAL"
#define GLOBAL_STRING "GLOBAL"
#define GRIDHEAD_TYPE_INDEX 0
#define GRIDHEAD_NX_INDEX 1
#define GRIDHEAD_NY_INDEX 2
#define GRIDHEAD_NZ_INDEX 3
#define GRIDHEAD_LGR_INDEX 4
#define GRIDHEAD_SIZE 100
/* Observe that these indices are one value lower than the values used
in the ecl_smspec file. */
#define DIMENS_NX_INDEX 0
#define DIMENS_NY_INDEX 1
#define DIMENS_NZ_INDEX 2
#define FILEHEAD_VERSION_INDEX 0
#define FILEHEAD_YEAR_INDEX 1
#define FILEHEAD_COMPAT_INDEX 3
#define FILEHEAD_TYPE_INDEX 4
#define FILEHEAD_DUALP_INDEX 5
#define FILEHEAD_ORGFORMAT_INDEX 6
#define GRIDHEAD_GRIDTYPE_CORNERPOINT 1 /* <----\ */
/* | Fucking hysterical! */
#define FILEHEAD_GRIDTYPE_CORNERPOINT 0 /* <----/ */
#define FILEHEAD_SINGLE_POROSITY 0
#define FILEHEAD_ORGTYPE_CORNERPOINT 1
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,191 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_region.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_REGION_H__
#define __ECL_REGION_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <int_vector.h>
#include <geo_polygon.h>
#include <ecl_box.h>
#include <ecl_grid.h>
typedef enum {
SELECT_ALL = 0,
DESELECT_ALL = 1,
SELECT_FROM_IJK = 2,
DESELECT_FROM_IJK = 3,
SELECT_FROM_I = 4,
DSELECT_FROM_I = 5,
SELECT_FROM_J = 6,
DSELECT_FROM_J = 7,
SELECT_FROM_K = 8,
DSELECT_FROM_K = 9,
SELECT_EQUAL = 10,
DESELECT_EQUAL = 11,
SELECT_IN_INTERVAL = 12,
DESELECT_IN_INTERVAL = 13,
INVERT_SELECTION = 14
} ecl_region_select_cmd;
typedef struct ecl_region_struct ecl_region_type;
void ecl_region_unlock( ecl_region_type * region );
void ecl_region_lock( ecl_region_type * region );
void ecl_region_reset( ecl_region_type * ecl_region );
ecl_region_type * ecl_region_alloc_copy( const ecl_region_type * ecl_region );
ecl_region_type * ecl_region_alloc( const ecl_grid_type * ecl_grid , bool preselect);
void ecl_region_free( ecl_region_type * region );
void ecl_region_free__( void * __region );
const int_vector_type * ecl_region_get_active_list( ecl_region_type * region );
const int_vector_type * ecl_region_get_global_list( ecl_region_type * region );
const int_vector_type * ecl_region_get_global_active_list( ecl_region_type * region );
bool ecl_region_contains_ijk( const ecl_region_type * ecl_region , int i , int j , int k);
bool ecl_region_contains_global( const ecl_region_type * ecl_region , int global_index);
bool ecl_region_contains_active( const ecl_region_type * ecl_region , int active_index);
void ecl_region_invert_selection( ecl_region_type * region );
void ecl_region_select_all( ecl_region_type * region);
void ecl_region_deselect_all( ecl_region_type * region );
void ecl_region_select_in_interval( ecl_region_type * region , const ecl_kw_type * ecl_kw, float min_value , float max_value);
void ecl_region_deselect_in_interval( ecl_region_type * region , const ecl_kw_type * ecl_kw, float min_value , float max_value);
void ecl_region_select_equal( ecl_region_type * region , const ecl_kw_type * ecl_kw, int value);
void ecl_region_deselect_equal( ecl_region_type * region , const ecl_kw_type * ecl_kw, int value);
void ecl_region_select_inactive_cells( ecl_region_type * region );
void ecl_region_deselect_inactive_cells( ecl_region_type * region );
void ecl_region_select_active_cells( ecl_region_type * region );
void ecl_region_deselect_active_cells( ecl_region_type * region );
void ecl_region_select_from_box( ecl_region_type * region , const ecl_box_type * ecl_box );
void ecl_region_deselect_from_box( ecl_region_type * region , const ecl_box_type * ecl_box );
void ecl_region_select_from_ijkbox( ecl_region_type * region , int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
void ecl_region_deselect_from_ijkbox( ecl_region_type * region , int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
void ecl_region_select_i1i2( ecl_region_type * region , int i1 , int i2);
void ecl_region_deselect_i1i2( ecl_region_type * region , int i1 , int i2);
void ecl_region_select_j1j2( ecl_region_type * region , int j1 , int j2);
void ecl_region_deselect_j1j2( ecl_region_type * region , int j1 , int i2);
void ecl_region_select_k1k2( ecl_region_type * region , int k1 , int k2);
void ecl_region_deselect_k1k2( ecl_region_type * region , int k1 , int i2);
void ecl_region_select_shallow_cells( ecl_region_type * region , double depth_limit );
void ecl_region_deselect_shallow_cells( ecl_region_type * region , double depth_limit );
void ecl_region_select_deep_cells( ecl_region_type * region , double depth_limit );
void ecl_region_deselect_deep_cells( ecl_region_type * region , double depth_limit );
void ecl_region_select_thin_cells( ecl_region_type * ecl_region , double dz_limit );
void ecl_region_deselect_thin_cells( ecl_region_type * ecl_region , double dz_limit );
void ecl_region_select_thick_cells( ecl_region_type * ecl_region , double dz_limit );
void ecl_region_deselect_thick_cells( ecl_region_type * ecl_region , double dz_limit );
void ecl_region_select_small_cells( ecl_region_type * ecl_region , double volum_limit );
void ecl_region_deselect_small_cells( ecl_region_type * ecl_region , double volum_limit );
void ecl_region_select_large_cells( ecl_region_type * ecl_region , double volum_limit );
void ecl_region_deselect_large_cells( ecl_region_type * ecl_region , double volum_limit );
void ecl_region_select_global_index( ecl_region_type * ecl_region , int global_index);
void ecl_region_deselect_global_index( ecl_region_type * ecl_region , int global_index);
void ecl_region_select_active_index( ecl_region_type * ecl_region , int active_index);
void ecl_region_deselect_active_index( ecl_region_type * ecl_region , int active_index);
void ecl_region_intersection( ecl_region_type * region , const ecl_region_type * new_region );
void ecl_region_union( ecl_region_type * region , const ecl_region_type * new_region );
void ecl_region_subtract( ecl_region_type * region , const ecl_region_type * new_region);
void ecl_region_xor( ecl_region_type * region , const ecl_region_type * new_region);
void ecl_region_select_smaller( ecl_region_type * ecl_region , const ecl_kw_type * ecl_kw , float limit);
void ecl_region_deselect_smaller( ecl_region_type * ecl_region , const ecl_kw_type * ecl_kw , float limit);
void ecl_region_select_larger( ecl_region_type * ecl_region , const ecl_kw_type * ecl_kw , float limit);
void ecl_region_deselect_larger( ecl_region_type * ecl_region , const ecl_kw_type * ecl_kw , float limit);
void ecl_region_cmp_select_less( ecl_region_type * ecl_region , const ecl_kw_type * kw1 , const ecl_kw_type * kw2);
void ecl_region_cmp_deselect_less( ecl_region_type * ecl_region , const ecl_kw_type * kw1 , const ecl_kw_type * kw2);
void ecl_region_cmp_select_more( ecl_region_type * ecl_region , const ecl_kw_type * kw1 , const ecl_kw_type * kw2);
void ecl_region_cmp_deselect_more( ecl_region_type * ecl_region , const ecl_kw_type * kw1 , const ecl_kw_type * kw2);
void ecl_region_select_in_cylinder( ecl_region_type * region , double x0 , double y0, double R);
void ecl_region_deselect_in_cylinder( ecl_region_type * region , double x0 , double y0, double R);
void ecl_region_select_in_zcylinder( ecl_region_type * region , double x0 , double y0, double R , double z1 , double z2);
void ecl_region_deselect_in_zcylinder( ecl_region_type * region , double x0 , double y0, double R, double z1 , double z2);
void ecl_region_select_above_plane( ecl_region_type * region, const double n[3] , const double p[3]);
void ecl_region_select_below_plane( ecl_region_type * region, const double n[3] , const double p[3]);
void ecl_region_deselect_above_plane( ecl_region_type * region, const double n[3] , const double p[3]);
void ecl_region_deselect_below_plane( ecl_region_type * region, const double n[3] , const double p[3]);
void ecl_region_select_inside_polygon( ecl_region_type * region , const geo_polygon_type * polygon);
void ecl_region_deselect_inside_polygon( ecl_region_type * region , const geo_polygon_type * polygon);
void ecl_region_select_outside_polygon( ecl_region_type * region , const geo_polygon_type * polygon);
void ecl_region_deselect_outside_polygon( ecl_region_type * region , const geo_polygon_type * polygon);
/*****************************************************************/
/* Functions to manipulate ecl_kw instances . */
void ecl_region_set_kw_int( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , int value, bool force_active);
void ecl_region_set_kw_float( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , float value , bool force_active);
void ecl_region_set_kw_double( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , double value , bool force_active);
void ecl_region_kw_copy( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , const ecl_kw_type * src_kw , bool force_active);
int ecl_region_get_kw_size( ecl_region_type * ecl_region , const ecl_kw_type * ecl_kw , bool force_active);
void ecl_region_kw_iadd( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , const ecl_kw_type * delta_kw , bool force_active);
void ecl_region_kw_idiv( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , const ecl_kw_type * div_kw , bool force_active);
void ecl_region_kw_imul( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , const ecl_kw_type * mul_kw , bool force_active);
void ecl_region_kw_isub( ecl_region_type * ecl_region , ecl_kw_type * ecl_kw , const ecl_kw_type * delta_kw , bool force_active);
/*****************************************************************/
/* set/get the name */
void ecl_region_set_name( ecl_region_type * region , const char * name );
const char * ecl_region_get_name( const ecl_region_type * region );
/*****************************************************************/
/* Stupid cpp compat/legacy/cruft functions. */
int ecl_region_get_active_size_cpp( ecl_region_type * region );
int ecl_region_get_global_size_cpp( ecl_region_type * region );
const int * ecl_region_get_active_list_cpp( ecl_region_type * region );
const int * ecl_region_get_global_list_cpp( ecl_region_type * region );
/*****************************************************************/
UTIL_IS_INSTANCE_HEADER( ecl_region );
UTIL_SAFE_CAST_HEADER( ecl_region );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,60 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_rft_file.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_RFT_FILE_H__
#define __ECL_RFT_FILE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stringlist.h>
#include <ecl_rft_node.h>
typedef struct ecl_rft_file_struct ecl_rft_file_type;
char * ecl_rft_file_alloc_case_filename(const char * case_input );
const char * ecl_rft_file_get_filename( const ecl_rft_file_type * rft_file );
ecl_rft_file_type * ecl_rft_file_alloc_case(const char * case_input );
bool ecl_rft_file_case_has_rft(const char * case_input );
bool ecl_rft_file_case_has_rft( const char * case_input );
ecl_rft_file_type * ecl_rft_file_alloc(const char * );
void ecl_rft_file_free(ecl_rft_file_type * );
void ecl_rft_file_block(const ecl_rft_file_type * , double , const char * , int , const double * , int * , int * , int *);
void ecl_rft_file_fprintf_rft_obs(const ecl_rft_file_type * , double , const char * , const char *, const char * , double);
ecl_rft_node_type * ecl_rft_file_get_node(const ecl_rft_file_type * , const char * );
void ecl_rft_file_summarize(const ecl_rft_file_type * , bool );
void ecl_rft_file_xml_summary( const ecl_rft_file_type * rft_file );
const ecl_rft_node_type * ecl_rft_file_get_well_time_rft( const ecl_rft_file_type * rft_file , const char * well , time_t recording_time);
int ecl_rft_file_get_size__( const ecl_rft_file_type * rft_file, const char * well_pattern , time_t recording_time);
int ecl_rft_file_get_size( const ecl_rft_file_type * rft_file);
const ecl_rft_node_type * ecl_rft_file_iget_node( const ecl_rft_file_type * rft_file , int index);
const ecl_rft_node_type * ecl_rft_file_iget_well_rft( const ecl_rft_file_type * rft_file , const char * well, int index);
bool ecl_rft_file_has_well( const ecl_rft_file_type * rft_file , const char * well);
int ecl_rft_file_get_well_occurences( const ecl_rft_file_type * rft_file , const char * well);
stringlist_type * ecl_rft_file_alloc_well_list(const ecl_rft_file_type * rft_file );
int ecl_rft_file_get_num_wells( const ecl_rft_file_type * rft_file );
void ecl_rft_file_free__( void * arg);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,61 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_rft_node.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_RFT_NODE_H__
#define __ECL_RFT_NODE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <ecl_file.h>
typedef enum { RFT = 1 ,
PLT = 2 ,
SEGMENT = 3 /* Not really implemented */ } ecl_rft_enum;
typedef struct ecl_rft_node_struct ecl_rft_node_type;
int ecl_rft_node_lookup_ijk( const ecl_rft_node_type * rft_node , int i, int j , int k);
void ecl_rft_node_fprintf_rft_obs(const ecl_rft_node_type * , double , const char * , const char * , double );
ecl_rft_node_type * ecl_rft_node_alloc(const ecl_file_type * file_map );
const char * ecl_rft_node_get_well_name(const ecl_rft_node_type * );
void ecl_rft_node_free(ecl_rft_node_type * );
void ecl_rft_node_free__(void * );
void ecl_rft_node_block2(const ecl_rft_node_type * , int , const double * , const double * , int * , int * , int *);
void ecl_rft_node_block(const ecl_rft_node_type * , double , int , const double * , int * , int * , int *);
time_t ecl_rft_node_get_date(const ecl_rft_node_type * );
int ecl_rft_node_get_size(const ecl_rft_node_type * );
void ecl_rft_node_summarize(const ecl_rft_node_type * , bool );
const char * ecl_rft_node_get_well_name( const ecl_rft_node_type * rft_node );
void ecl_rft_node_iget_ijk( const ecl_rft_node_type * rft_node , int index , int *i , int *j , int *k);
void ecl_rft_node_export_DEPTH(const ecl_rft_node_type * , const char * );
double ecl_rft_node_iget_pressure( const ecl_rft_node_type * rft_node , int index);
double ecl_rft_node_iget_depth( const ecl_rft_node_type * rft_node , int index);
double ecl_rft_node_iget_wrat( const ecl_rft_node_type * rft_node , int index);
double ecl_rft_node_iget_grat( const ecl_rft_node_type * rft_node , int index);
double ecl_rft_node_iget_orat( const ecl_rft_node_type * rft_node , int index);
double ecl_rft_node_iget_swat( const ecl_rft_node_type * rft_node , int index);
double ecl_rft_node_iget_sgas( const ecl_rft_node_type * rft_node , int index);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,44 +0,0 @@
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'ecl_rst_file.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_RST_FILE_H__
#define __ECL_RST_FILE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ecl_rst_file_struct ecl_rst_file_type;
ecl_rst_file_type * ecl_rst_file_open_read( const char * filename );
ecl_rst_file_type * ecl_rst_file_open_write( const char * filename );
ecl_rst_file_type * ecl_rst_file_open_append( const char * filename );
void ecl_rst_file_close( ecl_rst_file_type * rst_file );
void ecl_rst_file_start_solution( ecl_rst_file_type * rst_file );
void ecl_rst_file_end_solution( ecl_rst_file_type * rst_file );
void ecl_rst_file_fwrite_header( ecl_rst_file_type * rst_file , int seqnum , time_t date , double days , int nx , int ny ,int nz , int nactive , int phases);
void ecl_rst_file_add_kw(ecl_rst_file_type * rst_file , const ecl_kw_type * ecl_kw );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,142 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_smspec.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_SMSPEC__
#define __ECL_SMSPEC__
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include <stdbool.h>
#include <float_vector.h>
#include <stringlist.h>
#include <smspec_node.h>
typedef struct ecl_smspec_struct ecl_smspec_type;
/**
These are the different variable types, see table 3.4 in the
ECLIPFE file format docuemntation for naming conventions.
Only the variable types marked with "X" below are supported in the
remaining implementation. To add support for a new variable type
the functions smspec_node_alloc(), ecl_smsepec_fread_header() and
ecl_smspec_install_gen_key() must be updated.
*/
const int_vector_type * ecl_smspec_get_index_map( const ecl_smspec_type * smspec );
void ecl_smspec_index_node( ecl_smspec_type * ecl_smspec , smspec_node_type * smspec_node);
void ecl_smspec_insert_node(ecl_smspec_type * ecl_smspec, smspec_node_type * smspec_node);
void ecl_smspec_add_node( ecl_smspec_type * ecl_smspec , smspec_node_type * smspec_node );
ecl_smspec_var_type ecl_smspec_iget_var_type( const ecl_smspec_type * smspec , int index );
bool ecl_smspec_needs_num( ecl_smspec_var_type var_type );
bool ecl_smspec_needs_wgname( ecl_smspec_var_type var_type );
const char * ecl_smspec_get_var_type_name( ecl_smspec_var_type var_type );
ecl_smspec_var_type ecl_smspec_identify_var_type(const char * var);
ecl_smspec_type * ecl_smspec_alloc_writer( const char * key_join_string , time_t sim_start , int nx , int ny , int nz);
void ecl_smspec_fwrite( const ecl_smspec_type * smspec , const char * ecl_case , bool fmt_file );
ecl_smspec_type * ecl_smspec_fread_alloc(const char *header_file, const char * key_join_string , bool include_restart);
void ecl_smspec_free( ecl_smspec_type *);
int ecl_smspec_get_sim_days_index( const ecl_smspec_type * smspec );
int ecl_smspec_get_date_day_index( const ecl_smspec_type * smspec );
int ecl_smspec_get_date_month_index( const ecl_smspec_type * smspec );
int ecl_smspec_get_date_year_index( const ecl_smspec_type * smspec );
const smspec_node_type * ecl_smspec_get_well_var_node( const ecl_smspec_type * smspec , const char * well , const char * var);
int ecl_smspec_get_well_var_params_index(const ecl_smspec_type * ecl_smspec , const char * well , const char *var);
bool ecl_smspec_has_well_var(const ecl_smspec_type * ecl_smspec , const char * well , const char *var);
const smspec_node_type * ecl_smspec_get_group_var_node( const ecl_smspec_type * smspec , const char * group , const char * var);
int ecl_smspec_get_group_var_params_index(const ecl_smspec_type * ecl_smspec , const char * group , const char *var);
bool ecl_smspec_has_group_var(const ecl_smspec_type * ecl_smspec , const char * group , const char *var);
const smspec_node_type * ecl_smspec_get_field_var_node( const ecl_smspec_type * smspec , const char * var);
int ecl_smspec_get_field_var_params_index(const ecl_smspec_type * ecl_smspec , const char *var);
bool ecl_smspec_has_field_var(const ecl_smspec_type * ecl_smspec , const char *var);
const smspec_node_type * ecl_smspec_get_region_var_node(const ecl_smspec_type * ecl_smspec , const char *region_var , int region_nr);
int ecl_smspec_get_region_var_params_index(const ecl_smspec_type * ecl_smspec , const char * region_var , int region_nr);
bool ecl_smspec_has_region_var(const ecl_smspec_type * ecl_smspec , const char * region_var , int region_nr);
const smspec_node_type * ecl_smspec_get_misc_var_node(const ecl_smspec_type * ecl_smspec , const char *var);
int ecl_smspec_get_misc_var_params_index(const ecl_smspec_type * ecl_smspec , const char *var);
bool ecl_smspec_has_misc_var(const ecl_smspec_type * ecl_smspec , const char *var);
const smspec_node_type * ecl_smspec_get_block_var_node(const ecl_smspec_type * ecl_smspec , const char * block_var , int block_nr);
int ecl_smspec_get_block_var_params_index(const ecl_smspec_type * ecl_smspec , const char * block_var , int block_nr);
bool ecl_smspec_has_block_var(const ecl_smspec_type * ecl_smspec , const char * block_var , int block_nr);
const smspec_node_type * ecl_smspec_get_block_var_node_ijk(const ecl_smspec_type * ecl_smspec , const char * block_var , int i , int j , int k);
int ecl_smspec_get_block_var_params_index_ijk(const ecl_smspec_type * ecl_smspec , const char * block_var , int i , int j , int k);
bool ecl_smspec_has_block_var_ijk(const ecl_smspec_type * ecl_smspec , const char * block_var , int i , int j , int k);
const smspec_node_type * ecl_smspec_get_well_completion_var_node(const ecl_smspec_type * ecl_smspec , const char * well , const char *var, int cell_nr);
int ecl_smspec_get_well_completion_var_params_index(const ecl_smspec_type * ecl_smspec , const char * well , const char *var, int cell_nr);
bool ecl_smspec_has_well_completion_var(const ecl_smspec_type * ecl_smspec , const char * well , const char *var, int cell_nr);
const smspec_node_type * ecl_smspec_get_general_var_node( const ecl_smspec_type * smspec , const char * lookup_kw );
int ecl_smspec_get_general_var_params_index(const ecl_smspec_type * ecl_smspec , const char * lookup_kw);
bool ecl_smspec_has_general_var(const ecl_smspec_type * ecl_smspec , const char * lookup_kw);
const char * ecl_smspec_get_general_var_unit( const ecl_smspec_type * ecl_smspec , const char * lookup_kw);
//bool ecl_smspec_general_is_total(const ecl_smspec_type * ecl_smspec , const char * gen_key);
//bool ecl_smspec_is_rate(const ecl_smspec_type * smspec , int kw_index);
//ecl_smspec_var_type ecl_smspec_iget_var_type( const ecl_smspec_type * smspec , int index );
//const char * ecl_smspec_iget_unit( const ecl_smspec_type * smspec , int index );
//int ecl_smspec_iget_num( const ecl_smspec_type * smspec , int index );
//const char * ecl_smspec_iget_wgname( const ecl_smspec_type * smspec , int index );
//const char * ecl_smspec_iget_keyword( const ecl_smspec_type * smspec , int index );
void ecl_smspec_init_var( ecl_smspec_type * ecl_smspec , smspec_node_type * smspec_node , const char * keyword , const char * wgname , int num, const char * unit );
void ecl_smspec_select_matching_general_var_list( const ecl_smspec_type * smspec , const char * pattern , stringlist_type * keys);
stringlist_type * ecl_smspec_alloc_matching_general_var_list(const ecl_smspec_type * smspec , const char * pattern);
int ecl_smspec_get_time_index( const ecl_smspec_type * ecl_smspec );
time_t ecl_smspec_get_start_time(const ecl_smspec_type * );
/*****************************************************************/
bool ecl_smspec_get_formatted( const ecl_smspec_type * ecl_smspec);
const char * ecl_smspec_get_header_file( const ecl_smspec_type * ecl_smspec );
stringlist_type * ecl_smspec_alloc_well_list( const ecl_smspec_type * smspec , const char * pattern);
stringlist_type * ecl_smspec_alloc_group_list( const ecl_smspec_type * smspec , const char * pattern);
stringlist_type * ecl_smspec_alloc_well_var_list( const ecl_smspec_type * smspec );
const char * ecl_smspec_get_simulation_path(const ecl_smspec_type * ecl_smspec);
const stringlist_type * ecl_smspec_get_restart_list( const ecl_smspec_type * ecl_smspec);
const char * ecl_smspec_get_join_string( const ecl_smspec_type * smspec);
const float_vector_type * ecl_smspec_get_params_default( const ecl_smspec_type * ecl_smspec );
void ecl_smspec_update_wgname( ecl_smspec_type * smspec , smspec_node_type * node , const char * wgname );
const int * ecl_smspec_get_grid_dims( const ecl_smspec_type * smspec );
int ecl_smspec_get_params_size( const ecl_smspec_type * smspec );
const smspec_node_type * ecl_smspec_iget_node( const ecl_smspec_type * smspec , int index );
void ecl_smspec_lock( ecl_smspec_type * smspec );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,47 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_subsidence.h' is part of ERT - Ensemble based
Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_SUBSIDENCE_H__
#define __ECL_SUBSICENCE_H__
#ifdef __plusplus
extern "C" {
#endif
#include <ecl_file.h>
#include <ecl_grid.h>
#include <ecl_region.h>
typedef struct ecl_subsidence_struct ecl_subsidence_type;
typedef struct ecl_subsidence_survey_struct ecl_subsidence_survey_type;
void ecl_subsidence_free( ecl_subsidence_type * ecl_subsidence_config );
ecl_subsidence_type * ecl_subsidence_alloc( const ecl_grid_type * ecl_grid, const ecl_file_type * init_file );
ecl_subsidence_survey_type * ecl_subsidence_add_survey_PRESSURE( ecl_subsidence_type * subsidence ,
const char * name , const ecl_file_type * restart_file );
double ecl_subsidence_eval( const ecl_subsidence_type * subsidence ,
const char * base, const char * monitor ,
ecl_region_type * region ,
double utm_x, double utm_y , double depth, double compressibility, double poisson_ratio);
#ifdef __plusplus
}
#endif
#endif

View File

@ -1,186 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_sum.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_SUM_H__
#define __ECL_SUM_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <stringlist.h>
#include <time_t_vector.h>
#include <double_vector.h>
#include <ecl_smspec.h>
#include <ecl_sum_tstep.h>
#include <smspec_node.h>
typedef struct ecl_sum_struct ecl_sum_type;
double ecl_sum_get_from_sim_time( const ecl_sum_type * ecl_sum , time_t sim_time , const smspec_node_type * node);
double ecl_sum_get_from_sim_days( const ecl_sum_type * ecl_sum , double sim_days , const smspec_node_type * node);
void ecl_sum_set_unified( ecl_sum_type * ecl_sum , bool unified );
void ecl_sum_set_fmt_case( ecl_sum_type * ecl_sum , bool fmt_case );
int ecl_sum_get_report_step_from_time( const ecl_sum_type * sum , time_t sim_time);
int ecl_sum_get_report_step_from_days( const ecl_sum_type * sum , double sim_days);
bool ecl_sum_check_sim_time( const ecl_sum_type * sum , time_t sim_time);
bool ecl_sum_check_sim_days( const ecl_sum_type * sum , double sim_days);
const char * ecl_sum_get_keyword( const ecl_sum_type * sum , const char * gen_key );
const char * ecl_sum_get_wgname( const ecl_sum_type * sum , const char * gen_key );
const char * ecl_sum_get_unit( const ecl_sum_type * sum , const char * gen_key );
int ecl_sum_get_num( const ecl_sum_type * sum , const char * gen_key );
double ecl_sum_iiget( const ecl_sum_type * ecl_sum , int internal_index , int param_index);
int ecl_sum_iget_num( const ecl_sum_type * sum , int param_index );
const char * ecl_sum_iget_wgname( const ecl_sum_type * sum , int param_index );
const char * ecl_sum_iget_keyword( const ecl_sum_type * sum , int param_index );
int ecl_sum_get_data_length( const ecl_sum_type * ecl_sum );
double ecl_sum_iget_from_sim_time( const ecl_sum_type * ecl_sum , time_t sim_time , int param_index);
double ecl_sum_iget_from_sim_days( const ecl_sum_type * ecl_sum , double sim_days , int param_index );
void ecl_sum_summarize( const ecl_sum_type * ecl_sum , FILE * stream );
bool ecl_sum_general_is_total(const ecl_sum_type * ecl_sum , const char * gen_key);
bool ecl_sum_var_is_total(const ecl_sum_type * ecl_sum , const char * gen_key);
void ecl_sum_free_data(ecl_sum_type * );
void ecl_sum_free__(void * );
void ecl_sum_free(ecl_sum_type * );
ecl_sum_type * ecl_sum_fread_alloc(const char * , const stringlist_type * data_files, const char * key_join_string);
ecl_sum_type * ecl_sum_fread_alloc_case(const char * , const char * key_join_string);
ecl_sum_type * ecl_sum_fread_alloc_case__(const char * , const char * key_join_string , bool include_restart);
/* Accessor functions : */
double ecl_sum_get_well_var(const ecl_sum_type * ecl_sum , int time_index , const char * well , const char *var);
bool ecl_sum_has_well_var(const ecl_sum_type * ecl_sum , const char * well , const char *var);
double ecl_sum_get_well_var_from_sim_days( const ecl_sum_type * ecl_sum , double sim_days , const char * well , const char * var);
double ecl_sum_get_well_var_from_sim_time( const ecl_sum_type * ecl_sum , time_t sim_time , const char * well , const char * var);
double ecl_sum_get_group_var(const ecl_sum_type * ecl_sum , int time_index , const char * group , const char *var);
bool ecl_sum_has_group_var(const ecl_sum_type * ecl_sum , const char * group , const char *var);
double ecl_sum_get_field_var(const ecl_sum_type * ecl_sum , int time_index , const char *var);
bool ecl_sum_has_field_var(const ecl_sum_type * ecl_sum , const char *var);
double ecl_sum_get_field_var_from_sim_days( const ecl_sum_type * ecl_sum , double sim_days , const char * var);
double ecl_sum_get_field_var_from_sim_time( const ecl_sum_type * ecl_sum , time_t sim_time , const char * var);
double ecl_sum_get_block_var(const ecl_sum_type * ecl_sum , int time_index , const char * block_var , int block_nr);
int ecl_sum_get_block_var_index(const ecl_sum_type * ecl_sum , const char * block_var , int block_nr);
bool ecl_sum_has_block_var(const ecl_sum_type * ecl_sum , const char * block_var , int block_nr);
double ecl_sum_get_block_var_ijk(const ecl_sum_type * ecl_sum , int time_index , const char * block_var , int i , int j , int k);
int ecl_sum_get_block_var_index_ijk(const ecl_sum_type * ecl_sum , const char * block_var , int i , int j , int k);
bool ecl_sum_has_block_var_ijk(const ecl_sum_type * ecl_sum , const char * block_var , int i , int j , int k);
double ecl_sum_get_region_var(const ecl_sum_type * ecl_sum , int time_index , const char *var , int region_nr);
bool ecl_sum_has_region_var(const ecl_sum_type * ecl_sum , const char *var , int region_nr);
double ecl_sum_get_misc_var(const ecl_sum_type * ecl_sum , int time_index , const char *var);
int ecl_sum_get_misc_var_index(const ecl_sum_type * ecl_sum , const char *var);
bool ecl_sum_has_misc_var(const ecl_sum_type * ecl_sum , const char *var);
double ecl_sum_get_well_completion_var(const ecl_sum_type * ecl_sum , int time_index , const char * well , const char *var, int cell_nr);
int ecl_sum_get_well_completion_var_index(const ecl_sum_type * ecl_sum , const char * well , const char *var, int cell_nr);
bool ecl_sum_has_well_completion_var(const ecl_sum_type * ecl_sum , const char * well , const char *var, int cell_nr);
double ecl_sum_get_general_var(const ecl_sum_type * ecl_sum , int time_index , const char * lookup_kw);
int ecl_sum_get_general_var_params_index(const ecl_sum_type * ecl_sum , const char * lookup_kw);
const smspec_node_type * ecl_sum_get_general_var_node(const ecl_sum_type * ecl_sum , const char * lookup_kw);
bool ecl_sum_has_general_var(const ecl_sum_type * ecl_sum , const char * lookup_kw);
bool ecl_sum_has_key(const ecl_sum_type * ecl_sum , const char * lookup_kw);
double ecl_sum_get_general_var_from_sim_days( const ecl_sum_type * ecl_sum , double sim_days , const char * var);
double ecl_sum_get_general_var_from_sim_time( const ecl_sum_type * ecl_sum , time_t sim_time , const char * var);
const char * ecl_sum_get_general_var_unit( const ecl_sum_type * ecl_sum , const char * var);
/***************/
void ecl_sum_fprintf(const ecl_sum_type * , FILE * , const stringlist_type * , bool report_only , bool print_header);
/* Time related functions */
int ecl_sum_get_first_gt( const ecl_sum_type * ecl_sum , int param_index , double limit);
int ecl_sum_get_first_lt( const ecl_sum_type * ecl_sum , int param_index , double limit);
int ecl_sum_get_last_report_step( const ecl_sum_type * ecl_sum );
int ecl_sum_get_first_report_step( const ecl_sum_type * ecl_sum );
bool ecl_sum_has_report_step(const ecl_sum_type * ecl_sum , int report_step );
time_t ecl_sum_get_report_time( const ecl_sum_type * ecl_sum , int report_step );
time_t ecl_sum_iget_sim_time( const ecl_sum_type * ecl_sum , int index );
double ecl_sum_iget_sim_days( const ecl_sum_type * ecl_sum , int time_index);
int ecl_sum_iget_report_step( const ecl_sum_type * ecl_sum , int internal_index );
int ecl_sum_iget_mini_step( const ecl_sum_type * ecl_sum , int internal_index );
double ecl_sum_iget_general_var(const ecl_sum_type * ecl_sum , int internal_index , const char * lookup_kw);
void ecl_sum_init_data_vector( const ecl_sum_type * ecl_sum , double_vector_type * data_vector , int data_index , bool report_only );
double_vector_type * ecl_sum_alloc_data_vector( const ecl_sum_type * ecl_sum , int data_index , bool report_only);
time_t_vector_type * ecl_sum_alloc_time_vector( const ecl_sum_type * ecl_sum , bool report_only);
time_t ecl_sum_get_data_start( const ecl_sum_type * ecl_sum );
time_t ecl_sum_get_end_time( const ecl_sum_type * ecl_sum);
time_t ecl_sum_get_start_time(const ecl_sum_type * );
const char * ecl_sum_get_base(const ecl_sum_type * ecl_sum );
const char * ecl_sum_get_path(const ecl_sum_type * ecl_sum );
const char * ecl_sum_get_abs_path(const ecl_sum_type * ecl_sum );
const char * ecl_sum_get_case(const ecl_sum_type * );
bool ecl_sum_same_case( const ecl_sum_type * ecl_sum , const char * input_file );
void ecl_sum_resample_from_sim_days( const ecl_sum_type * ecl_sum , const double_vector_type * sim_days , double_vector_type * value , const char * gen_key);
void ecl_sum_resample_from_sim_time( const ecl_sum_type * ecl_sum , const time_t_vector_type * sim_time , double_vector_type * value , const char * gen_key);
time_t ecl_sum_time_from_days( const ecl_sum_type * ecl_sum , double sim_days );
double ecl_sum_days_from_time( const ecl_sum_type * ecl_sum , time_t sim_time );
double ecl_sum_get_sim_length( const ecl_sum_type * ecl_sum ) ;
double ecl_sum_get_first_day( const ecl_sum_type * ecl_sum );
/*****************************************************************/
stringlist_type * ecl_sum_alloc_well_list( const ecl_sum_type * ecl_sum , const char * pattern);
stringlist_type * ecl_sum_alloc_group_list( const ecl_sum_type * ecl_sum , const char * pattern);
stringlist_type * ecl_sum_alloc_well_var_list( const ecl_sum_type * ecl_sum );
stringlist_type * ecl_sum_alloc_matching_general_var_list(const ecl_sum_type * ecl_sum , const char * pattern);
void ecl_sum_select_matching_general_var_list( const ecl_sum_type * ecl_sum , const char * pattern , stringlist_type * keys);
const ecl_smspec_type * ecl_sum_get_smspec( const ecl_sum_type * ecl_sum );
ecl_smspec_var_type ecl_sum_identify_var_type(const char * var);
ecl_smspec_var_type ecl_sum_get_var_type( const ecl_sum_type * ecl_sum , const char * gen_key);
bool ecl_sum_var_is_rate( const ecl_sum_type * ecl_sum , const char * gen_key);
bool ecl_sum_var_is_total( const ecl_sum_type * ecl_sum , const char * gen_key);
int ecl_sum_iget_report_end( const ecl_sum_type * ecl_sum , int report_step );
int ecl_sum_iget_report_start( const ecl_sum_type * ecl_sum , int report_step );
ecl_sum_type * ecl_sum_alloc_writer( const char * ecl_case , bool fmt_output , bool unified , const char * key_join_string , time_t sim_start , int nx , int ny , int nz);
void ecl_sum_set_case( ecl_sum_type * ecl_sum , const char * ecl_case);
void ecl_sum_fwrite( const ecl_sum_type * ecl_sum );
void ecl_sum_fwrite_smspec( const ecl_sum_type * ecl_sum );
smspec_node_type * ecl_sum_add_var( ecl_sum_type * ecl_sum , const char * keyword , const char * wgname , int num , const char * unit , float default_value);
smspec_node_type * ecl_sum_add_blank_var( ecl_sum_type * ecl_sum , float default_value);
void ecl_sum_init_var( ecl_sum_type * ecl_sum , smspec_node_type * smspec_node , const char * keyword , const char * wgname , int num , const char * unit);
ecl_sum_tstep_type * ecl_sum_add_tstep( ecl_sum_type * ecl_sum , int report_step , double sim_days);
void ecl_sum_update_wgname( ecl_sum_type * ecl_sum , smspec_node_type * node , const char * wgname );
UTIL_IS_INSTANCE_HEADER( ecl_sum );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,87 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_sum_data.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_SUM_DATA_H__
#define __ECL_SUM_DATA_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <time.h>
#include <time_t_vector.h>
#include <double_vector.h>
#include <stringlist.h>
#include <ecl_sum_tstep.h>
#include <smspec_node.h>
typedef struct ecl_sum_data_struct ecl_sum_data_type ;
void ecl_sum_data_fwrite_step( const ecl_sum_data_type * data , const char * ecl_case , bool fmt_case , bool unified, int report_step);
void ecl_sum_data_fwrite( const ecl_sum_data_type * data , const char * ecl_case , bool fmt_case , bool unified);
void ecl_sum_data_fread( ecl_sum_data_type * data , const stringlist_type * filelist);
void ecl_sum_data_fread_restart( ecl_sum_data_type * data , const stringlist_type * filelist);
ecl_sum_data_type * ecl_sum_data_alloc_writer( ecl_smspec_type * smspec );
ecl_sum_data_type * ecl_sum_data_alloc( ecl_smspec_type * smspec);
int ecl_sum_data_get_report_step_from_time(const ecl_sum_data_type * data , time_t sim_time);
int ecl_sum_data_get_report_step_from_days(const ecl_sum_data_type * data , double days);
bool ecl_sum_data_check_sim_time( const ecl_sum_data_type * data , time_t sim_time);
bool ecl_sum_data_check_sim_days( const ecl_sum_data_type * data , double sim_days);
int ecl_sum_data_get_num_ministep( const ecl_sum_data_type * data );
double_vector_type * ecl_sum_data_alloc_data_vector( const ecl_sum_data_type * data , int data_index , bool report_only);
void ecl_sum_data_init_data_vector( const ecl_sum_data_type * data , double_vector_type * data_vector , int data_index , bool report_only);
void ecl_sum_data_init_time_vector( const ecl_sum_data_type * data , time_t_vector_type * time_vector , bool report_only);
time_t_vector_type * ecl_sum_data_alloc_time_vector( const ecl_sum_data_type * data , bool report_only);
time_t ecl_sum_data_get_data_start( const ecl_sum_data_type * data );
time_t ecl_sum_data_get_report_time( const ecl_sum_data_type * data , int report_step);
double ecl_sum_data_get_first_day( const ecl_sum_data_type * data);
time_t ecl_sum_data_get_sim_start ( const ecl_sum_data_type * data );
time_t ecl_sum_data_get_sim_end ( const ecl_sum_data_type * data );
double ecl_sum_data_get_sim_length( const ecl_sum_data_type * data );
void ecl_sum_data_summarize(const ecl_sum_data_type * data , FILE * stream);
double ecl_sum_data_iget( const ecl_sum_data_type * data , int internal_index , int params_index );
double ecl_sum_data_iget_sim_days( const ecl_sum_data_type * , int );
time_t ecl_sum_data_iget_sim_time( const ecl_sum_data_type * , int );
bool ecl_sum_data_has_report_step(const ecl_sum_data_type * , int );
ecl_sum_data_type * ecl_sum_data_fread_alloc( ecl_smspec_type * , const stringlist_type * filelist , bool include_restart);
void ecl_sum_data_free( ecl_sum_data_type * );
int ecl_sum_data_get_last_report_step( const ecl_sum_data_type * data );
int ecl_sum_data_get_first_report_step( const ecl_sum_data_type * data );
int ecl_sum_data_get_first_ministep( const ecl_sum_data_type * data );
int ecl_sum_data_get_last_ministep( const ecl_sum_data_type * data );
double ecl_sum_data_get_from_sim_time( const ecl_sum_data_type * data , time_t sim_time , const smspec_node_type * smspec_node);
double ecl_sum_data_get_from_sim_days( const ecl_sum_data_type * data , double sim_days , const smspec_node_type * smspec_node);
int ecl_sum_data_get_length( const ecl_sum_data_type * data );
int ecl_sum_data_iget_report_step(const ecl_sum_data_type * data , int internal_index);
int ecl_sum_data_iget_mini_step(const ecl_sum_data_type * data , int internal_index);
int ecl_sum_data_iget_report_end( const ecl_sum_data_type * data , int report_step );
int ecl_sum_data_iget_report_start( const ecl_sum_data_type * data , int report_step );
ecl_sum_tstep_type * ecl_sum_data_add_new_tstep( ecl_sum_data_type * data , int report_step , double sim_days);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,63 +0,0 @@
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'ecl_sum_tstep.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_SUM_TSTEP_H__
#define __ECL_SUM_TSTEP_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <int_vector.h>
#include <ecl_smspec.h>
#include <ecl_kw.h>
typedef struct ecl_sum_tstep_struct ecl_sum_tstep_type;
void ecl_sum_tstep_free( ecl_sum_tstep_type * ministep );
void ecl_sum_tstep_free__( void * __ministep);
ecl_sum_tstep_type * ecl_sum_tstep_alloc_from_file(int report_step ,
int ministep_nr ,
const ecl_kw_type * params_kw ,
const char * src_file ,
const ecl_smspec_type * smspec);
ecl_sum_tstep_type * ecl_sum_tstep_alloc_new( int report_step , int ministep , float sim_days , const ecl_smspec_type * smspec );
double ecl_sum_tstep_iget(const ecl_sum_tstep_type * ministep , int index);
time_t ecl_sum_tstep_get_sim_time(const ecl_sum_tstep_type * ministep);
double ecl_sum_tstep_get_sim_days(const ecl_sum_tstep_type * ministep);
int ecl_sum_tstep_get_report(const ecl_sum_tstep_type * ministep);
int ecl_sum_tstep_get_ministep(const ecl_sum_tstep_type * ministep);
void ecl_sum_tstep_fwrite( const ecl_sum_tstep_type * ministep , const int_vector_type * index_map , fortio_type * fortio);
void ecl_sum_tstep_iset( ecl_sum_tstep_type * tstep , int index , float value);
void ecl_sum_tstep_set_from_node( ecl_sum_tstep_type * tstep , const smspec_node_type * smspec_node , float value);
void ecl_sum_tstep_set_from_key( ecl_sum_tstep_type * tstep , const char * gen_key , float value);
UTIL_SAFE_CAST_HEADER( ecl_sum_tstep );
UTIL_SAFE_CAST_HEADER_CONST( ecl_sum_tstep );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,184 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'ecl_util.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __ECL_UTIL_H__
#define __ECL_UTIL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <time.h>
#include <stringlist.h>
typedef enum { ECL_OTHER_FILE = 0 ,
ECL_RESTART_FILE = 1 ,
ECL_UNIFIED_RESTART_FILE = 2 ,
ECL_SUMMARY_FILE = 4 ,
ECL_UNIFIED_SUMMARY_FILE = 8 ,
ECL_SUMMARY_HEADER_FILE = 16 ,
ECL_GRID_FILE = 32 ,
ECL_EGRID_FILE = 64 ,
ECL_INIT_FILE = 128 ,
ECL_RFT_FILE = 256 ,
ECL_DATA_FILE = 512 } ecl_file_enum;
#define ECL_FILE_ENUM_DEFS {.value = 0 , .name="ECL_OTHER_FILE"}, \
{.value = 1 , .name="ECL_RESTART_FILE"}, \
{.value = 2 , .name="ECL_UNIFIED_RESTART_FILE"}, \
{.value = 4 , .name="ECL_SUMMARY_FILE"}, \
{.value = 8 , .name="ECL_UNIFIED_SUMMARY_FILE"}, \
{.value = 16 , .name="ECL_SUMMARY_HEADER_FILE"}, \
{.value = 32 , .name="ECL_GRID_FILE"}, \
{.value = 64 , .name="ECL_EGRID_FILE"}, \
{.value = 128 , .name="ECL_INIT_FILE"}, \
{.value = 256 , .name="ECL_RFT_FILE"}, \
{.value = 512 , .name="ECL_DATA_FILE"}
#define ECL_FILE_ENUM_SIZE 11
/*
This enum enumerates the four different ways summary and restart information
can be stored.
*/
typedef enum { ECL_INVALID_STORAGE = 0,
ECL_BINARY_UNIFIED = 1,
ECL_FORMATTED_UNIFIED = 2,
ECL_BINARY_NON_UNIFIED = 4,
ECL_FORMATTED_NON_UNIFIED = 8} ecl_storage_enum;
/*
Character data in ECLIPSE files comes as an array of fixed-length
string. Each of these strings is 8 characters long. The type name,
i.e. 'REAL', 'INTE', ... , come as 4 character strings.
*/
#define ECL_STRING_LENGTH 8
#define ECL_TYPE_LENGTH 4
/*****************************************************************/
/*
Observe that these type identidiers are (ab)used in both the rms and
ert/enkf libraries in situations where ECLIPSE is not at all involved.
*/
typedef enum {
ECL_CHAR_TYPE = 0,
ECL_FLOAT_TYPE = 1,
ECL_DOUBLE_TYPE = 2,
ECL_INT_TYPE = 3,
ECL_BOOL_TYPE = 4,
ECL_MESS_TYPE = 5
} ecl_type_enum;
#define ECL_TYPE_ENUM_DEFS {.value = 0 , .name = "ECL_CHAR_TYPE"}, \
{.value = 1 , .name = "ECL_FLOAT_TYPE"} , \
{.value = 2 , .name = "ECL_DOUBLE_TYPE"}, \
{.value = 3 , .name = "ECL_INT_TYPE"}, \
{.value = 4 , .name = "ECL_BOOL_TYPE"}, \
{.value = 5 , .name = "ECL_MESS_TYPE"}
#define ECL_TYPE_ENUM_SIZE 6
/*
The libecl library has been built and tested 99.5% with ECLIPSE100
as context, but in thye gravity code there is some very limited
functionality related to ECLIPSE100 versus ECLIPSE300 functionality.
*/
typedef enum {
ECLIPSE_UNDEFINED = 0,
ECLIPSE100 = 1,
ECLIPSE300 = 2
} ecl_version_enum;
/*
Observe that the numerical enum VALUES matches those found in item
14 in the INTEHEAD keyword in the ECLIPSE INIT files; i.e. the
distribution of numerical values 1,2,4 can NOT BE CHANGED.
The function ecl_util_get_phase_name() can be used to lookup a
string name from an enum value.
The phases in a simulation will typically be a sum of these
fundamental phases, and represented as an integer.
*/
typedef enum {
ECL_OIL_PHASE = 1,
ECL_GAS_PHASE = 2,
ECL_WATER_PHASE = 4
} ecl_phase_enum;
#define ECL_PHASE_ENUM_DEFS {.value = 1 , .name = "ECL_OIL_PHASE"}, {.value = 2 , .name = "ECL_GAS_PHASE"} , {.value = 4 , .name = "ECL_WATER_PHASE"}
#define ECL_PHASE_ENUM_SIZE 3
// For unformatted files:
#define ECL_BOOL_TRUE_INT -1 // Binary representation: 11111111 11111111 11111111 1111111
#define ECL_BOOL_FALSE_INT 0 // Binary representation: 00000000 00000000 00000000 0000000
#define ECL_COMMENT_STRING "--"
#define ECL_COMMENT_CHAR '-' // Need to consecutive to make an ECLIPSE comment
#define ECL_DATA_TERMINATION "/"
int ecl_util_get_sizeof_ctype_fortio(ecl_type_enum ecl_type);
int ecl_util_get_sizeof_ctype(ecl_type_enum );
ecl_type_enum ecl_util_get_type_from_name( const char * type_name );
const char * ecl_util_get_type_name( ecl_type_enum ecl_type );
/*****************************************************************/
bool ecl_util_unified_file(const char *filename);
const char * ecl_util_file_type_name( ecl_file_enum file_type );
char * ecl_util_alloc_base_guess(const char *);
int ecl_util_filename_report_nr(const char *);
ecl_file_enum ecl_util_get_file_type(const char * , bool * , int * );
ecl_file_enum ecl_util_inspect_extension(const char * ext , bool *_fmt_file, int * _report_nr);
char * ecl_util_alloc_filename(const char * /* path */, const char * /* base */, ecl_file_enum , bool /* fmt_file */ , int /*report_nr*/);
char * ecl_util_alloc_exfilename(const char * /* path */, const char * /* base */, ecl_file_enum , bool /* fmt_file */ , int /*report_nr*/);
void ecl_util_memcpy_typed_data(void *, const void * , ecl_type_enum , ecl_type_enum , int );
void ecl_util_escape_kw(char * kw);
bool ecl_util_alloc_summary_files(const char * , const char * , const char * , char ** , stringlist_type * );
void ecl_util_alloc_summary_data_files(const char * path , const char * base , bool fmt_file , stringlist_type * filelist);
void ecl_util_alloc_restart_files(const char * , const char * , char *** , int * , bool * , bool *);
time_t ecl_util_get_start_date(const char * );
int ecl_util_get_num_cpu(const char * data_file);
bool ecl_util_fmt_file(const char *);
char * ecl_util_alloc_exfilename_anyfmt(const char * path, const char * base , ecl_file_enum file_type , bool start_fmt , int report_nr);
int ecl_util_get_month_nr(const char * month_name);
int ecl_util_fname_report_cmp(const void *f1, const void *f2);
bool ecl_util_valid_basename( const char * basename );
const char * ecl_util_get_phase_name( ecl_phase_enum phase );
const char * ecl_util_file_enum_iget( int index, int * value);
int ecl_util_select_filelist( const char * path , const char * base , ecl_file_enum file_type , bool fmt_file , stringlist_type * filelist);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __float_VECTOR_H__
#define __float_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct float_vector_struct float_vector_type;
typedef float (float_ftype) (float);
int float_vector_lookup_bin( const float_vector_type * limits , float value , int guess);
int float_vector_lookup_bin__( const float_vector_type * limits , float value , int guess);
void float_vector_inplace_div( float_vector_type * vector , const float_vector_type * inv_factor);
void float_vector_inplace_mul( float_vector_type * vector , const float_vector_type * factor);
void float_vector_inplace_add( float_vector_type * vector , const float_vector_type * delta);
void float_vector_set_read_only( float_vector_type * vector , bool read_only);
bool float_vector_get_read_only( const float_vector_type * vector );
void float_vector_resize( float_vector_type * vector , int new_alloc_size );
void float_vector_memcpy_data( float * target, const float_vector_type * src );
void float_vector_memcpy( float_vector_type * target , const float_vector_type * src);
void float_vector_memcpy_data_block( float_vector_type * target , const float_vector_type * src , int target_offset , int src_offset , int len);
bool float_vector_growable( const float_vector_type * vector);
void float_vector_select_unique(float_vector_type * vector);
float_vector_type * float_vector_alloc( int init_size , float );
float_vector_type * float_vector_alloc_private_wrapper(int init_size, float default_value , float * data , int alloc_size);
float_vector_type * float_vector_alloc_shared_wrapper(int init_size, float default_value , float * data , int alloc_size);
float_vector_type * float_vector_alloc_strided_copy( const float_vector_type * src , int start , int stop , int stride );
float_vector_type * float_vector_alloc_copy( const float_vector_type * src);
void float_vector_imul(float_vector_type * vector, int index, float factor);
void float_vector_scale(float_vector_type * vector, float factor);
float float_vector_iget(const float_vector_type * , int);
float float_vector_safe_iget(const float_vector_type * , int);
float float_vector_get_min(const float_vector_type * vector);
float float_vector_get_max(const float_vector_type * vector);
int float_vector_get_min_index(const float_vector_type * vector, bool reverse);
int float_vector_get_max_index(const float_vector_type * vector, bool reverse);
float float_vector_iadd( float_vector_type * vector , int index , float delta);
void float_vector_iset(float_vector_type * , int , float);
void float_vector_idel_block( float_vector_type * vector , int index , int block_size);
float float_vector_idel( float_vector_type * vector , int index);
void float_vector_append(float_vector_type * , float);
void float_vector_free(float_vector_type *);
void float_vector_free__(void *);
void float_vector_free_data(float_vector_type *);
void float_vector_reset(float_vector_type *);
void float_vector_reset__(void * __vector);
int float_vector_size(const float_vector_type * );
float float_vector_pop(float_vector_type * vector);
float float_vector_get_first(const float_vector_type * vector);
float float_vector_get_last(const float_vector_type * );
float * float_vector_get_ptr(const float_vector_type * );
float * float_vector_alloc_data_copy( const float_vector_type * vector );
const float * float_vector_get_const_ptr(const float_vector_type * );
void float_vector_set_many(float_vector_type * , int , const float * , int );
void float_vector_set_all(float_vector_type * vector , float value);
void float_vector_append_many(float_vector_type * vector , const float * data , int length);
void float_vector_shrink(float_vector_type * );
float float_vector_sum(const float_vector_type * );
float float_vector_get_default(const float_vector_type * );
void float_vector_set_default(float_vector_type * vector, float default_value);
void float_vector_append_default(float_vector_type * vector , float default_value);
void float_vector_iset_default(float_vector_type * vector , int index , float default_value);
bool float_vector_is_sorted( const float_vector_type * vector , bool reverse);
int float_vector_index(const float_vector_type * vector , float value);
int float_vector_index_sorted(const float_vector_type * vector , float value);
void float_vector_sort(float_vector_type * vector);
void float_vector_rsort(float_vector_type * vector);
void float_vector_permute(float_vector_type * vector , const int * perm);
int * float_vector_alloc_sort_perm(const float_vector_type * vector);
int * float_vector_alloc_rsort_perm(const float_vector_type * vector);
void float_vector_fprintf(const float_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void float_vector_fwrite(const float_vector_type * vector , FILE * stream);
void float_vector_buffer_fread(float_vector_type * vector , buffer_type * buffer);
float_vector_type * float_vector_fread_alloc( FILE * stream );
float_vector_type * float_vector_buffer_fread_alloc( buffer_type * buffer );
void float_vector_buffer_fwrite(const float_vector_type * vector , buffer_type * buffer);
void float_vector_fread( float_vector_type * vector , FILE * stream );
void float_vector_fwrite_data( const float_vector_type * vector , FILE * stream );
void float_vector_fread_data( float_vector_type * vector , int size, FILE * stream);
bool float_vector_equal(const float_vector_type * vector1 , const float_vector_type * vector2);
void float_vector_apply(float_vector_type * vector , float_ftype *func);
int float_vector_count_equal( const float_vector_type * vector , float cmp_value);
int float_vector_element_size( const float_vector_type * vector );
UTIL_SAFE_CAST_HEADER( float_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,79 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'fortio.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __FORTIO_H__
#define __FORTIO_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
typedef enum {
FORTIO_NOENTRY = 0, /* File does not exists at all - application error. */
FORTIO_EOF = 1, /* The file / record is empty */
FORTIO_OK = 2, /* The file / record is OK with: [32 bit header | data | 32 bit footer] */
FORTIO_MISSING_DATA = 3,
FORTIO_MISSING_TAIL = 4,
FORTIO_HEADER_MISMATCH = 5
} fortio_status_type;
#define FORTIO_READ 1
#define FORTIO_WRITE 2
typedef struct fortio_struct fortio_type;
fortio_status_type fortio_check_buffer( FILE * stream , bool endian_flip , size_t buffer_size );
fortio_status_type fortio_check_file( const char * filename , bool endian_flip);
bool fortio_guess_endian_flip(const char * , bool *);
bool fortio_is_fortran_file(const char * , bool * );
void fortio_copy_record(fortio_type * , fortio_type * , int , void * , bool *);
fortio_type * fortio_alloc_FILE_wrapper(const char * , bool , bool , FILE * );
fortio_type * fortio_open_reader(const char *, bool fmt_file , bool endian_flip_header);
fortio_type * fortio_open_writer(const char *, bool fmt_file , bool endian_flip_header);
fortio_type * fortio_open_readwrite(const char *, bool fmt_file , bool endian_flip_header);
fortio_type * fortio_open_append(const char *filename , bool fmt_file , bool endian_flip_header);
void fortio_free_FILE_wrapper(fortio_type *);
void fortio_fclose(fortio_type *);
int fortio_init_read(fortio_type *);
void fortio_complete_read(fortio_type *);
void fortio_init_write(fortio_type * , int);
void fortio_complete_write(fortio_type *);
void fortio_fskip_buffer(fortio_type *, int );
int fortio_fskip_record(fortio_type *);
int fortio_fread_record(fortio_type * , char *buffer);
void fortio_fread_buffer(fortio_type * , char * , int );
void fortio_fwrite_record(fortio_type * , const char *, int);
FILE * fortio_get_FILE(const fortio_type *);
void fortio_fflush(fortio_type * ) ;
int fortio_get_record_size(const fortio_type *);
bool fortio_is_fortio_file(fortio_type * );
void fortio_rewind(const fortio_type *fortio);
const char * fortio_filename_ref(const fortio_type * );
bool fortio_fmt_file(const fortio_type *);
long fortio_ftell( const fortio_type * fortio );
int fortio_fseek( fortio_type * fortio , long offset , int whence);
int fortio_get_mode( const fortio_type * fortio );
int fortio_fileno( fortio_type * fortio );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,42 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'geo_pointset.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __GEO_POINTSET_H__
#define __GEO_POINTSET_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct geo_pointset_struct geo_pointset_type;
geo_pointset_type * geo_pointset_alloc( bool external_z );
void geo_pointset_free( geo_pointset_type * pointset );
void geo_pointset_add_xy( geo_pointset_type * pointset , double x , double y);
void geo_pointset_add_xyz( geo_pointset_type * pointset , double x , double y, double z);
int geo_pointset_get_size( const geo_pointset_type * pointset );
void geo_pointset_iget_xy( const geo_pointset_type * pointset , int index , double * x , double * y);
const double * geo_pointset_get_zcoord( const geo_pointset_type * pointset );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,56 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'geo_region.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#include <stdlib.h>
#include <stdbool.h>
#include <util.h>
#include <geo_pointset.h>
#include <geo_polygon.h>
#ifndef __GEO_REGION_H__
#define __GEO_REGION_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct geo_region_struct geo_region_type;
geo_region_type * geo_region_alloc( const geo_pointset_type * pointset , bool preselect);
void geo_region_free( geo_region_type * region );
void geo_region_free__( void * arg );
void geo_region_reset( geo_region_type * region );
const int_vector_type * geo_region_get_index_list( geo_region_type * region );
void geo_region_select_inside_polygon( geo_region_type * region , const geo_polygon_type * polygon);
void geo_region_select_outside_polygon( geo_region_type * region , const geo_polygon_type * polygon);
void geo_region_deselect_inside_polygon( geo_region_type * region , const geo_polygon_type * polygon);
void geo_region_deselect_outside_polygon( geo_region_type * region , const geo_polygon_type * polygon);
void geo_region_select_above_line( geo_region_type * region, const double xcoords[2] , const double ycoords[2]);
void geo_region_select_below_line( geo_region_type * region, const double xcoords[2] , const double ycoords[2]);
void geo_region_deselect_above_line( geo_region_type * region, const double xcoords[2] , const double ycoords[2]);
void geo_region_deselect_below_line( geo_region_type * region, const double xcoords[2] , const double ycoords[2]);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,46 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'geo_surface.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __GEO_SURFACE_H__
#define __GEO_SURFACE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <geo_pointset.h>
typedef struct geo_surface_struct geo_surface_type;
void geo_surface_free( geo_surface_type * geo_surface );
void geo_surface_free__( void * arg);
geo_pointset_type * geo_surface_get_pointset( const geo_surface_type * surface );
geo_surface_type * geo_surface_fload_alloc_irap( const char * filename , bool loadz);
void geo_surface_fload_irap_zcoord( const geo_surface_type * surface, const char * filename, double *zlist);
int geo_surface_get_size( const geo_surface_type * surface );
void geo_surface_fprintf_irap( const geo_surface_type * surface, const char * filename );
void geo_surface_fprintf_irap_external_zcoord( const geo_surface_type * surface, const char * filename , const double * zcoord);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,85 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'hash.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __HASH_H__
#define __HASH_H__
#ifdef __cplusplus
extern"C" {
#endif
#include <stdlib.h>
#include <stringlist.h>
#include <type_macros.h>
typedef struct hash_struct hash_type;
typedef struct hash_iter_struct hash_iter_type;
typedef void (hash_apply_ftype) (void * );
#include <hash_node.h>
void hash_lock (hash_type * );
void hash_unlock(hash_type * );
hash_type * hash_alloc();
hash_type * hash_alloc_unlocked();
hash_type * hash_safe_cast( void * arg);
void hash_iter_complete(hash_type * );
void hash_free(hash_type *);
void hash_free__(void *);
void hash_insert_ref(hash_type * , const char * , const void *);
void hash_insert_copy(hash_type *, const char * , const void *, copyc_ftype *, free_ftype *);
void hash_insert_string(hash_type *, const char *, const char *);
bool hash_has_key(const hash_type *, const char *);
void * hash_pop( hash_type * hash , const char * key);
void * hash_safe_get( const hash_type * hash , const char * key );
void * hash_get(const hash_type *, const char *);
char * hash_get_string(hash_type * , const char *);
void hash_del(hash_type *, const char *);
void hash_safe_del(hash_type * , const char * );
void hash_clear(hash_type *);
int hash_get_size(const hash_type *);
void hash_set_keylist(const hash_type * , char **);
char ** hash_alloc_keylist(hash_type *);
stringlist_type * hash_alloc_stringlist(hash_type * );
char ** hash_alloc_sorted_keylist (hash_type *hash , int ( hash_get_cmp_value ) (const void *));
char ** hash_alloc_key_sorted_list(hash_type *hash, int (*cmp)(const void *, const void *));
bool hash_key_list_compare( hash_type * hash1, hash_type * hash2);
void hash_insert_hash_owned_ref(hash_type *, const char * , const void *, free_ftype *);
void hash_resize(hash_type *hash, int new_size);
hash_iter_type * hash_iter_alloc(const hash_type *);
void hash_iter_free(hash_iter_type *);
bool hash_iter_is_complete(const hash_iter_type *);
const char * hash_iter_get_next_key(hash_iter_type *);
void * hash_iter_get_next_value(hash_iter_type *);
void hash_iter_restart( hash_iter_type * iter );
hash_type * hash_alloc_from_options(const stringlist_type *);
int hash_inc_counter(hash_type * hash , const char * counter_key);
int hash_get_counter(hash_type * hash , const char * key);
void hash_insert_int(hash_type * , const char * , int);
int hash_get_int(hash_type * , const char *);
void hash_insert_double(hash_type * , const char * , double);
double hash_get_double(hash_type * , const char *);
void hash_apply( hash_type * hash , hash_apply_ftype * func);
UTIL_IS_INSTANCE_HEADER(hash);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,49 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'hash_node.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __HASH_NODE_H__
#define __HASH_NODE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdint.h>
#include <node_data.h>
typedef struct hash_node_struct hash_node_type;
typedef uint32_t (hashf_type) (const char *key, size_t len);
typedef enum {hash_ref_data , hash_int_data , hash_double_data , hash_string_data} hash_data_type;
bool hash_node_key_eq(const hash_node_type * , uint32_t , const char *);
hash_node_type * hash_node_get_next(const hash_node_type * );
uint32_t hash_node_get_insert_nr(const hash_node_type * );
void hash_node_set_next(hash_node_type * , const hash_node_type * );
hash_node_type * hash_node_alloc_new(const char *, node_data_type * , hashf_type *, uint32_t);
void hash_node_set_insert_nr(hash_node_type *, uint32_t );
uint32_t hash_node_get_table_index(const hash_node_type * );
uint32_t hash_node_get_global_index(const hash_node_type * );
const char * hash_node_get_key(const hash_node_type * );
node_data_type * hash_node_get_data(const hash_node_type *);
void hash_node_free(hash_node_type *);
uint32_t hash_node_set_table_index(hash_node_type *, uint32_t );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,41 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'hash_sll.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __HASH_SLL_H__
#define __HASH_SLL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <hash_node.h>
typedef struct hash_sll_struct hash_sll_type;
hash_sll_type **hash_sll_alloc_table(int );
/*hash_sll_type * hash_sll_alloc(void);*/
void hash_sll_del_node(hash_sll_type * , hash_node_type *);
void hash_sll_add_node(hash_sll_type *, hash_node_type *);
void hash_sll_free(hash_sll_type *);
bool hash_sll_has_key(const hash_sll_type *, uint32_t , const char *);
bool hash_sll_empty(const hash_sll_type * hash_sll);
hash_node_type * hash_sll_get(const hash_sll_type *, uint32_t , const char *);
hash_node_type * hash_sll_get_head(const hash_sll_type *);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __int_VECTOR_H__
#define __int_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct int_vector_struct int_vector_type;
typedef int (int_ftype) (int);
int int_vector_lookup_bin( const int_vector_type * limits , int value , int guess);
int int_vector_lookup_bin__( const int_vector_type * limits , int value , int guess);
void int_vector_inplace_div( int_vector_type * vector , const int_vector_type * inv_factor);
void int_vector_inplace_mul( int_vector_type * vector , const int_vector_type * factor);
void int_vector_inplace_add( int_vector_type * vector , const int_vector_type * delta);
void int_vector_set_read_only( int_vector_type * vector , bool read_only);
bool int_vector_get_read_only( const int_vector_type * vector );
void int_vector_resize( int_vector_type * vector , int new_alloc_size );
void int_vector_memcpy_data( int * target, const int_vector_type * src );
void int_vector_memcpy( int_vector_type * target , const int_vector_type * src);
void int_vector_memcpy_data_block( int_vector_type * target , const int_vector_type * src , int target_offset , int src_offset , int len);
bool int_vector_growable( const int_vector_type * vector);
void int_vector_select_unique(int_vector_type * vector);
int_vector_type * int_vector_alloc( int init_size , int );
int_vector_type * int_vector_alloc_private_wrapper(int init_size, int default_value , int * data , int alloc_size);
int_vector_type * int_vector_alloc_shared_wrapper(int init_size, int default_value , int * data , int alloc_size);
int_vector_type * int_vector_alloc_strided_copy( const int_vector_type * src , int start , int stop , int stride );
int_vector_type * int_vector_alloc_copy( const int_vector_type * src);
void int_vector_imul(int_vector_type * vector, int index, int factor);
void int_vector_scale(int_vector_type * vector, int factor);
int int_vector_iget(const int_vector_type * , int);
int int_vector_safe_iget(const int_vector_type * , int);
int int_vector_get_min(const int_vector_type * vector);
int int_vector_get_max(const int_vector_type * vector);
int int_vector_get_min_index(const int_vector_type * vector, bool reverse);
int int_vector_get_max_index(const int_vector_type * vector, bool reverse);
int int_vector_iadd( int_vector_type * vector , int index , int delta);
void int_vector_iset(int_vector_type * , int , int);
void int_vector_idel_block( int_vector_type * vector , int index , int block_size);
int int_vector_idel( int_vector_type * vector , int index);
void int_vector_append(int_vector_type * , int);
void int_vector_free(int_vector_type *);
void int_vector_free__(void *);
void int_vector_free_data(int_vector_type *);
void int_vector_reset(int_vector_type *);
void int_vector_reset__(void * __vector);
int int_vector_size(const int_vector_type * );
int int_vector_pop(int_vector_type * vector);
int int_vector_get_first(const int_vector_type * vector);
int int_vector_get_last(const int_vector_type * );
int * int_vector_get_ptr(const int_vector_type * );
int * int_vector_alloc_data_copy( const int_vector_type * vector );
const int * int_vector_get_const_ptr(const int_vector_type * );
void int_vector_set_many(int_vector_type * , int , const int * , int );
void int_vector_set_all(int_vector_type * vector , int value);
void int_vector_append_many(int_vector_type * vector , const int * data , int length);
void int_vector_shrink(int_vector_type * );
int int_vector_sum(const int_vector_type * );
int int_vector_get_default(const int_vector_type * );
void int_vector_set_default(int_vector_type * vector, int default_value);
void int_vector_append_default(int_vector_type * vector , int default_value);
void int_vector_iset_default(int_vector_type * vector , int index , int default_value);
bool int_vector_is_sorted( const int_vector_type * vector , bool reverse);
int int_vector_index(const int_vector_type * vector , int value);
int int_vector_index_sorted(const int_vector_type * vector , int value);
void int_vector_sort(int_vector_type * vector);
void int_vector_rsort(int_vector_type * vector);
void int_vector_permute(int_vector_type * vector , const int * perm);
int * int_vector_alloc_sort_perm(const int_vector_type * vector);
int * int_vector_alloc_rsort_perm(const int_vector_type * vector);
void int_vector_fprintf(const int_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void int_vector_fwrite(const int_vector_type * vector , FILE * stream);
void int_vector_buffer_fread(int_vector_type * vector , buffer_type * buffer);
int_vector_type * int_vector_fread_alloc( FILE * stream );
int_vector_type * int_vector_buffer_fread_alloc( buffer_type * buffer );
void int_vector_buffer_fwrite(const int_vector_type * vector , buffer_type * buffer);
void int_vector_fread( int_vector_type * vector , FILE * stream );
void int_vector_fwrite_data( const int_vector_type * vector , FILE * stream );
void int_vector_fread_data( int_vector_type * vector , int size, FILE * stream);
bool int_vector_equal(const int_vector_type * vector1 , const int_vector_type * vector2);
void int_vector_apply(int_vector_type * vector , int_ftype *func);
int int_vector_count_equal( const int_vector_type * vector , int cmp_value);
int int_vector_element_size( const int_vector_type * vector );
UTIL_SAFE_CAST_HEADER( int_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,50 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'log.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __LOG_H__
#define __LOG_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdlib.h>
typedef struct log_struct log_type;
FILE * log_get_stream(log_type * logh );
void log_reset_filename( log_type * logh , const char * filename );
void log_set_file(log_type * , const char *);
log_type * log_alloc_new(const char *filename, int log_level);
log_type * log_alloc_existing(const char *filename, int log_level);
void log_add_message(log_type *logh, int message_level , FILE * dup_stream , char* message, bool free_message);
void log_add_fmt_message(log_type * logh , int message_level , FILE * dup_stream , const char * fmt , ...);
int log_get_level( const log_type * logh);
void log_set_level( log_type * logh , int new_level);
void log_close( log_type * logh );
void log_sync(log_type * logh);
const char * log_get_filename( const log_type * logh );
int log_get_level( const log_type * logh);
void log_set_level( log_type * logh , int log_level);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __long_VECTOR_H__
#define __long_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct long_vector_struct long_vector_type;
typedef long (long_ftype) (long);
int long_vector_lookup_bin( const long_vector_type * limits , long value , int guess);
int long_vector_lookup_bin__( const long_vector_type * limits , long value , int guess);
void long_vector_inplace_div( long_vector_type * vector , const long_vector_type * inv_factor);
void long_vector_inplace_mul( long_vector_type * vector , const long_vector_type * factor);
void long_vector_inplace_add( long_vector_type * vector , const long_vector_type * delta);
void long_vector_set_read_only( long_vector_type * vector , bool read_only);
bool long_vector_get_read_only( const long_vector_type * vector );
void long_vector_resize( long_vector_type * vector , int new_alloc_size );
void long_vector_memcpy_data( long * target, const long_vector_type * src );
void long_vector_memcpy( long_vector_type * target , const long_vector_type * src);
void long_vector_memcpy_data_block( long_vector_type * target , const long_vector_type * src , int target_offset , int src_offset , int len);
bool long_vector_growable( const long_vector_type * vector);
void long_vector_select_unique(long_vector_type * vector);
long_vector_type * long_vector_alloc( int init_size , long );
long_vector_type * long_vector_alloc_private_wrapper(int init_size, long default_value , long * data , int alloc_size);
long_vector_type * long_vector_alloc_shared_wrapper(int init_size, long default_value , long * data , int alloc_size);
long_vector_type * long_vector_alloc_strided_copy( const long_vector_type * src , int start , int stop , int stride );
long_vector_type * long_vector_alloc_copy( const long_vector_type * src);
void long_vector_imul(long_vector_type * vector, int index, long factor);
void long_vector_scale(long_vector_type * vector, long factor);
long long_vector_iget(const long_vector_type * , int);
long long_vector_safe_iget(const long_vector_type * , int);
long long_vector_get_min(const long_vector_type * vector);
long long_vector_get_max(const long_vector_type * vector);
int long_vector_get_min_index(const long_vector_type * vector, bool reverse);
int long_vector_get_max_index(const long_vector_type * vector, bool reverse);
long long_vector_iadd( long_vector_type * vector , int index , long delta);
void long_vector_iset(long_vector_type * , int , long);
void long_vector_idel_block( long_vector_type * vector , int index , int block_size);
long long_vector_idel( long_vector_type * vector , int index);
void long_vector_append(long_vector_type * , long);
void long_vector_free(long_vector_type *);
void long_vector_free__(void *);
void long_vector_free_data(long_vector_type *);
void long_vector_reset(long_vector_type *);
void long_vector_reset__(void * __vector);
int long_vector_size(const long_vector_type * );
long long_vector_pop(long_vector_type * vector);
long long_vector_get_first(const long_vector_type * vector);
long long_vector_get_last(const long_vector_type * );
long * long_vector_get_ptr(const long_vector_type * );
long * long_vector_alloc_data_copy( const long_vector_type * vector );
const long * long_vector_get_const_ptr(const long_vector_type * );
void long_vector_set_many(long_vector_type * , int , const long * , int );
void long_vector_set_all(long_vector_type * vector , long value);
void long_vector_append_many(long_vector_type * vector , const long * data , int length);
void long_vector_shrink(long_vector_type * );
long long_vector_sum(const long_vector_type * );
long long_vector_get_default(const long_vector_type * );
void long_vector_set_default(long_vector_type * vector, long default_value);
void long_vector_append_default(long_vector_type * vector , long default_value);
void long_vector_iset_default(long_vector_type * vector , int index , long default_value);
bool long_vector_is_sorted( const long_vector_type * vector , bool reverse);
int long_vector_index(const long_vector_type * vector , long value);
int long_vector_index_sorted(const long_vector_type * vector , long value);
void long_vector_sort(long_vector_type * vector);
void long_vector_rsort(long_vector_type * vector);
void long_vector_permute(long_vector_type * vector , const int * perm);
int * long_vector_alloc_sort_perm(const long_vector_type * vector);
int * long_vector_alloc_rsort_perm(const long_vector_type * vector);
void long_vector_fprintf(const long_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void long_vector_fwrite(const long_vector_type * vector , FILE * stream);
void long_vector_buffer_fread(long_vector_type * vector , buffer_type * buffer);
long_vector_type * long_vector_fread_alloc( FILE * stream );
long_vector_type * long_vector_buffer_fread_alloc( buffer_type * buffer );
void long_vector_buffer_fwrite(const long_vector_type * vector , buffer_type * buffer);
void long_vector_fread( long_vector_type * vector , FILE * stream );
void long_vector_fwrite_data( const long_vector_type * vector , FILE * stream );
void long_vector_fread_data( long_vector_type * vector , int size, FILE * stream);
bool long_vector_equal(const long_vector_type * vector1 , const long_vector_type * vector2);
void long_vector_apply(long_vector_type * vector , long_ftype *func);
int long_vector_count_equal( const long_vector_type * vector , long cmp_value);
int long_vector_element_size( const long_vector_type * vector );
UTIL_SAFE_CAST_HEADER( long_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,46 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'lookup_table.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __LOOKUP_TABLE_H__
#define __LOOKUP_TABLE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <double_vector.h>
typedef struct lookup_table_struct lookup_table_type;
void lookup_table_set_data( lookup_table_type * lt , double_vector_type * x , double_vector_type * y , bool data_owner );
lookup_table_type * lookup_table_alloc( double_vector_type * x , double_vector_type * y , bool data_owner);
lookup_table_type * lookup_table_alloc_empty();
void lookup_table_append( lookup_table_type * lt , double x , double y);
void lookup_table_free( lookup_table_type * lt );
double lookup_table_interp( lookup_table_type * lt , double x);
double lookup_table_get_max_value( lookup_table_type * lookup_table );
double lookup_table_get_min_value( lookup_table_type * lookup_table );
double lookup_table_get_max_arg( lookup_table_type * lookup_table );
double lookup_table_get_max_arg( lookup_table_type * lookup_table );
int lookup_table_get_size( const lookup_table_type * lt );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,146 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'matrix.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __MATRIX_H__
#define __MATRIX_H__
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <rng.h>
#include <type_macros.h>
#ifdef HAVE_THREAD_POOL
#include <thread_pool.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct matrix_struct matrix_type;
void matrix_fscanf_data( matrix_type * matrix , bool row_major_order , FILE * stream );
void matrix_fprintf( const matrix_type * matrix , const char * fmt , FILE * stream );
void matrix_pretty_fprint(const matrix_type * matrix , const char * name , const char * fmt , FILE * stream);
matrix_type * matrix_alloc(int rows, int columns);
matrix_type * matrix_safe_alloc(int rows, int columns);
bool matrix_resize(matrix_type * matrix , int rows , int columns , bool copy_content);
bool matrix_safe_resize(matrix_type * matrix , int rows , int columns , bool copy_content);
matrix_type * matrix_alloc_copy(const matrix_type * src);
matrix_type * matrix_safe_alloc_copy(const matrix_type * src);
matrix_type * matrix_realloc_copy(matrix_type * T , const matrix_type * src);
matrix_type * matrix_alloc_shared(const matrix_type * src , int row , int column , int rows , int columns);
void matrix_free(matrix_type * matrix);
void matrix_safe_free( matrix_type * matrix );
void matrix_pretty_print(const matrix_type * matrix , const char * name , const char * fmt);
void matrix_set(matrix_type * matrix, double value);
void matrix_set_name( matrix_type * matrix , const char * name);
void matrix_scale(matrix_type * matrix, double value);
void matrix_shift(matrix_type * matrix, double value);
void matrix_assign(matrix_type * A , const matrix_type * B);
void matrix_inplace_add(matrix_type * A , const matrix_type * B);
void matrix_inplace_sub(matrix_type * A , const matrix_type * B);
void matrix_inplace_mul(matrix_type * A , const matrix_type * B);
void matrix_inplace_div(matrix_type * A , const matrix_type * B);
void matrix_sub(matrix_type * A , const matrix_type * B , const matrix_type * C);
void matrix_mul( matrix_type * A , const matrix_type * B , const matrix_type * C);
void matrix_transpose(const matrix_type * A , matrix_type * T);
void matrix_iset_safe(matrix_type * matrix , int i , int j, double value);
void matrix_iset(matrix_type * matrix , int i , int j, double value);
double matrix_iget(const matrix_type * matrix , int i , int j);
double matrix_iget_safe(const matrix_type * matrix , int i , int j);
void matrix_iadd(matrix_type * matrix , int i , int j , double value);
void matrix_isub(matrix_type * matrix , int i , int j , double value);
void matrix_imul(matrix_type * matrix , int i , int j , double value);
void matrix_inplace_matmul(matrix_type * A, const matrix_type * B);
void matrix_inplace_matmul_mt1(matrix_type * A, const matrix_type * B , int num_threads);
#ifdef HAVE_THREAD_POOL
void matrix_inplace_matmul_mt2(matrix_type * A, const matrix_type * B , thread_pool_type * thread_pool);
#endif
void matrix_shift_column(matrix_type * matrix , int column, double shift);
void matrix_shift_row(matrix_type * matrix , int row , double shift);
double matrix_get_column_sum(const matrix_type * matrix , int column);
double matrix_get_row_sum(const matrix_type * matrix , int column);
double matrix_get_column_sum2(const matrix_type * matrix , int column);
double matrix_get_row_abssum(const matrix_type * matrix , int row);
double matrix_get_column_abssum(const matrix_type * matrix , int column);
double matrix_get_row_sum2(const matrix_type * matrix , int column);
void matrix_subtract_row_mean(matrix_type * matrix);
void matrix_subtract_and_store_row_mean(matrix_type * matrix, matrix_type * row_mean);
void matrix_scale_column(matrix_type * matrix , int column , double scale_factor);
void matrix_scale_row(matrix_type * matrix , int row , double scale_factor);
void matrix_set_const_column(matrix_type * matrix , const double value , int column);
void matrix_copy_column(matrix_type * target_matrix, const matrix_type * src_matrix , int src_column, int target_column);
void matrix_set_const_row(matrix_type * matrix , const double value , int row);
double * matrix_get_data(const matrix_type * matrix);
double matrix_orthonormality( const matrix_type * matrix );
matrix_type * matrix_alloc_steal_data(int rows , int columns , double * data , int data_size);
void matrix_set_column(matrix_type * matrix , const double * data , int column);
void matrix_set_many_on_column(matrix_type * matrix , int row_offset , int elements , const double * data , int column);
void matrix_ensure_rows(matrix_type * matrix, int rows, bool copy_content);
void matrix_shrink_header(matrix_type * matrix , int rows , int columns);
void matrix_full_size( matrix_type * matrix );
int matrix_get_rows(const matrix_type * matrix);
int matrix_get_columns(const matrix_type * matrix);
int matrix_get_row_stride(const matrix_type * matrix);
int matrix_get_column_stride(const matrix_type * matrix);
void matrix_get_dims(const matrix_type * matrix , int * rows , int * columns , int * row_stride , int * column_stride);
bool matrix_is_quadratic(const matrix_type * matrix);
bool matrix_equal( const matrix_type * m1 , const matrix_type * m2);
void matrix_diag_set_scalar(matrix_type * matrix , double value);
void matrix_diag_set(matrix_type * matrix , const double * diag);
void matrix_random_init(matrix_type * matrix , rng_type * rng);
void matrix_matlab_dump(const matrix_type * matrix, const char * filename);
void matrix_imul_col( matrix_type * matrix , int column , double factor);
double matrix_column_column_dot_product(const matrix_type * m1 , int col1 , const matrix_type * m2 , int col2);
double matrix_row_column_dot_product(const matrix_type * m1 , int row1 , const matrix_type * m2 , int col2);
matrix_type * matrix_alloc_view(double * data , int rows , int columns);
matrix_type * matrix_alloc_transpose( const matrix_type * A);
void matrix_copy_row(matrix_type * target_matrix, const matrix_type * src_matrix , int target_row, int src_row);
void matrix_copy_block( matrix_type * target_matrix , int target_row , int target_column , int rows , int columns,
const matrix_type * src_matrix , int src_row , int src_column);
void matrix_scalar_set( matrix_type * matrix , double value);
void matrix_inplace_diag_sqrt(matrix_type *Cd);
void matrix_create_identiy(int n,matrix_type *Id);
double matrix_trace(const matrix_type *matrix);
double matrix_diag_std(const matrix_type * Sk,double mean);
double matrix_det3( const matrix_type * A);
double matrix_det4( const matrix_type * A);
#ifdef HAVE_ISFINITE
bool matrix_is_finite(const matrix_type * matrix);
void matrix_assert_finite( const matrix_type * matrix );
#endif
UTIL_SAFE_CAST_HEADER( matrix );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,42 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'menu.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __MENU_H__
#define __MENU_H__
typedef struct menu_struct menu_type;
typedef struct menu_item_struct menu_item_type;
typedef void (menu_func_type) (void *);
typedef void (arg_free_ftype) (void *);
menu_type * menu_alloc(const char * , const char * , const char *);
void menu_run(const menu_type * );
void menu_free(menu_type * );
menu_item_type * menu_get_item(const menu_type * , char );
menu_item_type * menu_add_item(menu_type *, const char * , const char * , menu_func_type * , void * , arg_free_ftype * );
void menu_add_separator(menu_type * );
menu_item_type * menu_get_item(const menu_type * , char );
void menu_set_title(menu_type *, const char *);
void menu_item_set_label( menu_item_type * , const char *);
void menu_item_disable( menu_item_type * item );
void menu_item_enable( menu_item_type * item );
#endif

View File

@ -1,46 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'mzran.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __MZRAN_H__
#define __MZRAN_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <util.h>
typedef struct mzran_struct mzran_type;
#define MZRAN_MAX_VALUE 4294967296
#define MZRAN_STATE_SIZE 16 /* Size of the seed buffer - in bytes. */
void mzran_fscanf_state( void * __rng , FILE * stream );
unsigned int mzran_forward(void * __rng);
void * mzran_alloc( void );
void mzran_set_state(void * __rng , const char * seed_buffer);
double mzran_get_double(mzran_type * rng);
int mzran_get_int( mzran_type * rng, int max);
void mzran_fprintf_state( const void * __rng , FILE * stream);
void mzran_free( void * __rng );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,50 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'node_ctype.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __NODE_CTYPE_H__
#define __NODE_CTYPE_H__
#ifdef __cplusplus
extern "C" {
#endif
/*
value : means a scalar which has been packed into the container
object.
pointer: means a (typed) pointer which points to a memory location
outside the container object (however the container can own
the memory).
*/
typedef enum {CTYPE_VOID_POINTER = 1,
CTYPE_INT_VALUE = 2,
CTYPE_DOUBLE_VALUE = 3,
CTYPE_FLOAT_VALUE = 4 ,
CTYPE_CHAR_VALUE = 5 ,
CTYPE_BOOL_VALUE = 6 ,
CTYPE_SIZE_T_VALUE = 7 ,
CTYPE_INVALID = 100} node_ctype;
const char * node_ctype_name(node_ctype );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,57 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'node_data.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __NODE_DATA_H__
#define __NODE_DATA_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
typedef void * ( copyc_ftype ) (const void *);
typedef void ( free_ftype ) (void *);
typedef struct node_data_struct node_data_type;
void node_data_free(node_data_type *);
void node_data_free_container(node_data_type * );
node_data_type * node_data_alloc_deep_copy(const node_data_type * );
node_data_type * node_data_alloc_shallow_copy(const node_data_type * );
node_data_type * node_data_alloc_copy(const node_data_type * node , bool deep_copy);
void * node_data_get_ptr(const node_data_type *);
const void * node_data_get_const_ptr(const node_data_type *);
node_data_type * node_data_alloc_buffer(const void *, int );
node_data_type * node_data_alloc_ptr(const void * , copyc_ftype * , free_ftype *);
node_data_type * node_data_alloc_int(int );
int node_data_get_int( const node_data_type * );
int node_data_fetch_and_inc_int( node_data_type * node_data );
node_data_type * node_data_alloc_double(double );
double node_data_get_double( const node_data_type * );
node_data_type * node_data_alloc_string(const char *);
char * node_data_get_string( const node_data_type * );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,159 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'parser.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __PARSER_H__
#define __PARSER_H__
#include <stringlist.h>
typedef struct parser_struct parser_type;
/**
GENERAL OVERVIEW
The parser_type is used to create a series of "tokens"
from a file or string buffer. In it's simplest form,
we define a token as a subset of a string separated by
by some split characters.
For example, if we define the normal space (i.e. " ") as
the only split character, "tokenizing" the string
"I like beer " would give the following result:
Token number 0 is "I"
Token number 1 is "like"
Token number 2 is "beer"
Note that all the white space (i.e. split characters) have been
removed.
COMMENTS
The parser can ignore comments when tokenzing
a file or buffer. To enable this feature, allocate
the parser_type with comment_start and comment_end
different from NULL. For example if we set both
comment_start and comment_end to "##", tokenizing
"I ## really ## like beer" would give:
Token number 0 is "I"
Token number 1 is "like"
Token number 2 is "beer"
SPECIAL CHARACTERS
Some times it can be useful to define a set of characters which
behave like white space in the sense that they separate tokens in
the source, but they do not get dropped. For example, letting "=" be
a special character, tokenzing "key=value" would give:
Token number 0 is "key"
Token number 1 is "="
Token number 2 is "value"
The special characters are given in the "specials" string when
allocating the parser.
QUOTERS
When parsing user input, the user often wants to provide e.g. a
filename with a white-space character in it. To support this, the
parser can be given a set of quoters. For example, letting " " be
white space and adding "'" to the quoters, tokenizing
"my_file = 'my documents with space in.txt'"
would give:
Token number 0 is "my_file"
Token number 1 is "="
Token number 2 is "'my documents with space in.txt'"
If wanted, the quoting characters can be removed
using the strip_quote_marks options when running
the parser on the buffer. The last token
in the example above would then be:
Token number 2 is "my documents with space in.txt"
To use one of the quoter characters in a string,
place a "\" in front of it. Building on our previous
example, let the string be "my_file = 'my \'doc.txt'"
Tokenzing this with strip_quote_marks set to true
would give:
Token number 0 is "my_file"
Token number 1 is "="
Token number 2 is "my 'doc.txt"
Note that the "\" in front of"'" has been removed.
If strip_quote_marks is set to false, the result is:
Token number 0 is "my_file"
Token number 1 is "="
Token number 2 is "'my \'doc.txt'"
*/
parser_type * parser_alloc(
const char * whitespace, /** Set to NULL if not interessting. */
const char * quoters, /** Set to NULL if not interessting. */
const char * specials, /** Set to NULL if not interessting. */
const char * delete_set,
const char * comment_start, /** Set to NULL if not interessting. */
const char * comment_end); /** Set to NULL if not interessting. */
void parser_set_splitters( parser_type * parser , const char * splitters );
void parser_set_quoters( parser_type * parser , const char * quoters );
void parser_set_specials( parser_type * parser , const char * specials );
void parser_set_delete_set( parser_type * parser , const char * delete_set );
void parser_set_comment_start( parser_type * parser , const char * comment_start );
void parser_set_comment_end( parser_type * parser , const char * comment_end );
void parser_free(
parser_type * parser);
stringlist_type * parser_tokenize_buffer(
const parser_type * parser,
const char * buffer,
bool strip_quote_marks);
stringlist_type * parser_tokenize_file(
const parser_type * parser,
const char * filename,
bool strip_quote_marks);
/* Pollution by Joakim: */
void parser_strip_buffer(const parser_type * parser , char ** __buffer);
bool parser_fseek_string(const parser_type * parser , FILE * stream , const char * string , bool skip_string , bool case_sensitive);
char * parser_fread_alloc_file_content(const char * filename , const char * quote_set , const char * delete_set , const char * comment_start , const char * comment_end);
#endif

View File

@ -1,46 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'path_fmt.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __PATH_FMT_H__
#define __PATH_FMT_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include <stdbool.h>
#include <node_ctype.h>
typedef struct path_fmt_struct path_fmt_type;
path_fmt_type * path_fmt_alloc_directory_fmt(const char * );
path_fmt_type * path_fmt_alloc_path_fmt(const char * );
path_fmt_type * path_fmt_copyc(const path_fmt_type *);
path_fmt_type * path_fmt_scanf_alloc(const char * , int , const node_ctype * , bool );
char * path_fmt_alloc_path(const path_fmt_type * , bool , ...);
char * path_fmt_alloc_file(const path_fmt_type * , bool , ...);
void path_fmt_free(path_fmt_type * );
void path_fmt_free__( void * arg );
const char * path_fmt_get_fmt(const path_fmt_type * );
void path_fmt_reset_fmt(path_fmt_type * , const char * );
void path_fmt_make_path(const path_fmt_type * );
path_fmt_type * path_fmt_realloc_path_fmt( path_fmt_type * path_fmt, const char * fmt );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,75 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'rng.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __RNG_H__
#define __RNG_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <type_macros.h>
typedef enum {
INIT_DEFAULT = 0, /* The rng is initialized with the default seed values. */
INIT_CLOCK = 1, /* Four random seeds are calculated with the util_clock_seed() function. */
INIT_DEV_RANDOM = 2, /* Random content is read with the function util_fread_dev_random(). */
INIT_DEV_URANDOM = 3 /* Random content is read with the function util_fread_dev_urandom(). */
} rng_init_mode;
typedef enum {
MZRAN = 1
} rng_alg_type;
typedef unsigned int ( rng_forward_ftype ) ( void * );
typedef void ( rng_set_state_ftype ) ( void * , const char * );
typedef void * ( rng_alloc_ftype ) ( void );
typedef void ( rng_free_ftype ) ( void * );
typedef void ( rng_fscanf_ftype ) ( void * , FILE * );
typedef void ( rng_fprintf_ftype ) ( const void * , FILE * );
typedef struct rng_struct rng_type;
rng_type * rng_alloc( rng_alg_type type , rng_init_mode init_mode );
void rng_free( rng_type * rng);
void rng_free( rng_type * rng);
unsigned int rng_forward( rng_type * rng );
double rng_get_double( rng_type * rng);
void rng_rng_init( rng_type * rng , rng_type * seed_src);
void rng_init( rng_type * rng , rng_init_mode init_mode );
rng_alg_type rng_get_type( const rng_type * rng );
void rng_fprintf_state( rng_type * rng , FILE * stream );
void rng_fscanf_state( rng_type * rng , FILE * stream );
unsigned int rng_forward( rng_type * rng );
double rng_get_double( rng_type * rng );
int rng_get_int( rng_type * rng , int max_value );
double rng_std_normal( rng_type * rng );
void rng_shuffle_int( rng_type * rng , int * data , size_t num_elements);
void rng_shuffle( rng_type * rng , char * data , size_t element_size , size_t num_elements);
UTIL_SAFE_CAST_HEADER( rng );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,61 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'set.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __SET_H__
#define __SET_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <hash.h>
typedef struct set_struct set_type;
typedef struct set_iter_struct set_iter_type;
void set_clear( set_type * set );
void set_remove_key(set_type * , const char * );
set_type * set_alloc(int , const char ** );
set_type * set_alloc_empty();
bool set_add_key(set_type * , const char * );
bool set_has_key(const set_type * set, const char * );
void set_free(set_type * );
int set_get_size(const set_type *);
char ** set_alloc_keylist(const set_type * );
void set_fwrite(const set_type * , FILE * );
void set_fread(set_type * , FILE * );
set_type * set_fread_alloc(FILE *);
void set_fprintf(const set_type * , const char * sep , FILE * );
void set_intersect(set_type * , const set_type * );
void set_union(set_type * , const set_type * );
void set_minus(set_type * , const set_type * );
set_type * set_copyc(const set_type *);
set_iter_type * set_iter_alloc(const set_type * set);
void set_iter_free(set_iter_type * set_iter);
bool set_iter_is_complete(const set_iter_type * set_iter);
const char * set_iter_get_next_key(set_iter_type * set_iter);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __size_t_VECTOR_H__
#define __size_t_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct size_t_vector_struct size_t_vector_type;
typedef size_t (size_t_ftype) (size_t);
int size_t_vector_lookup_bin( const size_t_vector_type * limits , size_t value , int guess);
int size_t_vector_lookup_bin__( const size_t_vector_type * limits , size_t value , int guess);
void size_t_vector_inplace_div( size_t_vector_type * vector , const size_t_vector_type * inv_factor);
void size_t_vector_inplace_mul( size_t_vector_type * vector , const size_t_vector_type * factor);
void size_t_vector_inplace_add( size_t_vector_type * vector , const size_t_vector_type * delta);
void size_t_vector_set_read_only( size_t_vector_type * vector , bool read_only);
bool size_t_vector_get_read_only( const size_t_vector_type * vector );
void size_t_vector_resize( size_t_vector_type * vector , int new_alloc_size );
void size_t_vector_memcpy_data( size_t * target, const size_t_vector_type * src );
void size_t_vector_memcpy( size_t_vector_type * target , const size_t_vector_type * src);
void size_t_vector_memcpy_data_block( size_t_vector_type * target , const size_t_vector_type * src , int target_offset , int src_offset , int len);
bool size_t_vector_growable( const size_t_vector_type * vector);
void size_t_vector_select_unique(size_t_vector_type * vector);
size_t_vector_type * size_t_vector_alloc( int init_size , size_t );
size_t_vector_type * size_t_vector_alloc_private_wrapper(int init_size, size_t default_value , size_t * data , int alloc_size);
size_t_vector_type * size_t_vector_alloc_shared_wrapper(int init_size, size_t default_value , size_t * data , int alloc_size);
size_t_vector_type * size_t_vector_alloc_strided_copy( const size_t_vector_type * src , int start , int stop , int stride );
size_t_vector_type * size_t_vector_alloc_copy( const size_t_vector_type * src);
void size_t_vector_imul(size_t_vector_type * vector, int index, size_t factor);
void size_t_vector_scale(size_t_vector_type * vector, size_t factor);
size_t size_t_vector_iget(const size_t_vector_type * , int);
size_t size_t_vector_safe_iget(const size_t_vector_type * , int);
size_t size_t_vector_get_min(const size_t_vector_type * vector);
size_t size_t_vector_get_max(const size_t_vector_type * vector);
int size_t_vector_get_min_index(const size_t_vector_type * vector, bool reverse);
int size_t_vector_get_max_index(const size_t_vector_type * vector, bool reverse);
size_t size_t_vector_iadd( size_t_vector_type * vector , int index , size_t delta);
void size_t_vector_iset(size_t_vector_type * , int , size_t);
void size_t_vector_idel_block( size_t_vector_type * vector , int index , int block_size);
size_t size_t_vector_idel( size_t_vector_type * vector , int index);
void size_t_vector_append(size_t_vector_type * , size_t);
void size_t_vector_free(size_t_vector_type *);
void size_t_vector_free__(void *);
void size_t_vector_free_data(size_t_vector_type *);
void size_t_vector_reset(size_t_vector_type *);
void size_t_vector_reset__(void * __vector);
int size_t_vector_size(const size_t_vector_type * );
size_t size_t_vector_pop(size_t_vector_type * vector);
size_t size_t_vector_get_first(const size_t_vector_type * vector);
size_t size_t_vector_get_last(const size_t_vector_type * );
size_t * size_t_vector_get_ptr(const size_t_vector_type * );
size_t * size_t_vector_alloc_data_copy( const size_t_vector_type * vector );
const size_t * size_t_vector_get_const_ptr(const size_t_vector_type * );
void size_t_vector_set_many(size_t_vector_type * , int , const size_t * , int );
void size_t_vector_set_all(size_t_vector_type * vector , size_t value);
void size_t_vector_append_many(size_t_vector_type * vector , const size_t * data , int length);
void size_t_vector_shrink(size_t_vector_type * );
size_t size_t_vector_sum(const size_t_vector_type * );
size_t size_t_vector_get_default(const size_t_vector_type * );
void size_t_vector_set_default(size_t_vector_type * vector, size_t default_value);
void size_t_vector_append_default(size_t_vector_type * vector , size_t default_value);
void size_t_vector_iset_default(size_t_vector_type * vector , int index , size_t default_value);
bool size_t_vector_is_sorted( const size_t_vector_type * vector , bool reverse);
int size_t_vector_index(const size_t_vector_type * vector , size_t value);
int size_t_vector_index_sorted(const size_t_vector_type * vector , size_t value);
void size_t_vector_sort(size_t_vector_type * vector);
void size_t_vector_rsort(size_t_vector_type * vector);
void size_t_vector_permute(size_t_vector_type * vector , const int * perm);
int * size_t_vector_alloc_sort_perm(const size_t_vector_type * vector);
int * size_t_vector_alloc_rsort_perm(const size_t_vector_type * vector);
void size_t_vector_fprintf(const size_t_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void size_t_vector_fwrite(const size_t_vector_type * vector , FILE * stream);
void size_t_vector_buffer_fread(size_t_vector_type * vector , buffer_type * buffer);
size_t_vector_type * size_t_vector_fread_alloc( FILE * stream );
size_t_vector_type * size_t_vector_buffer_fread_alloc( buffer_type * buffer );
void size_t_vector_buffer_fwrite(const size_t_vector_type * vector , buffer_type * buffer);
void size_t_vector_fread( size_t_vector_type * vector , FILE * stream );
void size_t_vector_fwrite_data( const size_t_vector_type * vector , FILE * stream );
void size_t_vector_fread_data( size_t_vector_type * vector , int size, FILE * stream);
bool size_t_vector_equal(const size_t_vector_type * vector1 , const size_t_vector_type * vector2);
void size_t_vector_apply(size_t_vector_type * vector , size_t_ftype *func);
int size_t_vector_count_equal( const size_t_vector_type * vector , size_t cmp_value);
int size_t_vector_element_size( const size_t_vector_type * vector );
UTIL_SAFE_CAST_HEADER( size_t_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,126 +0,0 @@
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'smspec_node.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __SMSPEC_NODE_H__
#define __SMSPEC_NODE_H__
#include <stdbool.h>
#include <ecl_smspec.h>
#ifdef __cplusplus
extern "C" {
#endif
#define DUMMY_WELL ":+:+:+:+"
#define IS_DUMMY_WELL(well) (strcmp((well) , DUMMY_WELL) == 0)
#define SMSPEC_PARAMS_INDEX_INVALID -77
typedef enum {ECL_SMSPEC_INVALID_VAR = 0 ,
ECL_SMSPEC_AQUIFER_VAR = 1 ,
ECL_SMSPEC_WELL_VAR = 2 , /* X */
ECL_SMSPEC_REGION_VAR = 3 , /* X */
ECL_SMSPEC_FIELD_VAR = 4 , /* X */
ECL_SMSPEC_GROUP_VAR = 5 , /* X */
ECL_SMSPEC_BLOCK_VAR = 6 , /* X */
ECL_SMSPEC_COMPLETION_VAR = 7 , /* X */
ECL_SMSPEC_LOCAL_BLOCK_VAR = 8 , /* X */
ECL_SMSPEC_LOCAL_COMPLETION_VAR = 9 , /* X */
ECL_SMSPEC_LOCAL_WELL_VAR = 10 , /* X */
ECL_SMSPEC_NETWORK_VAR = 11 ,
ECL_SMSPEC_REGION_2_REGION_VAR = 12 ,
ECL_SMSPEC_SEGMENT_VAR = 13 , /* X */
ECL_SMSPEC_MISC_VAR = 14 /* X */} ecl_smspec_var_type;
#define SMSPEC_NUMS_INVALID -991199
typedef struct smspec_node_struct smspec_node_type;
char * smspec_alloc_block_ijk_key( const char * join_string , const char * keyword , int i , int j , int k);
char * smspec_alloc_completion_ijk_key( const char * join_string , const char * keyword, const char * wgname , int i , int j , int k);
char * smspec_alloc_completion_num_key( const char * join_string , const char * keyword, const char * wgname , int num);
char * smspec_alloc_group_key( const char * join_string , const char * keyword , const char * wgname);
char * smspec_alloc_well_key( const char * join_string , const char * keyword , const char * wgname);
char * smspec_alloc_region_key( const char * join_string , const char * keyword , int num);
char * smspec_alloc_segment_key( const char * join_string , const char * keyword , const char * wgname , int num);
char * smspec_alloc_block_num_key( const char * join_string , const char * keyword , int num);
char * smspec_alloc_local_well_key( const char * join_string , const char * keyword , const char * lgr_name , const char * wgname);
char * smspec_alloc_local_block_key( const char * join_string , const char * keyword , const char * lgr_name , int i , int j , int k);
char * smspec_alloc_local_completion_key( const char * join_string, const char * keyword , const char * lgr_name , const char * wgname , int i , int j , int k);
bool smspec_node_init( smspec_node_type * smspec_node,
ecl_smspec_var_type var_type ,
const char * wgname ,
const char * keyword ,
const char * unit ,
const char * key_join_string ,
const int grid_dims[3] ,
int num);
smspec_node_type * smspec_node_alloc( ecl_smspec_var_type var_type ,
const char * wgname ,
const char * keyword ,
const char * unit ,
const char * key_join_string ,
const int grid_dims[3] ,
int num , int param_index, float default_value);
smspec_node_type * smspec_node_alloc_lgr( ecl_smspec_var_type var_type ,
const char * wgname ,
const char * keyword ,
const char * unit ,
const char * lgr ,
const char * key_join_string ,
int lgr_i, int lgr_j , int lgr_k,
int param_index,
float default_value);
smspec_node_type * smspec_node_alloc_new(int params_index, float default_value);
void smspec_node_free( smspec_node_type * index );
void smspec_node_free__(void * arg);
void smspec_node_set_params_index( smspec_node_type * smspec_node , int params_index);
int smspec_node_get_params_index( const smspec_node_type * smspec_node );
const char * smspec_node_get_gen_key1( const smspec_node_type * smspec_node);
const char * smspec_node_get_gen_key2( const smspec_node_type * smspec_node);
ecl_smspec_var_type smspec_node_get_var_type( const smspec_node_type * smspec_node);
int smspec_node_get_num( const smspec_node_type * smspec_node);
const char * smspec_node_get_wgname( const smspec_node_type * smspec_node);
void smspec_node_update_wgname( smspec_node_type * index , const char * wgname , const char * key_join_string);
const char * smspec_node_get_keyword( const smspec_node_type * smspec_node);
const char * smspec_node_get_unit( const smspec_node_type * smspec_node);
void smspec_node_set_unit( smspec_node_type * smspec_node , const char * unit );
bool smspec_node_is_rate( const smspec_node_type * smspec_node );
bool smspec_node_is_total( const smspec_node_type * smspec_node );
bool smspec_node_need_nums( const smspec_node_type * smspec_node );
void smspec_node_fprintf( const smspec_node_type * smspec_node , FILE * stream);
void smspec_node_set_default( smspec_node_type * smspec_node , float default_value);
float smspec_node_get_default( const smspec_node_type * smspec_node);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,21 +0,0 @@
/*
When building with MSVC this file is renamed to stdbool.h and copied into the
list of headers. The situation is as follows:
- The ERT code makes use of stdbool in many places. The msvc C
compiler does not have a stdbool header, i.e. the #include <stdbool.h>
statements fail when compiling.
- When included in a C++ project the compiler already has a bool
defined; it is therefor important not to redifine this symbol if
we are compiling C++.
*/
#ifndef __cplusplus
typedef int bool;
#define true 1
#define false 0
#endif

View File

@ -1,107 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'stringlist.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __STRINGLIST_H__
#define __STRINGLIST_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdio.h>
#include <type_macros.h>
#include <int_vector.h>
#include <buffer.h>
typedef struct stringlist_struct stringlist_type;
typedef int ( string_cmp_ftype) (const void * , const void *);
void stringlist_deep_copy( stringlist_type * target , const stringlist_type * src);
stringlist_type * stringlist_alloc_deep_copy_with_limits(const stringlist_type * src , int offset, int num_strings);
stringlist_type * stringlist_alloc_deep_copy_with_offset(const stringlist_type * src , int offset);
stringlist_type * stringlist_alloc_deep_copy( const stringlist_type * src );
stringlist_type * stringlist_alloc_new();
void stringlist_free__(void * );
void stringlist_free(stringlist_type *);
void stringlist_clear(stringlist_type * );
void stringlist_append_copy(stringlist_type * , const char *);
void stringlist_append_ref(stringlist_type * , const char *);
void stringlist_append_owned_ref(stringlist_type * , const char *);
const char * stringlist_safe_iget( const stringlist_type * stringlist , int index);
bool stringlist_iequal( const stringlist_type * stringlist , int index, const char * s );
const char * stringlist_iget(const stringlist_type * , int);
char * stringlist_iget_copy(const stringlist_type * stringlist , int );
char * stringlist_alloc_joined_string(const stringlist_type * , const char * );
char * stringlist_alloc_joined_substring( const stringlist_type * s , int start_index , int end_index , const char * sep );
void stringlist_iset_copy(stringlist_type *, int index , const char *);
void stringlist_iset_ref(stringlist_type *, int index , const char *);
void stringlist_iset_owned_ref(stringlist_type *, int index , const char *);
void stringlist_insert_copy(stringlist_type *, int index , const char *);
void stringlist_insert_ref(stringlist_type *, int index , const char *);
void stringlist_insert_owned_ref(stringlist_type *, int index , const char *);
void stringlist_idel(stringlist_type * stringlist , int index);
int stringlist_get_size(const stringlist_type * );
void stringlist_fprintf(const stringlist_type * , const char * , FILE *);
void stringlist_fprintf_fmt(const stringlist_type * stringlist, const stringlist_type * fmt_list , FILE * stream);
stringlist_type * stringlist_alloc_argv_copy(const char ** , int );
stringlist_type * stringlist_alloc_argv_ref (const char ** , int );
stringlist_type * stringlist_alloc_argv_owned_ref(const char ** argv , int argc);
stringlist_type * stringlist_alloc_shallow_copy(const stringlist_type *);
stringlist_type * stringlist_alloc_shallow_copy_with_offset(const stringlist_type * stringlist, int offset);
stringlist_type * stringlist_alloc_shallow_copy_with_limits(const stringlist_type * stringlist, int offset , int num_strings);
stringlist_type * stringlist_alloc_from_split( const char * input_string , const char * sep );
stringlist_type * stringlist_fread_alloc(FILE * );
void stringlist_append_stringlist_copy(stringlist_type * , const stringlist_type * );
void stringlist_append_stringlist_ref(stringlist_type * , const stringlist_type * );
void stringlist_insert_stringlist_copy(stringlist_type * , const stringlist_type *, int);
bool stringlist_equal(const stringlist_type * , const stringlist_type *);
bool stringlist_contains(const stringlist_type * , const char * );
int_vector_type * stringlist_find(const stringlist_type *, const char *);
int stringlist_find_first(const stringlist_type * , const char * );
int stringlist_get_argc(const stringlist_type * );
char ** stringlist_alloc_char_copy(const stringlist_type * );
void stringlist_fread(stringlist_type * , FILE * );
void stringlist_fwrite(const stringlist_type * , FILE * );
void stringlist_buffer_fread( stringlist_type * s , buffer_type * buffer );
void stringlist_buffer_fwrite( const stringlist_type * s , buffer_type * buffer );
void stringlist_sort(stringlist_type * , string_cmp_ftype * string_cmp);
void stringlist_python_sort( stringlist_type * s , int cmp_flag);
#ifdef HAVE_GLOB
int stringlist_select_matching(stringlist_type * names , const char * pattern);
#endif
int stringlist_select_matching_files(stringlist_type * names , const char * path , const char * file_pattern);
UTIL_IS_INSTANCE_HEADER(stringlist);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,56 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'subst_func.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __SUBST_FUNC_H__
#define __SUBST_FUNC_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stringlist.h>
typedef char * (subst_func_ftype) (const stringlist_type * , void * );
typedef struct subst_func_struct subst_func_type;
typedef struct subst_func_pool_struct subst_func_pool_type;
char * subst_func_eval( const subst_func_type * subst_func , const stringlist_type * args);
/*****************************************************************/
subst_func_pool_type * subst_func_pool_alloc( );
void subst_func_pool_free( subst_func_pool_type * pool );
void subst_func_pool_add_func( subst_func_pool_type * pool , const char * func_name , const char * doc_string , subst_func_ftype * func , bool vararg, int argc_min , int argc_max , void * arg);
subst_func_type * subst_func_pool_get_func( const subst_func_pool_type * pool , const char * func_name );
bool subst_func_pool_has_func( const subst_func_pool_type * pool , const char * func_name );
UTIL_IS_INSTANCE_HEADER( subst_func_pool );
/*****************************************************************/
char * subst_func_randint( const stringlist_type * args , void * arg);
char * subst_func_randfloat( const stringlist_type * args , void * arg);
char * subst_func_add( const stringlist_type * args , void * arg);
char * subst_func_mul( const stringlist_type * args , void * arg);
char * subst_func_exp( const stringlist_type * args , void * arg);
char * subst_func_log( const stringlist_type * args , void * arg);
char * subst_func_pow10( const stringlist_type * args , void * arg);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,66 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'subst_list.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __SUBST_H__
#define __SUBST_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <util.h>
#include <node_data.h>
#include <subst_func.h>
typedef struct subst_list_struct subst_list_type;
void subst_list_update_buffer( const subst_list_type * subst_list , buffer_type * buffer );
void subst_list_insert_func(subst_list_type * subst_list , const char * func_name , const char * local_func_name);
void subst_list_fprintf(const subst_list_type * , FILE * stream);
void subst_list_set_parent( subst_list_type * subst_list , const subst_list_type * parent);
const subst_list_type * subst_list_get_parent( const subst_list_type * subst_list );
subst_list_type * subst_list_alloc( const void * input_arg );
subst_list_type * subst_list_alloc_deep_copy(const subst_list_type * );
void subst_list_free(subst_list_type *);
void subst_list_clear( subst_list_type * subst_list );
void subst_list_append_copy(subst_list_type * , const char * , const char * , const char * doc_string);
void subst_list_append_ref(subst_list_type * , const char * , const char * , const char * doc_string);
void subst_list_append_owned_ref(subst_list_type * , const char * , const char * , const char * doc_string);
void subst_list_prepend_copy(subst_list_type * , const char * , const char * , const char * doc_string);
void subst_list_prepend_ref(subst_list_type * , const char * , const char * , const char * doc_string);
void subst_list_prepend_owned_ref(subst_list_type * , const char * , const char * , const char * doc_string);
void subst_list_filter_file(const subst_list_type * , const char * , const char * );
void subst_list_update_file(const subst_list_type * , const char * );
void subst_list_update_string(const subst_list_type * , char ** );
char * subst_list_alloc_filtered_string(const subst_list_type * , const char * );
void subst_list_filtered_fprintf(const subst_list_type * , const char * , FILE * );
int subst_list_get_size( const subst_list_type *);
const char * subst_list_iget_value( const subst_list_type * subst_list , int index);
const char * subst_list_iget_key( const subst_list_type * subst_list , int index);
const char * subst_list_iget_doc_string( const subst_list_type * subst_list , int index);
char * subst_list_alloc_string_representation( const subst_list_type * subst_list );
int subst_list_add_from_string( subst_list_type * subst_list , const char * arg_string, bool append);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,47 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __TEMPLATE_H__
#define __TEMPLATE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <subst_list.h>
typedef struct template_struct template_type;
template_type * template_alloc( const char * template_file , bool internalize_template, subst_list_type * parent_subst);
void template_free( template_type * template );
void template_instansiate( const template_type * template , const char * __target_file , const subst_list_type * arg_list , bool override_symlink);
void template_add_arg( template_type * template , const char * key , const char * value );
void template_clear_args( template_type * template );
int template_add_args_from_string( template_type * template , const char * arg_string);
char * template_get_args_as_string( template_type * template );
void template_set_template_file( template_type * template , const char * template_file);
const char * template_get_template_file( const template_type * template );
#endif
#ifdef __cplusplus
}
#endif

View File

@ -1,117 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector_template.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __time_t_VECTOR_H__
#define __time_t_VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <buffer.h>
#include <type_macros.h>
typedef struct time_t_vector_struct time_t_vector_type;
typedef time_t (time_t_ftype) (time_t);
int time_t_vector_lookup_bin( const time_t_vector_type * limits , time_t value , int guess);
int time_t_vector_lookup_bin__( const time_t_vector_type * limits , time_t value , int guess);
void time_t_vector_inplace_div( time_t_vector_type * vector , const time_t_vector_type * inv_factor);
void time_t_vector_inplace_mul( time_t_vector_type * vector , const time_t_vector_type * factor);
void time_t_vector_inplace_add( time_t_vector_type * vector , const time_t_vector_type * delta);
void time_t_vector_set_read_only( time_t_vector_type * vector , bool read_only);
bool time_t_vector_get_read_only( const time_t_vector_type * vector );
void time_t_vector_resize( time_t_vector_type * vector , int new_alloc_size );
void time_t_vector_memcpy_data( time_t * target, const time_t_vector_type * src );
void time_t_vector_memcpy( time_t_vector_type * target , const time_t_vector_type * src);
void time_t_vector_memcpy_data_block( time_t_vector_type * target , const time_t_vector_type * src , int target_offset , int src_offset , int len);
bool time_t_vector_growable( const time_t_vector_type * vector);
void time_t_vector_select_unique(time_t_vector_type * vector);
time_t_vector_type * time_t_vector_alloc( int init_size , time_t );
time_t_vector_type * time_t_vector_alloc_private_wrapper(int init_size, time_t default_value , time_t * data , int alloc_size);
time_t_vector_type * time_t_vector_alloc_shared_wrapper(int init_size, time_t default_value , time_t * data , int alloc_size);
time_t_vector_type * time_t_vector_alloc_strided_copy( const time_t_vector_type * src , int start , int stop , int stride );
time_t_vector_type * time_t_vector_alloc_copy( const time_t_vector_type * src);
void time_t_vector_imul(time_t_vector_type * vector, int index, time_t factor);
void time_t_vector_scale(time_t_vector_type * vector, time_t factor);
time_t time_t_vector_iget(const time_t_vector_type * , int);
time_t time_t_vector_safe_iget(const time_t_vector_type * , int);
time_t time_t_vector_get_min(const time_t_vector_type * vector);
time_t time_t_vector_get_max(const time_t_vector_type * vector);
int time_t_vector_get_min_index(const time_t_vector_type * vector, bool reverse);
int time_t_vector_get_max_index(const time_t_vector_type * vector, bool reverse);
time_t time_t_vector_iadd( time_t_vector_type * vector , int index , time_t delta);
void time_t_vector_iset(time_t_vector_type * , int , time_t);
void time_t_vector_idel_block( time_t_vector_type * vector , int index , int block_size);
time_t time_t_vector_idel( time_t_vector_type * vector , int index);
void time_t_vector_append(time_t_vector_type * , time_t);
void time_t_vector_free(time_t_vector_type *);
void time_t_vector_free__(void *);
void time_t_vector_free_data(time_t_vector_type *);
void time_t_vector_reset(time_t_vector_type *);
void time_t_vector_reset__(void * __vector);
int time_t_vector_size(const time_t_vector_type * );
time_t time_t_vector_pop(time_t_vector_type * vector);
time_t time_t_vector_get_first(const time_t_vector_type * vector);
time_t time_t_vector_get_last(const time_t_vector_type * );
time_t * time_t_vector_get_ptr(const time_t_vector_type * );
time_t * time_t_vector_alloc_data_copy( const time_t_vector_type * vector );
const time_t * time_t_vector_get_const_ptr(const time_t_vector_type * );
void time_t_vector_set_many(time_t_vector_type * , int , const time_t * , int );
void time_t_vector_set_all(time_t_vector_type * vector , time_t value);
void time_t_vector_append_many(time_t_vector_type * vector , const time_t * data , int length);
void time_t_vector_shrink(time_t_vector_type * );
time_t time_t_vector_sum(const time_t_vector_type * );
time_t time_t_vector_get_default(const time_t_vector_type * );
void time_t_vector_set_default(time_t_vector_type * vector, time_t default_value);
void time_t_vector_append_default(time_t_vector_type * vector , time_t default_value);
void time_t_vector_iset_default(time_t_vector_type * vector , int index , time_t default_value);
bool time_t_vector_is_sorted( const time_t_vector_type * vector , bool reverse);
int time_t_vector_index(const time_t_vector_type * vector , time_t value);
int time_t_vector_index_sorted(const time_t_vector_type * vector , time_t value);
void time_t_vector_sort(time_t_vector_type * vector);
void time_t_vector_rsort(time_t_vector_type * vector);
void time_t_vector_permute(time_t_vector_type * vector , const int * perm);
int * time_t_vector_alloc_sort_perm(const time_t_vector_type * vector);
int * time_t_vector_alloc_rsort_perm(const time_t_vector_type * vector);
void time_t_vector_fprintf(const time_t_vector_type * vector , FILE * stream , const char * name , const char * fmt);
void time_t_vector_fwrite(const time_t_vector_type * vector , FILE * stream);
void time_t_vector_buffer_fread(time_t_vector_type * vector , buffer_type * buffer);
time_t_vector_type * time_t_vector_fread_alloc( FILE * stream );
time_t_vector_type * time_t_vector_buffer_fread_alloc( buffer_type * buffer );
void time_t_vector_buffer_fwrite(const time_t_vector_type * vector , buffer_type * buffer);
void time_t_vector_fread( time_t_vector_type * vector , FILE * stream );
void time_t_vector_fwrite_data( const time_t_vector_type * vector , FILE * stream );
void time_t_vector_fread_data( time_t_vector_type * vector , int size, FILE * stream);
bool time_t_vector_equal(const time_t_vector_type * vector1 , const time_t_vector_type * vector2);
void time_t_vector_apply(time_t_vector_type * vector , time_t_ftype *func);
int time_t_vector_count_equal( const time_t_vector_type * vector , time_t cmp_value);
int time_t_vector_element_size( const time_t_vector_type * vector );
UTIL_SAFE_CAST_HEADER( time_t_vector );
#ifdef __cplusplus
}
#endif
#endif
//

View File

@ -1,106 +0,0 @@
#ifndef __TYPE_MACROS_H__
#define __TYPE_MACROS_H__
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************/
/**
The four macros UTIL_IS_INSTANCE_FUNCTION, UTIL_SAFE_CAST_FUNTION,
UTIL_TYPE_ID_DECLARATION and UTIL_TYPE_ID_INIT can be used to
implement a simple system for type checking (void *) at
runtime. The system is based on a unique integer for each class,
this must be provided by the user.
The motivation for these functions is to be able to to type-check
the arguments to callback functions like pthread_create.
UTIL_TYPE_ID_DECLARATION: Adds a field "int __type_id;" to the
struct defintion.
UTIL_TYPE_ID_INIT: Should be added to the allocation routine,
inserts a "->__type_id = magic_int;" code line in the alloc
routine.
UTIL_IS_INSTANCE_FUNCTION: This macro will generate a function
<type>_is_instance(void *) which will cast the (void *) input to
(type *), and check the value of __type_id. If this is the
correct value true is returned, otherwise the function will
return false. Observe that the function will accept NULL as
input; in which case it will return false.
UTIL_SAFE_CAST_FUNCTION: This is similar to
UTIL_IS_INSTANCE_FUNCTION, but it will return (type *) if the
cast succeeds, and fail hard if it fails. There is also a _CONST
variety of this function.
*/
#define UTIL_IS_INSTANCE_FUNCTION(type , TYPE_ID) \
bool type ## _is_instance( const void * __arg ) { \
if (__arg == NULL) \
return false; \
else { \
const type ## _type * arg = (type ## _type *) __arg; \
if ( arg->__type_id == TYPE_ID) \
return true; \
else \
return false; \
} \
}
#define UTIL_IS_INSTANCE_HEADER(type) bool type ## _is_instance( const void * __arg )
#define UTIL_SAFE_CAST_FUNCTION(type , TYPE_ID) \
type ## _type * type ## _safe_cast( void * __arg ) { \
if (__arg == NULL) { \
util_abort("%s: runtime cast failed - tried to dereference NULL\n",__func__); \
return NULL; \
} \
{ \
type ## _type * arg = (type ## _type *) __arg; \
if ( arg->__type_id == TYPE_ID) \
return arg; \
else { \
util_abort("%s: runtime cast failed: File:%s Line:%d. Got:%d Expected:%d \n", __func__ , __FILE__ , __LINE__ , arg->__type_id , TYPE_ID); \
return NULL; \
} \
} \
}
#define UTIL_SAFE_CAST_HEADER( type ) type ## _type * type ## _safe_cast( void * __arg )
#define UTIL_SAFE_CAST_FUNCTION_CONST(type , TYPE_ID) \
const type ## _type * type ## _safe_cast_const( const void * __arg ) { \
if (__arg == NULL) { \
util_abort("%s: runtime cast failed - tried to dereference NULL\n",__func__); \
return NULL; \
} \
{ \
const type ## _type * arg = (const type ## _type *) __arg; \
if ( arg->__type_id == TYPE_ID) \
return arg; \
else { \
util_abort("%s: runtime cast failed: File:%s Line:%d. Got:%d Expected:%d \n", __func__ , __FILE__ , __LINE__ , arg->__type_id , TYPE_ID); \
return NULL; \
} \
} \
}
#define UTIL_SAFE_CAST_HEADER_CONST( type ) const type ## _type * type ## _safe_cast_const( const void * __arg )
#define UTIL_TYPE_ID_DECLARATION int __type_id
#define UTIL_TYPE_ID_INIT(var , TYPE_ID) var->__type_id = TYPE_ID;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,440 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'util.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __UTIL_H__
#define __UTIL_H__
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <stdarg.h>
#ifdef HAVE_GETUID
#include <sys/stat.h>
#include <sys/types.h>
#endif
#define UTIL_PATH_SEP_STRING "/" /* A \0 terminated separator used when we want a (char *) instance. */
#define UTIL_PATH_SEP_CHAR '/' /* A simple character used when we want an actual char instance (i.e. not a pointer). */
#define UTIL_NEWLINE_STRING " \n"
#define UTIL_DEFAULT_MKDIR_MODE 0777 /* Directories are by default created with mode a+rwx - and then comes the umask ... */
#ifdef __cplusplus
extern"C" {
#endif
/*****************************************************************/
/*
*/
/*****************************************************************/
typedef void (walk_file_callback_ftype) (const char * , /* The current directory */
const char * , /* The current file / directory */
void *); /* Arbitrary argument */
typedef bool (walk_dir_callback_ftype) (const char * , /* The current directory */
const char * , /* The current file / directory */
int , /* The current depth in the file hiearcrcy. */
void *); /* Arbitrary argument */
typedef enum {left_pad = 0,
right_pad = 1,
center_pad = 2} string_alignement_type;
//#define UTIL_CXX_MALLOC(var , num_elm) (typeof (var)) util_malloc( (num_elm) * sizeof var)
void util_bitmask_on(int * , int );
time_t util_make_datetime(int , int , int , int , int , int );
void util_fprintf_datetime(time_t , FILE * );
void util_fprintf_date(time_t , FILE * );
time_t util_make_date(int , int , int);
void util_inplace_forward_days(time_t * , double);
double util_difftime(time_t , time_t , int * , int * , int * , int *);
double util_difftime_days(time_t , time_t );
bool util_file_newer( const char * file , time_t t0);
bool util_file_older( const char * file , time_t t0);
char * util_alloc_date_string( time_t t );
char * util_alloc_date_stamp( );
double util_pow10(double x);
bool util_char_in(char c, int , const char *);
char * util_alloc_sprintf_va(const char * fmt , va_list ap);
char * util_alloc_sprintf(const char * , ...);
char * util_realloc_sprintf(char * , const char * , ...);
void util_fprintf_int(int , int , FILE * );
void util_fprintf_string(const char * , int , string_alignement_type , FILE * );
void util_fprintf_double(double , int , int , char , FILE *);
bool util_fscanf_date(FILE * , time_t *);
bool util_sscanf_date(const char * , time_t *);
char * util_alloc_stdin_line();
char * util_realloc_stdin_line(char * );
bool util_is_executable(const char * );
bool util_entry_exists( const char * entry );
bool util_file_exists(const char *);
bool util_is_abs_path(const char * );
char * util_alloc_abs_path( const char * path );
bool util_fmt_bit8 (const char *);
bool util_fmt_bit8_stream(FILE * );
void util_make_path (const char *);
char * util_newest_file(const char *, const char *);
double util_file_difftime(const char * , const char *);
bool util_file_update_required(const char *, const char *);
size_t util_file_size(const char *);
void util_clear_directory(const char *path, bool strict_uid , bool unlink_root);
void util_unlink_existing(const char *filename);
void util_strupr(char *);
bool util_string_equal(const char * s1 , const char * s2 );
char * util_alloc_strupr_copy(const char * );
void util_string_tr(char * , char , char);
bool util_copy_stream(FILE *, FILE *, int , void * , bool abort_on_error);
void util_move_file(const char * src_file , const char * target_file);
void util_move_file4( const char * src_name , const char * target_name , const char *src_path , const char * target_path);
bool util_copy_file(const char * , const char * );
char * util_alloc_cwd(void);
char * util_alloc_realpath(const char * );
bool util_string_match(const char * string , const char * pattern);
bool util_string_has_wildcard( const char * s);
bool util_entry_readable( const char * entry );
void util_ftruncate(FILE * stream , long size);
void util_usleep( unsigned long micro_seconds );
char * util_blocking_alloc_stdin_line(unsigned long );
int util_roundf( float x );
int util_round( double x );
#ifdef HAVE_VA_COPY
#define UTIL_VA_COPY(target,src) va_copy(target,src)
#else
#define UTIL_VA_COPY(target,src) target = src
#endif
#ifdef HAVE_OPENDIR
void util_copy_directory(const char * , const char * , const char *);
void util_walk_directory(const char * root_path , walk_file_callback_ftype * file_callback , void * file_callback_arg , walk_dir_callback_ftype * dir_callback , void * dir_callback_arg);
#endif
#ifdef HAVE_GETUID
uid_t util_get_entry_uid( const char * file );
bool util_addmode_if_owner( const char * filename , mode_t add_mode );
bool util_delmode_if_owner( const char * filename , mode_t del_mode);
bool util_chmod_if_owner( const char * filename , mode_t new_mode);
#endif
#ifdef HAVE_PROC
bool util_proc_alive(pid_t pid);
#endif
int util_forward_line(FILE * , bool * );
void util_rewind_line(FILE *);
int util_count_content_file_lines(FILE * );
int util_count_file_lines(FILE * );
FILE * util_mkdir_fopen( const char * filename , const char * mode );
int util_fmove( FILE * stream , long offset , long shift);
FILE * util_fopen(const char * , const char *);
void util_fclose( FILE * stream );
bool util_fopen_test(const char *, const char *);
void util_alloc_file_components(const char * , char ** , char **, char **);
//char * util_realloc_full_path(char * , const char *, const char *);
char * util_alloc_tmp_file(const char * , const char * , bool );
char * util_fscanf_alloc_line(FILE *, bool *);
char * util_fscanf_realloc_line(FILE *, bool * , char *);
char * util_fscanf_alloc_token(FILE * );
void util_fskip_token(FILE * );
void util_fskip_space(FILE * , bool *);
void util_fskip_chars(FILE * , const char * , bool *);
void util_fskip_cchars(FILE * , const char * , bool *);
bool util_fscanf_int(FILE * , int * );
bool util_fscanf_bool(FILE * stream , bool * value);
bool util_sscanf_bool(const char * , bool *);
bool util_sscanf_octal_int(const char * buffer , unsigned int * value);
int util_strcmp_int( const char * s1 , const char * s2);
int util_strcmp_float( const char * s1 , const char * s2);
bool util_sscanf_int(const char * , int * );
const char * util_parse_int(const char * , int * , bool *);
const char * util_skip_sep(const char * , const char * , bool *);
int util_scanf_int_with_limits(const char * , int , int , int );
char * util_scanf_int_with_limits_return_char(const char * , int , int , int );
void util_printf_prompt(const char * , int , char , const char *);
int util_scanf_int(const char * , int);
char * util_scanf_int_return_char(const char * , int);
double util_scanf_double(const char * prompt , int prompt_len);
char * util_scanf_alloc_string(const char * );
bool util_sscanf_double(const char * , double * );
//char * util_alloc_full_path(const char *, const char *);
char * util_alloc_filename(const char * , const char * , const char * );
char * util_realloc_filename(char * , const char * , const char * , const char * );
char * util_alloc_strip_copy(const char *);
char * util_realloc_strip_copy(char *);
void util_set_strip_copy(char * , const char *);
char * util_alloc_string_sum(const char ** , int);
char * util_strcat_realloc(char *, const char * );
char * util_alloc_string_copy(const char *);
char ** util_stringlist_append_copy(char ** , int , const char * );
char ** util_stringlist_append_ref(char ** , int , const char * );
char ** util_alloc_stringlist_copy(const char **, int );
void util_split_string(const char *, const char *, int *, char ***);
void util_path_split(const char * , int *, char ***);
void util_binary_split_string(const char * , const char * , bool , char ** , char ** );
char * util_alloc_joined_string(const char ** , int , const char * );
char * util_alloc_multiline_string(const char ** , int );
char * util_string_replace_alloc(const char *, const char *, const char *);
char * util_string_replacen_alloc(const char *, int , const char ** , const char **);
int util_string_replace_inplace(char ** , const char * , const char *);
char * util_string_strip_chars_alloc(const char *, const char * );
char * util_realloc_string_copy(char * , const char *);
char * util_realloc_substring_copy(char * , const char *, int N);
char * util_realloc_dequoted_string(char *);
char * util_alloc_dequoted_copy(const char *s);
void util_safe_free(void *);
void util_free_stringlist(char **, int );
char * util_alloc_substring_copy(const char *, int offset , int N);
bool util_is_directory(const char * );
bool util_is_file(const char * );
void util_set_datetime_values(time_t , int * , int * , int * , int * , int * , int *);
void util_set_date_values(time_t , int * , int * , int * );
void util_fread_from_buffer(void * , size_t , size_t , char ** );
unsigned int util_clock_seed( );
void util_fread_dev_random(int , char * );
void util_fread_dev_urandom(int , char * );
char * util_alloc_string_copy(const char *);
bool util_string_isspace(const char * s);
void util_exit(const char * fmt , ...);
void util_abort(const char * fmt , ...);
void util_abort_signal(int );
void util_abort_append_version_info(const char * );
void util_abort_free_version_info();
void util_abort_set_executable( const char * executable );
void * util_realloc(void * , size_t );
void * util_malloc(size_t );
void * util_calloc( size_t elements , size_t element_size );
void * util_realloc_copy(void * org_ptr , const void * src , size_t byte_size );
void * util_alloc_copy(const void * , size_t );
void util_double_to_float(float * , const double * , int );
void util_float_to_double(double * , const float * , int );
int util_get_month_nr(const char * );
char * util_fread_alloc_file_content(const char * , int *);
void util_fwrite_string(const char * , FILE *);
char * util_fread_realloc_string(char * , FILE *);
char * util_fread_alloc_string(FILE *);
void util_fskip_string(FILE *stream);
void util_endian_flip_vector(void * data , int element_size , int elements);
int util_proc_mem_free(void);
void util_apply_int_limits(int * , int , int );
void util_apply_float_limits(float * , float , float );
void util_apply_double_limits(double * , double , double );
double util_double_vector_mean(int , const double * );
double util_double_vector_stddev(int , const double * );
void util_double_vector_max_min(int , const double *, double * , double *);
void util_update_double_max_min(double , double * , double * );
void util_update_float_max_min(float , float * , float * );
void util_update_int_max_min(int , int * , int * );
float util_float_max (float , float );
long int util_long_max(long int a , long int b);
int util_int_max (int , int);
double util_double_max(double , double );
float util_float_min (float , float );
int util_int_min (int , int);
size_t util_size_t_min(size_t a , size_t b);
size_t util_size_t_max(size_t a , size_t b);
time_t util_time_t_min(time_t a , time_t b);
time_t util_time_t_max(time_t a , time_t b);
double util_double_min(double , double );
void util_fskip_lines(FILE * , int);
bool util_same_file(const char * , const char * );
void util_read_path(const char * , int , bool , char * );
char * util_fscanf_alloc_filename(const char * , int , int);
void util_read_string(const char * , int , char * );
void util_fread (void *, size_t , size_t , FILE * , const char * );
void util_fwrite(const void *, size_t , size_t , FILE * , const char * );
time_t util_fread_time_t(FILE * stream);
int util_fread_int(FILE * );
long util_fread_long(FILE * );
bool util_fread_bool(FILE * );
double util_fread_double(FILE * stream);
void util_fwrite_int (int , FILE * );
void util_fwrite_long (long , FILE * );
void util_fwrite_bool (bool , FILE * );
void util_fwrite_time_t (time_t , FILE * );
void util_fwrite_double(double , FILE * );
void util_fwrite_int_vector (const int * , int , FILE * , const char * );
void util_fwrite_double_vector(const double * , int , FILE * , const char * );
void util_fread_char_vector(char * , int , FILE * , const char * );
int util_type_get_id( const void * data );
char * util_alloc_realpath(const char * );
bool util_sscanf_bytesize(const char * , size_t *);
void util_sscanf_active_range(const char * , int , bool * );
int * util_sscanf_alloc_active_list(const char * , int * );
int util_get_current_linenr(FILE * stream);
const char * util_update_path_var(const char * , const char * , bool );
int util_get_type( void * data );
void util_fskip_int(FILE * stream);
void util_fskip_long(FILE * stream);
void util_fskip_bool(FILE * stream);
bool util_fseek_string(FILE * stream , const char * string , bool skip_string , bool case_sensitive);
char * util_fscanf_alloc_upto(FILE * stream , const char * stop_string, bool include_stop_string);
bool util_files_equal( const char * file1 , const char * file2 );
double util_kahan_sum(const double *data, size_t N);
int util_fnmatch( const char * pattern , const char * string );
void util_localtime( time_t * t , struct tm * ts );
char * util_alloc_PATH_executable(const char * executable );
char * util_isscanf_alloc_envvar( const char * string , int env_index );
void util_setenv( const char * variable , const char * value);
const char * util_interp_setenv( const char * variable , const char * value);
void util_unsetenv( const char * variable);
char * util_alloc_envvar( const char * value );
bool util_is_link(const char * ); // Will always return false on windows
#define UTIL_FWRITE_SCALAR(s,stream) { if (fwrite(&s , sizeof s , 1 , stream) != 1) util_abort("%s: write failed: %s\n",__func__ , strerror(errno)); }
#define UTIL_FREAD_SCALAR(s,stream) { if (fread(&s , sizeof s , 1 , stream) != 1) util_abort("%s: read failed: %s\n",__func__ , strerror(errno)); }
#define UTIL_FWRITE_VECTOR(s,n,stream) { if (fwrite(s , sizeof s , (n) , stream) != (n)) util_abort("%s: write failed: %s \n",__func__ , strerror(errno)); }
#define UTIL_FREAD_VECTOR(s,n,stream) { if (fread(s , sizeof s , (n) , stream) != (n)) util_abort("%s: read failed: %s \n",__func__ , strerror(errno)); }
#define CONTAINS_HEADER(TYPE) int util_sorted_contains_ ## TYPE(const TYPE * data , int size , TYPE value);
CONTAINS_HEADER(int);
CONTAINS_HEADER(time_t);
CONTAINS_HEADER(size_t);
#undef CONTAINS_HEADER
/*****************************************************************/
/*
The code below here is a simple functionality to support 'enum
introspection'; the point is that when calling the library functions
from Python/ctypes it is very valuable to have access to the enum
values from the Python side. The enum defintions is just used during
the compile phase, and then subsequently dropped. It is therefor
impossible to determine enum values by inspecting the resulting
object files.
The approach which has been chosen is that each of the enums which
should support 'introspection' from Python should have a function:
const char * <enum>_iget(int index, int * value) {
...
}
which should take an enum element number as input argument and
return a string representation of the corresponding enum element and
also update the value reference to contain the corresponding enum
value. If index is out of range the function should return NULL and
also set value to -1. The python layer can then create an integer
variable with the correct name and value in the calling module.
The util_enum_element_type and the util_enum_iget() function are
convenience functions which can be used to avoid indirectly
repeating the enum definition in the <enum>_iget() function.
In the example below we create the enum definition in normal way in
the header file, and then in addition we repeat the defintion in a
#define a symbol which is used as argument in the <enum>_iget()
function:
header_file:
------------
enum my_enum {
INVALID = 0,
VALUE1 = 2,
VALUE2 = 17
}
// The enum definition is repeated; but at at least at the very same spot of the code.
#define MY_ENUM_DEF { .value = INVALID, .name="INVALID"} , {.value = VALUE1 , .name="VALUE1"} , {.value = VALUE2 , .name="VALUE2"}
#define MY_ENUM_SIZE 3
source file:
------------
const char * my_enum_iget(int index, int * value) {
return util_enum_iget( index , MY_ENUM_SIZE , (const util_enum_element_type []) MY_ENUM_DEF , value);
}
*/
typedef struct {
int value;
const char * name;
} util_enum_element_type;
const char * util_enum_iget( int index , int size , const util_enum_element_type * enum_defs , int * value);
/*****************************************************************/
/* Conditional section below here */
#ifdef WITH_ZLIB
void util_compress_buffer(const void * , int , void * , unsigned long * );
int util_fread_sizeof_compressed(FILE * stream);
void util_fread_compressed(void * , FILE * );
void * util_fread_alloc_compressed(FILE * );
void util_fwrite_compressed(const void * , int , FILE * );
#endif
#ifdef HAVE_SYMLINK
void util_make_slink(const char *, const char * );
char * util_alloc_link_target(const char * link);
#ifdef HAVE_READLINKAT
char * util_alloc_atlink_target(const char * path , const char * link);
#endif
#endif
#ifdef HAVE_FORK
#include "util_fork.h"
#endif
#ifdef HAVE_LOCKF
FILE * util_fopen_lockf(const char * , const char * );
bool util_try_lockf(const char * , mode_t , int * );
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,86 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'vector.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __VECTOR_H__
#define __VECTOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <node_data.h>
#include <type_macros.h>
typedef void ( vector_func_type ) (void * , void *);
typedef int ( vector_cmp_ftype) (const void * , const void *);
typedef struct vector_struct vector_type;
vector_type * vector_alloc_new();
void vector_grow_NULL( vector_type * vector , int new_size );
vector_type * vector_alloc_NULL_initialized( int size );
int vector_append_ref( vector_type * , const void *);
int vector_append_owned_ref( vector_type * , const void * , free_ftype * del);
int vector_append_copy(vector_type * , const void *, copyc_ftype *, free_ftype *);
void vector_iset_ref( vector_type * , int , const void *);
void vector_iset_owned_ref( vector_type * , int , const void * , free_ftype * del);
void vector_iset_copy(vector_type * , int , const void *, copyc_ftype *, free_ftype *);
void vector_safe_iset_copy(vector_type * vector , int index , const void * data, copyc_ftype * copyc , free_ftype * del);
void vector_safe_iset_owned_ref(vector_type * vector , int index , const void * data, free_ftype * del);
void vector_safe_iset_ref(vector_type * vector , int index , const void * data);
void vector_insert_ref( vector_type * , int , const void *);
void vector_insert_owned_ref( vector_type * , int , const void * , free_ftype * del);
void vector_insert_copy(vector_type * , int , const void *, copyc_ftype *, free_ftype *);
void vector_insert_buffer(vector_type * vector , int index , const void * buffer, int buffer_size);
void vector_push_ref( vector_type * , const void *);
void vector_push_owned_ref( vector_type * , const void * , free_ftype * del);
void vector_push_copy(vector_type * , const void *, copyc_ftype *, free_ftype *);
void vector_clear(vector_type * vector);
void vector_free(vector_type * );
void vector_free__( void * arg );
void vector_append_buffer(vector_type * , const void * , int);
void vector_push_buffer(vector_type * , const void * , int);
int vector_get_size(const vector_type * );
void * vector_safe_iget(const vector_type * vector, int index);
const void * vector_safe_iget_const(const vector_type * vector, int index);
const void * vector_iget_const(const vector_type * , int );
void * vector_iget(const vector_type * , int );
void vector_idel(vector_type * vector , int index);
void vector_shrink( vector_type * vector , int new_size );
void * vector_get_last(const vector_type * );
const void * vector_get_last_const(const vector_type * );
int vector_get_size( const vector_type * );
void * vector_pop(vector_type * );
void vector_sort(vector_type * vector , vector_cmp_ftype * cmp);
vector_type * vector_alloc_copy(const vector_type * src , bool deep_copy);
void vector_iset_buffer(vector_type * vector , int index , const void * buffer, int buffer_size);
UTIL_IS_INSTANCE_HEADER( vector );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,42 +0,0 @@
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'well_branch.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __WELL_BRANCH_H__
#define __WELL_BRANCH_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <well_conn.h>
typedef struct well_branch_struct well_branch_type;
well_branch_type * well_branch_alloc(int branch_nr);
void well_branch_free( well_branch_type * branch );
void well_branch_add_conn( well_branch_type * branch , well_conn_type * connection );
int well_branch_get_length( const well_branch_type * branch );
const well_conn_type ** well_branch_get_connections( const well_branch_type * branch );
int well_branch_get_nr( const well_branch_type * branch );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,61 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'well_conn.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __WELL_CONN_H__
#define __WELL_CONN_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <ecl_kw.h>
#include <ecl_intehead.h>
typedef enum {
well_conn_dirX = 1,
well_conn_dirY = 2,
well_conn_dirZ = 3,
well_conn_fracX = 4,
well_conn_fracY = 5
} well_conn_dir_enum;
typedef struct well_conn_struct well_conn_type;
void well_conn_free( well_conn_type * conn);
void well_conn_free__( void * arg );
well_conn_type * well_conn_alloc( const ecl_kw_type * icon_kw , const ecl_kw_type * iseg_kw , const ecl_intehead_type * header , int well_nr , int seg_well_nr , int conn_nr);
well_conn_type * well_conn_alloc_wellhead( const ecl_kw_type * iwel_kw , const ecl_intehead_type * header , int well_nr);
int well_conn_get_branch(const well_conn_type * conn);
int well_conn_get_i(const well_conn_type * conn);
int well_conn_get_j(const well_conn_type * conn);
int well_conn_get_k(const well_conn_type * conn);
well_conn_dir_enum well_conn_get_dir(const well_conn_type * conn);
bool well_conn_open( const well_conn_type * conn );
int well_conn_get_segment( const well_conn_type * conn );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,91 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'well_const.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __WELL_CONST_H__
#define __WELL_CONST_H__
#ifdef __cplusplus
extern "C" {
#endif
/*
Observe that the values given as _ITEM are not indices which can
be directly used in the IWEL or ICON keywords; an offset must be
added.
*/
#define IWEL_HEADI_ITEM 0
#define IWEL_HEADJ_ITEM 1
#define IWEL_HEADK_ITEM 2
#define IWEL_CONNECTIONS_ITEM 4
#define IWEL_TYPE_ITEM 6
#define IWEL_STATUS_ITEM 10
#define IWEL_LGR_ITEM 42
#define IWEL_SEGMENTED_WELL_NR_ITEM 70
#define ISEG_OUTLET_ITEM 1
#define ISEG_BRANCH_ITEM 3
#define ICON_IC_ITEM 0
#define ICON_I_ITEM 1
#define ICON_J_ITEM 2
#define ICON_K_ITEM 3
#define ICON_STATUS_ITEM 5
#define ICON_DIRECTION_ITEM 13
#define ICON_SEGMENT_ITEM 14
#define ICON_DIRX 1
#define ICON_DIRY 2
#define ICON_DIRZ 3
#define ICON_FRACX 4
#define ICON_FRACY 5
#define ICON_DEFAULT_DIR_VALUE 0
#define ICON_DEFAULT_DIR_TARGET ICON_DIRZ
/*
The ECLIPSE documentation says that a certain item in the IWEL array
should indicate the type of the well, the available types are the
ones given in the enum below. Unfortunately it turns out that when
the well is closed the integer value in the IWEL array can be 0, if
the well is indeed closed we accept this zero - otherwise we fail
hard. Theese hoops are in the well_state_alloc() routine.
*/
#define IWEL_UNDOCUMENTED_ZERO 0
#define IWEL_PRODUCER 1
#define IWEL_OIL_INJECTOR 2
#define IWEL_WATER_INJECTOR 3
#define IWEL_GAS_INJECTOR 4
typedef enum {
UNDOCUMENTED_ZERO = 0,
PRODUCER = 10,
WATER_INJECTOR = 22,
GAS_INJECTOR = 21,
OIL_INJECTOR = 78
} well_type_enum;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,52 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'well_info.c' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __WELL_INFO_H__
#define __WELL_INFO_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <ecl_file.h>
#include <ecl_grid.h>
#include <well_ts.h>
typedef struct well_info_struct well_info_type;
well_info_type * well_info_alloc(const ecl_grid_type * grid);
void well_info_add_UNRST_wells( well_info_type * well_info , ecl_file_type * rst_file);
void well_info_add_wells( well_info_type * well_info , ecl_file_type * rst_file , int report_nr );
void well_info_load_rstfile( well_info_type * well_info , const char * filename);
void well_info_free( well_info_type * well_info );
well_ts_type * well_info_get_ts( const well_info_type * well_info , const char *well_name);
int well_info_get_num_wells( const well_info_type * well_info );
const char * well_info_iget_well_name( const well_info_type * well_info, int well_index);
well_state_type * well_info_get_state_from_time( const well_info_type * well_info , const char * well_name , time_t sim_time);
well_state_type * well_info_get_state_from_report( const well_info_type * well_info , const char * well_name , int report_step );
well_state_type * well_info_iget_state_from_report( const well_info_type * well_info , const char * well_name , int time_index);
well_state_type * well_info_iiget_state( const well_info_type * well_info , int well_index , int time_index);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,47 +0,0 @@
/*
Copyright (C) 2012 Statoil ASA, Norway.
The file 'well_path.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __WELL_PATH_H__
#define __WELL_PATH_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <well_conn.h>
#include <well_branch.h>
typedef struct well_path_struct well_path_type;
well_path_type * well_path_alloc(const char * grid_name );
void well_path_free( well_path_type * path );
void well_path_add_conn( well_path_type * well_path , well_conn_type * conn);
well_branch_type * well_path_iget_branch( const well_path_type * well_path , int branch_nr);
void well_path_free__(void * arg);
int well_path_get_max_branches( const well_path_type * well_path );
int well_path_get_num_active_branches( const well_path_type * well_path );
const char * well_path_get_grid_name( const well_path_type * well_path );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,73 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'well_state.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __WELL_STATE_H__
#define __WELL_STATE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include <ecl_file.h>
#include <ecl_intehead.h>
#include <well_conn.h>
#include <well_const.h>
#define GLOBAL_GRID_NAME "GLOBAL" // The name assigned to the global grid for name based lookup.
typedef struct well_state_struct well_state_type;
well_state_type * well_state_alloc( ecl_file_type * ecl_file , int report_step , int well_nr);
void well_state_free( well_state_type * well );
const char * well_state_get_name( const well_state_type * well );
int well_state_get_report_nr( const well_state_type * well_state );
time_t well_state_get_sim_time( const well_state_type * well_state );
well_conn_type * well_state_iget_connection( const well_state_type * well_state , int index);
well_type_enum well_state_get_type( const well_state_type * well_state);
bool well_state_is_open( const well_state_type * well_state );
const well_conn_type * well_state_iget_wellhead( const well_state_type * well_state , int grid_nr);
const well_conn_type * well_state_get_wellhead( const well_state_type * well_state , const char * grid_name);
const well_conn_type ** well_state_iget_lgr_connections(const well_state_type * well_state , int grid_nr , int branch_nr );
const well_conn_type ** well_state_get_lgr_connections(const well_state_type * well_state , const char * lgr_name , int branch_nr);
const well_conn_type ** well_state_get_connections(const well_state_type * well_state , int branch_nr );
int well_state_iget_num_lgr_connections(const well_state_type * well_state , int grid_nr , int branch_nr );
int well_state_get_num_lgr_connections(const well_state_type * well_state , const char * lgr_name , int branch_nr);
int well_state_get_num_connections(const well_state_type * well_state , int branch_nr );
int well_state_iget_lgr_num_branches( const well_state_type * well_state , int grid_nr);
int well_state_get_lgr_num_branches( const well_state_type * well_state , const char * lgr_name);
int well_state_get_num_branches(const well_state_type * well_state );
void well_state_summarize( const well_state_type * well_state , FILE * stream );
UTIL_IS_INSTANCE_HEADER( well_state );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,48 +0,0 @@
/*
Copyright (C) 2011 Statoil ASA, Norway.
The file 'well_ts.h' is part of ERT - Ensemble based Reservoir Tool.
ERT 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.
ERT 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 at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#ifndef __WELL_TS_H__
#define __WELL_TS_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <well_state.h>
typedef struct well_ts_struct well_ts_type;
void well_ts_free( well_ts_type * well_ts );
void well_ts_add_well( well_ts_type * well_ts , well_state_type * well_state );
well_ts_type * well_ts_alloc( const char * well_name );
void well_ts_free__( void * arg );
well_state_type * well_ts_get_state_from_sim_time( const well_ts_type * well_ts , time_t sim_time);
well_state_type * well_ts_get_state_from_report( const well_ts_type * well_ts , int report_nr);
well_state_type * well_ts_iget_state( const well_ts_type * well_ts , int index);
int well_ts_get_size( const well_ts_type * well_ts);
well_state_type * well_ts_get_first_state( const well_ts_type * well_ts);
well_state_type * well_ts_get_last_state( const well_ts_type * well_ts);
#ifdef __cplusplus
}
#endif
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,93 +0,0 @@
#The source code for ERT is located in :
cd /home/builder/src/ert/devel/
# We only use libecl and libutil
# libutil must be built first
# First you might want to check what has happened since last update:
cd libutil
svn log -r BASE:HEAD
cd ../libecl
svn log -r BASE:HEAD
cd ..
# Then update and build the code:
# using cmake
svn up
cmake-gui
# Enter the following in the gui:
# Source code: /home/builder/src/ert/devel/
# Binaries: /home/builder/src/ert/ErtCmakeBuild
# Then press configure, and edit the following variables:
# BLAS_LIBRARY: /usr/lib64/libblas.so.3
# INSTALL_ROOT: /home/builder/Projects/ResInsight/ThirdParty/Ert/
# then press Configure and then Generate
# at the prompt:
cd /home/builder/src/ert/ErtCmakeBuild
make clean
make
# make your copy of the library editable by checking it out
#p4 edit -c default /home/builder/Projects/ResInsight/ThirdParty/Ert/...
rm -r /home/builder/Projects/ResInsight/ThirdParty/Ert/ecl/*
rm -r /home/builder/Projects/ResInsight/ThirdParty/Ert/util/*
rm -r /home/builder/Projects/ResInsight/ThirdParty/Ert/geometry/*
rm -r /home/builder/Projects/ResInsight/ThirdParty/Ert/well/*
make install
# Then check in if appropriate
# Finished.
############################################################################
# Old build system using SCons.
# At that time the installation directories was
# called libecl and libutil, not ecl and util so this must be taken into
# accont if this approach is tested
# First clean up
cd libutil
scons -c
rm -r include
rm -r lib
cd ..
cd libecl
scons -c
rm -r include
rm -r lib
cd ..
# update and build
svn up
cd libutil
scons -k
cd ..
cd libecl
scons -k
cd ..
# Copy the new lib files and includes into our repository
# make your copy of the library editable by checking it out
#p4 edit -c default /home/builder/Projects/ResInsight/ThirdParty/Ert/...
rm -r /home/builder/Projects/ResInsight/ThirdParty/Ert/libecl/*
rm -r /home/builder/Projects/ResInsight/ThirdParty/Ert/libutil/*
cp -v -r libecl/include /home/builder/Projects/ResInsight/ThirdParty/Ert/libecl/include
cp -v -r libecl/lib /home/builder/Projects/ResInsight/ThirdParty/Ert/libecl/lib
cp -v -r libutil/include /home/builder/Projects/ResInsight/ThirdParty/Ert/libutil/include
cp -v -r libutil/lib /home/builder/Projects/ResInsight/ThirdParty/Ert/libutil/lib
# Then check in if appropriate

View File

@ -0,0 +1,17 @@
#include <stdlib.h>
void dgemv_(char * , int * , int * , double * , double * , int * , const double * , int * , double * , double * , int * );
/*
This test is only to check if seperate linking with BLAS is
necessary; on the RedHat linux computers only explicit linking with
lapack is sufficient, whereas in other cases also blas must be
linked in specifically.
*/
int main(int argc , char ** argv) {
/* Wildly invalid input - but the signature is satisfies so it should compile. */
dgemv_( "A" , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL);
}

View File

@ -0,0 +1,7 @@
#include <stdlib.h>
int main(int argc, char ** argv) {
getenv("PATH");
}

View File

@ -0,0 +1,8 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
int main(int argc, char ** argv) {
struct stat stat_buffer;
return S_ISREG(stat_buffer.st_mode);
}

View File

@ -0,0 +1,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
int main(int argc, char ** argv) {
mkdir("/tmp/path" , 0);
}

View File

@ -0,0 +1,11 @@
#include <stdlib.h>
#include <omp.h>
int main(int argc, char ** argv) {
int sum = 0;
#pragma omp parallel for
for (int i=0; i < 100; i++)
sum += i;
}

View File

@ -0,0 +1,6 @@
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char ** argv) {
pid_t pid = getpid();
}

View File

@ -0,0 +1,16 @@
#include <stdarg.h>
#include <stdlib.h>
int func(int arg1 , ...) {
va_list ap;
va_list copy;
va_start(ap , arg1);
va_copy( copy , ap );
va_end(ap);
return 1;
}
int main(int argc, char ** argv) {
func(10 , NULL , "String" );
}

View File

@ -0,0 +1,18 @@
#cmakedefine HAVE_PTHREAD
#cmakedefine HAVE_EXECINFO
#cmakedefine HAVE_FORK
#cmakedefine HAVE_ZLIB
#cmakedefine HAVE_LSF
#cmakedefine HAVE_REALPATH
#cmakedefine HAVE_SYMLINK
#cmakedefine HAVE_READLINKAT
#cmakedefine HAVE_GETUID
#cmakedefine HAVE_LOCALTIME_R
#cmakedefine HAVE_LOCKF
#cmakedefine HAVE_SETENV
#cmakedefine HAVE_GLOB
#cmakedefine MKDIR_POSIX
#cmakedefine HAVE_FNMATCH
#cmakedefine NEED_BLAS
#cmakedefine HAVE_OPENMP
#cmakedefine HAVE_FTRUNCATE

280
ThirdParty/Ert/devel/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,280 @@
cmake_minimum_required( VERSION 2.6 )
project( ERT C CXX )
include( CheckFunctionExists )
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(ERT_LINUX TRUE )
add_definitions( -DERT_LINUX )
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(ERT_WINDOWS TRUE)
add_definitions( -DERT_WINDOWS )
endif()
set( CMAKE_C_FLAGS "-g -O2 -Wall -std=gnu99 -fno-leading-underscore" )
set( CMAKE_CXX_FLAGS "-g -O2 -Wall" )
set( INSTALL_GROUP "" CACHE STRING "Group to install as - blank to install as current group")
if (MSVC)
set(SHARED_LIB OFF)
else()
option( SHARED_LIB "Build shared libraries" OFF)
endif()
if (SHARED_LIB)
set( LIBRARY_TYPE SHARED )
else()
set( LIBRARY_TYPE STATIC )
endif()
#-----------------------------------------------------------------
find_library( ZLIB_LIBRARY NAMES z )
find_path( ZLIB_HEADER zlib.h /usr/include )
if (ZLIB_LIBRARY AND ZLIB_HEADER)
option(WITH_ZLIB "Include support for zlib functions compress()/uncompress()" ON)
if (WITH_ZLIB)
add_definitions( -DWITH_ZLIB )
endif()
else()
set( WITH_ZLIB FALSE )
message("ZLib not found - zlib support will not be included." )
endif()
#-----------------------------------------------------------------
find_library( PTHREAD_LIBRARY NAMES pthread )
if (PTHREAD_LIBRARY)
option( WITH_PTHREAD "Include support for pthreads" ON )
if (WITH_PTHREAD)
add_definitions( -DWITH_PTHREAD )
endif()
else()
set( WITH_PTHREAD FALSE )
message("pthread library not found - pthread support will not be included")
endif()
#-----------------------------------------------------------------
find_library( LAPACK_LIBRARY NAMES lapack)
if (LAPACK_LIBRARY)
set(CMAKE_REQUIRED_LIBS LAPACK_LIBRARY)
try_compile( BLAS0 ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/CMake/Tests/test_blas.c )
if (BLAS0)
set(NEED_BLAS OFF)
else()
set(NEED_BLAS ON)
find_library( BLAS_LIBRARY NAMES blas)
endif()
option(WITH_LAPACK "Build LAPACK enabled code" ON)
if (WITH_LAPACK)
add_definitions( -DWITH_LAPACK )
endif()
else()
set( WITH_LAPACK OFF)
message("LAPACK library not found - LAPACK support will not be included")
endif()
#-----------------------------------------------------------------
find_program(LATEX_PATH NAMES pdflatex)
if (LATEX_PATH)
option( WITH_LATEX "Build small class for compiling LaTeX files" ON)
if (WITH_LATEX)
set( WITH_LATEX ON)
add_definitions( -DWITH_LATEX )
endif()
else()
set( WITH_LATEX OFF )
endif()
#-----------------------------------------------------------------
find_path( EXECINFO_HEADER execinfo.h /usr/include )
if (EXECINFO_HEADER)
add_definitions( -DHAVE_EXECINFO )
endif()
#-----------------------------------------------------------------
find_path( GETOPT_HEADER getopt.h /usr/include )
if (GETOPT_HEADER)
add_definitions( -DHAVE_GETOPT )
endif()
#-----------------------------------------------------------------
if (ERT_WINDOWS)
find_library( SHLWAPI_LIBRARY NAMES Shlwapi )
endif()
if (MSVC)
add_definitions( -D__func__="\\"????\\"")
endif()
check_function_exists( regexec HAVE_REGEXP )
if (HAVE_REGEXP)
add_definitions( -DHAVE_REGEXP )
endif()
check_function_exists( realpath HAVE_REALPATH )
if (HAVE_REALPATH)
add_definitions( -DHAVE_REALPATH )
endif()
check_function_exists( fork HAVE_FORK )
if (HAVE_FORK)
add_definitions( -DHAVE_FORK )
endif()
check_function_exists( round HAVE_ROUND )
if (HAVE_ROUND)
add_definitions( -DHAVE_ROUND )
endif()
check_function_exists( ftruncate HAVE_FTRUNCATE )
if (HAVE_FTRUNCATE)
add_definitions( -DHAVE_FTRUNCATE )
endif()
check_function_exists( readlinkat HAVE_READLINKAT )
if (HAVE_READLINKAT)
add_definitions( -DHAVE_READLINKAT )
endif()
check_function_exists( symlink HAVE_SYMLINK )
if (HAVE_SYMLINK)
add_definitions( -DHAVE_SYMLINK )
endif()
check_function_exists( getuid HAVE_GETUID )
if (HAVE_GETUID)
add_definitions( -DHAVE_GETUID )
endif()
check_function_exists( localtime_r HAVE_LOCALTIME_R )
if (HAVE_LOCALTIME_R)
add_definitions( -DHAVE_LOCALTIME_R )
endif()
check_function_exists( lockf HAVE_LOCKF )
if (HAVE_LOCKF)
add_definitions( -DHAVE_LOCKF )
endif()
check_function_exists( isfinite HAVE_ISFINITE )
if (HAVE_ISFINITE)
add_definitions( -DHAVE_ISFINITE )
endif()
check_function_exists( glob HAVE_GLOB )
if (HAVE_GLOB)
add_definitions( -DHAVE_GLOB )
endif()
check_function_exists( fnmatch HAVE_FNMATCH )
if (HAVE_FNMATCH)
add_definitions( -DHAVE_FNMATCH )
endif()
check_function_exists( fsync HAVE_FSYNC )
if (HAVE_FSYNC)
add_definitions( -DHAVE_FSYNC )
endif()
check_function_exists( setenv HAVE_SETENV )
if (HAVE_SETENV)
add_definitions( -DPOSIX_SETENV )
endif()
check_function_exists( opendir HAVE_OPENDIR )
if (HAVE_OPENDIR)
add_definitions( -DHAVE_OPENDIR )
endif()
check_function_exists( usleep HAVE_USLEEP )
if (HAVE_OPENDIR)
add_definitions( -DHAVE_USLEEP )
endif()
try_compile( MKDIR_POSIX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/CMake/Tests/test_mkdir.c )
if (MKDIR_POSIX)
add_definitions( -DMKDIR_POSIX )
endif()
try_compile( HAVE_PID_T ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/CMake/Tests/test_pid_t.c )
if (HAVE_PID_T)
add_definitions( -DHAVE_PID_T )
endif()
try_compile( HAVE_VA_COPY ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/CMake/Tests/test_va_copy.c )
if (HAVE_VA_COPY)
message("Have va_copy() macro")
add_definitions( -DHAVE_VA_COPY )
endif()
try_compile( ISREG_POSIX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/CMake/Tests/test_isreg.c )
if (ISREG_POSIX)
add_definitions( -DHAVE_ISREG )
endif()
if (ERT_LINUX)
set( NEED_LIBM TRUE )
set( LINK_STATIC FALSE )
else()
set( NEED_LIBM FALSE )
set( LINK_STATIC TRUE )
endif()
configure_file( ${PROJECT_SOURCE_DIR}/CMake/config/ert_build_config.h.in
${PROJECT_BINARY_DIR}/ert_build_config.h )
set( libert_util_build_path ${PROJECT_BINARY_DIR}/libutil/src )
set( libert_util_src_path ${PROJECT_SOURCE_DIR}/libutil/src )
set( libecl_src_path ${PROJECT_SOURCE_DIR}/libecl/src )
set( libgeometry_src_path ${PROJECT_SOURCE_DIR}/libgeometry/src )
set( libwell_src_path ${PROJECT_SOURCE_DIR}/libwell/src )
set( libplot_src_path ${PROJECT_SOURCE_DIR}/libplot/src )
set( BUILD_CXX ON )
set( BUILD_ERT OFF)
include_directories( ${libert_util_build_path})
include_directories( ${libert_util_src_path} )
add_subdirectory( libutil )
add_subdirectory( libgeometry )
add_subdirectory( libecl )
add_subdirectory( libwell )
#-----------------------------------------------------------------
if (BUILD_ERT)
#-----------------------------------------------------------------
option(USE_LSF "Include support for LSF" ON)
set( libconfig_src_path ${CMAKE_SOURCE_DIR}/libconfig/src )
set( libsched_src_path ${CMAKE_SOURCE_DIR}/libsched/src )
set( librms_src_path ${CMAKE_SOURCE_DIR}/librms/src )
set( libanalysis_src_path ${CMAKE_SOURCE_DIR}/libanalysis/src )
set( libjob_queue_src_path ${CMAKE_SOURCE_DIR}/libjob_queue/src )
set( libplot_src_path ${CMAKE_SOURCE_DIR}/libplot/src )
set( libenkf_src_path ${CMAKE_SOURCE_DIR}/libenkf/src )
add_subdirectory( libconfig )
add_subdirectory( libanalysis )
add_subdirectory( librms )
add_subdirectory( libsched )
add_subdirectory( libjob_queue )
add_subdirectory( libplot )
add_subdirectory( libenkf)
add_dependencies( config_shared util_shared )
#add_dependencies( analysis_shared util_shared )
add_dependencies( rms_shared geometry_shared util_shared )
add_dependencies( sched_shared util_shared ecl_shared )
add_dependencies( job_queue_shared config_shared util )
add_dependencies( plot_shared util_shared )
add_dependencies( enkf_shared plot_shared ecl_shared util_shared config_shared sched_shared rms_shared analysis job_queue_shared )
add_dependencies( ert_shared enkf_shared plot_shared )
add_dependencies( config_static util_static )
#add_dependencies( analysis_static util_static )
add_dependencies( rms_static geometry_static util_static )
add_dependencies( sched_static util_static ecl_static )
add_dependencies( job_queue_static config_static util )
add_dependencies( plot_static util_static )
add_dependencies( enkf_static plot_static ecl_static util_static config_static sched_static rms_static analysis job_queue_static )
add_dependencies( ert enkf_static plot_static )
endif()

1265
ThirdParty/Ert/devel/Doxyfile vendored Normal file

File diff suppressed because it is too large Load Diff

15
ThirdParty/Ert/devel/SConstruct vendored Normal file
View File

@ -0,0 +1,15 @@
SConscript(["libsched/SConstruct",
"librms/SConstruct",
"libecl/SConstruct",
"libwell/SConstruct",
"libanalysis/SConstruct",
"libgeometry/SConstruct",
"libjob_queue/SConstruct",
"libplot/SConstruct",
"libutil/SConstruct",
"libconfig/SConstruct",
"libenkf/SConstruct"])

View File

@ -0,0 +1,26 @@
/*
The ert code is based on C99, and in particular makes extensive use
of the C99 feature stdbool.h. When including the ert headers in a
VisualStudio C++ project this creates problems because the
VisualStudio C compiler is not C99 conforming, and the compiler will
complain it can not find the stdbool.h header.
The symbols defined in the stdbool header are actually correctly(?)
defined by the VisualStudio compiler already, so this header file
does not define any bool related symbols!
To actually use this file you should copy it manually into the ert
include directory as used by VisualStudio.
*/
#ifndef __STDBOOL_H__
#define __STDBOOL_H__
#ifndef __cplusplus
typedef int bool;
#define true 1
#define false 0
#endif
#endif

90
ThirdParty/Ert/devel/Windows.txt vendored Normal file
View File

@ -0,0 +1,90 @@
Preparations:
-------------
1. Install the CMake build system from www.cmake.org
2. Install the MinGW and MSYS packages from www.mingw.org - this a
collection of gnu tools built for windows. Observe that these tools
behave like they do on linux, but they are native windows
applications and the compilers produce native windows binaries, not
like Cygwin which is based on a portability layer.
Make sure to install at least the C and Fortran compilers.
3. Install lapack; download and install instructions can be found on
http://icl.cs.utk.edu/lapack-for-windows/ The text says that you
will need the Intel Fortran compiler, but the Fortran compiler from
MinGW works fine. The distribution contains a cmake CMakeLists.txt
file, and build with Cmake is easy altough time consuming.
To make sure the system can find your libraries you should update
the windows PATH variable to include the location of your
libblas.dll and liblapack.dll files; if you fail to do this CMake
will fail to generate a valid set of makefiles for building libutil
and libecl.
Building libecl / libutil
-------------------------
1. Go to the root directory of the ert distribution and create a
directory to hold the files created by the build -
e.g. 'tmp-build'.
2. Open the cmake gui and give the path to the source (i.e. the root
of the ert distribution) and the path to the build directory.
3. Press the [Configure] button and select the "MSys Makefiles"
option. Cmake will inspect your system and set build configuration
variables accordingly. Cmake will fail with a beep and large red
warnings. Scroll down to the variables:
USE_LSF
USE_PTHREAD
USE_ZLIB
and uncheck them. In addition you might want to modify some other
variables? Press the [Configure] button again, and then finally the
[Generate] button to create makefiles.
4. Start up the MSys shell, go to the build directory,
e.g. 'tmp-build', and type:
make ; make install
:-)
Using from VisualStudio
-----------------------
The ERT code itself can unfortunately not be compiled with the
VisualStudio C++ compiler, however you can link against the ert
libraries. In that case you will need the dummy header file
VisualStudio/stdbool.h
About the portabaility and features
-----------------------------------
The libecl library is virtually unmodified for compiling on windows,
but the libutil library (in particular the util.c file) has quite many
#ifdef HAVE_FEATUREXX
#endif
codeblocks. The symbols HAVE_FEATUREXX are defined during the CMake
configure process. The system inspection is linux centric in the sense
that the features it is checked for are mostly present/defined on
linux. If FEATUREXX is not present it is sometimes completely ignore,
e.g. pthreads, or a windows alternative is compiled in. In the case of
windows alternative it is just assumed that the feature in question is
present on the other (i.e. Windows) platform.

Some files were not shown because too many files have changed in this diff Show More