Convecting a mesh (C++)

Asked by Charles on 2013-02-12

Hello,

Is there a convenient way to convect a mesh by a velocity? I have the total derivative and velocity field and would like to convect the mesh by u(x)*dt. Using interpolate would require a somewhat painful 'look back' into the previous location of the 'particle'.

I don't suppose one could simple convect the dofs on the mesh (is there a helper function in c++)?

Thank you,

Charles

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
2013-02-14
Last query:
2013-02-14
Last reply:
2013-02-14

This question was reopened

Charles (rodbourn) said : #2

Thank you Felix - one of those days :)

Charles (rodbourn) said : #3

Thanks Felix Ospald, that solved my question.

Charles (rodbourn) said : #4

Felix, I've been having some trouble using move, in particular:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https://answers.launchpad.net/dolfin
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to move mesh using mesh smoothing.
*** Reason: Illegal value dimension of displacement function.
*** Where: This error was encountered inside ALE.cpp.
*** Process: 0
*** -------------------------------------------------------------------------

I am working with Interval meshes. Do I need to do anything in particular to create a Function to move the mesh by?

I tracked this down to this check in ALE.cpp:

  if (!((element.value_rank() == 0 && gdim == 0) ||
        (element.value_rank() == 1 && gdim == element.value_dimension(0))))
  {
    dolfin_error("ALE.cpp",
                 "move mesh using mesh smoothing",
                 "Illegal value dimension of displacement function");
  }

I check just before the move call and the value_rank is 0, and the value_dimension is 1.

Thank you

Best Anders Logg (logg) said : #5

On Thu, Feb 14, 2013 at 07:35:50PM -0000, Charles wrote:
> Question #221688 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/221688
> Status: Solved => Open
> Charles is still having a problem:
> Felix, I've been having some trouble using move, in particular:
> *** -------------------------------------------------------------------------
> *** DOLFIN encountered an error. If you are not able to resolve this issue
> *** using the information listed below, you can ask for help at
> ***
> *** https://answers.launchpad.net/dolfin
> ***
> *** Remember to include the error message listed below and, if possible,
> *** include a *minimal* running example to reproduce the error.
> ***
> *** -------------------------------------------------------------------------
> *** Error: Unable to move mesh using mesh smoothing.
> *** Reason: Illegal value dimension of displacement function.
> *** Where: This error was encountered inside ALE.cpp.
> *** Process: 0
> *** -------------------------------------------------------------------------
> I am working with Interval meshes. Do I need to do anything in
> particular to create a Function to move the mesh by?
> I tracked this down to this check in ALE.cpp:
> if (!((element.value_rank() == 0 && gdim == 0) ||
> (element.value_rank() == 1 && gdim == element.value_dimension(0))))
> {
> dolfin_error("ALE.cpp",
> "move mesh using mesh smoothing",
> "Illegal value dimension of displacement function");
> }
> I check just before the move call and the value_rank is 0, and the value_dimension is 1.
> Thank you

This is a bug. The first line should check gdim == 1...

File a bug report for this and I can push a fix.

--
Anders

Charles (rodbourn) said : #6

I created one here: https://bugs.launchpad.net/dolfin/+bug/1125499

I'm glad I've actually found something :)

Should I update the source locally until it makes it into the trunk?

Charles (rodbourn) said : #7

Thanks Anders Logg, that solved my question.