Hi Andrew,

I have run into a similar problem before, and implemented a fourth option you may want to try. I implemented a MeshMovement class that takes my triangulation and dof_handler as constructor arguments. Once the triangulation is initialized in the reference configuration, the class has a function "record_reference_configuration()" which basically stores the nodal coordinates of the mesh for later use. It then has two functions, "move_mesh_to_reference_configuration()" and "move_mesh_to_deformed_configuration(..)". The latter takes a displacement vector and optional scaling value. Using these two functions, you can move the mesh back and forth between the deformed and the (stored) reference configurations, writing output in the deformed config and calculating fe_values in the reference config. Obviously this may be a little slow, but if you are writing output infrequently or just at the end of the sim it wouldn't matter much.

Just another idea,
Josh

Attachment: mesh-movement.h
Description: Binary data



On Jan 1, 2009, at 5:52 PM, Wolfgang Bangerth wrote:


Andrew,

As I understand it, the reinit command "points"  fe_values to the
current cell and then recalculates the various quantities prescribed in
the update_flags. The problem is that I have scaled the displacements
for post-processing so I don't want reinit to recalculate any parameters for the current cell, all I want it to do is recall the initial values
on the undeformed initial domain.

That's not quite so easy to do: FEValues::reinit computes the quantities using the mapping from the reference cell to the current configuration of the cell using its vertices and the mapping object. Of course it has no idea about any previous values the locations of the vertices may have had.

I see three options for you:
- either you keep two meshes, one where you move nodes around and one that keeps the reference configuration. You use one or the other depending on whether you need quantities in the reference or the current configuration

- you compute quantities like shape function values and gradients once at
the beginning of the program and put them into a cache of your own

- you use the MappingQEulerian or MappingQ1Eulerian class that tracks the deformation of your domain as a finite element field. The mesh itself if undeformed. Pretty much all parts of deal.II accept a mapping object; by default, this is a MappingQ1 object that assumes that your mesh is as the
vertices of the cells indicate, but whenever you want to deal with the
deformed configuration you could pass a MappingQ1Eulerian object that
describes this deformation.

Maybe one of these gets you where you want to be!
Cheers
W.

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            [email protected]
                                www: http://www.math.tamu.edu/~bangerth/


_______________________________________________

_______________________________________________

Reply via email to