This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Is it possible to set the accuracy for "assemble()"

0 votes

I am using an iterative method to solve an optimization problem. Therefore I need to use armijo-backtracking, where I need to check whether

for $$ \alpha \rightarrow 0 $$ check if
$$ j(\varphi + \alpha v) \leq j(\varphi) + \tau \alpha \cdot (j'(\varphi), v) $$

here $$ j(\varphi + \alpha v) $$, $$ j(\varphi)$$ and $$ j'(\varphi) v $$ are integrals, which need to be assembled using "assemble()".

when $$ \alpha \rightarrow 0$$ therefore it is making a difference whether I am using

assemble() on each single form, or using it on the form as a whole.

Are there any suggestions how to set the accuracy?

asked Jul 1, 2016 by Whistler FEniCS Novice (460 points)

1 Answer

0 votes

You can set the quadrature degree manually. For example,

b = assemble(L, form_compiler_parameters = {"quadrature_degree": 5})

or set the global parameter,

parameters["form_compiler"]["quadrature_degree"] = 5

Make sure that the Expressions in the forms have degree or element set appropriately.

answered Jul 1, 2016 by Magne Nordaas FEniCS Expert (13,820 points)
...