1 // Copyright (C) 2005 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef __CALCULATOR_GEN__
20 #define __CALCULATOR_GEN__
22 \defgroup EXAMPLES SALOME EXAMPLES components
25 #include "SALOME_Component.idl"
26 #include "SALOME_Exception.idl"
32 This package contains the interface CALCULATOR_ORB used
33 for %CALCULATOR component as an example in %SALOME application.
38 Enumeration ErrorCode contains a code of the error
40 typedef long ErrorCode;
41 const ErrorCode NO_ERROR = 0;
42 const ErrorCode NOT_COMPATIBLE = 1;
43 const ErrorCode EXCEPTION_RAISED = 2;
44 const ErrorCode INVALID_FIELD = 3;
47 /*! \brief Interface of the %CALCULATOR component
49 interface CALCULATOR_Gen : Engines::Component
52 Calculate the maximum relative difference of field with the previous one.
53 At first call, store passed field and return 1.
55 double convergenceCriteria(in SALOME_MED::FIELDDOUBLE field);
57 Apply to each (scalar) field component the linear function x -> ax+b.
58 Release field1 after use.
60 SALOME_MED::FIELDDOUBLE applyLin(in SALOME_MED::FIELDDOUBLE field1, in double a1, in double a2);
64 Release field1 and field2 after use.
66 SALOME_MED::FIELDDOUBLE add(in SALOME_MED::FIELDDOUBLE field1, in SALOME_MED::FIELDDOUBLE field2);
69 return euclidian norm of field
70 Release field after use.
72 double norm2(in SALOME_MED::FIELDDOUBLE field);
75 return L2 norm of field
76 Release field after use.
78 double normL2(in SALOME_MED::FIELDDOUBLE field);
81 return L1 norm of field
82 Release field after use.
84 double normL1(in SALOME_MED::FIELDDOUBLE field);
87 return max norm of field
88 Release field after use.
90 double normMax(in SALOME_MED::FIELDDOUBLE field);
93 This utility method print in standard output the coordinates & field values
94 Release field after use.
96 void printField(in SALOME_MED::FIELDDOUBLE field);
99 This method clones field in four examples.
100 Release field after use.
102 void cloneField(in SALOME_MED::FIELDDOUBLE field, out SALOME_MED::FIELDDOUBLE clone1,
103 out SALOME_MED::FIELDDOUBLE clone2, out SALOME_MED::FIELDDOUBLE clone3,
104 out SALOME_MED::FIELDDOUBLE clone4 );
107 This method returns True if the operation succeded.
108 Otherwise returns False.
113 This method return an error code
115 ErrorCode getErrorCode();