Package sfc :: Package codegeneration :: Module integralcgbase
[hide private]
[frames] | no frames]

Source Code for Module sfc.codegeneration.integralcgbase

 1  # -*- coding: utf-8 -*- 
 2  """ 
 3  This module contains shared code generation tools for the ufc::*_integral classes. 
 4  """ 
 5   
 6  # Copyright (C) 2008-2012 Martin Sandve Alnes and Simula Resarch Laboratory 
 7  # 
 8  # This file is part of SyFi. 
 9  # 
10  # SyFi is free software: you can redistribute it and/or modify 
11  # it under the terms of the GNU General Public License as published by 
12  # the Free Software Foundation, either version 2 of the License, or 
13  # (at your option) any later version. 
14  # 
15  # SyFi is distributed in the hope that it will be useful, 
16  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
18  # GNU General Public License for more details. 
19  # 
20  # You should have received a copy of the GNU General Public License 
21  # along with SyFi. If not, see <http://www.gnu.org/licenses/>. 
22  # 
23  # First added:  2008-08-13 
24  # Last changed: 2012-05-25 
25   
26  from sfc.common.output import sfc_debug, sfc_error, sfc_assert, sfc_warning 
27   
28  from sfc.codegeneration.codeformatting import indent 
29   
30 -class IntegralCGBase(object):
31 - def __init__(self, itgrep):
32 self.itgrep = itgrep 33 self.options = self.itgrep.formrep.options.code.integral
34
35 - def hincludes(self):
36 l = [] 37 return l
38
39 - def cincludes(self):
40 l = [] 41 return l
42
43 - def local_includes(self):
44 l = [] 45 return l
46
47 - def generate_code_dict(self):
48 # Calling these first so we can use the analysis results in other functions 49 tabulate_tensor = indent(self.gen_tabulate_tensor()) 50 tabulate_tensor_quadrature = indent(self.gen_tabulate_tensor_quadrature()) 51 vars = { 52 "classname" : self.itgrep.classname, 53 "constructor" : indent(self.gen_constructor()), 54 "constructor_arguments" : indent(self.gen_constructor_arguments()), 55 "initializer_list" : indent(self.gen_initializer_list()), 56 "destructor" : indent(self.gen_destructor()), 57 "members" : indent(self.gen_members()), 58 "tabulate_tensor" : tabulate_tensor, 59 "tabulate_tensor_quadrature" : tabulate_tensor_quadrature, 60 } 61 return vars
62
63 - def generate_support_code(self):
64 return ""
65
66 - def gen_constructor(self):
67 return ""
68
70 return ""
71
72 - def gen_initializer_list(self):
73 return ""
74
75 - def gen_destructor(self):
76 return ""
77
78 - def gen_members(self):
79 return ""
80
81 - def gen_tabulate_tensor(self):
82 return 'throw std::runtime_error("Not implemented.");'
83
85 return 'throw std::runtime_error("Not implemented.");'
86