FEDEM Model Database  R8.0
Source code of the FEDEM model database
FFlSesamReader.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 
8 #ifndef FFL_SESAM_READER_H
9 #define FFL_SESAM_READER_H
10 
11 #include <string>
12 #include <vector>
13 #include <map>
14 
16 
17 #ifdef FF_NAMESPACE
18 namespace FF_NAMESPACE {
19 #endif
20 
21 
23 {
24  struct Record
25  {
26  Record(const std::vector<double>& f) : fields(f) {}
27  std::vector<double> fields;
28  std::vector<std::string> text;
29  };
30 
31  typedef std::vector<Record> Records;
32  typedef std::map<std::string,Records> RecordMap;
33  typedef std::map<long int,short int> LSintMap;
34  typedef std::map<int,int> IntMap;
35 
36 public:
37  FFlSesamReader(FFlLinkHandler* readIntoLink);
38  virtual ~FFlSesamReader();
39 
40  static void init();
41  static void identifierCB(const std::string& fileName, int& isSesamFile);
42  static void readerCB (const std::string& fileName, FFlLinkHandler* link);
43 
44  static const std::string& findName(const Records& names, int ID);
45 
46 protected:
47  bool read(const std::string& fileName);
48  bool parse(const std::string& fileName);
49 
50  bool readNodes(const Records& recs);
51  bool readBCs(const Records& recs);
52  bool readMasses(const Records& recs);
53  bool readLinearDependencies(const Records& recs);
54  bool readElements(const Records& recs);
55  bool readElementRefs(const Records& recs,
56  const Records& eccs, const Records& univ);
57  bool readHinges(const Records& recs);
58  bool readBeamSections(const Records& recs, const Records& names);
59  bool readThicknesses(const Records& recs, const Records& names);
60  bool readMaterials(const Records& recs, const Records& names);
61  bool readGroundSprings(const Records& recs);
62  bool readUnitVectors(const Records& recs);
63  bool readGroups(const Records& recs, const Records& names);
64 
65 private:
69 };
70 
71 #ifdef FF_NAMESPACE
72 } // namespace
73 #endif
74 #endif
Container class for finite element models.
Definition: FFlLinkHandler.H:95
Definition: FFlReaderBase.H:23
Definition: FFlSesamReader.H:23
std::map< int, int > IntMap
Definition: FFlSesamReader.H:34
LSintMap myLinearDepDofs
Definition: FFlSesamReader.H:68
RecordMap myRecs
Definition: FFlSesamReader.H:66
std::map< long int, short int > LSintMap
Definition: FFlSesamReader.H:33
std::vector< Record > Records
Definition: FFlSesamReader.H:31
IntMap myHinges
Definition: FFlSesamReader.H:67
std::map< std::string, Records > RecordMap
Definition: FFlSesamReader.H:32
int read(FILE *fd, std::string &tag, unsigned int &cs, int tagLength=LEN_TAG)
Reads the file tag and checksum from the provided file.
Definition: FFaTag.C:317
void init()
Definition: FmDB.C:518
Definition: FFlSesamReader.H:25
Record(const std::vector< double > &f)
Definition: FFlSesamReader.H:26
std::vector< double > fields
Definition: FFlSesamReader.H:27
std::vector< std::string > text
Definition: FFlSesamReader.H:28