Even though I use the approach similar to the mixed formulation in the online tutorial (Mixed formulation for the Poisson equation): BDM = VectorFunctionSpace(mesh, "BDM", 1) DGv = VectorFunctionSpace(mesh, "DG", 0) DGs = FunctionSpace(mesh, "DG", 0) Vh = BDM * DGv * DGs I have the same error as before: Traceback (most recent call last): File "/home/simone/firedrake/src/PyOP2/pyop2/caching.py", line 197, in __new__ return cls._cache_lookup(key) File "/home/simone/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 53, in _cache_lookup return cls._cache.get(key) or cls._read_from_disk(key, comm) File "/home/simone/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 74, in _read_from_disk raise KeyError("Object with key %s not found" % key) KeyError: 'Object with key aec71f5f7a30a3d0b4db90beac07de85 not found' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "Elasticity2D_Firedrake.py", line 163, in <module> solve(lhs_varf == rhs_varf, sol, bcs=[bc1,bc2]) File "/home/simone/firedrake/src/firedrake/firedrake/solving.py", line 125, in solve _solve_varproblem(*args, **kwargs) File "/home/simone/firedrake/src/firedrake/firedrake/solving.py", line 152, in _solve_varproblem appctx=appctx) File "/home/simone/firedrake/src/firedrake/firedrake/variational_solver.py", line 335, in __init__ super(LinearVariationalSolver, self).__init__(*args, **kwargs) File "/home/simone/firedrake/src/firedrake/firedrake/variational_solver.py", line 182, in __init__ options_prefix=self.options_prefix) File "/home/simone/firedrake/src/firedrake/firedrake/solving_utils.py", line 131, in __init__ form_compiler_parameters=self.fcp) File "/home/simone/firedrake/src/firedrake/firedrake/assemble.py", line 158, in create_assembly_callable loops = tuple(loops) File "/home/simone/firedrake/src/firedrake/firedrake/assemble.py", line 228, in _assemble kernels = tsfc_interface.compile_form(f, "form", parameters=form_compiler_parameters, inverse=inverse) File "/home/simone/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 212, in compile_form number_map, interface, coffee).kernels File "/home/simone/firedrake/src/PyOP2/pyop2/caching.py", line 199, in __new__ obj = make_obj() File "/home/simone/firedrake/src/PyOP2/pyop2/caching.py", line 189, in make_obj obj.__init__(*args, **kwargs) File "/home/simone/firedrake/src/firedrake/firedrake/tsfc_interface.py", line 121, in __init__ tree = tsfc_compile_form(form, prefix=name, parameters=parameters, interface=interface, coffee=coffee) File "/home/simone/firedrake/src/tsfc/tsfc/driver.py", line 57, in compile_form fd = ufl_utils.compute_form_data(form, complex_mode=complex_mode) File "/home/simone/firedrake/src/tsfc/tsfc/ufl_utils.py", line 59, in compute_form_data complex_mode=complex_mode File "/home/simone/firedrake/src/ufl/ufl/algorithms/compute_form_data.py", line 298, in compute_form_data form = apply_function_pullbacks(form) File "/home/simone/firedrake/src/ufl/ufl/algorithms/apply_function_pullbacks.py", line 267, in apply_function_pullbacks return map_integrand_dags(FunctionPullbackApplier(), expr) File "/home/simone/firedrake/src/ufl/ufl/algorithms/map_integrands.py", line 58, in map_integrand_dags form, only_integral_type) File "/home/simone/firedrake/src/ufl/ufl/algorithms/map_integrands.py", line 39, in map_integrands for itg in form.integrals()] File "/home/simone/firedrake/src/ufl/ufl/algorithms/map_integrands.py", line 39, in <listcomp> for itg in form.integrals()] File "/home/simone/firedrake/src/ufl/ufl/algorithms/map_integrands.py", line 46, in map_integrands return itg.reconstruct(function(itg.integrand())) File "/home/simone/firedrake/src/ufl/ufl/algorithms/map_integrands.py", line 57, in <lambda> return map_integrands(lambda expr: map_expr_dag(function, expr, compress), File "/home/simone/firedrake/src/ufl/ufl/corealg/map_dag.py", line 37, in map_expr_dag result, = map_expr_dags(function, [expression], compress=compress) File "/home/simone/firedrake/src/ufl/ufl/corealg/map_dag.py", line 84, in map_expr_dags r = handlers[v._ufl_typecode_](v) File "/home/simone/firedrake/src/ufl/ufl/corealg/multifunction.py", line 42, in _memoized_handler r = handler(self, o) File "/home/simone/firedrake/src/ufl/ufl/algorithms/apply_function_pullbacks.py", line 256, in form_argument return apply_single_function_pullbacks(o) File "/home/simone/firedrake/src/ufl/ufl/algorithms/apply_function_pullbacks.py", line 151, in apply_single_function_pullbacks assert len(gsh) == 1 AssertionError Thank you so much, have a wonderful day. Best regards, Simone On Tue, Jun 25, 2019 at 8:03 AM Simone Puel <spuel@utexas.edu> wrote:
Dear Lawrence and Matt,
Thank you so much for your emails. I am not sure I understood correctly. In my case BDM is used for the stress (tensor), DGv for displacement (vector) and DGs for rotation (vector). If I write something like this:
BDM = TensorFunctionSpace(mesh, "BDM", 1) DGv = VectorFunctionSpace(mesh, "DG", 0) DGs = VectorFunctionSpace(mesh, "DG", 0)
# Mixed function spaces Vh_element = MixedElement([TensorElement(BDM), VectorElement(DGv), VectorElement(DGs)]) Vh = FunctionSpace(mesh, Vh_element)
I have the following error:
Traceback (most recent call last): File "Elasticity2D_Firedrake.py", line 116, in <module> BDM = TensorFunctionSpace(mesh, "BDM", 1) File "/home/simone/firedrake/src/firedrake/firedrake/functionspace.py", line 213, in TensorFunctionSpace assert sub_element.value_shape() == () AssertionError
Thank you so much, probably I am a little bit confused how to use these terms. Thanks in advance, have a wonderful day.
Best regards, Simone
On Tue, Jun 25, 2019 at 6:33 AM Matthew Knepley <knepley@gmail.com> wrote:
On Tue, Jun 25, 2019 at 7:22 AM Lawrence Mitchell <wence@gmx.li> wrote:
On 25 Jun 2019, at 11:49, Matthew Knepley <knepley@gmail.com> wrote:
On Tue, Jun 25, 2019 at 6:44 AM Ham, David A <david.ham@imperial.ac.uk> wrote: I *think* that the concept is that the physical cell is mapped to the reference cell, so you are pulling back reference values through that mapping to get physical values.
Ah. I named them the opposite way :) This is a good window into how my mind works. I thought since the Jacobian maps reference to real (and phi for that matter) that the default direction of any mapping should be ref-to-real. It seems like this is the overwhelming convention in large deformations.
If you have a mapping
\phi : \hat{K} \to K
Then
\phi^* : Alt^k(K) \to Alt^k(\hat{K})
is the pullback defined by
\phi^* w(v_1, ..., v_k) = w(\phi v_1, ... \phi v_k), v_i \in \hat{K}, w \in Alt^k(K)
So at least differential geometry says the pullback goes in the opposite direction to the mapping.
Yes, exactly. So if the mapping is ref-to-real, then then pulllback should be real-to-ref, which is what I needed for dual basis application. I needed ref-to-real for cell integration (since tabulations are in ref), which I called pushforward.
Thanks,
Matt
Lawrence
-- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/> _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-- *Simone Puel* Ph.D. student in Geological Sciences at the University of Texas at Austin Jackson School of Geosciences & Institute for Geophysics (UTIG) JGB 5.332 & ROC 2.116L spuel@utexas.edu +1 (737)-230-6811
-- *Simone Puel* Ph.D. student in Geological Sciences at the University of Texas at Austin Jackson School of Geosciences & Institute for Geophysics (UTIG) JGB 5.332 & ROC 2.116L spuel@utexas.edu +1 (737)-230-6811