FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
CFSTRDB_Step.cpp
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 /*
6  CFSTRDB_Step Ver.1.0
7 */
8 
9 #include "CFSTRDB.h"
10 #include "CHECData.h"
11 
12 using namespace std;
13 using namespace hecd_util;
14 
16  : CFSTRDataBlock(FSTRDB_STEP), type(TYPE_STANDARD), incmax(100) {}
17 
19 
22  incmax = 100;
23 }
24 
26  if (type == TYPE_NLGEOM) {
27  hecd->WriteHeader("!STEP", "SI", "TYPE", "NLGEOM", "INCMAX", incmax);
28  }
29 }
30 
31 bool CFSTRDB_Step::Read(CHECData *hecd, char *header_line) {
32  char s[256] = "";
33  char type_s[256];
34  int rcode[10];
35 
36  if (!hecd->ParseHeader(header_line, rcode, "SI", "TYPE", s, "INCMAX",
37  &incmax))
38  return false;
39 
40  cleanup_token(s, type_s);
41  toupper(type_s);
42 
43  if (strcmp(type_s, "STANDARD") == 0) {
45 
46  } else if (strcmp(type_s, "NLGEOM") == 0) {
47  type = TYPE_NLGEOM;
48 
49  } else
50  return false;
51 
52  return true;
53 }
CFSTRDB_Step::incmax
int incmax
Definition: CFSTRDB.h:136
CFSTRDB_Step::Read
virtual bool Read(class CHECData *hecd, char *header_line)
Definition: CFSTRDB_Step.cpp:31
CHECData::ParseHeader
virtual bool ParseHeader(char *header_line, int *rcode, const char *fmt,...)
Definition: CHECData.cpp:506
CHECData.h
CFSTRDB_Step::Write
virtual void Write(class CHECData *hecd)
Definition: CFSTRDB_Step.cpp:25
hecd_util::toupper
void toupper(char *s)
Definition: hecd_util.cpp:40
FSTRDB_STEP
@ FSTRDB_STEP
Definition: CFSTRDB.h:33
CFSTRDB.h
hecd_util::cleanup_token
void cleanup_token(char *s)
Definition: hecd_util.cpp:16
CFSTRDB_Step::Clear
virtual void Clear()
Definition: CFSTRDB_Step.cpp:20
CFSTRDB_Step::~CFSTRDB_Step
virtual ~CFSTRDB_Step()
Definition: CFSTRDB_Step.cpp:18
CHECData::WriteHeader
virtual void WriteHeader(const char *name, const char *fmt="",...)
Definition: CHECData.cpp:68
CHECData
Definition: CHECData.h:25
CFSTRDB_Step::TYPE_STANDARD
@ TYPE_STANDARD
Definition: CFSTRDB.h:135
hecd_util
Definition: hecd_util.cpp:11
CFSTRDataBlock
Definition: CFSTRDB.h:58
CFSTRDB_Step::TYPE_NLGEOM
@ TYPE_NLGEOM
Definition: CFSTRDB.h:135
CFSTRDB_Step::CFSTRDB_Step
CFSTRDB_Step()
Definition: CFSTRDB_Step.cpp:15
CFSTRDB_Step::type
int type
Definition: CFSTRDB.h:134