5 weeks ago by
I am implementing tim stepping and thus need to call dolfin.norm quite often.
cProfile tells me that the call to norm makes around 25% of my preprocess, solve, postprocess cycle of my time stepping.
Most of the call seems to be to dolfin.fem.assemble ( dolfin.fem._create_dolfin_form).
Can I prevent /reduce this assembling step?
Community: FEniCS Project
21 days ago by
(u1 - u2)**2*dxor whatever and then set
form = dolfin.Form(ufl_expression)which pre-compiles the form. Now you can call
assemble(form)whenever you need to compute the norm. This avoids compilation time, but assembly will of course need to be done every time if you want the "real" norm (the integral formulation). The linear algebra vector version, calling
f.vector().norm('l2'), should always be faster
Please login to add an answer/comment or follow this question.