Commit db898d38 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Merge branch 'fix/FC_interpolator' into 'master'

Fix/fc interpolator

Provide a fix for the interpolator in FieldUtils which currently using the wrong offset to place interpolated points back into the new field. This is mainly a problem when quad elements are listed before tri elements since this automatically leads to the incorrect offset. This would have not been a problem if tris went before quads. This MR also therefore adds in a regression test for this case.

See merge request !746
parents 411cacdf a7cdea45
......@@ -66,6 +66,7 @@ v4.4.0
- Update quality metric to include scaled Jacobian output (!695)
- Allow multiple XML files to be specified in InterpField module (!705)
- Fix issues with isocontour module (!719)
- Fix issue with interpolator routine (!746)
**NekMesh:**
- Modify curve module to allow for spline input (!628)
......
......@@ -339,8 +339,7 @@ void Interpolator::Interpolate(
if (elmtid >= 0)
{
int offset = m_expInField[0]->GetPhys_Offset(
m_expInField[0]->GetOffset_Elmt_Id(elmtid));
int offset = m_expInField[0]->GetPhys_Offset(elmtid);
for (int f = 0; f < m_expInField.size(); ++f)
{
......@@ -424,8 +423,7 @@ void Interpolator::Interpolate(
if (elmtid >= 0)
{
int offset = m_expInField[0]->GetPhys_Offset(
m_expInField[0]->GetOffset_Elmt_Id(elmtid));
int offset = m_expInField[0]->GetPhys_Offset(elmtid);
for (int f = 0; f < m_expInField.size(); ++f)
{
......
......@@ -27,6 +27,7 @@ ADD_NEKTAR_TEST(cube_prismhex)
ADD_NEKTAR_TEST(outflow_pointdatatofld)
ADD_NEKTAR_TEST(chan3D_equispacedoutput)
ADD_NEKTAR_TEST(chan3D_isocontour)
ADD_NEKTAR_TEST(interpfield)
ADD_NEKTAR_TEST(naca0012_bnd_equispacedoutput)
ADD_NEKTAR_TEST(smallmesh_isocontour)
......
<?xml version="1.0" encoding="utf-8"?>
<test>
<description> Interp field to a box of points (also calculate cp and cp0)</description>
<executable>FieldConvert</executable>
<parameters>-e -m interpfield:fromxml=interptest.xml:fromfld=interptest.fld interptest.xml new.fld </parameters>
<files>
<file description="Session File">interptest.xml</file>
<file description="Session File">interptest.fld</file>
</files>
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-4">0.0254815</value>
<value variable="v" tolerance="1e-4">0.00331392</value>
<value variable="p" tolerance="1e-4">0.00229271</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-4">0.784991</value>
<value variable="v" tolerance="1e-4">0.390773</value>
<value variable="p" tolerance="1e-4">0.0871031</value>
</metric>
</metrics>
</test>
This diff is collapsed.
This diff is collapsed.
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