Prohibit instantiation of components of the class
partial block PartialBlock input Real u; output Real y; protected Real x; equation x = y; end PartialBlock; block Integrator extends PartialBlock; equation der(x) = u; end Integrator; block Gain extends PartialBlock; parameter k = 1; equation x = k*u; end Gain; model Composition PartialBlock block1; // Illegal Integrator block2; // Legal Gain block3; // Legal end Composition;
See section on class_definition
in the Modelica
Grammar.
The keyword partial defines that a class is incomplete and that it cannot be instantiated. For example, defining
PartialBlock block1;
is illegal. A partial class can only be used in an "extends" clause to inherit from it or in a "constrainedby" clause to define the constraints of a replaceable class.