Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An issue when using trapezoid mesh #695

Open
sadfa1 opened this issue May 13, 2024 · 1 comment
Open

An issue when using trapezoid mesh #695

sadfa1 opened this issue May 13, 2024 · 1 comment

Comments

@sadfa1
Copy link

sadfa1 commented May 13, 2024

Hi, everyone, I'm trying to using the trapezoid mesh, but there are always error messages when I show the final result. By the way, almost everyone use rectangle mesh, is it because the non-rectangle mesh is not applicable in the underworld? Thanks a lot if anyone can help me!!!!

The code is shown as follow

Lx        = non_dimensionalise( 2e3 * u.kilometer)
Ly        = non_dimensionalise( 1e3 * u.kilometer)
gravity   = non_dimensionalise( 9.81 * u.meter / u.second**2)

resx=600
resy=300
mesh = uw.mesh.FeMesh_Cartesian( elementType = ("Q1/dQ0"), 
                                 elementRes  = (resx, resy), 
                                 minCoord    = (0., 0.), 
                                 maxCoord    = (Lx, Ly))



with mesh.deform_mesh():
    for index, coord in enumerate(mesh.data):
        mesh.data[index][0] = -0.5*mesh.data[index][0]*mesh.data[index][1]+mesh.data[index][0]




velocityField = mesh.add_variable(         nodeDofCount=2 )
pressureField = mesh.subMesh.add_variable( nodeDofCount=1 )
temperatureField = mesh.add_variable(         nodeDofCount=1 ) # required for AdvectionDiffusion (SUPG) method
temperatureDotField = mesh.add_variable(         nodeDofCount=1 ) # required for AdvectionDiffusion (SUPG) method
# initialise 

velocityField.data[:] = (0.,0.)
pressureField.data[:] = 0.
figMesh = vis.Figure(figsize=(800,400))
figMesh.append(vis.objects.Mesh(mesh))
#figMesh.append( vis.objects.Mesh(submesh, nodeNumbers=True, pointsize=10) )
figMesh.show()

The trapezoid mesh is shown here
ddc6dbe19a19e601bbb3c3baeb3c2e8e

The error messages are shown here
1715592826019

@sadfa1
Copy link
Author

sadfa1 commented May 24, 2024

@julesghub sir, I would be really thankful if you can help me!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant