diff --git a/python/dune/codegen/options.py b/python/dune/codegen/options.py index 49eec12b9140fe40d31f5737fcf73aa3c209cde3..dc32d30e50b87f72724d6b786e0864f870b8714f 100644 --- a/python/dune/codegen/options.py +++ b/python/dune/codegen/options.py @@ -278,13 +278,13 @@ def process_form_options(opt, form): if opt.numerical_jacobian: opt = opt.copy(generate_jacobians=False, generate_jacobian_apply=False) - if opt.form == '': + if opt.form is None: opt = opt.copy(form=form) - if opt.classname == '': + if opt.classname is None: opt = opt.copy(classname="{}Operator".format(form)) - if opt.filename == '': + if opt.filename is None: opt = opt.copy(filename="{}_{}_file.hh".format(get_option("target_name"), opt.classname)) if opt.block_preconditioner_diagonal or opt.block_preconditioner_offdiagonal: diff --git a/python/dune/codegen/options_form.yaml b/python/dune/codegen/options_form.yaml index 511e3e56497ef111f7196632377ad243db977077..d8c3836972fb8f1e2e2e6973f82b31dd9fefbd97 100644 --- a/python/dune/codegen/options_form.yaml +++ b/python/dune/codegen/options_form.yaml @@ -24,7 +24,8 @@ blockstructured: helpstr: "Use block structure" classname: type: string - default: "" + default: + nullable: True helpstr: "The name of the C++ class to generate" constant_transformation_matrix: type: boolean @@ -36,7 +37,8 @@ control: helpstr: "Generate operator of derivative w.r.t. the control variable" control_variable: type: string - default: "" + default: + nullable: True helpstr: "Name of control variable in UFL file" diagonal_transformation_matrix: type: boolean @@ -60,11 +62,13 @@ fastdg: helpstr: "Use FastDGGridOperator from PDELab." filename: type: string - default: "" + default: + nullable: True helpstr: "The filename to use for this LocalOperator" form: type: string - default: "" + default: + nullable: True helpstr: "The name of the UFL object representing the form in the UFL file" generate_jacobian_apply: type: boolean @@ -96,7 +100,8 @@ numerical_jacobian: helpstr: "use numerical jacobians (only makes sense, if uflpdelab for some reason fails to generate analytic jacobians)" objective_function: type: string - default: "" + default: + nullable: True helpstr: "Name of form representing the objective function in UFL file" print_transformations: type: boolean @@ -112,7 +117,8 @@ quadrature_mixins: helpstr: "A comma separated list of mixin identifiers to use for quadrature. Currently implemented: generic, sumfact" quadrature_order: type: string - default: "" + default: + nullable: True helpstr: "Quadrature order used for all integrals." simplify: type: boolean @@ -164,7 +170,8 @@ vectorization_blockstructured_tail_ordering: helpstr: "Ordering of the tail w.r.t the vectorized loop. Possible values: consecutive|blocked" vectorization_horizontal: type: string - default: "" + default: + nullable: True helpstr: "an explicit value for horizontal vectorization read by the 'explicit' strategy" vectorization_jacobians: type: boolean @@ -172,7 +179,8 @@ vectorization_jacobians: helpstr: "Whether to attempt to vectorize jacobians (takes time, often not needed)" vectorization_list_index: type: string - default: "" + default: + nullable: True helpstr: "Which vectorization to pick from a list (only valid with vectorization_strategy=fromlist)." vectorization_not_fully_vectorized_error: type: boolean @@ -180,7 +188,8 @@ vectorization_not_fully_vectorized_error: helpstr: "throw an error if nonquadloop vectorization did not fully vectorize" vectorization_padding: type: string - default: "" + default: + nullable: True helpstr: "an explicit value for the allowed padding in vectorization" vectorization_quadloop: type: boolean @@ -192,9 +201,11 @@ vectorization_strategy: helpstr: "The identifier of the vectorization cost model. Possible values: none|explicit|model|target|autotune" vectorization_target: type: float - default: -1 + default: + nullable: True helpstr: "The cost function target for the 'target' cost model. Only needed to verify the cost model itself, do not use light-heartedly!!!" vectorization_vertical: type: string - default: "" + default: + nullable: True helpstr: "an explicit value for vertical vectorization read by the 'explicit' strategy" \ No newline at end of file diff --git a/python/dune/codegen/options_global.yaml b/python/dune/codegen/options_global.yaml index 8e36f1dd9ac7c36707266d65cc98833ccbc4ffe5..6af896e7a444cf4bd07ec90017311c36456243d6 100644 --- a/python/dune/codegen/options_global.yaml +++ b/python/dune/codegen/options_global.yaml @@ -8,7 +8,8 @@ autotune_google_benchmark: helpstr: "Use google-benchmark library for autotuning (when autotuning is activated)." compare_l2errorsquared: type: string - default: "" + default: + nullable: True helpstr: "maximal allowed l2 error squared of difference between numerical solution and interpolation of exact solution (NOTE: requires --exact-solution-expression)" debug_cache_with_stack: type: boolean @@ -20,11 +21,13 @@ debug_interpolate_input: helpstr: "Should the input for printresidual and printmatix be interpolated (instead of random input)." driver_file: type: string - default: "" + default: + nullable: True helpstr: "The filename for the generated driver header" exact_solution_expression: type: string - default: "" + default: + nullable: True helpstr: "name of the exact solution expression in the ufl file" explicit_time_stepping: type: boolean @@ -32,7 +35,8 @@ explicit_time_stepping: helpstr: "use explicit time stepping" grid_info: type: string - default: None + default: + nullable: True helpstr: "Path to file with information about facedir and facemod variations. This can be used to limit the generation of skeleton kernels." grid_unstructured: type: boolean @@ -40,7 +44,8 @@ grid_unstructured: helpstr: "Set to true if you want to use an unstructured grid." ini_file: type: string - default: "" + default: + nullable: True helpstr: "An inifile to use. A generated driver will be hard-coded to it, a [formcompiler] section will be used as default values to form compiler arguments (use snake case)" instrumentation_level: type: integer @@ -48,7 +53,8 @@ instrumentation_level: helpstr: "Control time/opcounter measurements. 0-do nothing, 1-measure program as a whole, 2-operator applications, 3-measure kernel (eg. alpha-volume, ...), 4-parts of kernel (eg. stage 1-3 of SF)" l2error_tree_path: type: string - default: None + default: + nullable: True helpstr: "Tree pathes that should be considered for l2 error calculation. Default None means we take all of them into account." opcounter: type: boolean @@ -56,7 +62,8 @@ opcounter: helpstr: "Count operations. Note: In this case only operator applications are generated since solving and operator counting does not work. You probably want to set instrumentation level>0." operator_to_build: type: string - default: None + default: + nullable: True helpstr: "The operators from the list that is about to be build now. CMake sets this one!!!" operators: type: string @@ -76,15 +83,18 @@ precision_bits: helpstr: "The number of bits for the floating point type" project_basedir: type: string - default: "" + default: + nullable: True helpstr: "The base (build) directory of the dune-codegen project" target_name: type: string - default: None + default: + nullable: True helpstr: "The target name from CMake" uflfile: type: string - default: "" + default: + nullable: True helpstr: "the UFL file to compile" use_likwid: type: boolean