Commit 333366c8 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Merge branch 'fix/InputFld' into 'master'

Force InputFld to update fielddef

This forces InputFld to update fielddef after loading the expansions, instead of only doing this when range is specified. This is necessary because the number of partitions from the original file might not be the same as the number of processes being used in FieldConvert, causing the fielddef obtained from Import to contain extra elements.

For example, when converting a serial fld to a parallel format using
```
mpirun -np 8 FieldConvert file.xml file_serial.fld file_par.fld
```
the current implementation causes all 8 partition files from file_par.fld to contain the whole field.

See merge request !611
parents e056b266 cd98b2e5
......@@ -17,6 +17,10 @@ v4.3.1
**NekMesh**:
- Fix incorrect link directory on CCMIO library.
**FieldConvert**:
- Fix to FLD input to update the field definitions always, not just when a range
is specified. (!611)
v4.3.0
------
**Library:**
......
......@@ -261,25 +261,22 @@ void InputFld::Process(po::variables_map &vm)
}
}
// if range is defined reset up output field in case of
// reducing fld definition
if(vm.count("range"))
{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
= m_f->m_exp[0]->GetFieldDefinitions();
std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
// reset output field in case Import loaded elements that are not
// in the expansion (because of range option of partitioning)
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
= m_f->m_exp[0]->GetFieldDefinitions();
std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
for (j = 0; j < nfields; ++j)
for (j = 0; j < nfields; ++j)
{
for (i = 0; i < FieldDef.size(); ++i)
{
for (i = 0; i < FieldDef.size(); ++i)
{
FieldDef[i]->m_fields.push_back(m_f->m_fielddef[0]->m_fields[j]);
m_f->m_exp[j]->AppendFieldData(FieldDef[i], FieldData[i]);
}
FieldDef[i]->m_fields.push_back(m_f->m_fielddef[0]->m_fields[j]);
m_f->m_exp[j]->AppendFieldData(FieldDef[i], FieldData[i]);
}
m_f->m_fielddef = FieldDef;
m_f->m_data = FieldData;
}
m_f->m_fielddef = FieldDef;
m_f->m_data = FieldData;
}
if(m_f->m_verbose)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment