diff --git a/psydac/api/discretization.py b/psydac/api/discretization.py index 0519fc17f..b7080b9cb 100644 --- a/psydac/api/discretization.py +++ b/psydac/api/discretization.py @@ -536,7 +536,17 @@ def discretize(a, *args, **kwargs): assert isinstance(domain_h, Geometry) domain = domain_h.domain dim = domain.dim - if ((isinstance(a, sym_BilinearForm)) and (dim == 3)): + + backend = kwargs.get('backend')# or None + #print(f'backend: {backend}') + assembly_backend = kwargs.get('assembly_backend')# or None + #print(f'assembly_backend: {assembly_backend}') + assembly_backend = backend or assembly_backend + #print(f'assembly_backend: {assembly_backend}') + openmp = False if assembly_backend is None else assembly_backend.get('openmp') + #print(f'openmp: {openmp}') + + if (((isinstance(a, sym_BilinearForm)) and (dim == 3))) and not openmp: kwargs['new_assembly'] = True mapping = domain_h.domain.mapping kwargs['symbolic_mapping'] = mapping diff --git a/psydac/api/fem.py b/psydac/api/fem.py index 97168556f..a2cacf036 100644 --- a/psydac/api/fem.py +++ b/psydac/api/fem.py @@ -963,6 +963,9 @@ def make_file(self, temps, ordered_stmts, *args, mapping_option=None): assembly_code += '\n return\n' #------------------------- MAKE FILE ------------------------- + import os + if not os.path.isdir('__psydac__'): + os.makedirs('__psydac__') filename = '__psydac__/assemble.py' f = open(filename, 'w') f.writelines(assembly_code) @@ -1323,6 +1326,7 @@ def construct_arguments_generate_assembly_file(self): threads_args = tuple(np.int64(a) if isinstance(a, int) else a for a in threads_args) self.make_file(temps, ordered_stmts, test_v_p, trial_u_p, keys_1, keys_2, keys_3, mapping_option=mapping_option) + #from __test__.__psydac__.assemble import assemble_matrix from __psydac__.assemble import assemble_matrix from pyccel.epyccel import epyccel new_func = epyccel(assemble_matrix, language='fortran')