Re: [deal.II] Modifying shape function data in MatrixFree

2020-12-31 Thread luca.heltai


> On 31 Dec 2020, at 12:09, 'David' via deal.II User Group 
>  wrote:
> 
> 
> The absolute errors at the end of each iteration are of the order 
> \mathcal{O}(10^{-10}). Also, if I compare my two-point residual assembly 
> using matrix-free with the 'usual' spatial residual assembly and compute the 
> l2 norm of the difference, i.e. l2_norm(r_mf - r-_tau), I obtain a difference 
> of the order \mathcal{O}(10^{-10}). But from what I learnt, double precision 
> should be at least accurate up to ~10^{-15}. There are five orders of 
> magnitude in between. I probably miss something here in between. Any idea? 

Well, you have to keep in mind that there are two more ingredients to keep into 
account: 

1. the Jacobian condition number (easily in the order of 10^3 — 10^6)
2. the number of operations that lead to the residuals (i.e., how many sums 
your are eventually doing)

since errors accumulate, 10^{-10} is actually close to machine precision if you 
have around 10^4/10^5 dofs. 

Moreover, you are computing the l2_norm, i.e., sum over all dofs  of the 
*square* of the difference, and then you are taking the square root. 

If you make 1e-15 error et each step in the square difference, propagate that 
for ndofs sums, simply by taking the square root of the resulting error, you’d 
get an expected error close to 1^{-8}, so you’re results are essentially 
machine precision.

L.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/9D1619AB-95F5-4BE8-9360-162CBB69D9C5%40gmail.com.


[deal.II] Modifying shape function data in MatrixFree

2020-12-29 Thread 'David' via deal.II User Group

Hi all,

I'm currently trying to implement a vectorized variant of the residual 
assembly as it is done in step-44/one of the corresponding code-gallery 
examples using FEEvaluation objects in combination with matrix-free. 

I was not able to find an appropriate solution for the given code line 
and
 
the subsequent application for the assembly process: the major problem is 
that the shape function gradients are defined with regard to the current 
configuration, whereas my matrix-free object holds a mapping, which refers 
to the initial configuration. The reference configuration mapping  of my 
matrix-free object is desired as the final integration is actually 
performed in the reference frame.
A valid option is probably (I have not tried it) to use a matrix-free 
object with a different mapping (MappingQEulerian) which directly evaluates 
the shape gradients in the deformed configuration and use another 
referential matrix-free object for the integration part. 
The main reason to avoid this approach is that it would require a 
reinitialization of the 'deformed' matrix-free object in each nonlinear 
step and the mapping needs to be recomputed in each reinizialization. On 
the other hand, the expensive reinitialization is not really required as 
the mapping between the referential and the current configuration is known 
due to the (inverse) deformation gradient. 
Therefore, I'm looking for an opportunity to access the shape gradients and 
perform a push forward similarly to the approach in step-44 in order to 
evaluate the desired quantities. 

Until now I was not able to find an obvious solution for this computations 
using the FEEvaluation class. Maybe anyone else has a better idea for the 
described problem.

Thanks in advance,
David

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/34669b15-4c36-410c-9665-071b7bbe2c44n%40googlegroups.com.