From f185a905954451a93e3c6167fea088da4ce2dc55 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 19 Jun 2012 10:28:23 +0000 Subject: [PATCH] setName in MEDFileField* --- src/MEDLoader/MEDFileField.cxx | 11 +++++++++++ src/MEDLoader/MEDFileField.hxx | 2 ++ src/MEDLoader/MEDFileMesh.cxx | 5 ++--- src/MEDLoader/Swig/MEDLoader.i | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 8b8a2d85e..a13ad7ea0 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -2626,6 +2626,12 @@ std::string MEDFileField1TSWithoutDAS::getName() const return arr->getName(); } +void MEDFileField1TSWithoutDAS::setName(const char *name) +{ + DataArrayDouble *arr=getOrCreateAndGetArray(); + arr->setName(name); +} + void MEDFileField1TSWithoutDAS::simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const { std::string startOfLine(bkOffset,' '); @@ -3636,6 +3642,11 @@ std::string MEDFileFieldMultiTSWithoutDAS::getName() const return _name; } +void MEDFileFieldMultiTSWithoutDAS::setName(const char *name) +{ + _name=name; +} + void MEDFileFieldMultiTSWithoutDAS::simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const { std::string startLine(bkOffset,' '); diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index 24576d2e1..222591b84 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -381,6 +381,7 @@ namespace ParaMEDMEM double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; } void setTime(double val, int iteration, int order) { _dt=val; _iteration=iteration; _order=order; } std::string getName() const; + void setName(const char *name); void simpleRepr(int bkOffset, std::ostream& oss, int f1tsId) const; const std::string& getDtUnit() const { return _dt_unit; } std::string getMeshName() const throw(INTERP_KERNEL::Exception); @@ -492,6 +493,7 @@ namespace ParaMEDMEM std::vector< std::vector > getFieldSplitedByType2(int iteration, int order, const char *mname, std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const throw(INTERP_KERNEL::Exception); virtual void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception); std::string getName() const; + void setName(const char *name); void simpleRepr(int bkOffset, std::ostream& oss, int fmtsId) const; std::vector< std::pair > getTimeSteps(std::vector& ret1) const throw(INTERP_KERNEL::Exception); std::string getMeshName() const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index d0a2f2937..1e4726bfc 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -2047,10 +2047,9 @@ void MEDFileUMesh::duplicateNodesOnM1Group(const char *grpNameM1, DataArrayInt * newm1->setCoords(getCoords()); setMeshAtLevel(-1,newm1); setFamilyFieldArr(-1,newFam); - std::ostringstream famName; famName << "Family_" << idd; std::string grpName2(grpNameM1); grpName2+="_dup"; - addFamily(famName.str().c_str(),idd); - addFamilyOnGrp(grpName2.c_str(),famName.str().c_str()); + addFamily(grpName2.c_str(),idd); + addFamilyOnGrp(grpName2.c_str(),grpName2.c_str()); // fam=_fam_coords; if(fam) diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index 1aba14bb7..6fb38fc4d 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -756,6 +756,7 @@ namespace ParaMEDMEM int getIteration() const; int getOrder() const; std::string getName(); + void setName(const char *name); std::string getMeshName(); int getNumberOfComponents() const; bool isDealingTS(int iteration, int order) const; @@ -958,6 +959,7 @@ namespace ParaMEDMEM public: int getNumberOfTS() const; std::string getName() const; + void setName(const char *name); std::string getMeshName() const throw(INTERP_KERNEL::Exception); const std::vector& getInfo() const; %extend -- 2.39.2