-// Copyright (C) 2009-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2016 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.
+// 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
int Law::last_law_id = 0;
// ================================================== Constructeur
-Law::Law (cpchar name, int nbnodes)
+Law::Law (Document* dad, cpchar name, int nbnodes) : EltBase (dad, EL_LAW)
{
nbr_nodes = nbnodes;
law_id = last_law_id++;
if (!_nom.empty())
law_name = _nom;
else {
- char buffer [16];
- sprintf (buffer, "l%04d", law_id);
- law_name = std::string(buffer);
+ char buffer [16];
+ sprintf (buffer, "l%04d", law_id);
+ law_name = std::string(buffer);
}
law_type = Uniform;
law_coefficient = 0.0;
}
+
// ================================================== Constructeur 2
Law::Law (Law* other)
{
law_name = other->law_name ;
law_type = other->law_type ;
law_coefficient = other->law_coefficient;
+ el_root = other->el_root;
+}
+
+// ========================================================= getNextName
+char* Law::getNextName (pchar buffer)
+{
+ sprintf (buffer, "l%04d", last_law_id);
+ return buffer;
}
END_NAMESPACE_HEXA