hi Alberto,

the problem is that chrono::fea::ChElasticityCosseratAdvancedGenericFPM::ChElasticityCosseratAdvancedGenericFPM( ... ) requires a ChMatrixNM, that is a fixed size 6x6 matrix built on stack, but most likely you are passing *ChMatrixDynamicD *, that is a dynamically-sized matrix on the heap. Even if this is a 6x6 matrix too, both are not interchangeable. At the moment there is no way to generate a ChMatrixNM< double,6,6 > in Python because Python does not support templating, sorry.

Alessandro

On 12/04/2023 12:24, Alberto Fernández wrote:
I'm trying to create a Cosserat beam in python using the full matrix with coupling terms. I think the call to the constructor is correct, but I get a type error

Call (Klaw is a  pychrono.ChMatrixDynamicD 6x6):
melasticity = fea.ChElasticityCosseratAdvancedGenericFPM(Klaw, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
Error:
TypeError: Wrong number ortypeof arguments foroverloaded function 'new_ChElasticityCosseratAdvancedGenericFPM'.
  Possible C/C++prototypes are:
    chrono::fea::ChElasticityCosseratAdvancedGenericFPM::ChElasticityCosseratAdvancedGenericFPM()     chrono::fea::ChElasticityCosseratAdvancedGenericFPM::ChElasticityCosseratAdvancedGenericFPM(chrono::ChMatrixNM< double,6,6> const,double const,double const,double const,double const,double const,double const)

I assume this is a problem with the call not being correctly defined in the python wrapper, but I don't know how to fix it. Is there other route that may work? I also tried instantiating ChElasticityCosseratAdvancedGenericFPMand then using SetEMatrix but no luck that way either.
Thank you for your time
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/61be7629-c3cc-4bff-a2e0-595e67cff81cn%40googlegroups.com <https://groups.google.com/d/msgid/projectchrono/61be7629-c3cc-4bff-a2e0-595e67cff81cn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/7474f8d0-4182-ed93-9bf1-3119ee010300%40unipr.it.

Reply via email to