MCPcopy Create free account
hub / github.com/KratosMultiphysics/Kratos / MakeNumpyArray

Function MakeNumpyArray

kratos/python/numpy_utils.h:78–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77template <class TDataType>
78pybind11::array_t<TDataType> MakeNumpyArray(
79 TDataType const* pBegin,
80 TDataType const* pEnd,
81 const std::vector<std::size_t>& rShape)
82{
83 auto array = AllocateNumpyArray<TDataType>(rShape);
84 KRATOS_ERROR_IF_NOT(std::distance(pBegin, pEnd) == array.size()) << "Size mismatch.";
85 std::copy(pBegin,
86 pEnd,
87 array.mutable_data());
88 return array;
89}
90
91template<class TDataType, class TPybindArrayType>
92bool AssignDataImpl(

Callers

nothing calls this directly

Calls 4

distanceFunction · 0.85
copyFunction · 0.50
sizeMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected