Salome HOME
Copyright update 2022
[modules/med.git] / src / MEDCalc / cmp / MEDCalculator_i.cxx
index d81d2a3e5d1eb051a9eb3412b3496d16b792b4a9..832ef7471af25a9fc4d2a90f75aea1e6b2bf740d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2022  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
@@ -59,13 +59,13 @@ MEDCalculator_i::~MEDCalculator_i()
 MEDCALC::FieldHandler * MEDCalculator_i::add(const MEDCALC::FieldHandler & f1_hdl,
              const MEDCALC::FieldHandler & f2_hdl)
 {
-  // We first check that both operandes share the same mesh id. Note
+  // We first check that both operands share the same mesh id. Note
   // that it's not strictly required because the MEDCoupling operation
   // would raise an exception if the fields does not share the same
   // mesh support.
   if ( f1_hdl.meshid != f2_hdl.meshid ) {
     std::string message =
-      std::string("ERROR: Mesh ids are different for the field operandes ") +
+      std::string("ERROR: Mesh ids are different for the field operands ") +
       std::string(f1_hdl.fieldname) + std::string(" and ") + std::string(f2_hdl.fieldname);
     throw KERNEL::createSalomeException(message.c_str());
   }
@@ -103,7 +103,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::add(const MEDCALC::FieldHandler & f1_hd
 
   // >>>>>>>>>
   // _GBO_ We should test here if the iteration and order of the input
-  // files are identical for both operandes. A convention has to be
+  // files are identical for both operands. A convention has to be
   // defined here. By default, we let the iteration and order be
   // determined by the resulting MEDCouplingFieldDouble instance (see
   // function addField of the data manager).
@@ -126,7 +126,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::sub(const MEDCALC::FieldHandler & f1_hd
 {
   if ( f1_hdl.meshid != f2_hdl.meshid ) {
     std::string message =
-      std::string("ERROR: Mesh ids are different for the field operandes ") +
+      std::string("ERROR: Mesh ids are different for the field operands ") +
       std::string(f1_hdl.fieldname) + std::string(" and ") + std::string(f2_hdl.fieldname);
     throw KERNEL::createSalomeException(message.c_str());
   }
@@ -165,7 +165,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::mul(const MEDCALC::FieldHandler & f1_hd
 {
   if ( f1_hdl.meshid != f2_hdl.meshid ) {
     std::string message =
-      std::string("ERROR: Mesh ids are different for the field operandes ") +
+      std::string("ERROR: Mesh ids are different for the field operands ") +
       std::string(f1_hdl.fieldname) + std::string(" and ") + std::string(f2_hdl.fieldname);
     throw KERNEL::createSalomeException(message.c_str());
   }
@@ -203,7 +203,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::div(const MEDCALC::FieldHandler & f1_hd
 {
   if ( f1_hdl.meshid != f2_hdl.meshid ) {
     std::string message =
-      std::string("ERROR: Mesh ids are different for the field operandes ") +
+      std::string("ERROR: Mesh ids are different for the field operands ") +
       std::string(f1_hdl.fieldname) + std::string(" and ") + std::string(f2_hdl.fieldname);
     throw KERNEL::createSalomeException(message.c_str());
   }
@@ -247,7 +247,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::pow(const MEDCALC::FieldHandler & f_hdl
   MEDCouplingFieldDouble* field_result;
   try {
     field_result = field->clone(true);
-    string functionToApply = "u^"+ToString(power);
+    std::string functionToApply = "u^"+ToString(power);
     field_result->applyFunc(functionToApply.c_str());
   }
   catch (INTERP_KERNEL::Exception &ex) {
@@ -255,7 +255,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::pow(const MEDCALC::FieldHandler & f_hdl
   }
 
   // Set the name (the default is the same as the original field)
-  string name(field_result->getName());
+  std::string name(field_result->getName());
   name.append("^");
   name.append(ToString(power));
   field_result->setName(name.c_str());
@@ -286,7 +286,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::lin(const MEDCALC::FieldHandler & f_hdl
   MEDCouplingFieldDouble* field_result;
   try {
     field_result = field->clone(true);
-    string functionToApply = "u*"+ToString(factor)+"+"+ToString(offset);
+    std::string functionToApply = "u*"+ToString(factor)+"+"+ToString(offset);
     field_result->applyFunc(functionToApply.c_str());
   }
   catch (INTERP_KERNEL::Exception &ex) {
@@ -294,7 +294,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::lin(const MEDCALC::FieldHandler & f_hdl
   }
 
   // Set the name (the default is the same as the original field)
-  string name = string("lin(");
+  std::string name = std::string("lin(");
   name.append(field->getName());
   name.append(",factor=");
   name.append(ToString(factor));
@@ -333,7 +333,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::dup(const MEDCALC::FieldHandler & f_hdl
   }
 
   // Set the name (the default is the same as the original field)
-  string name = string("dup(");
+  std::string name = std::string("dup(");
   name.append(field->getName());
   name.append(")");
   field_result->setName(name.c_str());
@@ -347,7 +347,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::dup(const MEDCALC::FieldHandler & f_hdl
 /*!
  * This creates a new field by applying a function on the specified
  * field. The function is defined by a string of characters
- * (function), that specifies the litteral equation to apply, and an
+ * (function), that specifies the literal equation to apply, and an
  * integer (nbcomponents), that specifies the number of components to
  * consider in the resulting field. This is to mimic the interface of
  * MEDCouplingFieldDouble::applyFunc.
@@ -365,7 +365,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::fct(const MEDCALC::FieldHandler & f_hdl
   try {
     field_result = field->clone(true);
     if ( (nbResComponents == MEDCALC::NBCOMP_DEFAULT ) ||
-   (nbResComponents < 1) || (nbResComponents > field_result->getNumberOfComponents()) ) {
+        (nbResComponents < 1) || (nbResComponents > (int)field_result->getNumberOfComponents()) ) {
       field_result->applyFunc(function);
     }
     else {
@@ -376,7 +376,7 @@ MEDCALC::FieldHandler * MEDCalculator_i::fct(const MEDCALC::FieldHandler & f_hdl
     throw KERNEL::createSalomeException(ex.what());
   }
 
-  string name = string("fct("); name.append(field->getName());
+  std::string name = std::string("fct("); name.append(field->getName());
   name.append(",\""); name.append(function);
   name.append(",\""); name.append(ToString(nbResComponents)); name.append("\")");
   field_result->setName(name.c_str());