ICape Thermo Material ContextSet Material Method
Definition
Assembly: CapeOpen (in CapeOpen.dll) Version: 1.0.0.0 (1.0.0.0)
[DispIdAttribute(1)]
void SetMaterial(
Object material
)<DispIdAttribute(1)>
Sub SetMaterial (
material As Object
)Parameters
- material Object
Remarks
The SetMaterial method allows a Thermodynamic and Physical Properties component, such as a Property Package, to be given the ICapeThermoMaterial interface of a Material Object. This interface gives the component access to the description of the Material for which Property Calculations or Equilibrium Calculations are required. The component can access property values directly using this interface. A client can also use the ICapeThermoMaterial interface to query a Material Object for its ICapeThermoCompounds and ICapeThermoPhases interfaces, which provide access to Compound and Phase information, respectively.
It is envisaged that the SetMaterial method will be used to check that the Material Interface supplied is valid and useable. For example, a Property Package may check that there are some Compounds in a Material Object and that those Compounds can be identified by the Property Package. In addition a Property Package may perform any initialisation that depends on the configuration of a Material Object. A Property Calculator component might typically use this method to query the Material Object for any required information concerning the Compounds.
Calling the UnsetMaterial method of the ICapeThermoMaterialContext interface has the effect of removing the interface set by the SetMaterial method.
Exceptions
| ECapeNoImpl | The operation is “not” implemented even if this method can be called for reasons of compatibility with the CAPE-OPEN standards. That is to say that the operation exists, but it is not supported by the current implementation. |
| ECapeInvalidArgument | The input argument is not a valid CapeInterface. |
| ECapeFailedInitialisation | The pre-requisites for the property calculation are not valid. For example: • There are no Compounds in the object that implements the ICapeThermoMaterial interface. • The Compounds cannot be identified by the client (e.g. a Property Package). This case is a possibility if the way a Material Object has been configured by a PME is not consistent with the Property Package being used. |
| ECapeUnknown | The error to be raised when other error(s), specified for the operation, are not suitable. |