35#include <boost/format.hpp>
67 const int nVel =
m_fields[0]->GetCoordim(0);
76 m_session->LoadSolverInfo(
"BCType", bcType,
"Normal");
83 &bndCond =
m_fields[0]->GetBndConditions();
85 for (
int i = 0; i < bndCond.size(); ++i)
87 if (boost::iequals(bndCond[i]->GetUserDefined(),
"Wall"))
95 ASSERTL0(numDeform > 0,
"You must specify at least one WALL tag on"
96 "a boundary condition");
104 for (
int j = 0; j < nVel; ++j)
108 m_fields[j]->GetBndCondExpansions()[id];
109 int nCoeffs = bndCondExp->GetNcoeffs();
113 1, bndCondExp->UpdateCoeffs(), 1);
135 for (
int i = 0; i <
m_fields.size(); ++i)
137 physvals[i] =
m_fields[i]->UpdatePhys();
143 int invalidElmtId = -1;
151 for (j = 0; j <
m_fields[0]->GetExpSize(); ++j)
154 m_fields[0]->GetExp(j)->GetGeom()->GetGeomFactors();
156 if (!geomFac->IsValid())
159 m_fields[0]->GetExp(j)->GetGeom()->GetGlobalID();
167 if (invalidElmtId >= 0)
169 if (
m_session->GetComm()->GetRank() == 0)
171 std::cout <<
"- Detected negative Jacobian in element "
173 <<
"; terminating at"
181 if (
m_session->GetComm()->GetRank() == 0)
183 std::cout <<
"Step: " << i << std::endl;
189 for (j = 0; j <
m_fields.size(); ++j)
191 std::string varName =
m_session->GetVariable(j);
197 for (j = 0; j <
m_fields.size(); ++j)
200 &bndCondExp =
m_fields[j]->GetBndCondExpansions();
205 const int nCoeffs = bndCondExp[id]->GetNcoeffs();
207 bndCondExp[
id]->UpdateCoeffs(), 1);
222 s <<
m_session->GetSessionName() <<
"-" << i;
228 std::string ss = s.str();
229 if (!fs::is_directory(ss))
231 fs::create_directory(ss);
236 filename = fs::path(ss) / fs::path(pad.str());
241 filename = fs::path(s.str());
245 std::string geomType =
m_session->GetGeometryType();
248 graphIO->SetMeshGraph(
m_graph);
249 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.
bool m_repeatBCs
Flag determining whether to repeat boundary conditions.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Virtual function for generating summary information.
static std::string className
Name of class.
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)