On Thu, 21 Nov 2019, Renato Poli wrote:

> I have a doubt on L2 projection between meshes with split dofs.
>
> I am currently using the following code to project values from one mesh to
> another more refined one (I perform refinement myself):
>
>      MeshFunction * mesh_func = new MeshFunction( . . . );
>      mesh_func->init();
>      mesh_func->enable_out_of_mesh_mode( 0 );
>      sys.project_solution( ... )
>
> I can see it interpolates the projected values based on the coordinate of
> the dofs. Is that so?

With the MeshFunction interface, yes, I'm afraid so.  When we do our
own mesh refinement then we have more context available, but we can't
get that context to a MeshFunction, because FunctionBase::operator()
only takes a Point, not a Node or Elem.

> It happens that in some coordinates I have duplicated dofs representing
> fractures. Displacements are different on both sides of the fracture even
> though their coordinates are the same.

And then you basically get a value from a random side when it tries to
interpolate at that point.  That's awful.

> Can you see any smart-hack to avoid the interpolation _only_ on fracture
> nodes?

You could create a class that works like MeshFunction but subclasses
FEMFunctionBase instead, so whenever it gets called you have an Elem
as context rather than just a point.  It would be given one of the
*new* Elem objects as context, though, so I don't see how to make this
work generically - it would be specific to your case and you'd have to
handle mapping from new to old elements to determine which side of a
fracture you're on.

> Or should I rewrite the whole 'project_solution' with my own stuff?

Much of the hassle that makes GenericProjector so complicated only
applies if you're also using one advanced feature or another.  If
you're not using any of those features (i.e. you're not using threads,
you're not using p refinement, you're not using hierarchic h
refinement, you're using Lagrange elements only, you're running in
serial) then it'd be a pretty easy rewrite, whereas the more of those
assumptions you can't make the harder it would get.
---
Roy


_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to