Source: k2dgrflow/meshtype.h
|
|
|
|
// -*-c++-*-; Emacs major mode definition
#ifndef MESHTYPE_H_
#define MESHTYPE_H_
// *******************************************************************************
// PREPROCESSOR SWITCHES
// are defined in the include file defs.h
// sets our precision to double instead of float, ....
// *******************************************************************************
#include "defs.h"
/*
#define DEBUG // turns on general debugging message facilities
#define COUNT // tracks the number of valid instances of many classes
#define CHECK // enables internal consistency checks that cover the
// examination of function arguments and safe pointer casts
*/
/********************************************************************************
R C S -- I N F O R M A T I O N
$Author: benny $
$Date: 2001/06/08 09:38:33 $
$Log: meshtype.h,v $
Revision 1.1 2001/06/08 09:38:33 benny
*** empty log message ***
* Revision 2.12 94/11/13 19:22:08 hiptmair
* WARNING -> MESHWARNING in order to avoid double definition
*
* Revision 2.11 94/10/23 20:47:39 hiptmair
* *** empty log message ***
*
********************************************************************************/
/*********************************************************************************
* *
* meshtype.h *
* *
* This module defines several useful types that are frequently used throughout *
* the goofe code. *
* *
*********************************************************************************/
/*===============================================================================*/
// *******************************************************************************
// GENERAL INCLUDES
// *******************************************************************************
#include <new.h>
#include <assert.h>
#include <fstream.h>
// *******************************************************************************
// Several useful and convenient definitions of types and related constants
// *******************************************************************************
// *******************************************************************************
// BOOLEAN VARIABLES
// *******************************************************************************
typedef short int MeshBool;
const short int MeshTrue = 1; // C way to say yes
const short int MeshFalse = 0; // C way to say no
// *******************************************************************************
// POINTERs
// *******************************************************************************
#define NIL 0 // to label invalid (nil) pointers in a PASCAL fashion
// *******************************************************************************
// Type for coordinates of vertices
// *******************************************************************************
#ifdef PRECISE_COORDINATES
typedef double CoordReal;
#else
typedef float CoordReal;
#endif
// *******************************************************************************
// REAL type for weights of stencils
// *******************************************************************************
#ifdef PRECISE_WEIGHTS
typedef double NumReal;
#else
typedef float NumReal;
#endif
// *******************************************************************************
// REAL type for nodal values
// *******************************************************************************
#ifdef PRECISE_VALUES
typedef double NumReal;
#else
typedef float NumReal;
#endif
// *******************************************************************************
// INTEGER RELATED TYPES
// *******************************************************************************
typedef long int MeshLong;
typedef int MeshInt;
typedef short int MeshShort;
typedef unsigned int MeshCard;
typedef unsigned char MeshByte;
typedef unsigned char FlagType;
const FlagType AllFlagBits = ~(FlagType)0;
const FlagType NoFlagBit = (FlagType)0;
#define FLAGBIT(n) ((FlagType)((unsigned char)1 << ((unsigned int)(n)>7?7:(n))))
// *******************************************************************************
// Size of various types in bits
// *******************************************************************************
const int long_bits = sizeof(long)/sizeof(char)*8;
const int float_bits = sizeof(float)/sizeof(char)*8;
const int double_bits = sizeof(double)/sizeof(char)*8;
const int int_bits = sizeof(int)/sizeof(char)*8;
// *******************************************************************************
// Some #defines intended to enhance the readability of the code
// *******************************************************************************
#define inherited virtual
#define dummy
// *******************************************************************************
// A macro for debugging purposes
// *******************************************************************************
#ifdef WARNING
#undef WARNING
#endif
#ifdef ERROR
#undef ERROR
#endif
#define ERROR(proc) \
{ mesherr << "\t!! Fatal error in file " << __FILE__; \
mesherr << " in function " << proc << " at line "; \
mesherr << __LINE__ << " !!" << endl; \
assert(NIL); }
#define WARNING(proc) \
{ mesherr << "\t!! Awkward situation in file " << __FILE__; \
mesherr << " in function " << proc << " at line "; \
mesherr << __LINE__ << " !!" << endl; }
#define MESHWARNING(proc) \
{ mesherr << "\t!! Awkward situation in file " << __FILE__; \
mesherr << " in function " << proc << " at line "; \
mesherr << __LINE__ << " !!" << endl; }
#endif
// end of file
Generated by: benny@okidoki on Thu Jun 21 10:41:51 2001, using kdoc 2.0a53. |