39#include <boost/algorithm/string.hpp>
96 std::map<int, Array<OneD, NekDouble>> boundValues;
97 std::map<int, Array<OneD, NekDouble>> pPhys;
102 SolvePa(i, boundValues[i], pPhys[i]);
113 std::string varname(
"phi0");
114 std::vector<std::string> vars;
115 std::vector<Array<OneD, NekDouble>> fields;
118 varname[3] =
'0' + it.first;
119 vars.push_back(varname);
120 fields.push_back(it.second);
128 int ndim =
m_fields[0]->GetCoordim(0);
135 for (
int i = 0; i < BndConds.size(); ++i)
137 if (boost::iequals(BndConds[i]->GetUserDefined(),
m_MRFABCname))
139 numpts += BndExp[i]->GetTotPoints();
157 for (
int i = 0; i < BndConds.size(); ++i)
159 if (boost::iequals(BndConds[i]->GetUserDefined(),
m_MRFABCname))
161 int npts = BndExp[i]->GetTotPoints();
164 for (
int j = 0; j < 3; ++j)
169 BndExp[i]->GetNormals(n);
170 BndExp[i]->GetCoords(x[0], x[1], x[2]);
171 for (
int j = 0; j < 3; ++j)
176 for (
int j = 0; j < ndim; ++j)
178 if (dofs.find(j) != dofs.end())
180 Vmath::Smul(npts, -1., n[j], 1, atmp = bcs[j] + offset, 1);
183 if (dofs.find(5) != dofs.end())
185 atmp = bcs[5] + offset;
187 &n[1][0], 1, &atmp[0], 1);
199 m_session->MatchSolverInfo(
"Homogeneous",
"1D", homo1D,
false);
212 int nfld = pPhys.size();
214 std::numeric_limits<NekDouble>::lowest());
215 for (
int i = 0; i < BndConds.size(); ++i)
217 if (boost::iequals(BndConds[i]->GetUserDefined(),
m_MRFABCname))
222 m_pressure->GetBndElmtExpansion(i, BndElmtExp,
false);
225 for (
auto it : pPhys)
227 m_pressure->ExtractPhysToBndElmt(i, it.second, phiElm);
228 m_pressure->ExtractElmtToBndPhys(i, phiElm, phi[j]);
233 for (
int j = 0; j < nfld; ++j)
236 for (
const auto &it : boundValues)
238 Vmath::Vmul(edgeExplist->GetTotPoints(), phi[j], 1,
239 it.second + offset, 1, mularray, 1);
240 NekDouble temp = edgeExplist->Integral(mularray) / lz;
241 if (std::numeric_limits<NekDouble>::lowest() ==
244 value[k + j * nfld] = temp;
248 value[k + j * nfld] += temp;
253 offset += edgeExplist->GetTotPoints();
257 for (
int j = 0; j < value.size(); ++j)
259 if (std::numeric_limits<NekDouble>::lowest() == value[j])
267 for (
auto it : pPhys)
271 for (
auto jt : pPhys)
274 m_addedMass[i1 + j1 * NumDofs] = value[i + nfld * j];
279 if (
m_session->GetComm()->GetRank() == 0)
281 for (
int j = 0; j < NumDofs; ++j)
283 for (
int k = 0; k < NumDofs; ++k)
285 std::cout <<
"value[" << j <<
", " << k
286 <<
"] = " << std::scientific << std::setprecision(7)
301 for (
int i = 0; i < BndConds.size(); ++i)
303 if (boost::iequals(BndConds[i]->GetUserDefined(),
m_MRFABCname))
305 BndExp[i]->IProductWRTBase(bc + offset, BndExp[i]->UpdateCoeffs());
306 offset += BndExp[i]->GetTotPoints();
325 if (std::fabs(acceleration) != 0.)
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
PressDecompVCSFSI(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
void CalculateBCs(std::set< int > &dofs, std::map< int, Array< OneD, NekDouble > > &bcs)
Array< OneD, NekDouble > m_addedMass
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
static std::string solverTypeLookupId
void CalculateAddedMass(std::map< int, Array< OneD, NekDouble > > &boundValues, std::map< int, Array< OneD, NekDouble > > &pPhys)
void v_InitObject(bool DeclareField=true) override
Initialisation object for EquationSystem.
~PressDecompVCSFSI() override
void v_DoInitialise(bool dumpInitialConditions=true) override
Virtual function for initialisation implementation.
void SolvePotentials(std::set< int > &dofs)
std::map< int, Array< OneD, NekDouble > > m_pCoef
static std::string className
Name of class.
void SolvePa(int i, Array< OneD, NekDouble > bc, Array< OneD, NekDouble > pPhys)
void v_SolveSolid(NekDouble time) override
void SetNewmarkBetaSolver(Array< OneD, NekDouble > &AddedMass)
void InitObject(const LibUtilities::SessionReaderSharedPtr session, const MultiRegions::ExpListSharedPtr &pField, Array< OneD, NekDouble > pivot)
void SetMovableDoFs(std::vector< bool > &moveDoFs)
void SetOldFvis(Array< OneD, NekDouble > force)
void SetInitialConditions(const LibUtilities::SessionReaderSharedPtr session, Array< OneD, NekDouble > MRFData)
int m_spacedim
Spatial dimension (>= expansion dim).
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
std::vector< bool > m_movableDoFs
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Array< OneD, NekDouble > m_movingFrameData
Moving reference frame status in the body frame X, Y, Z, Theta_x, Theta_y, Theta_z,...
SOLVER_UTILS_EXPORT void GetMovableDoFs(std::set< int > &dirDoFs)
Base class for unsteady solvers.
void InitialiseFilter(Array< OneD, NekDouble > aeroforce)
RigidSolver m_rigidSolver
void v_SolveSolid(NekDouble time) override
void v_InitObject(bool DeclareField=true) override
Initialisation object for EquationSystem.
void v_DoInitialise(bool dumpInitialConditions=true) override
Sets up initial conditions.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
void Vvtvvtm(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtm (vector times vector minus vector times vector):
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.