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.

Periodic cube mesh

More
5 years 11 months ago #521 by joachim
Replied by joachim on topic Periodic cube mesh
The preferred way is to use names instead of numbers.
If you don't have names, you can create a region from a BitArray, like

Region(mesh,BND, BitArray([True,False,False,True]))

This region is defined on the first and last boundary.
More
5 years 11 months ago - 5 years 11 months ago #522 by pschroe
Replied by pschroe on topic Periodic cube mesh
Thank you, Joachim!

How can I use this region in, for example, "definedon=mesh.Boundaries(...)"?
Is it possible to assign names to regions?

Best, Philipp
Last edit: 5 years 11 months ago by pschroe.
More
5 years 11 months ago - 5 years 11 months ago #523 by christopher
Replied by christopher on topic Periodic cube mesh
You can set boundary names on a Netgen mesh with
mesh.SetBCName(index, name)
BC indices are 1 based.
Last edit: 5 years 11 months ago by christopher.
More
5 years 11 months ago #524 by pschroe
Replied by pschroe on topic Periodic cube mesh
Thank you, Christopher!

In the attached script, I tried to do it this way.
However, I always get the following error:
Code:
illegal bc-number

Can you tell me what I am doing wrong?

Thanks for your help.

Best, Philipp
More
5 years 11 months ago #526 by christopher
Replied by christopher on topic Periodic cube mesh
This is a bit messy... A quickfix is to set names for all boundary conditions. I will discuss a nice solution with Joachim when he's back in Vienna.
Best
Christopher
The following user(s) said Thank You: pschroe
Time to create page: 0.126 seconds