Visualizing Flows Between Parts

Next step: Visualizing a flow between parts. I have a fairly simple model of a car. It has a drivetrain which in turn has an engine, an alternator, and a battery. The engine in turn has a crankshaft. My model attempts to show a flow of torque from the crankshaft to the alternator and a flow of electricity from the alternator to the battery. I am expecting something like the first example in Table 14 of the standard, but with two flows between three parts.

The text syntax shows no problems in Syside Modeler.

Using the context menu to visualize the view in Tom Sawyer, I can see the ports with arrows in and out, but no connections.

Using to new viz visualizer, I get a nice looking flow, but only one, not two. Also no ports.

Have I missed something? Or is this simply the limit of development of Tom Sawyer and viz?

Car.sysml (886 Bytes)

Hi David,

out Torque; doesn’t declare a feature typed by your Torque item def, it declares a new untyped feature named Torque. Syside can show you this directly: with inlay hints on, the line displays as out ref Torque :> things; which has no relation to your item def at all. What you want is:

part Crankshaft {
    out item torqueOut : Torque;
}

Second, flow ends should be the directed features, not the parts. The grammar treats the last segment of each end as the output/input feature, so from Engine.Crankshaft to Alternator claims Crankshaft is an output feature of Engine. The Table 14 of yours does this too: flow action1.item1 to action2.item1;. So:

flow of Torque      from Engine.Crankshaft.torqueOut to Alternator.torqueIn;
flow of Electricity from Alternator.electricityOut   to Battery.electricityIn;

Beyond that, you did find a bug: flows whose ends cross a nesting level (like Engine.Crankshaft.torqueOut) aren’t drawn correctly. It’s filed and will be fixed in a forthcoming version. Thanks for the clean example!

When a diagram surprises you, check the hover/inlay hints on the suspicious declaration first; the resolved form distinguishes “the model doesn’t say what I meant” from “the tool can’t draw it” in seconds. For the language side, the flows chapter of The SysML v2 Book: Practical Insights and Comprehensive Reference (Weilkiens & Molnár) and spec §7.16 are the references we lean on; more in this reading list.

Adam Layne, PhD

Car.sysml (991 Bytes)

Adam,

Thanks for the guidance. Of course, I am working of both the standard and the Weilkiens/Molnar book. However, the sections in question are not very readable for normal engineers.

(Which is exactly why the Asatte Press team is testing step-by-step to identify easier to understand examples).

I implemented exactly as you suggested … with interesting results:

Tom Sawyer got better. Layout is a bit awkward, but at least the connections are correct. This is from right-clicking on the view in SysIDE modeler and selecting visualize view.

Sensmetry’s in-house render went backward - no connections shown at all:


This was generated with this command:

syside viz view Car.sysml --output-dir diagrams

CATIA nailed it perfectly. Albeit after regenerating the diagram in the tool. None of the diagram-first tools seem to be able to import views at all.

Thanks!

David Hetherington

More news… Just rendering the model (not the interconnection view) in viz produces a correct result.

Using this command:

syside viz element Car.sysml --name “CarTestModel::Car” -o Car.svg

I get this result (which is very nice):slight_smile:

Happy that you got an acceptable diagram using viz. I’m keeping an eye on the bugfix progress as well.