-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MPIProcessorGroup.hxx"
#include "OverlapElementLocator.hxx"
#include "OverlapInterpolationMatrix.hxx"
-#include "ICoCoMEDField.hxx"
+#include "ICoCoMEDDoubleField.hxx"
namespace MEDCoupling
{
}
OverlapDEC::~OverlapDEC()
+ {
+ release();
+ }
+
+ /** Destructor involves MPI operations: make sure this is accessible from a proper
+ * method for Python wrapping.
+ */
+ void OverlapDEC::release()
{
if(_own_group)
- delete _group;
+ {
+ delete _group;
+ _group = nullptr;
+ }
if(_own_source_field)
- delete _source_field;
+ {
+ delete _source_field;
+ _source_field = nullptr;
+ }
if(_own_target_field)
- delete _target_field;
+ {
+ delete _target_field;
+ _target_field = nullptr;
+ }
delete _interpolation_matrix;
+ _interpolation_matrix = nullptr;
delete _locator;
+ _locator = nullptr;
if (_comm != MPI_COMM_NULL)
{
MEDCoupling::CommInterface comm;
comm.commFree(&_comm);
}
+ _comm = MPI_COMM_NULL;
}
void OverlapDEC::sendRecvData(bool way)
attachTargetLocalField(tmpField,true);
}
- void OverlapDEC::attachSourceLocalField(ICoCo::MEDField *field)
+ void OverlapDEC::attachSourceLocalField(ICoCo::MEDDoubleField *field)
{
- attachSourceLocalField(field->getField());
+ attachSourceLocalField(field->getMCField());
}
- void OverlapDEC::attachTargetLocalField(ICoCo::MEDField *field)
+ void OverlapDEC::attachTargetLocalField(ICoCo::MEDDoubleField *field)
{
- attachTargetLocalField(field->getField());
+ attachTargetLocalField(field->getMCField());
}
bool OverlapDEC::isInGroup() const