Structure#
The CDB contains an entire data set in single computer file. The lookups are performed using the following algorithm:
If the slot is empty, the record does not exist. Abort the search.
If the slot’s matches the key’s hash, seek to the record. Read and compare.
The record is not in this slot. Proceed to next slot, wrapping around to the beginning of the hash table if necessary.
Like already mentioned the data is stored in data structures. These structures are different
and depend on the current key. The file ‘’CDBase Help’’ explains
how the structure looks like and which information is stored in.
For example the following entry is for the basic node data:
@Rec: 020/00 NODE
@0= NR [int] node-number
@1# INR [int] internal node-number
@2# KFIX [int] degree of freedoms
@3# NCOD [int] additional bit code
@1: XYZ 3[1001] X-Y-Z-ordinates
The data structures equate so called Types in VBA, C#, Python, Fortran, C++ and VB.NET.
Type CNODE
m_NR As Long 'node number
m_INR As Long 'internal node-number
m_KFIX As Long 'degree of freedoms
m_NCOD As Long 'additional bit code
m_XYZ(1 To 3) As Single '(1 to 1001) X-Y-Z-ordinates
End Type
public unsafe struct cs_node // 20/00 Nodes
{
public int m_nr; // node-number
public int m_inr; // internal node-number
public int m_kfix; // degree of freedoms
public int m_ncod; // additional bit code
public fixed float m_xyz[3]; // [1001] X-Y-Z-ordinates
}
type cnode ! 20/00 Nodes
sequence
integer nr ! node-number
integer inr ! internal node-number
integer kfix ! degree of freedoms
integer ncod ! additional bit code
real*4 xyz(3) ! [1001] X-Y-Z-ordinates
end type cnode
class NODE(Structure):
_fields_ = [ # 20/00 Nodes
('m_NR', c_int), # node-number
("m_INR", c_int), # internal node-number
("m_KFIX", c_int), # degree of freedoms
("m_NCOD", c_int), # additional bit code
("m_XYZ", c_float * 3) # [1001] X-Y-Z-ordinates
]
#define NODE_VER 200501
typedef struct tagCDB_NODE { /* 20/00 Nodes */
int m_nr; /* node-number */
int m_inr; /* internal node-number */
int m_kfix; /* degree of freedoms */
int m_ncod; /* additional bit code */
float m_xyz[3]; /* [1001] X-Y-Z-ordinates */
} typeCDB_NODE;
Structure CNODE ' 20/00 Nodes
Dim m_NR as Integer ' node-number
Dim m_INR as Integer ' internal node-number
Dim m_KFIX as Integer ' degree of freedoms
Dim m_NCOD as Integer ' additional bit code
<MarshalAs(UnmanagedType.ByValArray , SizeConst:=3)> Dim m_XYZ() as Single ' [1001] X-Y-Z-ordinates
END Structure
The data type for each value is explicit defined. Also the sequence in which the data is stored in the CDB is fixed. The following files includes an overview of all types and can be found in the corresponding folder:
C:\<sofistik_installation>\2024\SOFiSTiK 2024\interfaces\examples\
VBA
sofistik_daten.bas
VB.NET
sofistik_daten.vb
C#
sofistik_daten.cs
C++
*.h
Fortran
*.for, *.mod
Python
sofistik_daten.py
Hint
The data-types are generated automatically by SOFiSTiK (per Service-Pack). If you are using another programming language, then you can modify and adapt the data-types to the programming language that you are using.