FEDEM Model Database  R8.0
Source code of the FEDEM model database
FmSolverParser.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FM_SOLVER_PARSER_H
14 #define FM_SOLVER_PARSER_H
15 
16 #include <vector>
17 #include <string>
18 #include <cstdio>
19 
20 class FmPart;
21 class FmJointBase;
22 class FmCamJoint;
23 
24 
30 {
31 public:
33  explicit FmSolverParser(const char* fileName = NULL);
36 
38  int writeFullFile();
39 
41  static bool preSimuleCheck();
42 
46  void setRelPathCorrection(const std::string& path);
48  void setRDBPath(const std::string& path) { myRDBPath = path; }
49 
50 protected:
52  FmSolverParser(const FmSolverParser&) = delete;
55 
57  int writeHeading();
59  int writeEnvironment();
63  int writeBeams(int& nextBaseId);
65  int writeParts(std::vector<FmPart*>& gageParts);
67  int writeRosettes(const std::vector<FmPart*>& gageParts);
69  int writeSensors();
71  int writeSprings();
73  int writeJoints();
74 
76  int writeContactElement(FmCamJoint* aJoint);
78  int writeFriction(FmJointBase* aJoint, const std::vector<int>& iDof);
79 
83  int writeAllOfType(int classTypeID);
84 
85 private:
87  std::string myRDBPath;
89  std::string myRelPathCorrection;
90 
91  FILE* myFile;
92 };
93 
94 #endif
Definition: FmCamJoint.H:15
Definition: FmJointBase.H:22
Definition: FmPart.H:47
Class managing writing the FEDEM dynamics solver input file.
Definition: FmSolverParser.H:30
int writeFriction(FmJointBase *aJoint, const std::vector< int > &iDof)
Writes friction data, if any, for a joint to the solver input file.
Definition: FmSolverParser.C:1503
int writeSprings()
Writes all axial- and joint-springs to the solver input file.
Definition: FmSolverParser.C:1557
int writeAdditionalMasses()
Writes all additional masses to the solver input file.
Definition: FmSolverParser.C:253
int writeContactElement(FmCamJoint *aJoint)
Writes a cam joint element to the solver input file.
Definition: FmSolverParser.C:1452
void setRelPathCorrection(const std::string &path)
Assigns the myRelPathCorrection member.
Definition: FmSolverParser.C:72
FmSolverParser & operator=(const FmSolverParser &)=delete
Deleted assignment operator.
int writeBeams(int &nextBaseId)
Writes all beam elements to the solver input file.
Definition: FmSolverParser.C:738
FmSolverParser(const FmSolverParser &)=delete
Deleted copy constructor.
int writeSensors()
Writes all sensors to the solver input file.
Definition: FmSolverParser.C:1610
std::string myRDBPath
Absolute path to where the dynamics solver will be run from.
Definition: FmSolverParser.H:87
int writeFullFile()
Writes the full solver input file for the current model.
Definition: FmSolverParser.C:120
int writeEnvironment()
Writes the environment record to the solver input file.
Definition: FmSolverParser.C:197
int writeParts(std::vector< FmPart * > &gageParts)
Writes all generic and FE parts to the solver input file.
Definition: FmSolverParser.C:268
int writeHeading()
Writes the heading of the solver input file.
Definition: FmSolverParser.C:174
std::string myRelPathCorrection
Path to the model file location relative to myRDBPath.
Definition: FmSolverParser.H:89
FmSolverParser(const char *fileName=NULL)
The default constructor opens the named solver input file.
Definition: FmSolverParser.C:58
FILE * myFile
Pointer to the solver input file being written.
Definition: FmSolverParser.H:91
void setRDBPath(const std::string &path)
Assigns the myRDBPath member.
Definition: FmSolverParser.H:48
~FmSolverParser()
The destructor closes the solver input file.
Definition: FmSolverParser.C:64
int writeRosettes(const std::vector< FmPart * > &gageParts)
Writes all strain rosettes to the solver input file.
Definition: FmSolverParser.C:1646
int writeJoints()
Writes all joints to the solver input file.
Definition: FmSolverParser.C:765
int writeAllOfType(int classTypeID)
Writes solver input record for all objects of type classTypeID.
Definition: FmSolverParser.C:1662
static bool preSimuleCheck()
Performs some consistency checking on the current model.
Definition: FmSolverParser.C:78