FrontISTR  5.7.1
Large-scale structural analysis program with finit element method
CFSTRDB_Heat.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_Heat Ver.1.0
7 */
8 
9 #include "CFSTRDB.h"
10 #include "CHECData.h"
11 
12 using namespace std;
13 using namespace hecd_util;
14 
17  restart(0),
18  dt(0),
19  etime(0),
20  dtime(0),
21  deltmx(0),
22  itmax(20),
23  eps(1e-6) {}
24 
26 
28  restart = 0;
29  dt = 0;
30  etime = 0;
31  dtime = 0;
32  deltmx = 0;
33  itmax = 20;
34  eps = 1e-6;
35 }
36 
38  if (restart) {
39  hecd->WriteHeader("!HEAT", "S", "READ", "RESTART");
40 
41  } else {
42  hecd->WriteHeader("!HEAT");
43  }
44 
45  hecd->WriteData("FFFFIF", dt, etime, dtime, deltmx, itmax, eps);
46 }
47 
48 bool CFSTRDB_Heat::Read(CHECData *hecd, char *header_line) {
49  int rcode[10];
50  char s[256] = "";
51  char restart_s[256];
52 
53  if (!hecd->ParseHeader(header_line, rcode, "S", "READ", s)) return false;
54 
55  cleanup_token(s, restart_s);
56  toupper(restart_s);
57  restart = (strcmp(restart_s, "RESTERT") == 0);
58  hecd->ReadData(rcode, "FFFFIF", &dt, &etime, &dtime, &deltmx, &itmax, &eps);
59  return true;
60 }
@ FSTRDB_HEAT
Definition: CFSTRDB.h:44
double dt
Definition: CFSTRDB.h:345
virtual bool Read(class CHECData *hecd, char *header_line)
virtual void Clear()
virtual void Write(class CHECData *hecd)
double eps
Definition: CFSTRDB.h:347
double dtime
Definition: CFSTRDB.h:345
int restart
Definition: CFSTRDB.h:341
virtual ~CFSTRDB_Heat()
double deltmx
Definition: CFSTRDB.h:345
double etime
Definition: CFSTRDB.h:345
virtual bool ReadData(int *rcode, const char *fmt,...)
Definition: CHECData.cpp:548
virtual bool ParseHeader(char *header_line, int *rcode, const char *fmt,...)
Definition: CHECData.cpp:506
virtual void WriteData(const char *fmt,...)
Definition: CHECData.cpp:162
virtual void WriteHeader(const char *name, const char *fmt="",...)
Definition: CHECData.cpp:68
void toupper(char *s)
Definition: hecd_util.cpp:37
void cleanup_token(char *s)
Definition: hecd_util.cpp:13
real(kind=kreal) eps
Definition: m_fstr.f90:142
real(kind=kreal) etime
Definition: m_fstr.f90:140
integer(kind=kint) itmax
Definition: m_fstr.f90:141
real(kind=kreal) dt
ANALYSIS CONTROL for NLGEOM and HEAT.
Definition: m_fstr.f90:139