The PassThrough Object

0 views
Skip to first unread message

WNien

unread,
Oct 23, 2007, 10:52:34 AM10/23/07
to thermodynamicslib
Hallo Evgenii,

in the guide, it is stated that PassThrough does nothing to the input
values. Since it does nothing, why can't I remove it from the file
minimum.mod? I tried to remove it but in the end I got an error
message "convert: id is not defined".

...
<compute>
<PassThrough class=algorithm id=pass></PassThrough>
<input name=n> n </input>
<output> n </output>
</compute>
<input name=xH2> xH2 </input>
<input name=xN2> xN2 </input>
<input name=n> n </input>
<output> all </output>
<convert name=xN2> xN2 </convert>
<convert name=xH2> xH2 </convert>
<convert name=xNH3> xNH3 </convert>
<convert name=G> G </convert>
<convert name=n> n </convert>
<convert name=G*n> G*n </convert>
</compute>

Best wishes,

Wee Nien

Evgenii Rudnyi

unread,
Oct 24, 2007, 2:58:16 PM10/24/07
to thermody...@googlegroups.com
Hello Wee Nien,

> in the guide, it is stated that PassThrough does nothing to the input
> values. Since it does nothing, why can't I remove it from the file
> minimum.mod?

This is because of the design. Probably it could be done better than
that but anyway.

The object compute contains an algorithm that in turn takes inputs
values and return output values. Usually an algorithm does something
with the input values. However, at some point I needed just to pass
input values to output without changes. So, I have developed an
algorithm PassThrough.

To understand this problem, look at the examples pass* at tdlib/ex/algo.
In the current version there is no other way to do it otherwise.

An object ComputeOutput must have a compute object that in turn must
have an algorithm. This is the rule.

Usually an algorithm does not pass the input values to outputs. So, when
you would like to have input vales as outputs and the algorithm does not
do it, PassThrough is the solution in this case.

I tried to remove it but in the end I got an error
> message "convert: id is not defined".

This what happens when this name is not available among outputs. And
when you remove PassThrough then this is what happens.

Best wishes,

Evgenii

Reply all
Reply to author
Forward
0 new messages