-// Copyright (C) 2007-2016 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
*/
ParaFIELD::ParaFIELD(MEDCouplingFieldDouble* subdomain_field, ParaMESH *sup, const ProcessorGroup& proc_group):
_field(subdomain_field),
- _component_topology(ComponentTopology(_field->getNumberOfComponents())),_topology(0),_own_support(false),
+ _component_topology(ComponentTopology((int)_field->getNumberOfComponents())),_topology(0),_own_support(false),
_support(sup)
{
if(_field)
}
ParaFIELD::~ParaFIELD()
+ {
+ release();
+ }
+
+ /** Destructor involves MPI operations: make sure this is accessible from a proper
+ * method for Python wrapping.
+ */
+ void ParaFIELD::release()
{
if(_field)
- _field->decrRef();
+ {
+ _field->decrRef();
+ _field = nullptr;
+ }
+
if(_own_support)
- delete _support;
+ {
+ delete _support;
+ _support = nullptr;
+ }
delete _topology;
+ _topology = nullptr;
}
void ParaFIELD::synchronizeTarget(ParaFIELD* source_field)
* This method returns, if it exists, an array with only one component and as many as tuples as _field has.
* This array gives for every element on which this->_field lies, its global number, if this->_field is nodal.
* For example if _field is a nodal field : returned array will be the nodal global numbers.
- * The content of this method is used to inform Working side to accumulate data recieved by lazy side.
+ * The content of this method is used to inform Working side to accumulate data received by lazy side.
*/
- DataArrayInt* ParaFIELD::returnCumulativeGlobalNumbering() const
+ DataArrayIdType* ParaFIELD::returnCumulativeGlobalNumbering() const
{
if(!_field)
return 0;
}
}
- DataArrayInt* ParaFIELD::returnGlobalNumbering() const
+ DataArrayIdType* ParaFIELD::returnGlobalNumbering() const
{
if(!_field)
return 0;