Solve STEP Geometry

More
6 years 3 months ago - 6 years 3 months ago #678 by Username
Solve STEP Geometry was created by Username
Hi,

When I use 'from netgen.geom2d import unit_square' and set the boundary conditions with the flag 'dirichlet=' left|right'' ( figure 1 ), then the Poisson equation on the unit square with homogeneous Dirichlet boundary conditions is solved ( figure 2 ).

If I import the geometry in the format *.step using 'geo=LoadOCCGeometry ('unit_square.step') ' (the unit-square) and set the boundary conditions with 'dirichlet=' left|right'' flag ( figure 3 ), then the Poisson equation on the unit square with homogeneous Dirichlet boundary conditions is not solved ( figure 4 ).

How to set boundary conditions for files of type *.step? Is it possible to determine several boundary conditions on the walls of a square?
Last edit: 6 years 3 months ago by Username.
More
6 years 3 months ago #679 by cwinters
Replied by cwinters on topic Solve STEP Geometry
Hi,

I'm not sure which boundary conditions are loaded from a *.step.
If the boundary conditions are set to strings, you can use the following to print them:
Code:
from netgen.geom2d import unit_square ngmesh = unit_square.GenerateMesh() from ngsolve import * mesh = Mesh(ngmesh) print(mesh.GetBoundaries())
If you have integers as boundary conditon, you can set names using:
Code:
mesh.ngmesh.SetBCName(0,"somename")
Could you please attach your *.step file? Then I can check what is loaded from the *.step file?

Best,
Christoph
More
6 years 3 months ago #680 by Username
Replied by Username on topic Solve STEP Geometry
Thanks for your quick response, STEP file
More
6 years 3 months ago - 6 years 3 months ago #681 by Username
Replied by Username on topic Solve STEP Geometry
Using
Code:
print(mesh.GetBoundaries())
I determined:
  • The number of integers as a boundary condition is equal to the number of planes in the file *.step. There are exactly six of them in 3D for a cube.
  • And what about the 2D case where the number of integers is equal to one, since one plane? You can set the name of the boundary conditions at a node?
Last edit: 6 years 3 months ago by Username.
More
6 years 3 months ago #682 by cwinters
Replied by cwinters on topic Solve STEP Geometry
As it looks like, importing *.step files just makes sense for 3D meshes and 2D surface meshes in 3D.
But for a 2D mesh, some information is not set correctly.

Do you really need to import a 2D *.step file? Generating 2D geometries in Netgen is not very difficult.

Best,
Christoph
More
6 years 3 months ago #683 by Username
Replied by Username on topic Solve STEP Geometry
The priority is to import the finished 2D model in the format *.step. In Netgen, when writing a 2D object (line) to a file, the '-bc=' flag is specified with the individual number to be referenced when setting the boundary condition. That is, the boundary condition is set on the line. With the format *.step so can be done? Set a boundary condition on a line, point, node, or finite element rather than a surface?
Time to create page: 0.111 seconds