- Thank you received: 0
Evaluation of ProxyFunction
- JanWesterdiep
- Topic Author
- Offline
- Junior Member
Less
More
5 years 1 month ago #1929
by JanWesterdiep
Evaluation of ProxyFunction was created by JanWesterdiep
Hello team,
After recently attending a workshop in Vienna that featured NGSolve (RMMM2019), I finally took the plunge and am slowly working on understanding the codebase. I have a number of questions, with one problem in particular. For now, I am using the Python frontend, which I hope will be sufficient for my application.
- I am used to navigating code documentation with something like Doxygen, but it seems this is unavailable for NGSolve. Although very extensive, sometimes the example code at ngsolve.org/docu is not sufficient and I resort to calling `help(variable_or_class)` to get some idea of the methods a class has. Is this the intended way? Is there any way for me to generate/find Doxygen-like documentation?
- My specific application features point evaluations of test- and trial functions, like such:
This code gives me the cryptic error "netgen.libngpy._meshing.NgException: cannot evaluate ProxyFunction without userdata", however it does not give me a traceback to *where* this error comes from, and this string gives no hits on google, nor does "userdata" yield a hit in the documentation.
Am I approaching this problem the wrong way?
In any case, thank you immensely for the codebase
After recently attending a workshop in Vienna that featured NGSolve (RMMM2019), I finally took the plunge and am slowly working on understanding the codebase. I have a number of questions, with one problem in particular. For now, I am using the Python frontend, which I hope will be sufficient for my application.
- I am used to navigating code documentation with something like Doxygen, but it seems this is unavailable for NGSolve. Although very extensive, sometimes the example code at ngsolve.org/docu is not sufficient and I resort to calling `help(variable_or_class)` to get some idea of the methods a class has. Is this the intended way? Is there any way for me to generate/find Doxygen-like documentation?
- My specific application features point evaluations of test- and trial functions, like such:
Code:
I = some_mesh_on_the_interval()
X = H1(I)
u, v = X.TnT()
C = BilinearForm(X)
C += u * v * dx + epsilon * u(I(0.0)) * v(I(0.0))
Am I approaching this problem the wrong way?
In any case, thank you immensely for the codebase
- mneunteufel
- Offline
- Premium Member
Less
More
- Thank you received: 59
5 years 1 month ago #1930
by mneunteufel
Replied by mneunteufel on topic Evaluation of ProxyFunction
Hi JanWesterdiep,
it is not possible to evaluate a ProxyFunction at a mesh point.
Therefore you first have to solve the problem and then evaluate the GridFunction where the solution is stored.
I don't understand your BilinarForm completely. Do you want to have a boundary integral?
This is done by the ds integrator:
However, with this both boundaries of the interval are "evaluated". You can use the IfPos command
or use the definedon syntax (therefore the boundaries must have a name or number)
Best,
Michael
it is not possible to evaluate a ProxyFunction at a mesh point.
Therefore you first have to solve the problem and then evaluate the GridFunction where the solution is stored.
I don't understand your BilinarForm completely. Do you want to have a boundary integral?
This is done by the ds integrator:
Code:
I = some_mesh_on_the_interval()
X = H1(I)
u, v = X.TnT()
C = BilinearForm(X)
C += u * v * dx + epsilon * u* v * ds
However, with this both boundaries of the interval are "evaluated". You can use the IfPos command
Code:
C += u * v * dx + IfPos(x-1e-5,0,1)*epsilon * u* v * ds
or use the definedon syntax (therefore the boundaries must have a name or number)
Code:
C += u * v * dx + epsilon * u* v * ds(definedon=mesh.Boundaries("left"))
Best,
Michael
- JanWesterdiep
- Topic Author
- Offline
- Junior Member
Less
More
- Thank you received: 0
5 years 1 month ago #1931
by JanWesterdiep
Replied by JanWesterdiep on topic Evaluation of ProxyFunction
Michael -- Perfect, your last suggestion works well. Thank you for taking the time to reply.
Time to create page: 0.098 seconds