-
Notifications
You must be signed in to change notification settings - Fork 53
Writing C interface code
Since t8code is primarily a C++ library a proper C interface is necessary. The current status is a mix of C and C++ code.
For the future, when t8code will have been settled on a matured C++ API, the goal is to provide a C interface via automatic code generation.
Till then, we write C interfaces/wrappers by hand.
C interface code is written side by side with t8code's C++ sources. The C interface/wrapper functions are simply added at the bottom of the C++ source files. The following mockup gives an example how this looks like.
// file: t8code/src/t8_module/t8_some_functionality.cxx
int SomeClass::member_function {...args...} {
};
// At the bottom of the CXX source file we find the related
// C interface function wrapped in `T8_EXTERN_C_{BEGIN,END} ();` blocks.
T8_EXTERN_C_BEGIN ();
int t8_SomeClass_member_function(SomeClass_t *obj, ...arguments...) {
return obj->member_function(...args...);
}
T8_EXTERN_C_END ();
Alongside the C++ file an accompanying C header file makes the interface/wrapper available to any C application.
// file: t8code/src/t8_module/t8_some_class.h
/**
* Doxygen documentation.
*/
int
t8_SomeClass_member_function(SomeClass_t *obj, ...arguments...);
Installation Guide
Configure Options
Setup t8code on JUWELS and other Slurm based systems
Setup t8code for VTK
General
Step 0 Hello World
Step 1 Creating a coarse mesh
Step 2 Creating a uniform forest
Step 3 Adapting a forest
Step 4 Partition,-Balance,-Ghost
Step 5 Store element data
Step 6 Computing stencils
Step 7 Interpolation
Features
Documentation
Tree Indexing
Element Indexing
Running on JUWELS using Slurm
Overview of the most used API functions
Known issues
Workflow - FreeCAD to t8code
Reproducing Scaling Resluts
Coding Guidelines
Tips
Debugging with gdb
Debugging with valgrind
Test driven development
Testing with GoogleTest
Writing C interface code