35#include <boost/format.hpp>
69 const int nVel =
m_fields[0]->GetCoordim(0);
78 m_session->LoadSolverInfo(
"BCType", bcType,
"Normal");
85 &bndCond =
m_fields[0]->GetBndConditions();
87 for (
int i = 0; i < bndCond.size(); ++i)
89 if (boost::iequals(bndCond[i]->GetUserDefined(),
"Wall"))
97 ASSERTL0(numDeform > 0,
"You must specify at least one WALL tag on"
98 "a boundary condition");
106 for (
int j = 0; j < nVel; ++j)
110 m_fields[j]->GetBndCondExpansions()[id];
111 int nCoeffs = bndCondExp->GetNcoeffs();
115 1, bndCondExp->UpdateCoeffs(), 1);
137 for (
int i = 0; i <
m_fields.size(); ++i)
139 physvals[i] =
m_fields[i]->UpdatePhys();
145 int invalidElmtId = -1;
153 for (j = 0; j <
m_fields[0]->GetExpSize(); ++j)
156 m_fields[0]->GetExp(j)->GetGeom()->GetGeomFactors();
158 if (!geomFac->IsValid())
161 m_fields[0]->GetExp(j)->GetGeom()->GetGlobalID();
169 if (invalidElmtId >= 0)
171 if (
m_session->GetComm()->GetRank() == 0)
173 cout <<
"- Detected negative Jacobian in element "
175 <<
"; terminating at"
183 if (
m_session->GetComm()->GetRank() == 0)
185 cout <<
"Step: " << i << endl;
191 for (j = 0; j <
m_fields.size(); ++j)
193 string varName =
m_session->GetVariable(j);
199 for (j = 0; j <
m_fields.size(); ++j)
202 &bndCondExp =
m_fields[j]->GetBndCondExpansions();
207 const int nCoeffs = bndCondExp[id]->GetNcoeffs();
209 bndCondExp[
id]->UpdateCoeffs(), 1);
224 s <<
m_session->GetSessionName() <<
"-" << i;
231 if (!fs::is_directory(ss))
233 fs::create_directory(ss);
238 filename = fs::path(ss) / fs::path(pad.str());
243 filename = fs::path(s.str());
247 string geomType =
m_session->GetGeometryType();
250 graphIO->SetMeshGraph(
m_graph);
251 graphIO->WriteGeometry(fname);
#define ASSERTL0(condition, msg)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_savedBCs
Storage for boundary conditions.
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void WriteGeometry(const int i)
Write out a file in serial or directory in parallel containing new mesh geometry.
void v_InitObject(bool DeclareFields=true) override
Initialisation object for EquationSystem.
static std::string className
Name of class.
bool m_repeatBCs
Flag determining whether to repeat boundary conditions.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Virtual function for generating summary information.
std::vector< int > m_toDeform
Vector of boundary regions to deform.
void v_DoSolve() override
Virtual function for solve implementation.
int m_numSteps
Number of steps to split deformation across.
IterativeElasticSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Base class for linear elastic system.
void v_InitObject(bool DeclareFields=true) override
Set up the linear elasticity system.
void v_DoSolve() override
Solve elliptic linear elastic system.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Generate summary at runtime.
SpatialDomains::MeshGraphSharedPtr m_graph
Pointer to graph defining mesh.
LibUtilities::CommSharedPtr m_comm
Communicator.
NekDouble m_time
Current time of simulation.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
void UpdateGeometry(SpatialDomains::MeshGraphSharedPtr graph, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &PhysVals, bool modal)
Update geometry according to displacement that is in current fields.
static std::string PortablePath(const fs::path &path)
create portable path on different platforms for std::filesystem path.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
MeshGraphIOFactory & GetMeshGraphIOFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)