From c49910810f3fcc0add85a2ee68dd20801c8ad302 Mon Sep 17 00:00:00 2001 From: Zachary Sexton <47196674+zasexton@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:00:21 -0700 Subject: [PATCH] fixing initialize check for seperate fluid equation in AD simulation (#202) --- Code/Source/svFSI/initialize.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Code/Source/svFSI/initialize.cpp b/Code/Source/svFSI/initialize.cpp index 3d6a9ce0..a7313ddb 100644 --- a/Code/Source/svFSI/initialize.cpp +++ b/Code/Source/svFSI/initialize.cpp @@ -439,17 +439,23 @@ void initialize(Simulation* simulation, Vector& timeP) // degrees of freedom based on the precomputed state-variable (velocity) // data. if (eq.phys == Equation_heatF) { - bool fflag = false; - for (int jEq = 0; jEq < com_mod.nEq; jEq++) { - if (std::set{Equation_fluid, Equation_FSI, Equation_CMM, Equation_stokes}.count(com_mod.eq[jEq].phys)) { - fflag = true; + bool fflag = false; + for (int jEq = 0; jEq < com_mod.nEq; jEq++) { + if (std::set < EquationType > + {Equation_fluid, Equation_FSI, Equation_CMM, Equation_stokes}.count(com_mod.eq[jEq].phys)) { + fflag = true; + } + } + if (com_mod.usePrecomp) { + if (!fflag) { + tDof = tDof + nsd; + } + } else { + if (!fflag) { + throw std::runtime_error( + "HeatF equation must be accompanied by a fluid equation or precomputed velocity data."); + } } - } - if (!fflag && com_mod.usePrecomp) { - tDof = tDof + nsd; - } else { - throw std::runtime_error("HeatF equation must be accompanied by a fluid equation or precomputed velocity data."); - } } eq.pNorm = std::numeric_limits::max(); eq.af = 1.0 / (1.0 + eq.roInf);