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.

p-refinement?

More
5 years 10 months ago #553 by Guosheng Fu
p-refinement? was created by Guosheng Fu
Hi guys,

I know ngsolve is capable of doing p-refienement, but I am wondering whether it can be done via the python interface easily... (say, solve the laplace equation on a fixed mesh with p-refinement)... hp-refinement would be even better....
I didn't see any variable-degree tutorials in python.

Best,
Guosheng
More
5 years 10 months ago #555 by joachim
Replied by joachim on topic p-refinement?
Hi Guosheng,

yes, we can, but the syntax is not yet converged and thus you don't find a documentation. I shortly describe the concepts:

All finite element spaces in NGSolve can handle variable and also anisotropic polynomial orders.

Now the default.
future: only active when you set the flag:
H1 ( ... , order_policy = ORDER_POLICY.VARIABLE), otherwise we do some fixed-order optimisations.

You can give orders to mesh-nodes (e.g. edge number 7 set or order 5):
fes.SetOrder (NodeId(EDGE,7), 5)

After setting the orders, some tables must be recalculated via
fes.UpdateDofTables()

How you distribute the orders is your job. Either via error estimators, or on refinement level, distant to corners ....

Hope this helps,
Joachim
More
5 years 10 months ago #568 by Guosheng Fu
Replied by Guosheng Fu on topic p-refinement?
Sounds good!
I don't have any specific problem in mind for p-refinement yet, but it is very nice to know about this! :>
More
5 years 9 months ago #581 by Guosheng Fu
Replied by Guosheng Fu on topic p-refinement?
Hi Joachim,

I tried your suggestion on using
SetOrder and UpdateDofTables
for the finite elements, but it failed to work.

Here in the attachement is a modification of your adaptive.py demo code, where I only changed the h-refinement line 103
"mesh.SetRefine...
to p-refinement line 104
"V.SetOrder...
I tried to use "V.UpdateDofTables()" afterwards, but it gives me an error message...
'ngsolve.comp.H1' object has no attribute 'UpdateDofTables'

Best,
Guosheng
Attachments:
More
5 years 9 months ago #582 by joachim
Replied by joachim on topic p-refinement?
Hi Guosheng,

here is now a working mini-example. It needs the fixes I commited just now.

You have to set the order for the element-interior, as well as on the edges. By now only the H1 supports variable order from Python, the other spaces may come soon.

I have to warn you again, these things are very experimental and may change anytime.

Best, Joachim
Attachments:
More
5 years 9 months ago #584 by Guosheng Fu
Replied by Guosheng Fu on topic p-refinement?
Hi Joachim,

Great! It works nicely now.
It would be even better if you could help to support the variable order L2 space. :)
I am trying to see whether p-adaptivity would be a good choice for time domain wave propagation in the DG context...

Best,
Guosheng
Time to create page: 0.164 seconds