DetectAndStoreContacts.py 815 Bytes
Newer Older
1
2
# -*- coding: utf-8 -*-

Sebastian Eibl's avatar
Sebastian Eibl committed
3
4
from mesa_pd.accessor import create_access
from mesa_pd.utility import generate_file
5
6


Sebastian Eibl's avatar
Sebastian Eibl committed
7
class DetectAndStoreContacts:
8

Sebastian Eibl's avatar
Sebastian Eibl committed
9
    def __init__(self):
10
11
12
13
14
15
16
17
18
        self.context = {
            'interface': [
                create_access("uid", "walberla::id_t", access="g"),
                create_access("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g"),
                create_access("position", "walberla::mesa_pd::Vec3", access="g"),
                create_access("rotation", "walberla::mesa_pd::Rot3", access="g"),
                create_access("shape", "BaseShape*", access="g")
            ]
        }
19

Sebastian Eibl's avatar
Sebastian Eibl committed
20
21
22
    def generate(self, module):
        ctx = {'module': module, **self.context}
        generate_file(module['module_path'], 'kernel/DetectAndStoreContacts.templ.h', ctx)