TemperatureIntegration.py 1.23 KB
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
8
class TemperatureIntegration:
    def __init__(self):
9
10
11
12
13
14
15
16
        self.context = {
            'interface': [
                create_access("temperature", "walberla::real_t", access="gs"),
                create_access("heatFlux", "walberla::real_t", access="gs"),
                create_access("invMass", "walberla::real_t", access="g"),
                create_access("type", "uint_t", access="g")
            ]
        }
17

Sebastian Eibl's avatar
Sebastian Eibl committed
18
    def generate(self, module):
19
20
21
22
23
        ctx = {
            'module': module,
            **self.context,
            "parameters": ["invSpecificHeat"]
        }
Sebastian Eibl's avatar
Sebastian Eibl committed
24
        generate_file(module['module_path'], 'kernel/TemperatureIntegration.templ.h', ctx)
25

Sebastian Eibl's avatar
Sebastian Eibl committed
26
27
28
        ctx["InterfaceTestName"] = "TemperatureIntegrationInterfaceCheck"
        ctx["KernelInclude"] = "kernel/TemperatureIntegration.h"
        ctx[
29
30
            "ExplicitInstantiation"] = \
            "template void kernel::TemperatureIntegration::operator()(const size_t p_idx1, Accessor& ac) const;"
Sebastian Eibl's avatar
Sebastian Eibl committed
31
32
        generate_file(module['test_path'], 'tests/CheckInterface.templ.cpp', ctx,
                      'kernel/interfaces/TemperatureIntegrationInterfaceCheck.cpp')