MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / GenerateCode

Method GenerateCode

fem/python_fem.cpp:180–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178static RegisterClassForArchive<cl_BinaryOpCF<GenericBSpline2D>, CoefficientFunction> regbspline2d;
179
180template <> void
181cl_UnaryOpCF<GenericBSpline>::GenerateCode(Code &code, FlatArray<int> inputs, int index) const
182{
183 // bspline.hpp is not automatically included. so we should include it:
184 code.top+= "#include <bspline.hpp>\n";
185
186 stringstream s;
187 s << "reinterpret_cast<BSpline*>(" << code.AddPointer(lam.sp.get()) << ")";
188 code.body += Var(index,0,1).Assign(s.str());
189
190 Var(index).Assign( Var(inputs[0],0,c1->Dimensions()).Func(Var(index,0,1).S()+"->operator()"));
191}
192
193template <> shared_ptr<CoefficientFunction>
194cl_UnaryOpCF<GenericBSpline>::Diff(const CoefficientFunction * var,

Callers

nothing calls this directly

Calls 7

VarFunction · 0.85
AddPointerMethod · 0.80
FuncMethod · 0.80
DimensionsMethod · 0.80
SMethod · 0.80
getMethod · 0.45
AssignMethod · 0.45

Tested by

no test coverage detected