FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
CFSTRDB_SFlux.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_SFlux Ver.1.0
7*/
8
9#include "CFSTRDB.h"
10#include "CHECData.h"
11
12using namespace std;
13using namespace hecd_util;
14
16 amp[0] = 0;
17}
18
20
22 ItemList.clear();
23 amp[0] = 0;
24}
25
27 if (ItemList.size() == 0) return;
28
29 if (amp[0] == 0) {
30 hecd->WriteHeader("!SFLUX");
31
32 } else {
33 hecd->WriteHeader("!SFLUX", "S", "AMP", amp);
34 }
35
36 vector<CItem>::iterator iter;
37
38 for (iter = ItemList.begin(); iter != ItemList.end(); iter++) {
39 hecd->WriteData("SF", iter->sgrp, iter->value);
40 }
41}
42
43bool CFSTRDB_SFlux::Read(CHECData *hecd, char *header_line) {
44 int rcode[10];
45 amp[0] = 0;
46
47 if (!hecd->ParseHeader(header_line, rcode, "S", "AMP", amp)) return false;
48
49 while (1) {
50 CItem item;
51 bool fg = hecd->ReadData(rcode, "SF", item.sgrp, &item.value);
52
53 if (!fg) break;
54
55 ItemList.push_back(item);
56 }
57
58 return true;
59}
@ FSTRDB_SFLUX
Definition: CFSTRDB.h:48
char sgrp[hec_name_size]
Definition: CFSTRDB.h:458
std::vector< CItem > ItemList
Definition: CFSTRDB.h:471
virtual void Clear()
virtual bool Read(class CHECData *hecd, char *header_line)
virtual void Write(class CHECData *hecd)
char amp[hec_name_size]
Definition: CFSTRDB.h:467
virtual ~CFSTRDB_SFlux()
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