Add numerical diffusion with FM computation of non local fields
Added the possibility to introduce numerical diffusion when computing non local fields, using modes built with the Fast Marching approach (see user documentation). Note that it uses the same diffusion parameter penalty_coef in damageinfo.dat than the Lagrangian computation, which is noted "beta" in the user documentation.
Note that this method may not be optimal for several reasons:
-
Compared to the "classical" computation, which uses only a matrix-vector product, it requires to solve a linear system
-
The assembling of the matrix may not be optimal. Indeed, let:
- m be the number of modes
- n be the number of nodes in the damaged zones and the narrow band
- K_m be the modal diffusion operator (size m*m)
- K be the nodal diffusion operator (size n*n)
- M the mode matrix (size m*n)
K_m can be computed as K_m = MKM' , where X' is the transpose of matrix X.
In DamageBand, M is given as M1 and M2, where M1 corresponds to the n1 nodes inside the damaged zone, and M2 to the n2 nodes which are in the narrow band. We can write M = [M1 M2].
Within this commit, M1 and M2 are copied into a single xDenseMatrix M, M' in another xDenseMatrix matrix. Then U=KM' is computed using the gemm function of xGenericSparseMatrix, and finally K_mM*U is obtained using the gemm function of xDenseMatrix. Another way to build K_m would be to consider that :
K_m= M1K11M1' + M1K12M2' + M2K21M1' + M2K22M2 and K=[K11 K12; K21 K22], where index 1 corresponds to nodes in damaged zone and index 2 to nodes in the narrow band.
However, this would require to implement the gemm function for C = A.B', which is not trivial. Also, a thorougher investigation would be necessary to determine if it would really be faster.
- Aggregating adjacent modes to get evenly wide modes could also be another way to introduce diffusion, or eventually complementary to the diffusion introduced in this commit
Note that a few functions have been introduced in this commit:
-
computeMeanElementSizeInDamagedBand : performs computation of the mean element size in the damaged band. It just consists in the few lines of code which were initially at the begining of the compute_velocity function. Putting them in another function makes the code easier to read, and factorizes lines of codes that would have been copy/pasted, if one wants to add another compute_velocity function
-
createModesVelocityProblem : the idea of this function, similarly to what is done in compute_elastic by the createMechanicalProblem function, is to factorize steps common to any computation using the FM modes computation of non local fields. For now it only contains:
- the createModalLocalisationSpace function
- the export of the different modes
- the computation of the diffusion operator K_m, if penalty_coef>0.
One could imagine that in the future, if modes computation requires other pre-treatments, they could be put inside this function
This commit requires functionnalities introduced by commit 2ce67f257db9ff9de0c13f968d72f8af9835d269 in Xfiles.
Fixes #14 (closed)