FrontISTR  5.2.0
Large-scale structural analysis program with finit element method
CFSTRDB_CLoad.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_CLoad Ver.1.0
7 */
8 
9 #include "CFSTRDB.h"
10 #include "CHECData.h"
11 
12 using namespace std;
13 
15 
17 
18 void CFSTRDB_CLoad::Clear() { ItemList.clear(); }
19 
21  if (ItemList.size() == 0) return;
22 
23  hecd->WriteHeader("!CLOAD");
24  vector<CItem>::iterator iter;
25 
26  for (iter = ItemList.begin(); iter != ItemList.end(); iter++) {
27  hecd->WriteData("SIF", iter->ngrp, iter->dof_id, iter->value);
28  }
29 }
30 
31 bool CFSTRDB_CLoad::Read(CHECData *hecd, char *header_line) {
32  int rcode[10];
33 
34  while (1) {
35  CItem item;
36 
37  if (!hecd->ReadData(rcode, "SIF", &item.ngrp, &item.dof_id, &item.value))
38  break;
39 
40  ItemList.push_back(item);
41  }
42 
43  return true;
44 }
@ FSTRDB_CLOAD
Definition: CFSTRDB.h:37
char ngrp[hec_name_size]
Definition: CFSTRDB.h:195
virtual void Write(class CHECData *hecd)
virtual bool Read(class CHECData *hecd, char *header_line)
virtual ~CFSTRDB_CLoad()
std::vector< CItem > ItemList
Definition: CFSTRDB.h:209
virtual void Clear()
virtual bool ReadData(int *rcode, const char *fmt,...)
Definition: CHECData.cpp:548
virtual void WriteData(const char *fmt,...)
Definition: CHECData.cpp:162
virtual void WriteHeader(const char *name, const char *fmt="",...)
Definition: CHECData.cpp:68