Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Derivative in C++ of a CoefficientFunction from python

More
3 years 11 months ago #2770 by paul.stocker
Hi from home office :)

Can I differentiate a coefficientfunction in C++ that is passed from python?
Assuming cf is the shared_ptr<CoefficientFunction> coming from python
Code:
cf->Diff(MakeCoordinateCoefficientFunction (0), make_shared<ConstantCoefficientFunction>(1) );
does not work. It seems, I need exactly the same CoordinateCoefficientFunction and cannot use a new one, right?
Is there another way than passing "x" from python?

Cheers,
Paul
More
3 years 11 months ago #2771 by joachim
good point.

I just changed the differentiation of Coordinate-CFs such that dx/dx is always 1

Joachim
The following user(s) said Thank You: paul.stocker
More
3 years 11 months ago #2780 by paul.stocker
Works perfectly! Thank you!
Time to create page: 0.132 seconds