Comments (2)
I'm also experiencing the same issue (origin included when it shoudn't) with the following code:
import pygmsh
with pygmsh.geo.Geometry() as geom:
p0 = geom.add_point([0.0, 0.0], lcar)
p1 = geom.add_point([1.0, 0.0], lcar)
p2 = geom.add_point([2.0, 0.0], lcar)
p3 = geom.add_point([2.0, 5.0], lcar)
p4 = geom.add_point([0.0, 5.0], lcar)
p5 = geom.add_point([0.0, 1.0], lcar)
l0 = geom.add_line(p1, p2)
l1 = geom.add_line(p2, p3)
l2 = geom.add_line(p3, p4)
l3 = geom.add_line(p4, p5)
ca1 = geom.add_circle_arc(p5, p0, p1)
loop = geom.add_curve_loop([l0, l1, l2, l3, ca1])
surface = geom.add_plane_surface(loop)
geom.add_physical(l0, 'bottom')
geom.add_physical(l2, 'top')
geom.add_physical(l3, 'left')
geom.add_physical(l1, 'right')
geom.add_physical(ca1, 'hole')
mesh = geom.generate_mesh(dim=2)
nodes = mesh.points[:, :2]
cells = mesh.cells_dict['triangle']
For now, I implemented a workaround, but it's not ideal:
nodes_to_remove = [np.array([0.0, 0.0])] # Containing the origin
unconnected_nodes = []
for i, node in enumerate(nodes):
if node in nodes_to_remove:
unconnected_nodes.append(i)
for i in unconnected_nodes:
nodes = np.delete(nodes, i, axis=0) # Remove the node ID/index/pointer
cells[cells >= i] -= 1 # Make subsequent nodes pointing to the previous node ID/index/pointer
from pygmsh.
Related Issues (20)
- How to create a 2D cylinder in
- How to create a 2D cylinder in an rectangle? HOT 1
- Conda install option
- How to construct tetrahedron using vessel surface?
- Unable to create Second Order Incomplete elements
- Error and warnings in tests
- The example "ball with mesh refinement" prints errors: TypeError: <lambda>() takes 5 positional arguments but 6 were given
- The "Flat shapes" section in the README has some broken links for images
- add_surface with occ geometry kernel broken HOT 1
- How to generate tetrahedron from a mesh?
- Error with set_mesh_size_callback HOT 1
- Removing isolated solid phases
- Supress output console
- Support calling add_physical multiple times with the same label
- Raw code alternative for periodic curve
- How to create a rotationally symmetric geometry HOT 1
- Generate Hexahedral mesh inside complex geometry using gmsh
- py30-pygmsh missing dependencies gmsh (macport installation)
- Alternative for add_raw_code in pygmsh 7.1.17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygmsh.