35 #include <boost/format.hpp>
53 string IterativeElasticSystem::className =
55 "IterativeElasticSystem", IterativeElasticSystem::create);
57 IterativeElasticSystem::IterativeElasticSystem(
68 const int nVel =
m_fields[0]->GetCoordim(0);
77 m_session->LoadSolverInfo(
"BCType", bcType,
"Normal");
84 &bndCond =
m_fields[0]->GetBndConditions();
86 for (
int i = 0; i < bndCond.size(); ++i)
88 if (boost::iequals(bndCond[i]->GetUserDefined(),
"Wall"))
96 ASSERTL0(numDeform > 0,
"You must specify at least one WALL tag on"
97 "a boundary condition");
105 for (
int j = 0; j < nVel; ++j)
109 m_fields[j]->GetBndCondExpansions()[id];
110 int nCoeffs = bndCondExp->GetNcoeffs();
114 1, bndCondExp->UpdateCoeffs(), 1);
136 for (
int i = 0; i <
m_fields.size(); ++i)
138 physvals[i] =
m_fields[i]->UpdatePhys();
144 int invalidElmtId = -1;
152 for (j = 0; j <
m_fields[0]->GetExpSize(); ++j)
155 m_fields[0]->GetExp(j)->GetGeom()->GetGeomFactors();
157 if (!geomFac->IsValid())
160 m_fields[0]->GetExp(j)->GetGeom()->GetGlobalID();
168 if (invalidElmtId >= 0)
170 if (
m_session->GetComm()->GetRank() == 0)
172 cout <<
"- Detected negative Jacobian in element "
174 <<
"; terminating at"
182 if (
m_session->GetComm()->GetRank() == 0)
184 cout <<
"Step: " << i << endl;
190 for (j = 0; j <
m_fields.size(); ++j)
192 string varName =
m_session->GetVariable(j);
198 for (j = 0; j <
m_fields.size(); ++j)
201 &bndCondExp =
m_fields[j]->GetBndCondExpansions();
206 const int nCoeffs = bndCondExp[id]->GetNcoeffs();
208 bndCondExp[
id]->UpdateCoeffs(), 1);
223 s <<
m_session->GetSessionName() <<
"-" << i;
230 if (!fs::is_directory(ss))
232 fs::create_directory(ss);
237 filename = fs::path(ss) / fs::path(pad.str());
242 filename = fs::path(s.str());
246 m_fields[0]->GetGraph()->WriteGeometry(fname);
#define ASSERTL0(condition, msg)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_savedBCs
Storage for boundary conditions.
void WriteGeometry(const int i)
Write out a file in serial or directory in parallel containing new mesh geometry.
virtual void v_InitObject(bool DeclareFields=true) override
Set up the linear elasticity system.
bool m_repeatBCs
Flag determining whether to repeat boundary conditions.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Generate summary at runtime.
std::vector< int > m_toDeform
Vector of boundary regions to deform.
virtual void v_DoSolve() override
Solve elliptic linear elastic system.
int m_numSteps
Number of steps to split deformation across.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Base class for linear elastic system.
virtual void v_InitObject(bool DeclareFields=true) override
Set up the linear elasticity system.
virtual void v_DoSolve() override
Solve elliptic linear elastic system.
virtual 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.
std::string PortablePath(const boost::filesystem::path &path)
create portable path on different platforms for boost::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.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
The above copyright notice and this permission notice shall be included.
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)