Dear Anne-Cecile,

Ok, I see. I would not do node-averaging, like most commercial (and not
only) software do, for exporting smooth scalar fields (von Mises, strain
energy, etc.). Instead, my favorite approach is the one that you can find in
https://git.savannah.nongnu.org/cgit/getfem.git/tree/interface/tests/python/demo_finite_strain_plasticity_3D.py
for exporting the plastic strain field GAMMA.

What you need for this method is:

1) Before starting your simulation you calculate and store a mass matrix
for the scalar mesh_fem that you want to get the nodal values for

mass_mat = gf.asm_mass_matrix(mim, mfout)

mfout has to be a scalar fem (1 dof per node).

2) After (each step of) your simulation, you assemble the quantity that you
want to export, in this case strain energy with something like

      STRAIN_ENERGY = gf.asm_generic(mim, 1,
"(Gb*Grad(ub):Grad(ub)+Gb/(1-2*nub)*Div(ub)*Div(ub))*Test_t", -1, md,
                                     "t", True, mfout, np.zeros(mfout.nbdof()))

(check the correctness of the strain energy expression that I took from
some code you sent earlier)

3) Recover nodal values with

      STRAIN_ENERGY = np.transpose(gf.linsolve_mumps(mass_mat, STRAIN_ENERGY))

Then the vector STRAIN_ENERGY has the nodal values of the strain energy on
all dofs of mfout. If you calculate this vector for several simulations or
simulation steps, you can copy the result into different columns of a big
matrix as in the paper you are referring to.

Hope it helps.

BR
Kostas

On Tue, Jan 25, 2022 at 8:50 PM Lesage,Anne Cecile J <
ajles...@mdanderson.org> wrote:

> Dear Konstantinos
>
>
>
> The problem with patient specific surgery modeling is that we ignore a lot
> of the surgery scenario
>
> One way to model it with FEM is to precompute an atlas of organ
> deformation with a variety of surgery scenario parameter (here direction of
> gravity, loss of brain buoyancy by csf drainage, shrinkage due to drug,
>
> swelling due to edema, tumor resection, etc …) That is about 1000
> simulations
>
>
>
> Then the idea is to match intraoperative data, the surgeons measure a
> ground truth displacement on a few brain surface points
>
> The idea is to minimize function equation 7 in attached pdf:
>
> the first term is the least square between the ground truth displacement
> and the simulated one see equation
>
> the second term use the elastic strain energy on fem points pondered by
> the distance to the ground truth measurement points
>
> Finally we want to get the optimal alpha pondering vector to match the
> surgery measurement
>
>
>
> Ideally I would like my python script to output after poroelastic
> simulation converge
>
> The simulated displacements on the few measurement points (15)
>
> The pondered energy term
>
> So that I can assemble the function to minimize for the whole atlas
>
>
>
> Thank you
>
> Regards
>
> Anne-Cecile
>
>
>
>
>
> *From:* Konstantinos Poulios <logar...@googlemail.com>
> *Sent:* Tuesday, January 25, 2022 2:40 AM
> *To:* Lesage,Anne Cecile J <ajles...@mdanderson.org>
> *Cc:* getfem-users@nongnu.org
> *Subject:* [EXT] Re: Computing the linear elastic strain energy
>
>
>
> *WARNING: *This email originated from outside of MD Anderson. Please
> validate the sender's email address before clicking on links or attachments
> as they may not be safe.
>
>
>
> Dear Anne-Cecile
>
>
>
> The elastic strain energy density (is a scalar) at each node is easy to
> calculate. However, I have to ask you what you need this quantity for. Your
> reference suggests calculating this quantity on nodes which is probably not
> the best solution. If you calculate the strain energy density at a node
> between different elements, you get different results depending on which
> element you are evaluating the common node from. Then some averaging is
> required to get a value somewhere between all neighboring elements.
> Normally we evaluate strain energy densities at integration points. If you
> tell us what you need this result for I can maybe help with a better
> solution.
>
>
>
> Best regards
>
> K.
>
>
>
> On Mon, Jan 24, 2022 at 9:09 PM Lesage,Anne Cecile J <
> ajles...@mdanderson.org> wrote:
>
> Dear all
>
>
>
> I need to output tat the end of my poroelastic simulation the linear
> elastic strain energy matrix at each node of my mesh
>
> See attached formula
>
> What is an optimal way to compute it from the displacement u?
>
> Epsilon i = 0.5 (grad u + grad ut) right?
>
> And S here is the stress-strain law for isotropic materials?
>
>
>
> Thank you
>
> Anne-Cecile
>
> The information contained in this e-mail message may be privileged,
> confidential, and/or protected from disclosure. This e-mail message may
> contain protected health information (PHI); dissemination of PHI should
> comply with applicable federal and state laws. If you are not the intended
> recipient, or an authorized representative of the intended recipient, any
> further review, disclosure, use, dissemination, distribution, or copying of
> this message or any attachment (or the information contained therein) is
> strictly prohibited. If you think that you have received this e-mail
> message in error, please notify the sender by return e-mail and delete all
> references to it and its contents from your systems.
>
> The information contained in this e-mail message may be privileged,
> confidential, and/or protected from disclosure. This e-mail message may
> contain protected health information (PHI); dissemination of PHI should
> comply with applicable federal and state laws. If you are not the intended
> recipient, or an authorized representative of the intended recipient, any
> further review, disclosure, use, dissemination, distribution, or copying of
> this message or any attachment (or the information contained therein) is
> strictly prohibited. If you think that you have received this e-mail
> message in error, please notify the sender by return e-mail and delete all
> references to it and its contents from your systems.
>

Reply via email to