*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit e1413843 authored by Carl-Martin Pfeiler's avatar Carl-Martin Pfeiler
Browse files

structured mesh + maxwell(BEM) not working atm

parent 0e20569c
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
################################################################################
def AddStructuredMesh_BoundaryFaceCuboid(ngmesh, p, side):
def AddStructuredMesh_BoundaryFaceCuboid(ngmesh, fd, p, side):
from netgen.meshing import Element2D
if side in ["xmin", "ymin", "xmax", "ymax"]:
......@@ -16,13 +16,13 @@ def AddStructuredMesh_BoundaryFaceCuboid(ngmesh, p, side):
if flag:
for j in range(p.shape[0]-1):
for k in range(p.shape[1]-1):
ngmesh.Add(Element2D(1, [p[j,k], p[j+1, k+1], p[j, k+1]]))
ngmesh.Add(Element2D(1, [p[j,k], p[j+1, k+1], p[j+1, k]]))
ngmesh.Add(Element2D(fd, [p[j,k], p[j+1, k+1], p[j, k+1]]))
ngmesh.Add(Element2D(fd, [p[j,k], p[j+1, k+1], p[j+1, k]]))
else:
for j in range(p.shape[0]-1):
for k in range(p.shape[1]-1):
ngmesh.Add(Element2D(1, [p[j+1,k], p[j, k+1], p[j, k]]))
ngmesh.Add(Element2D(1, [p[j+1,k], p[j, k+1], p[j+1, k+1]]))
ngmesh.Add(Element2D(fd, [p[j+1,k], p[j, k+1], p[j, k]]))
ngmesh.Add(Element2D(fd, [p[j+1,k], p[j, k+1], p[j+1, k+1]]))
################################################################################
......@@ -36,13 +36,15 @@ def StructuredMesh_Cuboid(Xmin, Xmax, h):
fd = ngmesh.Add (FaceDescriptor(bc=1,domin=1,domout=0,surfnr=1))
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, nodes[0, :, :], "xmin")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, nodes[-1, :, :], "xmax")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, nodes[:, 0, :], "ymin")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, nodes[:, -1, :], "ymax")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, nodes[:, :, 0], "zmin")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, nodes[:, :, -1], "zmax")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, fd, nodes[0, :, :], "xmin")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, fd, nodes[-1, :, :], "xmax")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, fd, nodes[:, 0, :], "ymin")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, fd, nodes[:, -1, :], "ymax")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, fd, nodes[:, :, 0], "zmin")
AddStructuredMesh_BoundaryFaceCuboid(ngmesh, fd, nodes[:, :, -1], "zmax")
# for unknown reasons, it seems this number (0) has to be the bc parameter in
# FaceDescriptor, but -1. ...
ngmesh.SetBCName(0, "bc_dirichlet")
return ngmesh
......
......@@ -108,9 +108,9 @@ class _Integrator( \
# print("Oersted field implementation is Work In Progress; not finished.")
# sys.exit()
if(False): # TODO check bad combinations
print("message TODO")
sys.exit()
if(self.parameters.maxwellCoupling != "none" \
and self._geometry.structuredMesh == True):
raise NotImplementedError("maxwellCoupling != none and structured mesh doesn't work for now")
#------------------------------------------------------------------------------#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment