Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

'ngsolve.comp.SumOfIntegrals' object has no attribute 'SetDefinedOnElements'

More
3 years 10 months ago #2760 by dong
The attached file come from this diccusion with a small change.

The part that I changed is:
Code:
interfacebfi = SymbolicBFI (cf1+cf2+cf3, VOL, skeleton=True ) interfacebfi.SetDefinedOnElements(interface_indicator) a += interfacebfi

In many example on the forum, a+=something*dx is used to define a bilinear form for a weak formulation instead of using SymbolicBFI. I think they are interchangeable, so I guessed the above code can be rewrite as in the following one.
Code:
interfacebfi = (cf1+cf2+cf3)*dx(skeleton=True ) interfacebfi.SetDefinedOnElements(interface_indicator) a += interfacebfi

Then, there is an error when I run the file.
Code:
AttributeError: 'ngsolve.comp.SumOfIntegrals' object has no attribute 'SetDefinedOnElements'

I'm just wondering if there is any way to code in the second way, which is equivalent to the first one such that the original code works.
Many thanks in advanced.
More
3 years 10 months ago #2809 by christopher
Hi,
you are right, this was missing.
It is added in the current master and nightly and next release builds.
There you can use
Code:
... * dx(definedonelements=bitarray)

Best
Christopher
The following user(s) said Thank You: dong
Time to create page: 0.117 seconds