Assembling over subdomain fails

Bug #660334 reported by Gerd Wachsmuth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Medium
Unassigned

Bug Description

Following setup:

I have a mesh (with FunctionSpace V) and a submesh (with FunctionSpace W). Assembling a linear form on V over this subdomain involving a coefficient from W will fail.

I think the problem is that Dolfin would like to evaluate the function from W at the boundary of the subdomain. Maybe due to rounding errors this point lies outside the subdomain and the evaluation fails.

It does not happen, if W is a CG or DG space.

Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :
Revision history for this message
Marie Rognes (meg-simula) wrote : Re: [Bug 660334] [NEW] Assembling over subdomain fails

On 14. okt. 2010 09:13, Gerd Wachsmuth wrote:
> Public bug reported:
>
> Following setup:
>
> I have a mesh (with FunctionSpace V) and a submesh (with FunctionSpace
> W). Assembling a linear form on V over this subdomain involving a
> coefficient from W will fail.
>
> I think the problem is that Dolfin would like to evaluate the function
> from W at the boundary of the subdomain. Maybe due to rounding errors
> this point lies outside the subdomain and the evaluation fails.
>
> It does not happen, if W is a CG or DG space.
>
> ** Affects: dolfin
> Importance: Undecided
> Status: New
>
>

Have you tried setting

    parameters["allow_extrapolation"] = True

?

--
Marie

Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :

This works fine in 2D. But in 3D, extrapolation is not implemented.

Revision history for this message
Marie Rognes (meg-simula) wrote : Re: [Bug 660334] Re: Assembling over subdomain fails

On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
> This works fine in 2D. But in 3D, extrapolation is not implemented.
>
>

Ah.

--
Marie

Revision history for this message
Anders Logg (logg) wrote :

Marie Rognes skrev 2010-10-14 12.28:
> On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
>> This works fine in 2D. But in 3D, extrapolation is not implemented.
>>
>>
>
> Ah.
>
> --
> Marie

The problem is that this functionality is missing in CGAL so we have to
implement it ourselves and no one has done that yet.

--
Anders

Revision history for this message
Andre Massing (massing) wrote :

Den 20.10.10 21.07, skrev Anders Logg:
> Marie Rognes skrev 2010-10-14 12.28:
>> On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
>>> This works fine in 2D. But in 3D, extrapolation is not implemented.
>>>
>>>
>>
>> Ah.
>>
>> --
>> Marie
>
> The problem is that this functionality is missing in CGAL so we have
> to implement it ourselves and no one has done that yet.
It is already on my todo list, but not with a highest priority.
--
Andre

Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :

On Wed, 20 Oct 2010, Anders Logg wrote:
> Marie Rognes skrev 2010-10-14 12.28:
>> On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
>>> This works fine in 2D. But in 3D, extrapolation is not implemented.
>>>
>>>
>>
>> Ah.
>>
>
> The problem is that this functionality is missing in CGAL so we have to
> implement it ourselves and no one has done that yet.
>

In my opinion the problem is that Dolfin want to evaluate the function at
points which does not belong to the integration domain - or at points
lying to close at the boundary.

In my example the function w is defined only on a subdomain. Hence there
should be no error if this function is integrated over this subdomain.
By extrapolating this bug is only covered up.

Revision history for this message
Anders Logg (logg) wrote :

Gerd Wachsmuth skrev 2010-10-21 12.58:
> On Wed, 20 Oct 2010, Anders Logg wrote:
>> Marie Rognes skrev 2010-10-14 12.28:
>>> On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
>>>> This works fine in 2D. But in 3D, extrapolation is not implemented.
>>>>
>>>>
>>>
>>> Ah.
>>>
>>
>> The problem is that this functionality is missing in CGAL so we have to
>> implement it ourselves and no one has done that yet.
>>
>
> In my opinion the problem is that Dolfin want to evaluate the function at
> points which does not belong to the integration domain - or at points
> lying to close at the boundary.
>
> In my example the function w is defined only on a subdomain. Hence there
> should be no error if this function is integrated over this subdomain.
> By extrapolating this bug is only covered up.

Have you checked which point is thought to be outside of the domain?
Perhaps it's a small round-off error that causes the problem?

--
Anders

Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :

On Thu, 21 Oct 2010, Anders Logg wrote:

> Gerd Wachsmuth skrev 2010-10-21 12.58:
>> On Wed, 20 Oct 2010, Anders Logg wrote:
>>> Marie Rognes skrev 2010-10-14 12.28:
>>>> On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
>>>>> This works fine in 2D. But in 3D, extrapolation is not implemented.
>>>>>
>>>>>
>>>>
>>>> Ah.
>>>>
>>>
>>> The problem is that this functionality is missing in CGAL so we have to
>>> implement it ourselves and no one has done that yet.
>>>
>>
>> In my opinion the problem is that Dolfin want to evaluate the function at
>> points which does not belong to the integration domain - or at points
>> lying to close at the boundary.
>>
>> In my example the function w is defined only on a subdomain. Hence there
>> should be no error if this function is integrated over this subdomain.
>> By extrapolating this bug is only covered up.
>
> Have you checked which point is thought to be outside of the domain?
> Perhaps it's a small round-off error that causes the problem?
>

Yep. The problem seems to occur at points lying on the boundary.

Revision history for this message
Anders Logg (logg) wrote :

Gerd Wachsmuth skrev 2010-10-21 15.00:
> On Thu, 21 Oct 2010, Anders Logg wrote:
>
>> Gerd Wachsmuth skrev 2010-10-21 12.58:
>>> On Wed, 20 Oct 2010, Anders Logg wrote:
>>>> Marie Rognes skrev 2010-10-14 12.28:
>>>>> On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
>>>>>> This works fine in 2D. But in 3D, extrapolation is not implemented.
>>>>>>
>>>>>>
>>>>>
>>>>> Ah.
>>>>>
>>>>
>>>> The problem is that this functionality is missing in CGAL so we have to
>>>> implement it ourselves and no one has done that yet.
>>>>
>>>
>>> In my opinion the problem is that Dolfin want to evaluate the function at
>>> points which does not belong to the integration domain - or at points
>>> lying to close at the boundary.
>>>
>>> In my example the function w is defined only on a subdomain. Hence there
>>> should be no error if this function is integrated over this subdomain.
>>> By extrapolating this bug is only covered up.
>>
>> Have you checked which point is thought to be outside of the domain?
>> Perhaps it's a small round-off error that causes the problem?
>>
>
> Yep. The problem seems to occur at points lying on the boundary.

On the boundary between different subdomains or on the actual boundary?

--
Anders

Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :

On Thu, 21 Oct 2010, Anders Logg wrote:

> Gerd Wachsmuth skrev 2010-10-21 15.00:
>> On Thu, 21 Oct 2010, Anders Logg wrote:
>>
>>> Gerd Wachsmuth skrev 2010-10-21 12.58:
>>>> On Wed, 20 Oct 2010, Anders Logg wrote:
>>>>> Marie Rognes skrev 2010-10-14 12.28:
>>>>>> On 14. okt. 2010 11:13, Gerd Wachsmuth wrote:
>>>>>>> This works fine in 2D. But in 3D, extrapolation is not implemented.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Ah.
>>>>>>
>>>>>
>>>>> The problem is that this functionality is missing in CGAL so we have to
>>>>> implement it ourselves and no one has done that yet.
>>>>>
>>>>
>>>> In my opinion the problem is that Dolfin want to evaluate the function at
>>>> points which does not belong to the integration domain - or at points
>>>> lying to close at the boundary.
>>>>
>>>> In my example the function w is defined only on a subdomain. Hence there
>>>> should be no error if this function is integrated over this subdomain.
>>>> By extrapolating this bug is only covered up.
>>>
>>> Have you checked which point is thought to be outside of the domain?
>>> Perhaps it's a small round-off error that causes the problem?
>>>
>>
>> Yep. The problem seems to occur at points lying on the boundary.
>
> On the boundary between different subdomains or on the actual boundary?
>
>
On the boundary of the subdomain (where the function is defined and over
which we integrate) and its complement.

Revision history for this message
Garth Wells (garth-wells) wrote :

Could you post the simplest possible piece of code that reproduces the problem?

Revision history for this message
Gerd Wachsmuth (gerd-wachsmuth) wrote :

I've already posted a piece of code above.

Changed in dolfin:
status: New → Confirmed
Changed in dolfin:
milestone: none → 0.9.11
importance: Undecided → Medium
Revision history for this message
Marie Rognes (meg-simula) wrote :

We have added an additional strategy for evaluating functions on
semi-matching meshes. The three-dimensional version of the above
example (with "allow_extrapolation" = True) now runs without error.

Changed in dolfin:
status: Confirmed → Fix Committed
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.