From f6b5cd570a3a19b02c50431ecff3f9f48b82e595 Mon Sep 17 00:00:00 2001 From: lizdulac Date: Wed, 21 Aug 2024 16:37:55 -0400 Subject: [PATCH 1/5] Create cross product --- source/adios2/toolkit/derived/Expression.cpp | 39 ++++----- source/adios2/toolkit/derived/Expression.h | 1 + source/adios2/toolkit/derived/Function.cpp | 76 +++++++++++++++++- source/adios2/toolkit/derived/Function.h | 2 + .../derived/TestBPDerivedCorrectness.cpp | 79 +++++++++++++++---- 5 files changed, 158 insertions(+), 39 deletions(-) diff --git a/source/adios2/toolkit/derived/Expression.cpp b/source/adios2/toolkit/derived/Expression.cpp index 0f308d49c0..a139bedbdf 100644 --- a/source/adios2/toolkit/derived/Expression.cpp +++ b/source/adios2/toolkit/derived/Expression.cpp @@ -36,27 +36,28 @@ const std::map op_property = { {ExpressionOperator::OP_ASIN, {"ASIN", false}}, {ExpressionOperator::OP_ACOS, {"ACOS", false}}, {ExpressionOperator::OP_ATAN, {"ATAN", false}}, - {ExpressionOperator::OP_CURL, {"CURL", false}}, - {ExpressionOperator::OP_MAGN, {"MAGNITUDE", false}}}; + {ExpressionOperator::OP_MAGN, {"MAGNITUDE", false}}, + {ExpressionOperator::OP_CROSS, {"CROSS", false}}, + {ExpressionOperator::OP_CURL, {"CURL", false}}}; const std::map string_to_op = { {"ALIAS", ExpressionOperator::OP_ALIAS}, /* Parser-use only */ {"PATH", ExpressionOperator::OP_PATH}, /* Parser-use only */ {"NUM", ExpressionOperator::OP_NUM}, /* Parser-use only */ - {"INDEX", ExpressionOperator::OP_INDEX}, {"+", ExpressionOperator::OP_ADD}, - {"add", ExpressionOperator::OP_ADD}, {"ADD", ExpressionOperator::OP_ADD}, - {"-", ExpressionOperator::OP_SUBTRACT}, {"SUBTRACT", ExpressionOperator::OP_SUBTRACT}, - {"/", ExpressionOperator::OP_DIV}, {"divide", ExpressionOperator::OP_DIV}, - {"DIVIDE", ExpressionOperator::OP_DIV}, {"*", ExpressionOperator::OP_MULT}, - {"multiply", ExpressionOperator::OP_MULT}, {"MULTIPLY", ExpressionOperator::OP_MULT}, - {"SQRT", ExpressionOperator::OP_SQRT}, {"sqrt", ExpressionOperator::OP_SQRT}, - {"pow", ExpressionOperator::OP_POW}, {"POW", ExpressionOperator::OP_POW}, - {"sin", ExpressionOperator::OP_SIN}, {"cos", ExpressionOperator::OP_COS}, - {"tan", ExpressionOperator::OP_TAN}, {"asin", ExpressionOperator::OP_ASIN}, - {"acos", ExpressionOperator::OP_ACOS}, {"atan", ExpressionOperator::OP_ATAN}, - {"^", ExpressionOperator::OP_POW}, {"CURL", ExpressionOperator::OP_CURL}, - {"curl", ExpressionOperator::OP_CURL}, {"MAGNITUDE", ExpressionOperator::OP_MAGN}, - {"magnitude", ExpressionOperator::OP_MAGN}}; + {"INDEX", ExpressionOperator::OP_INDEX}, {"+", ExpressionOperator::OP_ADD}, + {"add", ExpressionOperator::OP_ADD}, {"ADD", ExpressionOperator::OP_ADD}, + {"-", ExpressionOperator::OP_SUBTRACT}, {"SUBTRACT", ExpressionOperator::OP_SUBTRACT}, + {"/", ExpressionOperator::OP_DIV}, {"divide", ExpressionOperator::OP_DIV}, + {"DIVIDE", ExpressionOperator::OP_DIV}, {"*", ExpressionOperator::OP_MULT}, + {"multiply", ExpressionOperator::OP_MULT}, {"MULTIPLY", ExpressionOperator::OP_MULT}, + {"SQRT", ExpressionOperator::OP_SQRT}, {"sqrt", ExpressionOperator::OP_SQRT}, + {"pow", ExpressionOperator::OP_POW}, {"POW", ExpressionOperator::OP_POW}, + {"sin", ExpressionOperator::OP_SIN}, {"cos", ExpressionOperator::OP_COS}, + {"tan", ExpressionOperator::OP_TAN}, {"asin", ExpressionOperator::OP_ASIN}, + {"acos", ExpressionOperator::OP_ACOS}, {"atan", ExpressionOperator::OP_ATAN}, + {"^", ExpressionOperator::OP_POW}, {"magnitude", ExpressionOperator::OP_MAGN}, + {"MAGNITUDE", ExpressionOperator::OP_MAGN}, {"cross", ExpressionOperator::OP_CROSS}, + {"curl", ExpressionOperator::OP_CURL}, {"CURL", ExpressionOperator::OP_CURL}}; inline std::string get_op_name(ExpressionOperator op) { return op_property.at(op).name; } @@ -151,9 +152,9 @@ std::map OpFunctions = { {adios2::detail::ExpressionOperator::OP_ASIN, {AsinFunc, SameDimsFunc, FloatTypeFunc}}, {adios2::detail::ExpressionOperator::OP_ACOS, {AcosFunc, SameDimsFunc, FloatTypeFunc}}, {adios2::detail::ExpressionOperator::OP_ATAN, {AtanFunc, SameDimsFunc, FloatTypeFunc}}, - {adios2::detail::ExpressionOperator::OP_CURL, {Curl3DFunc, CurlDimsFunc, SameTypeFunc}}, - {adios2::detail::ExpressionOperator::OP_MAGN, - {MagnitudeFunc, SameDimsWithAgrFunc, SameTypeFunc}}}; + {adios2::detail::ExpressionOperator::OP_MAGN, {MagnitudeFunc, SameDimsFunc, SameTypeFunc}}, + {adios2::detail::ExpressionOperator::OP_CROSS, {Cross3DFunc, Cross3DDimsFunc, SameTypeFunc}}, + {adios2::detail::ExpressionOperator::OP_CURL, {Curl3DFunc, CurlDimsFunc, SameTypeFunc}}}; Expression::Expression(std::string string_exp) : m_Shape({0}), m_Start({0}), m_Count({0}), ExprString(string_exp) diff --git a/source/adios2/toolkit/derived/Expression.h b/source/adios2/toolkit/derived/Expression.h index 148be48646..01bbb871e3 100644 --- a/source/adios2/toolkit/derived/Expression.h +++ b/source/adios2/toolkit/derived/Expression.h @@ -29,6 +29,7 @@ enum ExpressionOperator OP_ACOS, OP_ATAN, OP_MAGN, + OP_CROSS, OP_CURL }; } diff --git a/source/adios2/toolkit/derived/Function.cpp b/source/adios2/toolkit/derived/Function.cpp index 527809dd9a..a1dd0ddfc1 100644 --- a/source/adios2/toolkit/derived/Function.cpp +++ b/source/adios2/toolkit/derived/Function.cpp @@ -66,6 +66,21 @@ inline size_t returnIndex(size_t x, size_t y, size_t z, const size_t dims[3]) return z + y * dims[2] + x * dims[2] * dims[1]; } +template +T *ApplyCross3D(const T *Ax, const T *Ay, const T *Az, const T *Bx, const T *By, const T *Bz, + const size_t dataSize) +{ + T *data = (T *)malloc(dataSize * sizeof(T) * 3); + size_t index = 0; + for (size_t i = 0; i < dataSize; ++i) + { + data[3 * i] = (Ay[i] * Bz[i]) - (Az[i] * By[i]); + data[3 * i + 1] = (Ax[i] * Bz[i]) - (Az[i] * Bx[i]); + data[3 * i + 2] = (Ax[i] * By[i]) - (Ay[i] * Bx[i]); + } + return data; +} + template T *ApplyCurl(const T *input1, const T *input2, const T *input3, const size_t dims[3]) { @@ -196,8 +211,8 @@ DerivedData MultFunc(std::vector inputData, DataType type) #define declare_type_mult(T) \ if (type == helper::GetDataType()) \ { \ - T *multValues = detail::ApplyOneToOne( \ - inputData.begin(), inputData.end(), dataSize, [](T a, T b) { return a * b; }, 1); \ + T *multValues = detail::ApplyOneToOne(inputData.begin(), inputData.end(), dataSize, \ + [](T a, T b) { return a * b; }, 1); \ return DerivedData({(void *)multValues, inputData[0].Start, inputData[0].Count}); \ } ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_type_mult) @@ -218,8 +233,8 @@ DerivedData DivFunc(std::vector inputData, DataType type) #define declare_type_div(T) \ if (type == helper::GetDataType()) \ { \ - T *divValues = detail::ApplyOneToOne( \ - inputData.begin() + 1, inputData.end(), dataSize, [](T a, T b) { return a * b; }, 1); \ + T *divValues = detail::ApplyOneToOne(inputData.begin() + 1, inputData.end(), dataSize, \ + [](T a, T b) { return a * b; }, 1); \ for (size_t i = 0; i < dataSize; i++) \ divValues[i] = *(reinterpret_cast(inputData[0].Data) + i) / divValues[i]; \ return DerivedData({(void *)divValues, inputData[0].Start, inputData[0].Count}); \ @@ -586,6 +601,41 @@ DerivedData MagnitudeFunc(std::vector inputData, DataType type) return DerivedData(); } +DerivedData Cross3DFunc(const std::vector inputData, DataType type) +{ + PERFSTUBS_SCOPED_TIMER("derived::Function::Cross3DFunc"); + if (inputData.size() != 6) + { + helper::Throw("Derived", "Function", "Cross3DFunc", + "Invalid number of arguments passed to Cross3DFunc"); + } + size_t dataSize = std::accumulate(std::begin(inputData[0].Count), std::end(inputData[0].Count), + 1, std::multiplies()); + + DerivedData cross; + cross.Start = inputData[0].Start; + cross.Start.push_back(0); + cross.Count = inputData[0].Count; + cross.Count.push_back(3); + +#define declare_type_cross(T) \ + if (type == helper::GetDataType()) \ + { \ + T *Ax = (T *)inputData[0].Data; \ + T *Ay = (T *)inputData[1].Data; \ + T *Az = (T *)inputData[2].Data; \ + T *Bx = (T *)inputData[3].Data; \ + T *By = (T *)inputData[4].Data; \ + T *Bz = (T *)inputData[5].Data; \ + cross.Data = detail::ApplyCross3D(Ax, Ay, Az, Bx, By, Bz, dataSize); \ + return cross; \ + } + ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_type_cross) + helper::Throw("Derived", "Function", "Cross3DFunc", + "Invalid variable types"); + return DerivedData(); +} + /* * Input: 3D vector field F(x,y,z)= {F1(x,y,z), F2(x,y,z), F3(x,y,z)} * @@ -660,6 +710,24 @@ std::tuple SameDimsWithAgrFunc(std::vector input) +{ + // check that all dimenstions are the same + if (input.size() > 1) + { + Dims first_element = input[0]; + bool dim_are_equal = std::all_of(input.begin() + 1, input.end(), + [&first_element](Dims x) { return x == first_element; }); + if (!dim_are_equal) + helper::Throw("Derived", "Function", "Cross3DDimsFunc", + "Invalid variable dimensions"); + } + // return original dimensions with added dimension of number of inputs + Dims output = input[0]; + output.push_back(3); + return output; +} + // Input Dims are the same, output is combination of all inputs std::tuple CurlDimsFunc(std::vector> input) { diff --git a/source/adios2/toolkit/derived/Function.h b/source/adios2/toolkit/derived/Function.h index 99de5dc850..2f2bed708f 100644 --- a/source/adios2/toolkit/derived/Function.h +++ b/source/adios2/toolkit/derived/Function.h @@ -20,10 +20,12 @@ DerivedData DivFunc(std::vector input, DataType type); DerivedData SqrtFunc(std::vector input, DataType type); DerivedData PowFunc(std::vector input, DataType type); DerivedData MagnitudeFunc(std::vector input, DataType type); +DerivedData Cross3DFunc(std::vector input, DataType type); DerivedData Curl3DFunc(std::vector input, DataType type); std::tuple SameDimsFunc(std::vector> input); std::tuple SameDimsWithAgrFunc(std::vector> input); +std::tuple Cross3DDimsFunc(std::vector> input); std::tuple CurlDimsFunc(std::vector> input); DataType SameTypeFunc(DataType input); diff --git a/testing/adios2/derived/TestBPDerivedCorrectness.cpp b/testing/adios2/derived/TestBPDerivedCorrectness.cpp index da363a024b..4c3fadbb3b 100644 --- a/testing/adios2/derived/TestBPDerivedCorrectness.cpp +++ b/testing/adios2/derived/TestBPDerivedCorrectness.cpp @@ -320,7 +320,7 @@ TEST_P(DerivedCorrectnessP, TrigCorrectnessTest) bpFileReader.Close(); } -TEST_P(DerivedCorrectnessP, MagCorrectnessTest) +TEST_P(DerivedCorrectnessP, VectorCorrectnessTest) { const size_t Nx = 2, Ny = 3, Nz = 10; const size_t steps = 2; @@ -334,30 +334,50 @@ TEST_P(DerivedCorrectnessP, MagCorrectnessTest) std::vector simArray1(Nx * Ny * Nz); std::vector simArray2(Nx * Ny * Nz); std::vector simArray3(Nx * Ny * Nz); + std::vector simArray4(Nx * Ny * Nz); + std::vector simArray5(Nx * Ny * Nz); + std::vector simArray6(Nx * Ny * Nz); for (size_t i = 0; i < Nx * Ny * Nz; ++i) { simArray1[i] = distribution(generator); simArray2[i] = distribution(generator); simArray3[i] = distribution(generator); + simArray4[i] = distribution(generator); + simArray5[i] = distribution(generator); + simArray6[i] = distribution(generator); } adios2::ADIOS adios; adios2::IO bpOut = adios.DeclareIO("BPWriteExpression"); - std::vector varname = {"sim2/Ux", "sim2/Uy", "sim2/Uz"}; - std::string derivedname = "derived/magU"; + std::vector varname = {"sim2/Ux", "sim2/Uy", "sim2/Uz", + "sim2/Vx", "sim2/Vy", "sim2/Vz"}; + const std::string derMagName = "derived/magU"; + const std::string derCrossName = "derived/crossU"; auto Ux = bpOut.DefineVariable(varname[0], {Nx, Ny, Nz}, {0, 0, 0}, {Nx, Ny, Nz}); auto Uy = bpOut.DefineVariable(varname[1], {Nx, Ny, Nz}, {0, 0, 0}, {Nx, Ny, Nz}); auto Uz = bpOut.DefineVariable(varname[2], {Nx, Ny, Nz}, {0, 0, 0}, {Nx, Ny, Nz}); + auto Vx = bpOut.DefineVariable(varname[3], {Nx, Ny, Nz}, {0, 0, 0}, {Nx, Ny, Nz}); + auto Vy = bpOut.DefineVariable(varname[4], {Nx, Ny, Nz}, {0, 0, 0}, {Nx, Ny, Nz}); + auto Vz = bpOut.DefineVariable(varname[5], {Nx, Ny, Nz}, {0, 0, 0}, {Nx, Ny, Nz}); // clang-format off - bpOut.DefineDerivedVariable(derivedname, + bpOut.DefineDerivedVariable(derMagName, "x =" + varname[0] + " \n" "y =" + varname[1] + " \n" "z =" + varname[2] + " \n" "magnitude(x,y,z)", mode); + bpOut.DefineDerivedVariable(derCrossName, + "Ux =" + varname[0] + " \n" + "Uy =" + varname[1] + " \n" + "Uz =" + varname[2] + " \n" + "Vx =" + varname[3] + " \n" + "Vy =" + varname[4] + " \n" + "Vz =" + varname[5] + " \n" + "cross(Ux, Uy, Uz, Vx, Vy, Vz)", + mode); // clang-format on - std::string filename = "expMagnitude.bp"; + std::string filename = "expVector.bp"; adios2::Engine bpFileWriter = bpOut.Open(filename, adios2::Mode::Write); for (size_t i = 0; i < steps; i++) @@ -366,6 +386,9 @@ TEST_P(DerivedCorrectnessP, MagCorrectnessTest) bpFileWriter.Put(Ux, simArray1.data()); bpFileWriter.Put(Uy, simArray2.data()); bpFileWriter.Put(Uz, simArray3.data()); + bpFileWriter.Put(Vx, simArray4.data()); + bpFileWriter.Put(Vy, simArray5.data()); + bpFileWriter.Put(Vz, simArray6.data()); bpFileWriter.EndStep(); } bpFileWriter.Close(); @@ -376,28 +399,52 @@ TEST_P(DerivedCorrectnessP, MagCorrectnessTest) std::vector readUx; std::vector readUy; std::vector readUz; + std::vector readVx; + std::vector readVy; + std::vector readVz; std::vector readMag; + std::vector readCross; - float calcM; + float calcDerived; float epsilon = (float)0.01; for (size_t i = 0; i < steps; i++) { bpFileReader.BeginStep(); - auto varx = bpIn.InquireVariable(varname[0]); - auto vary = bpIn.InquireVariable(varname[1]); - auto varz = bpIn.InquireVariable(varname[2]); - auto varmag = bpIn.InquireVariable(derivedname); - - bpFileReader.Get(varx, readUx); - bpFileReader.Get(vary, readUy); - bpFileReader.Get(varz, readUz); + auto varUx = bpIn.InquireVariable(varname[0]); + auto varUy = bpIn.InquireVariable(varname[1]); + auto varUz = bpIn.InquireVariable(varname[2]); + auto varVx = bpIn.InquireVariable(varname[3]); + auto varVy = bpIn.InquireVariable(varname[4]); + auto varVz = bpIn.InquireVariable(varname[5]); + auto varmag = bpIn.InquireVariable(derMagName); + auto varcross = bpIn.InquireVariable(derCrossName); + + bpFileReader.Get(varUx, readUx); + bpFileReader.Get(varUy, readUy); + bpFileReader.Get(varUz, readUz); + bpFileReader.Get(varVx, readVx); + bpFileReader.Get(varVy, readVy); + bpFileReader.Get(varVz, readVz); bpFileReader.Get(varmag, readMag); + bpFileReader.Get(varcross, readCross); bpFileReader.EndStep(); + // Magnitude + for (size_t ind = 0; ind < Nx * Ny * Nz; ++ind) + { + calcDerived = + (float)sqrt(pow(readUx[ind], 2) + pow(readUy[ind], 2) + pow(readUz[ind], 2)); + EXPECT_TRUE(fabs(calcDerived - readMag[ind]) < epsilon); + } + // Cross Product for (size_t ind = 0; ind < Nx * Ny * Nz; ++ind) { - calcM = (float)sqrt(pow(readUx[ind], 2) + pow(readUy[ind], 2) + pow(readUz[ind], 2)); - EXPECT_TRUE(fabs(calcM - readMag[ind]) < epsilon); + calcDerived = (readUy[ind] * readVz[ind]) - (readUz[ind] * readVy[ind]); + EXPECT_TRUE(fabs(calcDerived - readCross[3 * ind]) < epsilon); + calcDerived = (readUx[ind] * readVz[ind]) - (readUz[ind] * readVx[ind]); + EXPECT_TRUE(fabs(calcDerived - readCross[3 * ind + 1]) < epsilon); + calcDerived = (readUx[ind] * readVy[ind]) - (readUy[ind] * readVx[ind]); + EXPECT_TRUE(fabs(calcDerived - readCross[3 * ind + 2]) < epsilon); } } bpFileReader.Close(); From cd090d588e8e47c29db30be3e62dd39c71490492 Mon Sep 17 00:00:00 2001 From: lizdulac Date: Wed, 21 Aug 2024 17:27:05 -0400 Subject: [PATCH 2/5] switch cross product dims function to new format --- source/adios2/toolkit/derived/Function.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/adios2/toolkit/derived/Function.cpp b/source/adios2/toolkit/derived/Function.cpp index a1dd0ddfc1..f375025c1b 100644 --- a/source/adios2/toolkit/derived/Function.cpp +++ b/source/adios2/toolkit/derived/Function.cpp @@ -710,21 +710,24 @@ std::tuple SameDimsWithAgrFunc(std::vector input) +std::tuple Cross3DDimsFunc(std::vector> input) { // check that all dimenstions are the same if (input.size() > 1) { - Dims first_element = input[0]; - bool dim_are_equal = std::all_of(input.begin() + 1, input.end(), - [&first_element](Dims x) { return x == first_element; }); + auto first_element = input[0]; + bool dim_are_equal = std::all_of( + input.begin() + 1, input.end(), + [&first_element](std::tuple x) { return x == first_element; }); if (!dim_are_equal) helper::Throw("Derived", "Function", "Cross3DDimsFunc", "Invalid variable dimensions"); } // return original dimensions with added dimension of number of inputs - Dims output = input[0]; - output.push_back(3); + std::tuple output = input[0]; + std::get<0>(output).push_back(0); + std::get<1>(output).push_back(3); + std::get<2>(output).push_back(3); return output; } From 6b2b0579b17fdd3662b73b01c622caa76b528dd8 Mon Sep 17 00:00:00 2001 From: lizdulac Date: Mon, 26 Aug 2024 10:22:22 -0400 Subject: [PATCH 3/5] formatting --- source/adios2/toolkit/derived/Function.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/adios2/toolkit/derived/Function.cpp b/source/adios2/toolkit/derived/Function.cpp index f375025c1b..ed9ad3b09e 100644 --- a/source/adios2/toolkit/derived/Function.cpp +++ b/source/adios2/toolkit/derived/Function.cpp @@ -211,8 +211,8 @@ DerivedData MultFunc(std::vector inputData, DataType type) #define declare_type_mult(T) \ if (type == helper::GetDataType()) \ { \ - T *multValues = detail::ApplyOneToOne(inputData.begin(), inputData.end(), dataSize, \ - [](T a, T b) { return a * b; }, 1); \ + T *multValues = detail::ApplyOneToOne( \ + inputData.begin(), inputData.end(), dataSize, [](T a, T b) { return a * b; }, 1); \ return DerivedData({(void *)multValues, inputData[0].Start, inputData[0].Count}); \ } ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_type_mult) @@ -233,8 +233,8 @@ DerivedData DivFunc(std::vector inputData, DataType type) #define declare_type_div(T) \ if (type == helper::GetDataType()) \ { \ - T *divValues = detail::ApplyOneToOne(inputData.begin() + 1, inputData.end(), dataSize, \ - [](T a, T b) { return a * b; }, 1); \ + T *divValues = detail::ApplyOneToOne( \ + inputData.begin() + 1, inputData.end(), dataSize, [](T a, T b) { return a * b; }, 1); \ for (size_t i = 0; i < dataSize; i++) \ divValues[i] = *(reinterpret_cast(inputData[0].Data) + i) / divValues[i]; \ return DerivedData({(void *)divValues, inputData[0].Start, inputData[0].Count}); \ From fc7fed1606c9756ddc3a611fa1861fd82bcdc63f Mon Sep 17 00:00:00 2001 From: lizdulac Date: Mon, 26 Aug 2024 13:52:49 -0400 Subject: [PATCH 4/5] formatting --- source/adios2/toolkit/derived/Expression.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/adios2/toolkit/derived/Expression.cpp b/source/adios2/toolkit/derived/Expression.cpp index a139bedbdf..95783663fa 100644 --- a/source/adios2/toolkit/derived/Expression.cpp +++ b/source/adios2/toolkit/derived/Expression.cpp @@ -152,7 +152,8 @@ std::map OpFunctions = { {adios2::detail::ExpressionOperator::OP_ASIN, {AsinFunc, SameDimsFunc, FloatTypeFunc}}, {adios2::detail::ExpressionOperator::OP_ACOS, {AcosFunc, SameDimsFunc, FloatTypeFunc}}, {adios2::detail::ExpressionOperator::OP_ATAN, {AtanFunc, SameDimsFunc, FloatTypeFunc}}, - {adios2::detail::ExpressionOperator::OP_MAGN, {MagnitudeFunc, SameDimsFunc, SameTypeFunc}}, + {adios2::detail::ExpressionOperator::OP_MAGN, + {MagnitudeFunc, SameDimsWithAgrFunc, SameTypeFunc}}, {adios2::detail::ExpressionOperator::OP_CROSS, {Cross3DFunc, Cross3DDimsFunc, SameTypeFunc}}, {adios2::detail::ExpressionOperator::OP_CURL, {Curl3DFunc, CurlDimsFunc, SameTypeFunc}}}; From c950908e527b41fd3de7e8488eff38c14ee9a0c7 Mon Sep 17 00:00:00 2001 From: lizdulac Date: Tue, 27 Aug 2024 14:13:00 -0400 Subject: [PATCH 5/5] remove unused variable --- source/adios2/toolkit/derived/Function.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/source/adios2/toolkit/derived/Function.cpp b/source/adios2/toolkit/derived/Function.cpp index ed9ad3b09e..99f5726295 100644 --- a/source/adios2/toolkit/derived/Function.cpp +++ b/source/adios2/toolkit/derived/Function.cpp @@ -71,7 +71,6 @@ T *ApplyCross3D(const T *Ax, const T *Ay, const T *Az, const T *Bx, const T *By, const size_t dataSize) { T *data = (T *)malloc(dataSize * sizeof(T) * 3); - size_t index = 0; for (size_t i = 0; i < dataSize; ++i) { data[3 * i] = (Ay[i] * Bz[i]) - (Az[i] * By[i]);