'partial'

partial

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Prohibit instantiation of components of the class

Examples

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;

Syntax

See section on class_definition in the Modelica Grammar.

Description

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.