36 #include <boost/format.hpp>
53 RegisterCreatorFunction(
"IterativeElasticSystem",
66 const int nVel =
m_fields[0]->GetCoordim(0);
75 m_session->LoadSolverInfo(
"BCType", bcType,
"Normal");
82 &bndCond =
m_fields[0]->GetBndConditions();
84 for (
int i = 0; i < bndCond.num_elements(); ++i)
86 if (boost::iequals(bndCond[i]->GetUserDefined(),
"Wall"))
94 ASSERTL0(numDeform > 0,
"You must specify at least one WALL tag on"
95 "a boundary condition");
103 for (
int j = 0; j < nVel; ++j)
107 m_fields[j]->GetBndCondExpansions()[id];
108 int nCoeffs = bndCondExp->GetNcoeffs();
112 bndCondExp->GetCoeffs(), 1,
113 bndCondExp->UpdateCoeffs(), 1);
136 int invalidElmtId = -1;
144 for (j = 0; j <
m_fields[0]->GetExpSize(); ++j)
147 m_fields[0]->GetExp(j)->GetGeom()->GetGeomFactors();
149 if (!geomFac->IsValid())
152 m_fields[0]->GetExp(j)->GetGeom()->GetGlobalID();
160 if (invalidElmtId >= 0)
162 if (
m_session->GetComm()->GetRank() == 0)
164 cout <<
"- Detected negative Jacobian in element "
165 << invalidElmtId <<
"; terminating at"
172 if (
m_session->GetComm()->GetRank() == 0)
174 cout <<
"Step: " << i << endl;
180 for (j = 0; j <
m_fields.num_elements(); ++j)
182 string varName =
m_session->GetVariable(j);
188 for (j = 0; j <
m_fields.num_elements(); ++j)
191 &bndCondExp =
m_fields[j]->GetBndCondExpansions();
196 const int nCoeffs = bndCondExp[id]->GetNcoeffs();
199 bndCondExp[
id]->UpdateCoeffs(), 1);
214 s <<
m_session->GetSessionName() <<
"-" << i;
220 if(!fs::is_directory(s.str()))
222 fs::create_directory(s.str());
225 boost::format pad(
"P%1$07d.xml");
227 filename = fs::path(s.str()) / fs::path(pad.str());
232 filename = fs::path(s.str());
236 m_fields[0]->GetGraph()->WriteGeometry(fname);
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
#define ASSERTL0(condition, msg)
virtual void v_InitObject()
Set up the linear elasticity system.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Generate summary at runtime.
NekDouble m_time
Current time of simulation.
std::vector< std::pair< std::string, std::string > > SummaryList
static std::string className
Name of class.
void UpdateGeometry(SpatialDomains::MeshGraphSharedPtr graph, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, bool modal)
Update geometry according to displacement that is in current fields.
int m_numSteps
Number of steps to split deformation across.
virtual void v_DoSolve()
Solve elliptic linear elastic system.
vector< int > m_toDeform
Vector of boundary regions to deform.
bool m_repeatBCs
Flag determining whether to repeat boundary conditions.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
LibUtilities::CommSharedPtr m_comm
Communicator.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_savedBCs
Storage for boundary conditions.
IterativeElasticSystem(const LibUtilities::SessionReaderSharedPtr &pSession)
Base class for linear elastic system.
virtual void v_InitObject()
Set up the linear elasticity system.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Generate summary at runtime.
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::string PortablePath(const boost::filesystem::path &path)
create portable path on different platforms for boost::filesystem path
EquationSystemFactory & GetEquationSystemFactory()
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SpatialDomains::MeshGraphSharedPtr m_graph
Pointer to graph defining mesh.
virtual void v_DoSolve()
Solve elliptic linear elastic system.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void WriteGeometry(const int i)
Write out a file in serial or directory in parallel containing new mesh geometry. ...