Comments (2)
Here is a short answer. Please take a look at this example. https://github.com/mfem/PyMFEM/blob/master/examples/ex3.py#L25
You need to create an object and define a method which PyMFEM will call from C++.
from pymfem.
Thanks! The example was very helpful. I realized I needed a scalar PyCoefficient and was able to get it like this (just noting for posterity):
class u_exact(mfem.PyCoefficient):
def __init__(self):
mfem.PyCoefficient.__init__(self)
def EvalValue(self, x):
return (x(0)+x(1))
...and then kept going from there!
from pymfem.
Related Issues (20)
- 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 14
- GridFunction, ProjectCoefficient and GetValue HOT 5
- build with external mfem still broken HOT 5
- build with external openblas HOT 3
- Modify an existing mfem.Mesh HOT 2
- 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 5
- Wrapper for hyperbolic class and fixing ex18 HOT 3
- Tests are skipped (+ passed) on cuda build HOT 4
- Parallel tests hang on python 3.7 & 3.8 HOT 3
- How to Install PyMFEM so that it reads Cubit Files? HOT 2
- Mesh Atributtes and .vtk/.vtu files HOT 2
- Wrapper for mfem.tmop.TMOPMatrixCoefficient and HOT 3
- PyMFEM 4.7.1
- Dockerfiles + CI to build images
- Auto trigger CI HOT 2
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.