modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
481 stars 169 forks source link

Improve inheritance of classes in MultiBody #3739

Open tobolar opened 3 years ago

tobolar commented 3 years ago

The inheritance of classes is not done consequently. See for example #3737 or https://github.com/modelica/ModelicaStandardLibrary/issues/2171#issuecomment-280661422

beutlich commented 3 years ago

The inheritance of classes is not done consequently. See for example #3737 or #2171 (comment)

Or also https://github.com/modelica/ModelicaStandardLibrary/pull/3725#issuecomment-762969249

tobolar commented 3 years ago

Or also https://github.com/modelica/ModelicaStandardLibrary/pull/3725#issuecomment-762969249

I would proceed with Constraints once #3725 is merged.

tobolar commented 3 years ago

I have started to apply the inheritance properly but see currently two problems.

  1. I really stumble on the usage of cardinality in the MultiBody classes. It is generally used in base classes such as Interfaces.PartialOneFrame_b but not in the classes which could inherit it, e.g. Parts.Fixed. Moreover, the cardinality is deprecated and even if #1410 gets some solution, it is obviously yet not resolved. So we can

    1. Wait untill #1410 is solved or
    2. Implement a "half" solution for classes only where cardinality is used already.
  2. The connector's description in the particular classes is moslty more specific compared to a base class. E.g. frame_b in Parts.Fixed is sayed to be "Coordinate system fixed in the world frame", but it is "Coordinate system fixed to the component with one cut-force and cut-torque" in Interfaces.PartialOneFrame_b. Any possibility to retain the more precise text?

beutlich commented 3 years ago

It should (?) be egal Modelica to overwrite the description in the extends statement, see for example

model M "Extend from PartialTwoFrames, but set other frame descriptions"
  extends Modelica.Mechanics.MultiBody.Interfaces.PartialTwoFrames(
    frame_a "This is frame A ...",
    frame_b "... and this is frame B");
end M;
christiankral commented 3 years ago

This is somehow related with #2455

tobolar commented 3 years ago

It should (?) be egal Modelica to overwrite the description in the extends statement...

@beutlich Thanks, I will use this.

TManikantan commented 1 year ago

@tobolar Hi!!! ,I recently assumed the responsibility of project deputy. Did you happen to fix the issue? would you please commit the fix,. We can get it reviewed and merge it.

tobolar commented 1 year ago

I started this a long time ago but let it be due to lack of time. Will try to recall.