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 ### General output options: 37 output = ParameterDict(enable_timing = False, 38 # TODO: Use logging system, verbosity = logging.WARNING: 39 verbosity = 0, 40 enable_debug_prints = False, 41 store_log = False) 42 43 ### General code generation options: 44 45 # General form options: 46 form = ParameterDict(name = None) 47 48 # Dof map code generation: 49 dof_map = ParameterDict(enable_dof_ptv = False) 50 51 # Uflacs integration options: 52 uflacs = ParameterDict(register_threshold = 2, 53 max_registers = 512) 54 55 # Integration options: 56 integral = ParameterDict(integration_method = "quadrature", # "symbolic", 57 integration_order = None, 58 enable_debug_code = False, 59 safemode = False, 60 use_expand_indices2 = False, 61 use_uflacs = False, 62 uflacs = uflacs, 63 ) 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 # highest order generated: 73 evaluate_basis_derivatives_order = 1, 74 optimize_basis = False, 75 # TODO: use horners rule in evaluate_basis*: 76 enable_horner = False) 77 78 code = ParameterDict(form = form, 79 integral = integral, 80 dof_map = dof_map, 81 finite_element = finite_element, 82 prefix = "", 83 dolfin_wrappers = False) 84 85 ### General compilation options: 86 compilation = ParameterDict(enable_debug_code = False, 87 # Override cache directory: 88 cache_dir = None, 89 # Force recompilation independent of cache status: 90 overwrite_cache = False, 91 cppargs = ["-O2"], 92 # To bypass C++ compilation phase 93 # (intended for testing and profiling): 94 skip = False, 95 # To bypass generation of swig interface: 96 generate_interface = True, 97 # To bypass generation of setup.py file: 98 generate_setup = True) 99 100 ### All options collected: 101 options = ParameterDict(output = output, 102 code = code, 103 compilation = compilation) 104 return options
105