Package sfc :: Package common :: Module options
[hide private]
[frames] | no frames]

Source Code for Module sfc.common.options

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3  """ 
 4  This module contains default options for SFC.  
 5  """ 
 6   
 7  # Copyright (C) 2008-2009 Martin Sandve Alnes and Simula Resarch Laboratory 
 8  # 
 9  # This file is part of SyFi. 
10  # 
11  # SyFi is free software: you can redistribute it and/or modify 
12  # it under the terms of the GNU General Public License as published by 
13  # the Free Software Foundation, either version 2 of the License, or 
14  # (at your option) any later version. 
15  # 
16  # SyFi is distributed in the hope that it will be useful, 
17  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
18  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
19  # GNU General Public License for more details. 
20  # 
21  # You should have received a copy of the GNU General Public License 
22  # along with SyFi. If not, see <http://www.gnu.org/licenses/>. 
23  # 
24  # Modified by Kent-Andre Mardal, 2010. 
25  # 
26  # First added:  2008-08-13 
27  # Last changed: 2009-04-23 
28   
29  from sfc.common.ParameterDict import ParameterDict 
30   
31   
32 -def default_parameters():
33 """Construct a ParameterDict with default options for SFC, 34 which can then be modified and passed to jit. 35 36 Some options may need explanation: 37 38 options.integration.representation: 39 "disable" | Generate empty tabulate_tensor functions, for debugging. 40 "symbolic" | Integrate each element tensor entry symbolically. 41 "truncated_symbolic" | Integrate symbolically after truncating the Taylor series. 42 "symbolic_quadrature" | Integrate by quadrature using symbolic expressions. 43 "quadrature" | (DEFAULT) Generate (partially) inlined quadrature rule. 44 "safe_quadrature" | Generate slow but safe quadrature code. 45 """ 46 47 ### General output options: 48 output = ParameterDict(enable_timing = False, 49 verbosity = 0, # TODO: Use logging system, verbosity = logging.WARNING 50 enable_debug_prints = False, 51 store_log = False) 52 53 ### General code generation options: 54 55 # General form options: 56 form = ParameterDict(name = None) 57 58 # Integration options: 59 integral = ParameterDict(integration_method = "quadrature", # "symbolic", 60 integration_order = None, 61 enable_debug_code = False, 62 safemode = False, 63 use_expand_indices2 = False) 64 65 # Dof map code generation: 66 dof_map = ParameterDict(enable_dof_ptv = False) 67 68 # Finite element code generation: 69 finite_element = ParameterDict(enable_evaluate_basis = True, 70 enable_evaluate_basis_derivatives = True, 71 default_order_of_element = 2, 72 evaluate_basis_derivatives_order = 1, # highest order generated 73 optimize_basis = False, 74 enable_horner = False) # TODO: use horners rule in evaluate_basis* 75 76 code = ParameterDict(form = form, 77 integral = integral, 78 dof_map = dof_map, 79 finite_element = finite_element, 80 prefix = "", 81 dolfin_wrappers = False) 82 83 ### General compilation options: 84 compilation = ParameterDict(enable_debug_code = False, 85 cache_dir = None, # Override cache directory 86 overwrite_cache = False, # Force recompilation independent of cache status 87 cppargs = ["-O2"], 88 skip = False, # To bypass C++ compilation phase (intended for testing and profiling) 89 generate_interface = True, # To bypass generation of swig interface 90 generate_setup = True) # To bypass generation of setup.py file 91 92 ### All options collected: 93 options = ParameterDict(output = output, 94 code = code, 95 compilation = compilation) 96 return options
97