Salome HOME
Now some libraries of MEDOP can be build without GUI
[modules/med.git] / src / MEDOP / cmp / MEDCalculator_i.cxx
index 94ad60240b3e77f6ef9ee923ddf484847d8f61b0..952dbd8ee2519f4a8e2934cc9d1e88dad9851fb9 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2011-2014  CEA/DEN, EDF R&D
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // Authors : Guillaume Boulant (EDF) - 01/06/2011
 
 #include "MEDCalculator_i.hxx"
@@ -56,7 +57,7 @@ MEDCalculator_i::~MEDCalculator_i()
  * MEDDataManager.
  */
 MEDOP::FieldHandler * MEDCalculator_i::add(const MEDOP::FieldHandler & f1_hdl,
-                                          const MEDOP::FieldHandler & f2_hdl)
+             const MEDOP::FieldHandler & f2_hdl)
 {
   // We first check that both operandes share the same mesh id. Note
   // that it's not strictly required because the MEDCoupling operation
@@ -98,7 +99,7 @@ MEDOP::FieldHandler * MEDCalculator_i::add(const MEDOP::FieldHandler & f1_hdl,
   //
   long meshHandlerId = f1_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   
   // >>>>>>>>>
   // _GBO_ We should test here if the iteration and order of the input
@@ -121,7 +122,7 @@ MEDOP::FieldHandler * MEDCalculator_i::add(const MEDOP::FieldHandler & f1_hdl,
  * MEDDataManager.
  */
 MEDOP::FieldHandler * MEDCalculator_i::sub(const MEDOP::FieldHandler & f1_hdl,
-                                          const MEDOP::FieldHandler & f2_hdl)
+             const MEDOP::FieldHandler & f2_hdl)
 {
   if ( f1_hdl.meshid != f2_hdl.meshid ) {
     std::string message = 
@@ -146,7 +147,7 @@ MEDOP::FieldHandler * MEDCalculator_i::sub(const MEDOP::FieldHandler & f1_hdl,
 
   long meshHandlerId = f1_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   return fieldResultHandler;
 }
 
@@ -160,7 +161,7 @@ MEDOP::FieldHandler * MEDCalculator_i::sub(const MEDOP::FieldHandler & f1_hdl,
  * MEDDataManager.
  */
 MEDOP::FieldHandler * MEDCalculator_i::mul(const MEDOP::FieldHandler & f1_hdl,
-                                          const MEDOP::FieldHandler & f2_hdl)
+             const MEDOP::FieldHandler & f2_hdl)
 {
   if ( f1_hdl.meshid != f2_hdl.meshid ) {
     std::string message = 
@@ -184,7 +185,7 @@ MEDOP::FieldHandler * MEDCalculator_i::mul(const MEDOP::FieldHandler & f1_hdl,
 
   long meshHandlerId = f1_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   return fieldResultHandler;
 }
 
@@ -198,7 +199,7 @@ MEDOP::FieldHandler * MEDCalculator_i::mul(const MEDOP::FieldHandler & f1_hdl,
  * MEDDataManager.
  */
 MEDOP::FieldHandler * MEDCalculator_i::div(const MEDOP::FieldHandler & f1_hdl,
-                                          const MEDOP::FieldHandler & f2_hdl)
+             const MEDOP::FieldHandler & f2_hdl)
 {
   if ( f1_hdl.meshid != f2_hdl.meshid ) {
     std::string message = 
@@ -223,7 +224,7 @@ MEDOP::FieldHandler * MEDCalculator_i::div(const MEDOP::FieldHandler & f1_hdl,
 
   long meshHandlerId = f1_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   return fieldResultHandler;
 }
 
@@ -261,7 +262,7 @@ MEDOP::FieldHandler * MEDCalculator_i::pow(const MEDOP::FieldHandler & f_hdl, CO
 
   long meshHandlerId = f_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   return fieldResultHandler;
 }
 
@@ -304,7 +305,7 @@ MEDOP::FieldHandler * MEDCalculator_i::lin(const MEDOP::FieldHandler & f_hdl, do
 
   long meshHandlerId = f_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   return fieldResultHandler;
 
 }
@@ -339,7 +340,7 @@ MEDOP::FieldHandler * MEDCalculator_i::dup(const MEDOP::FieldHandler & f_hdl)
 
   long meshHandlerId = f_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   return fieldResultHandler;
 }
 
@@ -355,7 +356,7 @@ MEDOP::FieldHandler * MEDCalculator_i::dup(const MEDOP::FieldHandler & f_hdl)
  * apply on the whole field (as if specified N=numberOfComponents).
  */
 MEDOP::FieldHandler * MEDCalculator_i::fct(const MEDOP::FieldHandler & f_hdl,
-                                          const char * function, CORBA::Long nbResComponents)
+             const char * function, CORBA::Long nbResComponents)
 {
   MEDCouplingFieldDouble* field = _medDataManager->getFieldDouble(&f_hdl);
 
@@ -364,7 +365,7 @@ MEDOP::FieldHandler * MEDCalculator_i::fct(const MEDOP::FieldHandler & f_hdl,
   try {
     field_result = field->clone(true);
     if ( (nbResComponents == MEDOP::NBCOMP_DEFAULT ) ||
-        (nbResComponents < 1) || (nbResComponents > field_result->getNumberOfComponents()) ) {
+   (nbResComponents < 1) || (nbResComponents > field_result->getNumberOfComponents()) ) {
       field_result->applyFunc(function);
     }
     else {
@@ -382,6 +383,6 @@ MEDOP::FieldHandler * MEDCalculator_i::fct(const MEDOP::FieldHandler & f_hdl,
 
   long meshHandlerId = f_hdl.meshid;
   MEDOP::FieldHandler * fieldResultHandler = _medDataManager->addField(field_result,
-                                                                      meshHandlerId);
+                       meshHandlerId);
   return fieldResultHandler;
 }