Next: OOMMF eXtensible Solver
Up: OOMMF Documentation
Previous: Platform-Independent Make
OOMMF Variable Types and Macros
The following typedefs are defined in the
oommf/pkg/oc/platform/ocport.h header file; this file is
created by the pimake build process (see
oommf/pkg/oc/procs.tcl), and contains platform and machine
specific information.
The oommf/pkg/oc/platform/ocport.h header file also
defines the following macros for use with the floating point variable
types:
- OC_REAL8m_IS_DOUBLE True if OC_REAL8m type
corresponds to the C++ ``double'' type.
- OC_REAL8m_IS_REAL8 True if OC_REAL8m and
OC_REAL8 refer to the same type.
- OC_REAL4_EPSILON The smallest value that can be added to
a OC_REAL4 value of ``1.0'' and yield a value different from
``1.0''. For IEEE 754 compatible floating point, this should be
1.1920929e-007.
- OC_SQRT_REAL4_EPSILON
Square root of the preceding.
- OC_REAL8_EPSILON The smallest value that can be added to
a OC_REAL8 value of ``1.0'' and yield a value different from
``1.0''. For IEEE 754 compatible floating point, this should be
2.2204460492503131e-016.
- OC_SQRT_REAL8_EPSILON, OC_CUBE_ROOT_REAL8_EPSILON
Square and cube roots of the preceding.
- OC_FP_REGISTER_EXTRA_PRECISION True if
intermediate floating point operations use a wider precision than
the floating point variable type; notably, this occurs with some
compilers on x86 hardware.
Note that all of the above macros have a leading ``OC_''
prefix. The prefix is intended to protect against possible name
collisions with system header files. Versions of some of these macros
are also defined without the prefix; these definitions represent
backward support for existing OOMMF extensions. All new code
should use the versions with the ``OC_'' prefix, and old code
should be updated where possible. The complete list of deprecated
macros is:
BOOL, UINT2m, INT4m, UINT4m,
REAL4, REAL4m, REAL8, REAL8m, REALWIDE,
REAL4_EPSILON, REAL8_EPSILON,
SQRT_REAL8_EPSILON, CUBE_ROOT_REAL8_EPSILON,
FP_REGISTER_EXTRA_PRECISION
Macros for system identification:
- OC_SYSTEM_TYPE One of OC_UNIX or
OC_WINDOWS.
- OC_SYSTEM_SUBTYPE For unix systems, this is
either OC_VANILLA (general unix) or OC_DARWIN
(Mac OS X). For Windows systems, this is generally
OC_WINNT, unless one is running out of a Cygwin shell,
in which case the value is OC_CYGWIN.
Additional macros and typedefs:
- OC_POINTERWIDTH Width of pointer type, in bytes.
- OC_INDEX Typedef for signed array index type;
typically the width of this (integer) type matches the width of the
pointer type, but is in any event at least four bytes wide and not
narrower than the pointer type.
- OC_UINDEX Typedef for unsigned version of
OC_INDEX. It is intended for special-purpose use only. In general,
use OC_INDEX where possible.
- OC_INDEX_WIDTH Width of OC_INDEX type.
- OC_BYTEORDER Either ``4321'' for little endian machines,
or ``1234'' for big endian.
- OC_THROW(x) Throws a C++ exception with
value ``x''.
- OOMMF_THREADS True threaded (multi-processing) builds.
- OC_USE_NUMA If true, then NUMA (non-uniform memory
access) libraries are available.
OOMMF Documentation Team
September 28, 2018