non-matching meshes in parallel

Asked by Jan Blechta

Hi everybody,
I'm wondering whether is there currently a working way how to deal with two different meshes in parallel. In particular I was trying to use a function from one (very small) mesh as bc value for space on another (large) mesh. Dolfin 1.1.0 outputs

*** Error: Unable to evaluate function at point.
*** Reason: The point is not inside the domain. Consider setting "allow_extrapolation" to allow extrapolation.
*** Where: This error was encountered inside Function.cpp.
*** Process: 0
*** -------------------------------------------------------------------------
mpirun: killing job...

when trying to apply this bc. If you allow_extrapolation, it of course computes rubbish. Also using interpolate or project between two meshes ends with similiar error. It's interesting because in documentation here http://fenicsproject.org/documentation/dolfin/1.1.0/python/programmers-reference/cpp/function/Function.html#dolfin.cpp.function.Function.interpolate is written:

 interpolate()

    Interpolate function (on possibly non-matching meshes)

Simple example code demontrating these errors can be found here http://artax.karlin.mff.cuni.cz/~blecj6am/dolfin/

Very simple workaround to these problems could be for me if every process could have its own copy of whole small mesh, corresponding function space and function. Is there a way to do this?

Jan

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Garth Wells
Solved:
Last query:
Last reply:
Revision history for this message
Anders Logg (logg) said :
#1

I think there should an option to read in a mesh to all processes.
Can we add this?

--
Anders

On Sun, Jan 13, 2013 at 04:25:55AM -0000, Jan Blechta wrote:
> New question #219050 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/219050
>
> Hi everybody,
> I'm wondering whether is there currently a working way how to deal with two different meshes in parallel. In particular I was trying to use a function from one (very small) mesh as bc value for space on another (large) mesh. Dolfin 1.1.0 outputs
>
> *** Error: Unable to evaluate function at point.
> *** Reason: The point is not inside the domain. Consider setting "allow_extrapolation" to allow extrapolation.
> *** Where: This error was encountered inside Function.cpp.
> *** Process: 0
> *** -------------------------------------------------------------------------
> mpirun: killing job...
>
> when trying to apply this bc. If you allow_extrapolation, it of course computes rubbish. Also using interpolate or project between two meshes ends with similiar error. It's interesting because in documentation here http://fenicsproject.org/documentation/dolfin/1.1.0/python/programmers-reference/cpp/function/Function.html#dolfin.cpp.function.Function.interpolate is written:
>
> interpolate()
>
> Interpolate function (on possibly non-matching meshes)
>
> Simple example code demontrating these errors can be found here http://artax.karlin.mff.cuni.cz/~blecj6am/dolfin/
>
> Very simple workaround to these problems could be for me if every process could have its own copy of whole small mesh, corresponding function space and function. Is there a way to do this?
>
> Jan
>

Revision history for this message
Jan Blechta (blechta) said :
#2

> I think there should an option to read in a mesh to all processes.
> Can we add this?
>
> --
> Anders
>
>

Generally, shouldn't there be an option for everything which parallel
initialization is handled by dolfin automatically?

Jan

Revision history for this message
Anders Logg (logg) said :
#3

On Mon, Jan 14, 2013 at 09:25:54AM -0000, Jan Blechta wrote:
> Question #219050 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/219050
>
> Status: Answered => Open
>
> Jan Blechta is still having a problem:
> > I think there should an option to read in a mesh to all processes.
> > Can we add this?
> >
>
> Generally, shouldn't there be an option for everything which parallel
> initialization is handled by dolfin automatically?

As a start, it might be enough to have it for the Mesh class. Then
everything else created from it (FunctionSpace, Function) would
have the same distribution.

--
Anders

Revision history for this message
Jan Blechta (blechta) said :
#4

I guess using ALE method with occasional remeshing can't be done in
parallel without interpolate/project working properly. Am I right?

Revision history for this message
Jan Blechta (blechta) said :
#5

On Mon, 14 Jan 2013 08:50:55 -0000, Anders Logg
> Anders Logg proposed the following answer:
> I think there should an option to read in a mesh to all processes.
> Can we add this?

This seems good. But in general there should be at least project() method
working for non-matching meshes in parallel otherwise there is no way to
compute problems which involves remeshing.

Revision history for this message
Garth Wells (garth-wells) said :
#6

On 15 January 2013 18:25, Jan Blechta
<email address hidden> wrote:
> Question #219050 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/219050
>
> Jan Blechta gave more information on the question:
> On Mon, 14 Jan 2013 08:50:55 -0000, Anders Logg
>> Anders Logg proposed the following answer:
>> I think there should an option to read in a mesh to all processes.
>> Can we add this?
>

There is a long-standing blueprint on this:

    https://blueprints.launchpad.net/dolfin/+spec/serial-meshes

Garth

> This seems good. But in general there should be at least project() method
> working for non-matching meshes in parallel otherwise there is no way to
> compute problems which involves remeshing.
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.

Revision history for this message
Jan Blechta (blechta) said :
#7

Garth Wells <email address hidden> wrote:
> There is a long-standing blueprint on this:
>
> https://blueprints.launchpad.net/dolfin/+spec/serial-meshes
>

And what about project() and interpolate() for non-matching meshes in
parallel? Are they on plans?

Jan

Revision history for this message
Best Garth Wells (garth-wells) said :
#8

On 17 January 2013 00:01, Jan Blechta
<email address hidden> wrote:
> Question #219050 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/219050
>
> Status: Answered => Open
>
> Jan Blechta is still having a problem:
> Garth Wells <email address hidden> wrote:
>> There is a long-standing blueprint on this:
>>
>> https://blueprints.launchpad.net/dolfin/+spec/serial-meshes
>>
>
> And what about project() and interpolate() for non-matching meshes in
> parallel? Are they on plans?
>

This will require some thought and discussion on how to (or not to)
handle off-process searches.

Garth

> Jan
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.

Revision history for this message
Jan Blechta (blechta) said :
#9

Thanks Garth Wells, that solved my question.