-// Copyright (C) 2011-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2011-2020 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
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) {
}
// 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());
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) {
}
// 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));
}
// 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());
/*!
* 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.
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 {
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());