Salome HOME
projects
/
tools
/
medcoupling.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add test for .mesh file format
[tools/medcoupling.git]
/
src
/
MEDLoader
/
MEDFileField.cxx
diff --git
a/src/MEDLoader/MEDFileField.cxx
b/src/MEDLoader/MEDFileField.cxx
index 17b42cf447131108946f61fe584076e9caf23266..3993ff9197e9184ecfb267205bd31f217b20f3c7 100644
(file)
--- a/
src/MEDLoader/MEDFileField.cxx
+++ b/
src/MEDLoader/MEDFileField.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-202
1 CEA/DEN, EDF R&D
+// Copyright (C) 2007-202
4 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-1092,7
+1092,12
@@
void MEDFileFields::aggregateFieldsOnSameMeshes(MEDFileMeshes *ms)
{
if(!ms)
THROW_IK_EXCEPTION("MEDFileFields::aggregateFieldsOnSameMeshes : ms is nullptr !");
{
if(!ms)
THROW_IK_EXCEPTION("MEDFileFields::aggregateFieldsOnSameMeshes : ms is nullptr !");
- MCAuto<MEDFileFields> mfs(MEDFileFields::New());
+ //
+ std::vector<std::string> msNames(ms->getMeshesNames());
+ std::set<std::string> msNamesSet(msNames.begin(),msNames.end());
+ if(msNames.size() == msNamesSet.size())
+ return ;
+ //
std::map<std::string,std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA>> > fsByName;
for(auto fmts : _fields)
{
std::map<std::string,std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA>> > fsByName;
for(auto fmts : _fields)
{
@@
-1186,7
+1191,7
@@
void MEDFileFields::aggregateFieldsOnSameMeshes(MEDFileMeshes *ms)
gg->setCoords(coo);
otherMeshes.push_back(DynamicCast<MEDFileUMesh,MEDFileMesh>(gg));
}
gg->setCoords(coo);
otherMeshes.push_back(DynamicCast<MEDFileUMesh,MEDFileMesh>(gg));
}
- //
+ //
until this point nothing has changed in \a this nor in \a ms as if a const method.
ms->resize(0);
for(auto mesh : otherMeshes)
ms->pushMesh(mesh);
ms->resize(0);
for(auto mesh : otherMeshes)
ms->pushMesh(mesh);