Comments (2)
How about this?
mesh = mfem.Mesh(10, 10, "TRIANGLE")
for x in mesh.GetVertexArray():
x[:] = (x[0]*2, x[1]*3)
mesh.Save("streched.mesh")
mesh.GetVertexArray returns tuple of numpy array, each of which points to a mesh vertex data. You can use in-place replacement numpy array to modify the mesh.
(Thinking about this, it might have been better to return Python iterator)
from pymfem.
How about this?
mesh = mfem.Mesh(10, 10, "TRIANGLE") for x in mesh.GetVertexArray(): x[:] = (x[0]*2, x[1]*3) mesh.Save("streched.mesh")
mesh.GetVertexArray returns tuple of numpy array, each of which points to a mesh vertex data. You can use in-place replacement numpy array to modify the mesh. (Thinking about this, it might have been better to return Python iterator)
Thank you so much! It is exactly what I expect.
from pymfem.
Related Issues (20)
- `FindPointsGSLIB::GetCode()` does not return `mfem::Array<unsigned int>` HOT 1
- Installation failure with `--with-parallel` and `--with-gslib` on v.4.5.2.1 HOT 4
- How to implement LinearFormIntegrator HOT 1
- MFEM4.6 support HOT 1
- vtk output for solutions HOT 14
- First element read by GF is 0 not the value in the file HOT 4
- can't build with external mfem HOT 13
- GridFunction, ProjectCoefficient and GetValue HOT 5
- build with external mfem still broken HOT 4
- build with external openblas HOT 3
- Install fails on MacOS: `chrpath` not found HOT 5
- h derefinement fails after p adaption HOT 2
- Performance issues w/ mesh attribute retrieval HOT 3
- PyMFEM 4.7 HOT 4
- Wrapper for hyperbolic class and fixing ex18 HOT 2
- Tests are skipped (+ passed) on cuda build
- Parallel tests hang on python 3.7 & 3.8
- How to Install PyMFEM so that it reads Cubit Files? HOT 2
- Mesh Atributtes and .vtk/.vtu files HOT 1
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 pymfem.