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

Function MakeCoefficients

fem/python_fem.cpp:79–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 }
78
79 Array<shared_ptr<CoefficientFunction>> MakeCoefficients (py::object py_coef)
80 {
81 Array<shared_ptr<CoefficientFunction>> tmp;
82 if (py::isinstance<py::list>(py_coef))
83 {
84 auto l = py_coef.cast<py::list>();
85 for (int i = 0; i < py::len(l); i++)
86 tmp += MakeCoefficient(l[i]);
87 }
88 else if (py::isinstance<py::tuple>(py_coef))
89 {
90 auto l = py_coef.cast<py::tuple>();
91 for (int i = 0; i < py::len(l); i++)
92 tmp += MakeCoefficient(l[i]);
93 }
94 else
95 tmp += MakeCoefficient(py_coef);
96
97 return tmp;
98 }
99}
100
101struct PythonCoefficientFunction : public CoefficientFunction {

Callers 1

Calls 1

MakeCoefficientFunction · 0.85

Tested by

no test coverage detected