-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015 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
#endif
#ifdef HAS_XDR
+#include <rpc/types.h>
#include <rpc/xdr.h>
#endif
using namespace SauvUtilities;
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
namespace
{
*/
struct TCellByIDCompare
{
- bool operator () (const Cell* i1, const Cell* i2)
+ bool operator () (const Cell* i1, const Cell* i2) const
{
return i1->_number < i2->_number;
}
//================================================================================
/*!
- * \brief Makes ParaMEDMEM::MEDFileData from self
+ * \brief Makes MEDCoupling::MEDFileData from self
*/
//================================================================================
-ParaMEDMEM::MEDFileData* IntermediateMED::convertInMEDFileDS()
+MEDCoupling::MEDFileData* IntermediateMED::convertInMEDFileDS()
{
- MEDCouplingAutoRefCountObjectPtr< MEDFileUMesh > mesh = makeMEDFileMesh();
- MEDCouplingAutoRefCountObjectPtr< MEDFileFields > fields = makeMEDFileFields(mesh);
+ MCAuto< MEDFileUMesh > mesh = makeMEDFileMesh();
+ MCAuto< MEDFileFields > fields = makeMEDFileFields(mesh);
- MEDCouplingAutoRefCountObjectPtr< MEDFileMeshes > meshes = MEDFileMeshes::New();
- MEDCouplingAutoRefCountObjectPtr< MEDFileData > medData = MEDFileData::New();
+ MCAuto< MEDFileMeshes > meshes = MEDFileMeshes::New();
+ MCAuto< MEDFileData > medData = MEDFileData::New();
meshes->pushMesh( mesh );
medData->setMeshes( meshes );
if ( fields ) medData->setFields( fields );
//================================================================================
/*!
- * \brief Creates ParaMEDMEM::MEDFileUMesh from its data
+ * \brief Creates MEDCoupling::MEDFileUMesh from its data
*/
//================================================================================
-ParaMEDMEM::MEDFileUMesh* IntermediateMED::makeMEDFileMesh()
+MEDCoupling::MEDFileUMesh* IntermediateMED::makeMEDFileMesh()
{
// check if all needed piles are present
checkDataAvailability();
*/
//================================================================================
-ParaMEDMEM::DataArrayDouble * IntermediateMED::getCoords()
+MEDCoupling::DataArrayDouble * IntermediateMED::getCoords()
{
DataArrayDouble* coordArray = DataArrayDouble::New();
coordArray->alloc( _nbNodes, _spaceDim );
*/
//================================================================================
-void IntermediateMED::setConnectivity( ParaMEDMEM::MEDFileUMesh* mesh,
- ParaMEDMEM::DataArrayDouble* coords )
+void IntermediateMED::setConnectivity( MEDCoupling::MEDFileUMesh* mesh,
+ MEDCoupling::DataArrayDouble* coords )
{
int meshDim = 0;
*/
//================================================================================
-void IntermediateMED::setGroups( ParaMEDMEM::MEDFileUMesh* mesh )
+void IntermediateMED::setGroups( MEDCoupling::MEDFileUMesh* mesh )
{
bool isMeshNameSet = false;
const int meshDim = mesh->getMeshDimension();
const int meshDimRelToMaxExt = ( dim == 0 ? 1 : dim - meshDim );
std::vector<const DataArrayInt *> medGroups;
- std::vector<MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > refGroups;
+ std::vector<MCAuto<DataArrayInt> > refGroups;
for ( size_t i = 0; i < _groups.size(); ++i )
{
Group& grp = _groups[i];
// Issue 0021311. Use case: a gibi group has references (recorded in pile 1)
// and several names (pile 27) refer (pile 10) to this group.
// We create a copy of this group per each named reference
+ std::set<std::string> uniqueNames;
+ uniqueNames.insert( grp._name );
for ( unsigned iRef = 0 ; iRef < grp._refNames.size(); ++iRef )
- if ( !grp._refNames[ iRef ].empty() )
+ if ( !grp._refNames[ iRef ].empty() &&
+ uniqueNames.insert( grp._refNames[ iRef ]).second ) // for name uniqueness (23155)
{
- refGroups.push_back( grp._medGroup->deepCpy() );
+ refGroups.push_back( grp._medGroup->deepCopy() );
refGroups.back()->setName( grp._refNames[ iRef ].c_str() );
medGroups.push_back( refGroups.back() );
}
*/
//================================================================================
-ParaMEDMEM::MEDFileFields * IntermediateMED::makeMEDFileFields(ParaMEDMEM::MEDFileUMesh* mesh)
+MEDCoupling::MEDFileFields * IntermediateMED::makeMEDFileFields(MEDCoupling::MEDFileUMesh* mesh)
{
if ( _nodeFields.empty() && _cellFields.empty() ) return 0;
//================================================================================
void IntermediateMED::setFields( SauvUtilities::DoubleField* fld,
- ParaMEDMEM::MEDFileFields* medFields,
- ParaMEDMEM::MEDFileUMesh* mesh,
+ MEDCoupling::MEDFileFields* medFields,
+ MEDCoupling::MEDFileUMesh* mesh,
const TID castemID,
std::set< std::string >& usedFieldNames)
{
//================================================================================
void IntermediateMED::setTS( SauvUtilities::DoubleField* fld,
- ParaMEDMEM::DataArrayDouble* values,
- ParaMEDMEM::MEDFileFields* medFields,
- ParaMEDMEM::MEDFileUMesh* mesh,
+ MEDCoupling::DataArrayDouble* values,
+ MEDCoupling::MEDFileFields* medFields,
+ MEDCoupling::MEDFileUMesh* mesh,
const int iSub)
{
// treat a field support
// set the mesh
if ( onAll )
{
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
< MEDCouplingUMesh > dimMesh = mesh->getMeshAtLevel( dimRel );
timeStamp->setMesh( dimMesh );
}
- else if ( timeStamp->getTypeOfField() == ParaMEDMEM::ON_NODES )
+ else if ( timeStamp->getTypeOfField() == MEDCoupling::ON_NODES )
{
DataArrayDouble * coo = mesh->getCoords();
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
<DataArrayDouble> subCoo = coo->selectByTupleId(support->_medGroup->begin(),
support->_medGroup->end());
- MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh > nodeSubMesh =
+ MCAuto< MEDCouplingUMesh > nodeSubMesh =
MEDCouplingUMesh::Build0DMeshFromCoords( subCoo );
timeStamp->setMesh( nodeSubMesh );
}
else
{
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
< MEDCouplingUMesh > dimMesh = mesh->getMeshAtLevel( dimRel );
- MEDCouplingAutoRefCountObjectPtr
+ MCAuto
<MEDCouplingMesh> subMesh = dimMesh->buildPart(support->_medGroup->begin(),
support->_medGroup->end());
timeStamp->setMesh( subMesh);
timeStamp->setArray( values );
values->decrRef();
// set gauss points
- if ( timeStamp->getTypeOfField() == ParaMEDMEM::ON_GAUSS_PT )
+ if ( timeStamp->getTypeOfField() == MEDCoupling::ON_GAUSS_PT )
{
TGaussDef gaussDef( fld->_sub[iSub]._support->_cellType,
fld->_sub[iSub].nbGauss() );
timeStamp->setOrder( nbTS );
// add the time-stamp
- timeStamp->checkCoherency();
+ timeStamp->checkConsistencyLight();
if ( onAll )
fld->_curMedField->appendFieldNoProfileSBT( timeStamp );
else
*/
//================================================================================
-ParaMEDMEM::TypeOfField DoubleField::getMedType( const int iSub ) const
+MEDCoupling::TypeOfField DoubleField::getMedType( const int iSub ) const
{
using namespace INTERP_KERNEL;
*/
//================================================================================
-ParaMEDMEM::TypeOfTimeDiscretization DoubleField::getMedTimeDisc() const
+MEDCoupling::TypeOfTimeDiscretization DoubleField::getMedTimeDisc() const
{
return ONE_TIME;
// NO_TIME = 4,