This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Inlining problem
- To: gcc at gcc dot gnu dot org
- Subject: Inlining problem
- From: Robert Schweikert <rjschwei at mindspring dot com>
- Date: Wed, 03 Jan 2001 21:46:28 -0500
Attached is a .i file that demonstrates a problem with inlining in
gcc-2.95.2. I do not understand why the inlining is not working, as
similar use of inlining in other classes works.
Here is the problem
-> g++ -c modSectLay.i
-> nm -Bg modSectLay.o | grep DeclareMatVar
U DeclareMatVar__14MatPointLayoutRC13MatPointVarIDT1
U DeclareMatVar__14MatPointLayoutRC13MatPointVarIDi
-> c++filt DeclareMatVar__14MatPointLayoutRC13MatPointVarIDT1
MatPointLayout::DeclareMatVar(MatPointVarID const &, MatPointVarID const &)
The method "DeclareMatVar(MatPointVarID const &, MatPointVarID const &)"
is declared as inline, and thus no symbol should be created when the
method is being called. This of course leads to link errors.
The declaration of "DeclareMatVar(MatPointVarID const &, MatPointVarID
const &)" is in line 2324 in the .i file, the implementation starts on
line 2759 and the call is in line 2826 of the .i file.
To work around this problem I made the method out of line. This didn't
cause any performance drop. However, I would like to understand why g++
is not inlining this function to let other programmers know what we need
to do to make inlining work consistently in our code on Linux.
Any help is appreciated.
Robert
--
Robert Schweikert MAY THE SOURCE BE WITH YOU
rjschwei@mindspring.com LINUX
extern "C" {
typedef unsigned int size_t;
typedef void *__gnuc_va_list;
void va_end (__gnuc_va_list);
typedef __gnuc_va_list va_list;
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __quad_t;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;
typedef __quad_t *__qaddr_t;
typedef __u_quad_t __dev_t;
typedef __u_int __uid_t;
typedef __u_int __gid_t;
typedef __u_long __ino_t;
typedef __u_int __mode_t;
typedef __u_int __nlink_t;
typedef long int __off_t;
typedef __quad_t __loff_t;
typedef int __pid_t;
typedef int __ssize_t;
typedef long int __rlim_t;
typedef __quad_t __rlim64_t;
typedef __u_int __id_t;
typedef struct
{
int __val[2];
} __fsid_t;
typedef int __daddr_t;
typedef char *__caddr_t;
typedef long int __time_t;
typedef long int __swblk_t;
typedef long int __clock_t;
typedef unsigned long int __fd_mask;
typedef struct
{
__fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask)) ];
} __fd_set;
typedef int __key_t;
typedef unsigned short int __ipc_pid_t;
typedef long int __blkcnt_t;
typedef __quad_t __blkcnt64_t;
typedef __u_long __fsblkcnt_t;
typedef __u_quad_t __fsblkcnt64_t;
typedef __u_long __fsfilcnt_t;
typedef __u_quad_t __fsfilcnt64_t;
typedef __u_long __ino64_t;
typedef __loff_t __off64_t;
typedef int __t_scalar_t;
typedef unsigned int __t_uscalar_t;
typedef int __intptr_t;
struct __sched_param
{
int sched_priority;
};
struct _pthread_fastlock
{
long int __status;
int __spinlock;
};
typedef struct _pthread_descr_struct *_pthread_descr;
typedef struct
{
int __detachstate;
int __schedpolicy;
struct __sched_param __schedparam;
int __inheritsched;
int __scope;
size_t __guardsize;
int __stackaddr_set;
void *__stackaddr;
size_t __stacksize;
} pthread_attr_t;
typedef struct
{
struct _pthread_fastlock __c_lock;
_pthread_descr __c_waiting;
} pthread_cond_t;
typedef struct
{
int __dummy;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef struct
{
int __m_reserved;
int __m_count;
_pthread_descr __m_owner;
int __m_kind;
struct _pthread_fastlock __m_lock;
} pthread_mutex_t;
typedef struct
{
int __mutexkind;
} pthread_mutexattr_t;
typedef int pthread_once_t;
typedef struct
{
struct _pthread_fastlock __rw_lock;
int __rw_readers;
_pthread_descr __rw_writer;
_pthread_descr __rw_read_waiting;
_pthread_descr __rw_write_waiting;
int __rw_kind;
int __rw_pshared;
} pthread_rwlock_t;
typedef struct
{
int __lockkind;
int __pshared;
} pthread_rwlockattr_t;
typedef unsigned long int pthread_t;
typedef struct _IO_FILE FILE;
typedef unsigned int wint_t;
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
struct _IO_jump_t; struct _IO_FILE;
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
};
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
typedef __ssize_t __io_read_fn (void * __cookie, char *__buf,
size_t __nbytes) ;
typedef __ssize_t __io_write_fn (void * __cookie, __const char *__buf,
size_t __n) ;
typedef int __io_seek_fn (void * __cookie, __off_t __pos, int __w) ;
typedef int __io_close_fn (void * __cookie) ;
typedef __io_read_fn cookie_read_function_t;
typedef __io_write_fn cookie_write_function_t;
typedef __io_seek_fn cookie_seek_function_t;
typedef __io_close_fn cookie_close_function_t;
typedef struct
{
__io_read_fn *read;
__io_write_fn *write;
__io_seek_fn *seek;
__io_close_fn *close;
} _IO_cookie_io_functions_t;
typedef _IO_cookie_io_functions_t cookie_io_functions_t;
extern "C" {
extern int __underflow (_IO_FILE *) throw () ;
extern int __uflow (_IO_FILE *) throw () ;
extern int __overflow (_IO_FILE *, int) throw () ;
extern int _IO_getc (_IO_FILE *__fp) throw () ;
extern int _IO_putc (int __c, _IO_FILE *__fp) throw () ;
extern int _IO_feof (_IO_FILE *__fp) throw () ;
extern int _IO_ferror (_IO_FILE *__fp) throw () ;
extern int _IO_peekc_locked (_IO_FILE *__fp) throw () ;
extern void _IO_flockfile (_IO_FILE *) throw () ;
extern void _IO_funlockfile (_IO_FILE *) throw () ;
extern int _IO_ftrylockfile (_IO_FILE *) throw () ;
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
__gnuc_va_list , int *__restrict) throw () ;
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
__gnuc_va_list ) throw () ;
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t ) throw () ;
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t ) throw () ;
extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t , int, int) throw () ;
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t , int) throw () ;
extern void _IO_free_backup_area (_IO_FILE *) throw () ;
}
typedef __off_t fpos_t;
typedef __off64_t fpos64_t;
extern int remove (__const char *__filename) throw () ;
extern int rename (__const char *__old, __const char *__new) throw () ;
extern FILE *tmpfile (void) throw () ;
extern FILE *tmpfile64 (void) throw () ;
extern char *tmpnam (char *__s) throw () ;
extern char *tmpnam_r (char *__s) throw () ;
extern char *tempnam (__const char *__dir, __const char *__pfx) throw () ;
extern int fclose (FILE *__stream) throw () ;
extern int fflush (FILE *__stream) throw () ;
extern int fflush_unlocked (FILE *__stream) throw () ;
extern int fcloseall (void) throw () ;
extern FILE *fopen (__const char *__restrict __filename,
__const char *__restrict __modes) throw () ;
extern FILE *freopen (__const char *__restrict __filename,
__const char *__restrict __modes,
FILE *__restrict __stream) throw () ;
extern FILE *fopen64 (__const char *__restrict __filename,
__const char *__restrict __modes) throw () ;
extern FILE *freopen64 (__const char *__restrict __filename,
__const char *__restrict __modes,
FILE *__restrict __stream) throw () ;
extern FILE *fdopen (int __fd, __const char *__modes) throw () ;
extern FILE *fopencookie (void *__restrict __magic_cookie,
__const char *__restrict __modes,
_IO_cookie_io_functions_t __io_funcs) throw () ;
extern FILE *open_memstream (char **__restrict __bufloc,
size_t *__restrict __sizeloc) throw () ;
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw () ;
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) throw () ;
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) throw () ;
extern void setlinebuf (FILE *__stream) throw () ;
extern int fprintf (FILE *__restrict __stream,
__const char *__restrict __format, ...) throw () ;
extern int printf (__const char *__restrict __format, ...) throw () ;
extern int sprintf (char *__restrict __s,
__const char *__restrict __format, ...) throw () ;
extern int vfprintf (FILE *__restrict __s,
__const char *__restrict __format,
__gnuc_va_list __arg) throw () ;
extern int vprintf (__const char *__restrict __format,
__gnuc_va_list __arg) throw () ;
extern int vsprintf (char *__restrict __s,
__const char *__restrict __format,
__gnuc_va_list __arg) throw () ;
extern int snprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format, ...) throw ()
__attribute__ ((__format__ (__printf__, 3, 4)));
extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format,
__gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__printf__, 3, 0)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format,
__gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__printf__, 3, 0)));
extern int vasprintf (char **__restrict __ptr,
__const char *__restrict __f, __gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int __asprintf (char **__restrict __ptr,
__const char *__restrict __fmt, ...) throw ()
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int asprintf (char **__restrict __ptr,
__const char *__restrict __fmt, ...) throw ()
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int vdprintf (int __fd, __const char *__restrict __fmt,
__gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, __const char *__restrict __fmt, ...) throw ()
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int fscanf (FILE *__restrict __stream,
__const char *__restrict __format, ...) throw () ;
extern int scanf (__const char *__restrict __format, ...) throw () ;
extern int sscanf (__const char *__restrict __s,
__const char *__restrict __format, ...) throw () ;
extern int vfscanf (FILE *__restrict __s,
__const char *__restrict __format,
__gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__scanf__, 2, 0)));
extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__scanf__, 1, 0)));
extern int vsscanf (__const char *__restrict __s,
__const char *__restrict __format,
__gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__scanf__, 2, 0)));
extern int fgetc (FILE *__stream) throw () ;
extern int getc (FILE *__stream) throw () ;
extern int getchar (void) throw () ;
extern int getc_unlocked (FILE *__stream) throw () ;
extern int getchar_unlocked (void) throw () ;
extern int fgetc_unlocked (FILE *__stream) throw () ;
extern int fputc (int __c, FILE *__stream) throw () ;
extern int putc (int __c, FILE *__stream) throw () ;
extern int putchar (int __c) throw () ;
extern int fputc_unlocked (int __c, FILE *__stream) throw () ;
extern int putc_unlocked (int __c, FILE *__stream) throw () ;
extern int putchar_unlocked (int __c) throw () ;
extern int getw (FILE *__stream) throw () ;
extern int putw (int __w, FILE *__stream) throw () ;
extern char *fgets (char *__restrict __s, int __n,
FILE *__restrict __stream) throw () ;
extern char *fgets_unlocked (char *__restrict __s, int __n,
FILE *__restrict __stream) throw () ;
extern char *gets (char *__s) throw () ;
extern __ssize_t __getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) throw () ;
extern __ssize_t getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) throw () ;
extern __ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) throw () ;
extern int fputs (__const char *__restrict __s,
FILE *__restrict __stream) throw () ;
extern int fputs_unlocked (__const char *__restrict __s,
FILE *__restrict __stream) throw () ;
extern int puts (__const char *__s) throw () ;
extern int ungetc (int __c, FILE *__stream) throw () ;
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) throw () ;
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s) throw () ;
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) throw () ;
extern size_t fwrite_unlocked (__const void *__restrict __ptr,
size_t __size, size_t __n,
FILE *__restrict __stream) throw () ;
extern int fseek (FILE *__stream, long int __off, int __whence) throw () ;
extern long int ftell (FILE *__stream) throw () ;
extern void rewind (FILE *__stream) throw () ;
typedef __off_t off_t;
typedef __off64_t off64_t;
extern int fseeko (FILE *__stream, __off_t __off, int __whence) throw () ;
extern __off_t ftello (FILE *__stream) throw () ;
extern int fgetpos (FILE *__restrict __stream,
fpos_t *__restrict __pos) throw () ;
extern int fsetpos (FILE *__stream, __const fpos_t *__pos) throw () ;
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence) throw () ;
extern __off64_t ftello64 (FILE *__stream) throw () ;
extern int fgetpos64 (FILE *__restrict __stream,
fpos64_t *__restrict __pos) throw () ;
extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos) throw () ;
extern void clearerr (FILE *__stream) throw () ;
extern int feof (FILE *__stream) throw () ;
extern int ferror (FILE *__stream) throw () ;
extern void clearerr_unlocked (FILE *__stream) throw () ;
extern int feof_unlocked (FILE *__stream) throw () ;
extern int ferror_unlocked (FILE *__stream) throw () ;
extern void perror (__const char *__s) throw () ;
extern int sys_nerr;
extern __const char *__const sys_errlist[];
extern int _sys_nerr;
extern __const char *__const _sys_errlist[];
extern int fileno (FILE *__stream) throw () ;
extern int fileno_unlocked (FILE *__stream) throw () ;
extern FILE *popen (__const char *__command, __const char *__modes) throw () ;
extern int pclose (FILE *__stream) throw () ;
extern char *ctermid (char *__s) throw () ;
extern char *cuserid (char *__s) throw () ;
struct obstack;
extern int obstack_printf (struct obstack *__restrict __obstack,
__const char *__restrict __format, ...) throw () ;
extern int obstack_vprintf (struct obstack *__restrict __obstack,
__const char *__restrict __format,
__gnuc_va_list __args) throw () ;
extern void flockfile (FILE *__stream) throw () ;
extern int ftrylockfile (FILE *__stream) throw () ;
extern void funlockfile (FILE *__stream) throw () ;
}
extern "C" void cfi_WriteMessage(int jop, const char* mesage);
void
adb_Abqerr1( int jop, char* format, int arg1);
void
adb_Abqerr1( int jop, char* format, double arg1);
void
adb_Abqerr1( int jop, char* format, char* arg1);
enum {jop_Info=1, jop_InpErr=0, jop_Warn=-1, jop_ErrCont=-2,
jop_Err=-3, jop_InpWarn=-4 };
struct IStrucDFIC {
int c;
int d;
int f;
int i;
IStrucDFIC operator+ (IStrucDFIC);
IStrucDFIC();
IStrucDFIC(int,int,int,int);
};
extern "C" {
extern void * memcpy (void * __restrict __dest,
__const void * __restrict __src, size_t __n) throw () ;
extern void * memmove (void * __dest, __const void * __src,
size_t __n) throw () ;
extern void * memccpy (void * __dest, __const void * __src,
int __c, size_t __n) throw () ;
extern void * memset (void * __s, int __c, size_t __n) throw () ;
extern int memcmp (__const void * __s1, __const void * __s2,
size_t __n) throw () ;
extern void * memchr (__const void * __s, int __c, size_t __n) throw () ;
extern void * rawmemchr (__const void * __s, int __c) throw () ;
extern char *strcpy (char *__restrict __dest,
__const char *__restrict __src) throw () ;
extern char *strncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
extern char *strcat (char *__restrict __dest,
__const char *__restrict __src) throw () ;
extern char *strncat (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
extern int strcmp (__const char *__s1, __const char *__s2) throw () ;
extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) throw () ;
extern int strcoll (__const char *__s1, __const char *__s2) throw () ;
extern size_t strxfrm (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
typedef struct __locale_struct
{
struct locale_data *__locales[6];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
} *__locale_t;
extern int __strcoll_l (__const char *__s1, __const char *__s2,
__locale_t __l) throw () ;
extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n,
__locale_t __l) throw () ;
extern char *__strdup (__const char *__s) throw () ;
extern char *strdup (__const char *__s) throw () ;
extern char *strndup (__const char *__string, size_t __n) throw () ;
extern char *strchr (__const char *__s, int __c) throw () ;
extern char *strrchr (__const char *__s, int __c) throw () ;
extern char *strchrnul (__const char *__s, int __c) throw () ;
extern size_t strcspn (__const char *__s, __const char *__reject) throw () ;
extern size_t strspn (__const char *__s, __const char *__accept) throw () ;
extern char *strpbrk (__const char *__s, __const char *__accept) throw () ;
extern char *strstr (__const char *__haystack, __const char *__needle) throw () ;
extern char *__strcasestr (__const char *__haystack,
__const char *__needle) throw () ;
extern char *strcasestr (__const char *__haystack,
__const char *__needle) throw () ;
extern char *strtok (char *__restrict __s,
__const char *__restrict __delim) throw () ;
extern char *__strtok_r (char *__restrict __s,
__const char *__restrict __delim,
char **__restrict __save_ptr) throw () ;
extern char *strtok_r (char *__restrict __s,
__const char *__restrict __delim,
char **__restrict __save_ptr) throw () ;
extern void * memmem (__const void * __haystack, size_t __haystacklen,
__const void * __needle, size_t __needlelen) throw () ;
extern void * __mempcpy (void * __restrict __dest,
__const void * __restrict __src, size_t __n) throw () ;
extern void * mempcpy (void * __restrict __dest,
__const void * __restrict __src, size_t __n) throw () ;
extern size_t strlen (__const char *__s) throw () ;
extern size_t strnlen (__const char *__string, size_t __maxlen) throw () ;
extern char *strerror (int __errnum) throw () ;
extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen) throw () ;
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) throw () ;
extern void __bzero (void * __s, size_t __n) throw () ;
extern void bcopy (__const void * __src, void * __dest, size_t __n) throw () ;
extern void bzero (void * __s, size_t __n) throw () ;
extern int bcmp (__const void * __s1, __const void * __s2, size_t __n) throw () ;
extern char *index (__const char *__s, int __c) throw () ;
extern char *rindex (__const char *__s, int __c) throw () ;
extern int __ffs (int __i) throw () __attribute__ ((const));
extern int ffs (int __i) throw () __attribute__ ((const));
extern int ffsl (long int __l) throw () __attribute__ ((const));
__extension__ extern int ffsll (long long int __ll) throw ()
__attribute__ ((const));
extern int __strcasecmp (__const char *__s1, __const char *__s2) throw () ;
extern int strcasecmp (__const char *__s1, __const char *__s2) throw () ;
extern int strncasecmp (__const char *__s1, __const char *__s2,
size_t __n) throw () ;
extern int __strcasecmp_l (__const char *__s1, __const char *__s2,
__locale_t __loc) throw () ;
extern int __strncasecmp_l (__const char *__s1, __const char *__s2,
size_t __n, __locale_t __loc) throw () ;
extern char *strsep (char **__restrict __stringp,
__const char *__restrict __delim) throw () ;
extern int strverscmp (__const char *__s1, __const char *__s2) throw () ;
extern char *strsignal (int __sig) throw () ;
extern char *__stpcpy (char *__restrict __dest,
__const char *__restrict __src) throw () ;
extern char *stpcpy (char *__restrict __dest,
__const char *__restrict __src) throw () ;
extern char *__stpncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
extern char *stpncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
extern char *strfry (char *__string) throw () ;
extern void * memfrob (void * __s, size_t __n) throw () ;
extern char *basename (__const char *__filename) throw () ;
}
int initBlankString(char*, int);
class Pool;
class adb_MemoryManagement
{
public:
void* operator new ( size_t, Pool& pool );
void* operator new (size_t, void* place)
{
return place;
}
void operator delete (void * addr, size_t);
protected:
adb_MemoryManagement(){};
~adb_MemoryManagement(){};
private:
void* operator new (size_t);
};
extern "C" {
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
extern size_t __ctype_get_mb_cur_max (void) throw () ;
extern double atof (__const char *__nptr) throw () ;
extern int atoi (__const char *__nptr) throw () ;
extern long int atol (__const char *__nptr) throw () ;
__extension__ extern long long int atoll (__const char *__nptr) throw () ;
extern double strtod (__const char *__restrict __nptr,
char **__restrict __endptr) throw () ;
extern float strtof (__const char *__restrict __nptr,
char **__restrict __endptr) throw () ;
extern long double strtold (__const char *__restrict __nptr,
char **__restrict __endptr) throw () ;
extern long int strtol (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) throw () ;
extern unsigned long int strtoul (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base) throw () ;
__extension__
extern long long int strtoq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) throw () ;
__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base) throw () ;
__extension__
extern long long int strtoll (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) throw () ;
__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base) throw () ;
extern long int __strtol_l (__const char *__restrict __nptr,
char **__restrict __endptr, int __base,
__locale_t __loc) throw () ;
extern unsigned long int __strtoul_l (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, __locale_t __loc) throw () ;
__extension__
extern long long int __strtoll_l (__const char *__restrict __nptr,
char **__restrict __endptr, int __base,
__locale_t __loc) throw () ;
__extension__
extern unsigned long long int __strtoull_l (__const char *__restrict
__nptr,
char **__restrict __endptr,
int __base,
__locale_t __loc) throw () ;
extern double __strtod_l (__const char *__restrict __nptr,
char **__restrict __endptr, __locale_t __loc) throw () ;
extern float __strtof_l (__const char *__restrict __nptr,
char **__restrict __endptr, __locale_t __loc) throw () ;
extern long double __strtold_l (__const char *__restrict __nptr,
char **__restrict __endptr,
__locale_t __loc) throw () ;
extern double __strtod_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __group) throw () ;
extern float __strtof_internal (__const char *__restrict __nptr,
char **__restrict __endptr, int __group) throw () ;
extern long double __strtold_internal (__const char *
__restrict __nptr,
char **__restrict __endptr,
int __group) throw () ;
extern long int __strtol_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) throw () ;
extern unsigned long int __strtoul_internal (__const char *
__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) throw () ;
__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) throw () ;
__extension__
extern unsigned long long int __strtoull_internal (__const char *
__restrict __nptr,
char **
__restrict __endptr,
int __base,
int __group) throw () ;
extern char *l64a (long int __n) throw () ;
extern long int a64l (__const char *__s) throw () ;
extern "C" {
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __ino64_t ino64_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
typedef __pid_t pid_t;
typedef __id_t id_t;
typedef __ssize_t ssize_t;
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
typedef __clock_t clock_t;
typedef __time_t time_t;
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
typedef int int8_t __attribute__ ((__mode__ ( __QI__ ))) ;
typedef int int16_t __attribute__ ((__mode__ ( __HI__ ))) ;
typedef int int32_t __attribute__ ((__mode__ ( __SI__ ))) ;
typedef int int64_t __attribute__ ((__mode__ ( __DI__ ))) ;
typedef unsigned int u_int8_t __attribute__ ((__mode__ ( __QI__ ))) ;
typedef unsigned int u_int16_t __attribute__ ((__mode__ ( __HI__ ))) ;
typedef unsigned int u_int32_t __attribute__ ((__mode__ ( __SI__ ))) ;
typedef unsigned int u_int64_t __attribute__ ((__mode__ ( __DI__ ))) ;
typedef int register_t __attribute__ ((__mode__ (__word__)));
typedef int __sig_atomic_t;
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int))) ];
} __sigset_t;
struct timespec
{
long int tv_sec;
long int tv_nsec;
};
extern "C" {
struct timeval;
typedef __fd_mask fd_mask;
typedef __fd_set fd_set;
extern int __select (int __nfds, __fd_set *__readfds,
__fd_set *__writefds, __fd_set *__exceptfds,
struct timeval *__timeout) throw () ;
extern int select (int __nfds, __fd_set *__readfds,
__fd_set *__writefds, __fd_set *__exceptfds,
struct timeval *__timeout) throw () ;
extern int pselect (int __nfds, __fd_set *__readfds,
__fd_set *__writefds, __fd_set *__exceptfds,
const struct timespec *__timeout,
const __sigset_t *__sigmask) throw () ;
}
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;
}
extern int32_t random (void) throw () ;
extern void srandom (unsigned int __seed) throw () ;
extern void * initstate (unsigned int __seed, void * __statebuf,
size_t __statelen) throw () ;
extern void * setstate (void * __statebuf) throw () ;
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) throw () ;
extern int srandom_r (unsigned int __seed, struct random_data *__buf) throw () ;
extern int initstate_r (unsigned int __seed,
void * __restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf) throw () ;
extern int setstate_r (void * __restrict __statebuf,
struct random_data *__restrict __buf) throw () ;
extern int rand (void) throw () ;
extern void srand (unsigned int __seed) throw () ;
extern int rand_r (unsigned int *__seed) throw () ;
extern double drand48 (void) throw () ;
extern double erand48 (unsigned short int __xsubi[3]) throw () ;
extern long int lrand48 (void) throw () ;
extern long int nrand48 (unsigned short int __xsubi[3]) throw () ;
extern long int mrand48 (void) throw () ;
extern long int jrand48 (unsigned short int __xsubi[3]) throw () ;
extern void srand48 (long int __seedval) throw () ;
extern unsigned short int *seed48 (unsigned short int __seed16v[3]) throw () ;
extern void lcong48 (unsigned short int __param[7]) throw () ;
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () ;
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () ;
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int srand48_r (long int __seedval, struct drand48_data *__buffer) throw () ;
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) throw () ;
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer) throw () ;
extern void * malloc (size_t __size) throw () ;
extern void * calloc (size_t __nmemb, size_t __size) throw () ;
extern void * realloc (void * __ptr, size_t __size) throw () ;
extern void free (void * __ptr) throw () ;
extern void cfree (void * __ptr) throw () ;
extern "C" {
extern void * alloca (size_t __size) throw () ;
}
extern void * valloc (size_t __size) throw () ;
extern void abort (void) throw () __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) throw () ;
extern int __on_exit (void (*__func) (int __status, void * __arg),
void * __arg) throw () ;
extern int on_exit (void (*__func) (int __status, void * __arg),
void * __arg) throw () ;
extern void exit (int __status) throw () __attribute__ ((__noreturn__));
extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
extern char *getenv (__const char *__name) throw () ;
extern char *__secure_getenv (__const char *__name) throw () ;
extern int putenv (__const char *__string) throw () ;
extern int setenv (__const char *__name, __const char *__value,
int __replace) throw () ;
extern void unsetenv (__const char *__name) throw () ;
extern int clearenv (void) throw () ;
extern char *mktemp (char *__template) throw () ;
extern int mkstemp (char *__template) throw () ;
extern int system (__const char *__command) throw () ;
extern char *canonicalize_file_name (__const char *__name) throw () ;
extern char *realpath (__const char *__restrict __name,
char *__restrict __resolved) throw () ;
typedef int (*__compar_fn_t) (__const void * , __const void * ) ;
typedef __compar_fn_t comparison_fn_t;
extern void * bsearch (__const void * __key, __const void * __base,
size_t __nmemb, size_t __size,
__compar_fn_t __compar) ;
extern void qsort (void * __base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) ;
extern int abs (int __x) throw () __attribute__ ((__const__));
extern long int labs (long int __x) throw () __attribute__ ((__const__));
__extension__ extern long long int llabs (long long int __x) throw ()
__attribute__ ((__const__));
extern div_t div (int __numer, int __denom) throw () __attribute__ ((__const__));
extern ldiv_t ldiv (long int __numer, long int __denom) throw ()
__attribute__ ((__const__));
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom) throw ()
__attribute__ ((__const__));
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () ;
extern char *gcvt (double __value, int __ndigit, char *__buf) throw () ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign) throw () ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign) throw () ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf) throw () ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () ;
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () ;
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len) throw () ;
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len) throw () ;
extern int mblen (__const char *__s, size_t __n) throw () ;
extern int mbtowc (wchar_t *__restrict __pwc,
__const char *__restrict __s, size_t __n) throw () ;
extern int wctomb (char *__s, wchar_t __wchar) throw () ;
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
__const char *__restrict __s, size_t __n) throw () ;
extern size_t wcstombs (char *__restrict __s,
__const wchar_t *__restrict __pwcs, size_t __n) throw () ;
extern int rpmatch (__const char *__response) throw () ;
extern int getsubopt (char **__restrict __optionp,
__const char *__const *__restrict __tokens,
char **__restrict __valuep) throw () ;
extern void setkey (__const char *__key) throw () ;
extern int grantpt (int __fd) throw () ;
extern int unlockpt (int __fd) throw () ;
extern char *ptsname (int __fd) throw () ;
extern int ptsname_r (int __fd, char *__buf, size_t __buflen) throw () ;
extern int getpt (void) throw () ;
}
extern "C" {
extern void __assert_fail (__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
}
extern "C" {
extern void __assert_fail (__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
}
class adb_LayStarts;
class Element;
class ElementDb;
class LayBulkStart;
class RebarLayout;
class VarBlock;
struct GPointer;
enum LayoutTypeKey {LayoutTypeKeyInvalid=-1,
ElementLayoutTypeKey,
SectIntLayoutTypeKey,
RebarLayoutTypeKey,
MatPointLayoutTypeKey,
nLayoutTypeKey};
class Layout : public adb_MemoryManagement
{
public:
Layout ();
Layout (const Layout & rLay,
LayBulkStart * pLBS,
Element * pCurrel);
virtual ~Layout();
const double* GetVarDR (const int ivID) const;
double* GetVarDW (const int ivID) const;
double* GetVarDRW(const int ivID) const;
const int* GetVarIR (const int ivID) const;
int* GetVarIW (const int ivID) const;
int* GetVarIRW(const int ivID) const;
inline int IsDeclared (const int ivID) const;
const double* QueryVarDR (const int ivID, int& declared) const;
double* QueryVarDW (const int ivID, int& declared) const;
double* QueryVarDRW(const int ivID, int& declared) const;
const int* QueryVarIR (const int ivID, int& declared) const;
int* QueryVarIW (const int ivID, int& declared) const;
int* QueryVarIRW(const int ivID, int& declared) const;
virtual Layout* CreateUnique(Pool &) = 0;
int Equal (const Layout&) const;
virtual int AttributesEqual(const Layout&) const = 0;
int Ordinal () const {return ordinal;};
void SetOrdinal (int i) {ordinal = i;};
inline
int Jelno() const;
LayoutTypeKey Type() const {return type;};
int Committed(const Layout* lay) const {return lay->Ordinal() >= 0;};
inline
adb_LayStarts * GetLayStarts () const {return m_pLayStarts;};
inline
void SetUniqueLS (adb_LayStarts * pLayStarts)
{
m_pLayStarts = pLayStarts;
}
inline
LayBulkStart* GetBulkStart () const {return layBulkStart;};
inline
Element* GetElement () {return currel;}
int* Ends () const;
inline
int NCase (int vol) const;
void Build();
int NSubLayout() const;
Layout*& SubLayout(int i=0) const;
VarBlock* GetVarBlock() const {return varBlock;};
VarBlock*& LayVarBlock() { return varBlock;};
Layout * MakeOpenCopyRecursive (Pool&,
LayBulkStart* rec,
Element* c1) const;
Layout * MakeCopyELay (Pool & rPool,
LayBulkStart * pLBS,
Element * pCurrel) const;
int NMatPts() const;
void CopyRWZeroW (const unsigned * const puActiveFields) const;
ElementDb & GetEldb () const;
void ZeroBulk();
void CopyRWZeroW();
void CopyRW();
void CopyRWZeroRW();
void CopyRtoWZeroW();
void StorageHarden ();
IStrucDFIC StorageSize () const
{
IStrucDFIC totalSize;
totalSize.i = StorageSizeBase().i + StorageSizeDer().i;
return totalSize;
};
void StorageWrite (int * loc) const;
static Layout* StorageReadNew (Pool&, const int* loc);
void StorageUnHarden (ElementDb*);
virtual unsigned int MemSize() const = 0;
void RotateLayoutandSubLayout( const double* rotate,
const double* translate );
virtual void Print (int indentSize, const char* flags) const = 0;
void Print (int indentSize) const;
void PrintBulk (int indentSize,
const char *flags) const;
void PrintBulkV (const char* spaces,
const int ivID,
int printW=0) const;
void PrintStarts (const char* indent) const;
void PrintEnds (const char* indent) const;
void UndeclaredVariableErr (const char* messagePart, const int ivID) const;
void InaccessibleVariableErr (const char* messagePart, const int ivID) const;
protected:
void MakeStarts (int* cursor);
enum StorageOrder {typeLoc,
varBlockOrdinalPLoc,
iLayStartsOrdinalLoc,
fixedDataEndILoc};
IStrucDFIC StorageSizeBase () const;
virtual IStrucDFIC StorageSizeDer () const = 0;
void StorageWriteBase (int * & loc) const;
virtual void StorageWriteDer (int * & loc) const = 0;
void StorageReadBase (const int * & loc);
virtual void StorageReadDer (const int * & loc) = 0;
virtual void StorageHardenDer () = 0;
virtual void StorageUnHardenDer (ElementDb*) = 0;
private:
inline int LocateVariable (const int ivID,
int& varPos,
int& vol) const;
void IVBTransferFromBulkRec();
void IVBTransferToBulkRec();
virtual void RotateLayoutVariables( const double* rotate,
const double* translate ) = 0;
RebarLayout * MakeCopyRLay (Pool & rPool,
LayBulkStart * pLBS,
Element * pCurrel) const;
protected:
LayoutTypeKey type;
int ordinal;
VarBlock* varBlock;
int varBlockOrdinalP;
adb_LayStarts * m_pLayStarts;
int m_iLSOrdinal;
private:
LayBulkStart* layBulkStart;
Element* currel;
GPointer* iVBuffers;
};
enum ElementVarID
{
vidE_pertElse ,
vidE_Elcd ,
vidE_Elke ,
};
enum MatPointVarID
{
vidM_Ce ,
vidM_Ceeq ,
vidM_Cener ,
vidM_Coord ,
};
enum SectIntVarID
{
vidS_Coord ,
vidS_Sf ,
vidS_pertSf ,
vidS_Se ,
};
typedef unsigned char UChar;
typedef char Char;
typedef unsigned short UShort;
typedef short Short;
typedef unsigned int UInt;
typedef int Int;
typedef unsigned long ULong;
typedef long Long;
typedef float Float;
typedef double Double;
enum rdm_TagTypes { rdm_TagInvalid, rdm_TagLocked,
rdm_TagCharV, rdm_TagIntV, rdm_TagUIntV,
rdm_TagFloatV, rdm_TagDoubleV,
rdm_TagBootPartition, rdm_TagWormPartition,
rdm_TagStatePartition, rdm_TagDir, rdm_TagIndexList,
rdm_TagIssue, rdm_TagIssueImmutable,
rdm_TagCharP, rdm_TagIntP, rdm_TagUIntP,
rdm_TagFloatP, rdm_TagDoubleP };
enum rdm_FolderNames { rdm_ModelFolder, rdm_StateFolder, rdm_ScratchFolder,
rdm_OperatorFolder, rdm_NicknameFolder,
rdm_SparseOrderFolder,
rdm_EquationFolder, rdm_UnsymmetricFactorFolder,
rdm_SuperElementMatrixFolder, rdm_LanczosFolder,
rdm_EigenFolder, rdm_LanczosOperatorFolder,
rdm_LanczosScratchFolder,
rdm_FolderNamesSize };
enum rdm_Access { rdm_none = 0x0, rdm_modify = 0x1,
rdm_read = 0x2, rdm_writeOnce = 0x4,
rdm_readWrite = rdm_read | rdm_writeOnce | rdm_modify,
rdm_write = rdm_writeOnce | rdm_modify
};
enum rdm_OpenMode { rdm_create, rdm_retrieve };
void operator delete(void*);
extern "C" {
extern void __assert_fail (__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
}
extern "C" {
extern void __assert_fail (__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
}
class ElementType;
class LayBulkStart;
class MatPointLayout;
class Pool;
class RebarRec;
class SectRec;
class SectIntVarBlock;
class SectIntLayout:public Layout
{
friend class Layout;
public:
SectIntLayout()
: Layout (),
nMatPoint (0),
nSmearRebar (0),
matPointLayoutOrdinalP (0),
smearRebarLayoutOrdinalP (0),
matPointLayout (0),
smearRebarLayout (0)
{
type = SectIntLayoutTypeKey;
}
~SectIntLayout();
virtual Layout* CreateUnique(Pool &);
void Define(const SectRec&, ElementDb&);
inline void
Define(const SectIntLayout&);
void DefineNOfRebar(ElementType* rebarEltype, int nSmearRebar);
void DefineSmearRebar(int i, const RebarRec&, ElementDb&);
void DefineSmearRebar(int i, const RebarLayout&);
void DefineSmearRebar(int i, const RebarRec&, const RebarLayout&, ElementDb&);
int NSmearRebar() const {return nSmearRebar;};
void SetSmearRebar( int rebarno, int rebarSLDB, double* aefr);
int NMatPoint() const {return nMatPoint;};
int AttributesEqual( const Layout&) const;
MatPointLayout* MatLayout(int klnum) const
{
((void) (( 0 <= klnum && klnum < nMatPoint ) ? 0 : (__assert_fail ("0 <= klnum && klnum < nMatPoint" , "/usr/abaqus60/5-adb/source/include/SectIntLayout.h", 70, __PRETTY_FUNCTION__ ), 0))) ;
return matPointLayout[klnum];
};
RebarLayout* SmrRebarLayout(int klnum) const
{
((void) (( 0 <= klnum && klnum < nSmearRebar ) ? 0 : (__assert_fail ("0 <= klnum && klnum < nSmearRebar" , "/usr/abaqus60/5-adb/source/include/SectIntLayout.h", 78, __PRETTY_FUNCTION__ ), 0))) ;
return smearRebarLayout[klnum];
};
void AddMatVariable( MatPointVarID m1, int );
void AddMatVariable( MatPointVarID m1 , MatPointVarID m2);
void AddMatVariableSelective( MatPointVarID m1, int, int );
void AddRebarMatVariable(int krebar , MatPointVarID m1 , int mult);
void AddRebarMatVariable(int krebar , MatPointVarID m1 , MatPointVarID m2);
void DeclareSecVar( SectIntVarID secVarID , int mult);
void SetVolSecVar (SectIntVarID secVarId, int vol);
void SetVolMatVar (MatPointVarID matVarId, int vol);
void RotateToGlobal(const int ndi, const int nshr);
void CopyInactiveFields (const unsigned * const puActiveFields) const;
virtual unsigned int MemSize () const;
void Print(FILE *dbg, int indentSize) const ;
void Print(FILE *dgg, int indentSize, const char* flags) const;
void Print( int indentSize, const char* flags) const;
protected:
inline
void AllocateSubLPointers();
private:
enum StorageOrderDerI {nMatPointLoc,
nSmearRebarLoc,
fixedDataEndLocI,
matPointLayoutOrdinalPXXX,
smearRebarLayoutOrdinalPXXX};
virtual void StorageHardenDer ();
virtual void StorageUnHardenDer (ElementDb*);
virtual IStrucDFIC StorageSizeDer () const;
virtual void StorageWriteDer (int * & loc) const;
virtual void StorageReadDer (const int * & loc);
void RotateLayoutVariables( const double* rotate,
const double* translate );
SectIntLayout (const SectIntLayout & rSLay)
: Layout ((Layout &) rSLay),
nMatPoint (rSLay.nMatPoint),
nSmearRebar (rSLay.nSmearRebar),
matPointLayoutOrdinalP (0),
smearRebarLayoutOrdinalP (0),
matPointLayout (0),
smearRebarLayout (0)
{}
SectIntLayout (const SectIntLayout & rSLay,
LayBulkStart * pLBS,
Element * pCurrel)
: Layout ((Layout &) rSLay, pLBS, pCurrel),
nMatPoint (rSLay.nMatPoint),
nSmearRebar (rSLay.nSmearRebar),
matPointLayoutOrdinalP (0),
smearRebarLayoutOrdinalP (0),
matPointLayout (0),
smearRebarLayout (0)
{}
int nMatPoint;
int nSmearRebar;
int* matPointLayoutOrdinalP;
int* smearRebarLayoutOrdinalP;
MatPointLayout** matPointLayout;
RebarLayout** smearRebarLayout;
};
enum FieldProblemType
{
FProb_StressDispl,
nFieldProblemType
};
extern const char* globalFieldProblemTypeName [ nFieldProblemType ];
enum VarBlockTypeKey
{VarBlockTypeKeyInvalid = -1,
ElementVarBlockTypeKey,
SectIntVarBlockTypeKey,
RebarVarBlockTypeKey,
MatPointVarBlockTypeKey,
DummyVarBlockTypeKey,
MasterMatVarBlockTypeKey,
nVarBlockTypeKey};
enum VarFGroup
{
VFGrp_dofVector,
VFGrp_mScalar,
VFGrp_quatern,
VFGrp_eNormals,
nVarFGroup
};
extern const char* globalVarFGroupName [ nVarFGroup ];
enum VarFormat
{
f_null,
fTens_11_22_33_12,
fTens_11_22_12_13,
fTens_11_22_33,
};
extern const char* getglobalVarFormatName(VarFormat);
extern int getglobalVarFormatSize(VarFormat);
class ElementType;
class Pool;
class VarsDef;
enum {VBTypeLoc,
VBProtectedLocBegin};
enum {VarBlockPositionInvalid = -1,
InvalidOrdinal = -1};
class VarBlock : public adb_MemoryManagement
{
public:
VarBlock (VarBlockTypeKey,
const VarsDef&);
VarBlock (const VarBlock& old);
virtual ~VarBlock();
virtual VarBlock* CreateUnique (Pool & rPool) = 0;
virtual int AttributesEqual (const VarBlock& other) const=0;
virtual void Print (int indentSize) const=0;
void DeclareFrom (const VarBlock& other);
void CopyFromMaster (const VarBlock & other);
int Equal (const VarBlock&) const;
void UnDeclare() ;
VarBlockTypeKey Type () const
{return type;};
int NVarID () const
{return nVarIDTotal;};
void SetOrdinal (int i)
{ordinal = i;};
int Ordinal () const
{return ordinal;};
int* Sizes () const
{return sizes;};
int Committed () const
{return Ordinal() >= 0;};
int VolOf (const int ivID) const
{return volIdTable[ivID];};
inline
void LocateVariable (const int ivID,
int& varPos,
int& vol) const
{
vol = VolOf (ivID);
varPos = vBlockPos[ivID];
}
void SetVolOfOneVar (const int ivID,
const int volNew);
void SetVolOfAllVars (const int volOld,
const int volNew);
int Multip(int var) const {return vMultip[var];}
inline
int SizeOfOne (const int ivID ) const;
inline
int SizeOfMult (const int ivID) const;
void PrintSizes (const char *indent) const;
void PrintSizesDsa (const char *indent) const;
inline
VarFGroup FGroupOf (const int ivID) const;
inline
VarFormat FormatOf (const int ivID) const;
const char* Name (const int ivID) const;
const char* Name (const VarFGroup& vFG) const
{return globalVarFGroupName[vFG];};
const char* Name (const VarFormat& vF) const
{return getglobalVarFormatName(vF);};
const ElementType* GetElementType() const
{return elementType;}
void StorageHarden ();
virtual IStrucDFIC StorageSize () const = 0;
virtual void StorageWrite (int * loc) const = 0;
virtual void StorageRead (const int * loc) = 0;
void StorageUnHarden (ElementType*);
virtual unsigned MemSize () const = 0;
int GetElementTypeOrdinalP ()
{
return elementTypeOrdinalP;
}
inline
FieldProblemType FieldType (const int vID) const;
private:
void Build ();
void DsaBuild (int*, int*, int*);
protected:
enum StorageOrder{elementTypeOrdinalPLoc=VBProtectedLocBegin,
fixedDataEndILoc,
vMultipLocXXX,
vBlockPosXXX,
sizesXXX,
volIdTableXXX};
void DeclareVar (const int ivID,
int mult);
void BuildGeneral();
unsigned MemSizeBase () const;
IStrucDFIC StorageSizeBase () const;
void StorageWriteBase (int * & loc) const;
void StorageReadBase (const int * & loc);
VarBlockTypeKey type;
ElementType* elementType;
int elementTypeOrdinalP;
const VarsDef& varsDef;
int ordinal;
int nVarIDTotal;
int* vMultip;
int* vBlockPos;
int* sizes;
int* volIdTable;
};
class Element;
class ElementType;
class ElementDb;
class LayBulkStart;
class MatPointLayout;
class VarID;
class MatPointLayout:public Layout
{
friend class Layout;
public:
MatPointLayout ()
: Layout (),
matTypeSLDB (0),
tensorBufferSize (0),
rotatedTensors (0),
oldTensorsPointers (0)
{
type = MatPointLayoutTypeKey;
};
~MatPointLayout ();
virtual Layout* CreateUnique (Pool&);
inline void
Define (ElementType*, int matTypeSLDB, ElementDb&);
inline void
Define (const MatPointLayout&);
inline int
MatTypeSLDB () const {return matTypeSLDB;} ;
void CopyInactiveFields (const unsigned * const puActiveFields) const
{
CopyRWZeroW (puActiveFields);
}
virtual unsigned int MemSize () const;
void Print (int indentSize, const char* flags) const;
int AttributesEqual (const Layout& ) const;
inline void
DeclareMatVar (const MatPointVarID & matVarID , int mult);
inline void
DeclareMatVar (const MatPointVarID & mvID1, const MatPointVarID & mvID2);
void FindOldTensorsOnDb ();
void RotOldTensorsInNewBuffer (const double*, const int*);
void RotNewTensorsInWriteIssue (const double*, const int, const int);
void SetVolOfMatVar(MatPointVarID matVarId, int vol);
void RotateToGlobal(const int ndi, const int nshr);
inline const double *
RetOldTensPointer (VarID& varID);
protected:
enum StorageOrderDer {matTypeSLDBLoc,
fixedDataEndILoc};
virtual void StorageHardenDer (){};
virtual void StorageUnHardenDer (ElementDb*){};
virtual IStrucDFIC StorageSizeDer () const;
virtual void StorageWriteDer (int * & loc) const;
virtual void StorageReadDer (const int * & loc);
private:
void RotateLayoutVariables( const double* rotate,
const double* translate );
MatPointLayout (const MatPointLayout & rMLay)
: Layout ((Layout &) rMLay),
matTypeSLDB (rMLay.matTypeSLDB),
tensorBufferSize (0),
rotatedTensors (0),
oldTensorsPointers (0)
{}
MatPointLayout (const MatPointLayout & rMLay,
LayBulkStart * pLBS,
Element * pCurrel)
: Layout ((Layout &) rMLay, pLBS, pCurrel),
matTypeSLDB (rMLay.matTypeSLDB),
tensorBufferSize (0),
rotatedTensors (0),
oldTensorsPointers (0)
{}
int matTypeSLDB;
int tensorBufferSize;
double* rotatedTensors;
const double** oldTensorsPointers;
};
extern "C" {
extern void __assert_fail (__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
}
template <class Class> class omi_SingletonBase {
static Class* instance;
protected:
omi_SingletonBase();
static Class* Instance() { return instance; }
public:
static void Finalize();
};
template <class Class>
class omi_Singleton : public omi_SingletonBase<Class> {
public:
static Class& Instance();
};
class adb_Debug;
class VolsDef;
class VarsDef;
class adb_Globals : public omi_Singleton<adb_Globals>
{
friend class omi_Singleton<adb_Globals>;
adb_Globals();
public:
~adb_Globals();
const VolsDef & GetGloElVols();
const VarsDef & GetGloElVars();
const VarsDef & GetGloSectVars();
const VarsDef & GetGloMatVars();
const VarsDef & GetGloDummyVars();
private:
void InitElVols ();
void InitElVars ();
void InitSectVars ();
void InitMatVars ();
void InitDummyVars ();
VolsDef * m_pGloElVols;
VarsDef * m_pGloElVars;
VarsDef * m_pGloSectVars;
VarsDef * m_pGloMatVars;
VarsDef * m_pGloDummyVars;
adb_Debug * m_pAdbDebug;
void InitDebug();
};
class TensorNum {private: TensorNum (){}; TensorNum (int i):vInt(i){};public: static TensorNum Make(int i){ return TensorNum (i);}; static TensorNum * CastPointer (int *j){ return ( TensorNum *) j;}; inline int Int() const { return vInt;};private: int vInt;} ;
class VarID {private: VarID (){}; VarID (int i):vInt(i){};public: static VarID Make(int i){ return VarID (i);}; static VarID * CastPointer (int *j){ return ( VarID *) j;}; inline int Int() const { return vInt;};private: int vInt;} ;
class MatPointVarBlock: public VarBlock
{
public:
MatPointVarBlock ()
: VarBlock (MatPointVarBlockTypeKey,
adb_Globals::Instance().GetGloMatVars()),
nActiveTensors(-1),
actTensNumToVId(0),
vIdToActTensNum(0) {};
~MatPointVarBlock ()
{
if (actTensNumToVId)
{
adb_MemoryManagement::operator delete( actTensNumToVId , nActiveTensors*sizeof(VarID) ) ;
adb_MemoryManagement::operator delete( vIdToActTensNum , NVarID()*sizeof(TensorNum) ) ;
nActiveTensors=-1;
}
};
virtual VarBlock* CreateUnique(Pool & rPool);
void Define (int masterSLDBx);
void Define (ElementType*, int masterSLDBx, ElementDb& );
int NActiveTensors() {
if (nActiveTensors == -1)
{
MakeListOfTensors();
}
return nActiveTensors;
}
VarID GetActiveTensorID(TensorNum ktens) {return actTensNumToVId[ktens.Int()];};
TensorNum GetActiveTensorNumber (VarID vID) {return vIdToActTensNum[vID.Int()];};
int MasterSLDB() const {return masterSLDB;};
int AttributesEqual(const VarBlock& other) const;
inline
void DeclareMatVar(const MatPointVarID, int);
inline
void DeclareMatVar(const MatPointVarID, const MatPointVarID);
void Print( int indentSize) const;
enum StorageOrderDer {masterSLDBLoc, nStorageOrderDer};
virtual IStrucDFIC StorageSize () const;
virtual void StorageWrite (int * loc) const;
virtual void StorageRead (const int * loc);
unsigned MemSize () const;
protected:
void MakeListOfTensors();
private:
int masterSLDB;
int nActiveTensors;
VarID* actTensNumToVId;
TensorNum* vIdToActTensNum;
};
inline void
MatPointVarBlock::Define (int masterSLDBx)
{
elementType=0;
masterSLDB=masterSLDBx;
}
inline void
MatPointVarBlock::DeclareMatVar (const MatPointVarID vID,
int mult)
{
VarBlock::DeclareVar (vID, mult);
}
inline void
MatPointVarBlock::DeclareMatVar (const MatPointVarID vID,
const MatPointVarID other)
{
VarBlock::DeclareVar(vID, Multip(other));
}
extern "C" {
extern void __assert_fail (__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
}
#pragma interface "new"
typedef int ptrdiff_t;
#pragma interface "exception"
extern "C++" {
namespace std {
class exception {
public:
exception () { }
virtual ~exception () { }
virtual const char* what () const;
};
class bad_exception : public exception {
public:
bad_exception () { }
virtual ~bad_exception () { }
};
typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
terminate_handler set_terminate (terminate_handler);
void terminate () __attribute__ ((__noreturn__));
unexpected_handler set_unexpected (unexpected_handler);
void unexpected () __attribute__ ((__noreturn__));
bool uncaught_exception ();
}
}
extern "C++" {
namespace std {
class bad_alloc : public exception {
public:
virtual const char* what() const throw() { return "bad_alloc"; }
};
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler (new_handler);
}
void *operator new (size_t) throw (std::bad_alloc);
void *operator new[] (size_t) throw (std::bad_alloc);
void operator delete[] (void *) throw();
void *operator new (size_t, const std::nothrow_t&) throw();
void *operator new[] (size_t, const std::nothrow_t&) throw();
void operator delete (void *, const std::nothrow_t&) throw();
void operator delete[] (void *, const std::nothrow_t&) throw();
inline void *operator new(size_t, void *place) throw() { return place; }
inline void *operator new[](size_t, void *place) throw() { return place; }
}
using std::new_handler;
using std::set_new_handler;
typedef double MRT;
class Pool
{
public:
enum PoolTypeKey {DummyPoolTypeKey,
FastPoolTypeKey,
ReusablePoolTypeKey};
inline static Pool& WhichHolds( void* address);
inline void* GetMem(unsigned);
inline void* GetMem(unsigned,unsigned);
inline void ReturnMem(void*,size_t);
size_t MemClaimed(){return memClaimed;}
PoolTypeKey Type(){return typeKey;}
static size_t AlignedSize(size_t size)
{
return sizeof(MRT)*((size+sizeof(MRT)-1)/sizeof(MRT));
}
~Pool()
{}
private:
Pool(const Pool&);
PoolTypeKey typeKey;
enum TestKey {testKeyValidValue=51385498};
enum TestKey testKey;
void SelfTest() { ((void) (( testKey == testKeyValidValue ) ? 0 : (__assert_fail ("testKey == testKeyValidValue" , "/usr/abaqus60/5-adb/source/include/Pool.h", 96, __PRETTY_FUNCTION__ ), 0))) ;}
protected:
enum BlockContents { addressOfThisNegLoc = 1, nObjectsNegLoc = 2 };
Pool (PoolTypeKey key)
: typeKey(key),
testKey(testKeyValidValue),
nActiveBlock(0),
memClaimed(0) {};
int nActiveBlock;
size_t memClaimed;
};
inline void
MatPointLayout::Define (ElementType * elementTypex,
int matTypeSLDBx,
ElementDb& eldb)
{
matTypeSLDB=matTypeSLDBx;
Pool& pool = Pool::WhichHolds(this);
varBlock = new (pool) MatPointVarBlock();
((MatPointVarBlock*)varBlock)->Define(elementTypex, matTypeSLDB, eldb);
}
inline void
MatPointLayout::Define (const MatPointLayout & ml)
{
matTypeSLDB=ml.matTypeSLDB;
varBlock = ml.varBlock;
}
inline void
MatPointLayout::DeclareMatVar (const MatPointVarID & matVarID,
int mult)
{
((MatPointVarBlock*) varBlock) -> DeclareMatVar (matVarID, mult);
}
inline void
MatPointLayout::DeclareMatVar (const MatPointVarID & mvID1,
const MatPointVarID & mvID2)
{
((MatPointVarBlock*) varBlock) -> DeclareMatVar (mvID1, mvID2);
}
inline const double *
MatPointLayout::RetOldTensPointer (VarID& varID)
{
TensorNum tID = ((MatPointVarBlock*) varBlock)
-> GetActiveTensorNumber (varID);
return oldTensorsPointers [tID.Int()];
};
typedef char *Character;
typedef int Length;
extern "C" {
void dbaloc_ (const unsigned&, const unsigned&, const unsigned&);
void dbml_ (const unsigned&, const unsigned&, const unsigned&, void*, void*,
unsigned&, unsigned&);
void dbsl_ (const unsigned&, void*, const unsigned&);
void dbnd_ (const unsigned&, void*, const unsigned&);
void dbre_ (const unsigned&, void*, unsigned&, unsigned&);
void dbsup_ (const unsigned&, const unsigned&, unsigned&, void*, unsigned&, unsigned&);
void eqc_int26b_ (void*, const double&, const double&, const double&);
void eqc_int26g_ (void*, void*, const unsigned&, const unsigned&);
void inth20_ (const double&, const double&, const double&, double*,
const unsigned&);
void eqc_intq83_ (const double&, const double&, const double&, double*);
void bcu_rotsig_ (const double*, const double*, double*, int&, const int&, const int&);
void transorr_ (double*, const int&, const int&, const double*);
void aprd_ (const double*, const double*, double*, const int&,
const int&, const int&);
void suptr3_ (const double*, int&, int&, double*, double*);
void acopy_ (const double*, double*, int&);
}
extern "C" {
extern void __assert_fail (__const char *__assertion,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum,
__const char *__file,
unsigned int __line,
__const char *__function) throw ()
__attribute__ ((__noreturn__));
}
void
SectIntLayout::AddMatVariable(MatPointVarID matVarID , MatPointVarID other )
{
for ( int i = 0 ; i < nMatPoint ; i++)
{
matPointLayout[i]->DeclareMatVar(matVarID , other);
}
}
void
SectIntLayout::AddMatVariableSelective(MatPointVarID matVarID , int mult, int kMatPt)
{
matPointLayout[kMatPt]->DeclareMatVar(matVarID , mult );
}