Open matekelemen opened 2 weeks ago
Do you think that we can generalize the original Table accessor
to include your case? @RiccardoRossi
Hi, i am not sure about how to achieve this without inducing a performance penalty...
@matekelemen how would you achieve that?
Hi, i am not sure about how to achieve this without inducing a performance penalty...
@matekelemen how would you achieve that?
to answer myself, maybe we could template it in a "option" to be either get_value or get_derivative
Hi, i am not sure about how to achieve this without inducing a performance penalty... @matekelemen how would you achieve that?
to answer myself, maybe we could template it in a "option" to be either get_value or get_derivative
like
template <SizeType DerivativeOrder = 0>
GetValue()
{
if constexpr (DerivativeOrder == 0) {
return table.GetValue();
} else if constexpr (DerivativeOrder == 1)
return table.GetFirstDerivative();
}
(disregard notation errors, just to get the point) ?
Hi, i am not sure about how to achieve this without inducing a performance penalty... @matekelemen how would you achieve that?
to answer myself, maybe we could template it in a "option" to be either get_value or get_derivative
like
template <SizeType DerivativeOrder = 0> GetValue() { if constexpr (DerivativeOrder == 0) { return table.GetValue(); } else if constexpr (DerivativeOrder == 1) return table.GetFirstDerivative(); }
(disregard notation errors, just to get the point) ?
This will result in different GetValue
methods when exporting to Python.
Hi, i am not sure about how to achieve this without inducing a performance penalty... @matekelemen how would you achieve that?
to answer myself, maybe we could template it in a "option" to be either get_value or get_derivative
like
template <SizeType DerivativeOrder = 0> GetValue() { if constexpr (DerivativeOrder == 0) { return table.GetValue(); } else if constexpr (DerivativeOrder == 1) return table.GetFirstDerivative(); }
(disregard notation errors, just to get the point) ?
This will result in different
GetValue
methods when exporting to Python.
yes indeed
Looks ok to me
El lun, 24 jun 2024, 14:40, Alejandro Cornejo @.***> escribió:
Hi, i am not sure about how to achieve this without inducing a performance penalty... @matekelemen https://github.com/matekelemen how would you achieve that?
to answer myself, maybe we could template it in a "option" to be either get_value or get_derivative
like
template
GetValue() { if constexpr (DerivativeOrder == 0) { return table.GetValue(); } else if constexpr (DerivativeOrder == 1) return table.GetFirstDerivative(); } (disregard notation errors, just to get the point) ?
This will result in different GetValue methods when exporting to Python.
yes indeed
— Reply to this email directly, view it on GitHub https://github.com/KratosMultiphysics/Kratos/pull/12472#issuecomment-2186485529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5PWENOYTAVY2C3NIZ5NJTZJAHSDAVCNFSM6AAAAABJTOMCXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBWGQ4DKNJSHE . You are receiving this because you were mentioned.Message ID: @.***>
Add an
Accessor
that fetches the derivatives from a table instead of the values. Example use case is getting stiffnesses from a displacement-force table.