Added functions for parsing SimulationJob
This commit is contained in:
parent
adaf49627f
commit
b4928c720b
|
|
@ -93,7 +93,7 @@ void ChronosEulerSimulationModel::parseForces(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChronosEulerSimulationModel::parseConstrainedVertices(
|
void ChronosEulerSimulationModel::parseConstrainedVertices(
|
||||||
const std::shared_ptr<SimulationJob> &pJob,
|
const std::shared_ptr<const SimulationJob> &pJob,
|
||||||
const std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronoNodes,
|
const std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronoNodes,
|
||||||
chrono::ChSystemSMC &my_system)
|
chrono::ChSystemSMC &my_system)
|
||||||
{
|
{
|
||||||
|
|
@ -138,16 +138,16 @@ void ChronosEulerSimulationModel::parseConstrainedVertices(
|
||||||
SimulationResults ChronosEulerSimulationModel::executeSimulation(
|
SimulationResults ChronosEulerSimulationModel::executeSimulation(
|
||||||
const std::shared_ptr<SimulationJob> &pJob)
|
const std::shared_ptr<SimulationJob> &pJob)
|
||||||
{
|
{
|
||||||
assert(pJob->pMesh->VN() != 0);
|
// assert(pJob->pMesh->VN() != 0);
|
||||||
const bool structureInitialized = mesh_chronos != nullptr;
|
// const bool structureInitialized = mesh_chronos != nullptr;
|
||||||
const bool wasInitializedWithDifferentStructure = structureInitialized
|
// const bool wasInitializedWithDifferentStructure = structureInitialized
|
||||||
&& (pJob->pMesh->EN()
|
// && (pJob->pMesh->EN()
|
||||||
!= mesh_chronos->GetNelements()
|
// != mesh_chronos->GetNelements()
|
||||||
|| pJob->pMesh->VN()
|
// || pJob->pMesh->VN()
|
||||||
!= mesh_chronos->GetNnodes());
|
// != mesh_chronos->GetNnodes());
|
||||||
if (!structureInitialized || wasInitializedWithDifferentStructure) {
|
// if (!structureInitialized || wasInitializedWithDifferentStructure) {
|
||||||
setStructure(pJob->pMesh);
|
setStructure(pJob->pMesh);
|
||||||
}
|
// }
|
||||||
chrono::ChSystemSMC my_system;
|
chrono::ChSystemSMC my_system;
|
||||||
// chrono::irrlicht::ChIrrApp application(&my_system,
|
// chrono::irrlicht::ChIrrApp application(&my_system,
|
||||||
// L"Irrlicht FEM visualization",
|
// L"Irrlicht FEM visualization",
|
||||||
|
|
@ -186,7 +186,7 @@ SimulationResults ChronosEulerSimulationModel::executeSimulation(
|
||||||
// solver->SetTolerance(1e-8);
|
// solver->SetTolerance(1e-8);
|
||||||
solver->EnableWarmStart(true); // IMPORTANT for convergence when using EULER_IMPLICIT_LINEARIZED
|
solver->EnableWarmStart(true); // IMPORTANT for convergence when using EULER_IMPLICIT_LINEARIZED
|
||||||
solver->EnableDiagonalPreconditioner(true);
|
solver->EnableDiagonalPreconditioner(true);
|
||||||
my_system.SetSolverForceTolerance(1e-6);
|
// my_system.SetSolverForceTolerance(1e-6);
|
||||||
solver->SetVerbose(false);
|
solver->SetVerbose(false);
|
||||||
|
|
||||||
SimulationResults simulationResults;
|
SimulationResults simulationResults;
|
||||||
|
|
@ -231,7 +231,7 @@ SimulationResults ChronosEulerSimulationModel::executeSimulation(
|
||||||
simulationResults.displacements[vi][5] = eulerAngles[2];
|
simulationResults.displacements[vi][5] = eulerAngles[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
simulationResults.setLabelPrefix("chronos");
|
simulationResults.simulationModelUsed = label;
|
||||||
return simulationResults;
|
return simulationResults;
|
||||||
|
|
||||||
// VCGEdgeMesh deformedMesh;
|
// VCGEdgeMesh deformedMesh;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,15 @@ class ChronosEulerSimulationModel : public SimulationModel
|
||||||
std::shared_ptr<chrono::fea::ChMesh> mesh_chronos;
|
std::shared_ptr<chrono::fea::ChMesh> mesh_chronos;
|
||||||
std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> edgeMeshVertsToChronoNodes;
|
std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> edgeMeshVertsToChronoNodes;
|
||||||
|
|
||||||
|
static void parseConstrainedVertices(
|
||||||
|
const std::shared_ptr<const SimulationJob> &pJob,
|
||||||
|
const std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronoNodes,
|
||||||
|
chrono::ChSystemSMC &my_system);
|
||||||
|
static void parseForces(
|
||||||
|
const std::shared_ptr<chrono::fea::ChMesh> &mesh_chronos,
|
||||||
|
const std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronoNodes,
|
||||||
|
const std::unordered_map<VertexIndex, Vector6d> &nodalExternalForces);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ChronosEulerSimulationModel();
|
ChronosEulerSimulationModel();
|
||||||
SimulationResults executeSimulation(const std::shared_ptr<SimulationJob> &pJob) override;
|
SimulationResults executeSimulation(const std::shared_ptr<SimulationJob> &pJob) override;
|
||||||
|
|
@ -24,15 +33,7 @@ public:
|
||||||
const std::shared_ptr<SimulationMesh> &pMesh,
|
const std::shared_ptr<SimulationMesh> &pMesh,
|
||||||
std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronosNodes);
|
std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronosNodes);
|
||||||
|
|
||||||
private:
|
inline const static std::string label{"Chronos_nonLinear_Euler"};
|
||||||
static void parseConstrainedVertices(
|
|
||||||
const std::shared_ptr<SimulationJob> &pJob,
|
|
||||||
const std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronoNodes,
|
|
||||||
chrono::ChSystemSMC &my_system);
|
|
||||||
static void parseForces(
|
|
||||||
const std::shared_ptr<chrono::fea::ChMesh> &mesh_chronos,
|
|
||||||
const std::vector<std::shared_ptr<chrono::fea::ChNodeFEAxyzrot>> &edgeMeshVertsToChronoNodes,
|
|
||||||
const std::unordered_map<VertexIndex, Vector6d> &nodalExternalForces);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHRONOSEULERSIMULATIONMODEL_HPP
|
#endif // CHRONOSEULERSIMULATIONMODEL_HPP
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue