I am trying to solve Poisson equation on a contraction step problem. I get an error to set dirichlet boundary condition at different boundaries.
Here is the part of the code:
######################################################################################################
from ngsolve import *
from netgen.geom2d import SplineGeometry
import netgen.gui
import matplotlib.pyplot as plt
import netgen.geom2d as geom2d
import numpy as np
from netgen.meshing import Element0D, Element1D, Element2D, MeshPoint, FaceDescriptor, Mesh
from netgen.csg import Pnt
ngsglobals.msg_level =2
%% Geometry generation (points definition)
geo = geom2d.SplineGeometry()
p1 = geo.AppendPoint (0,0)
p2 = geo.AppendPoint (3,0)
p3 = geo.AppendPoint (3,0.1)
p4 = geo.AppendPoint (2,0.1)
p5 = geo.AppendPoint (2,1)
p6 = geo.AppendPoint (0,1)
(Boundaries definition)
geo.Append ([“line”, p1, p2],bc=1) # bottom
geo.Append ([“line”, p2, p3],bc=2) # outlet
geo.Append ([“line”, p3, p4],bc=3) # horizontal
geo.Append ([“line”, p4, p5],bc=4) # vertical
geo.Append ([“line”, p5, p6],bc=5) # top
geo.Append ([“line”, p6, p1],bc=6) # Inlet
fes = H1(mesh, order=2, dirichlet=[1,2])
########################################################################################
The error happens for the last line:
TypeError: init(): incompatible constructor arguments. The following argument types are supported:
1. ngsolve.comp.H1(mesh: ngsolve.comp.Mesh, **kwargs)
Invoked with: <netgen.libngpy._meshing.Mesh object at 0x000002303900E530>; kwargs: order=2, dirichlet=[1, 2]
Thanks in advance