On Fri, Nov 2, 2018 at 9:50 PM Yuxiang Wang <yw...@virginia.edu> wrote:
> Dear all, > > I have been using the matrix notation (following the Bathe textbook) with > libmesh recently to code finite element solutions for basic continuum > structural elements. I realized that I need to compute those matrices twice > - once when I assemble the global stiffness matrix, and another time when I > get the solutions and need to post-process to compute the stresses/strains. > Being curious, do we have any best practices (or special considerations) to > save those matrices so that we don't have to compute them twice? For > example, should I just create a huge vector of DenseMatrix, and each matrix > for each quadrature point? Or that libmesh has some tools for this book > keeping? > > Explanation for what I meant by "matrix notation" and what are those finite > element matrices: for example, for each quadrature point I have an > interpolation matrix [H], a strain-displacement matrix [B] (constructed > from derivatives of [H]). With the constitutive tensor matrix being [C], we > can easily get the element stiffness matrix by [K] = > integrate([B]^T[C][B]). After the solution [uhat] is obtained, we can also > get the strain and stress by again [strain] = [B][uhat] or [stress] = > [C][B][uhat]. > > Just wondering whether anyone else has done this before and whether there > would be a better practice to do it more elegantly. Thanks :) > > Best, > Shawn See systems_of_equations_ex6 for an example of computing stresses in libMesh. In that case we do not store and re-use the per-element strain and stress matrices (C and B in your notation) You could store and reuse that data, but it's not clear to me whether it'd be worth it. You'd presumably get some speedup in the evaluation of the stress at the cost of extra storage, so you'd have to decide if you want that or not (in my experience I would not want that since memory is usually more of a limiting factor than speed). Best, David _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users