FrontISTR  5.7.1
Large-scale structural analysis program with finit element method
CFSTRDB_Boundary.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_Boundary Ver.1.0
7 */
8 
9 #include "CFSTRDB.h"
10 #include "CHECData.h"
11 
12 using namespace std;
13 
15  : CFSTRDataBlock(FSTRDB_BOUNDARY), ItemList() {}
16 
18 
19 void CFSTRDB_Boundary::Clear() { ItemList.clear(); }
20 
22  if (ItemList.size() == 0) return;
23 
24  hecd->WriteHeader("!BOUNDARY");
25  vector<CItem>::iterator iter;
26 
27  for (iter = ItemList.begin(); iter != ItemList.end(); iter++) {
28  hecd->WriteData("SIIF", iter->ngrp, iter->dof_ids, iter->dof_ide,
29  iter->value);
30  }
31 }
32 
33 bool CFSTRDB_Boundary::Read(CHECData *hecd, char *header_line) {
34  int rcode[10];
35 
36  while (1) {
37  CItem item;
38 
39  if (!hecd->ReadData(rcode, "SIIF", &item.ngrp, &item.dof_ids, &item.dof_ide,
40  &item.value))
41  break;
42 
43  ItemList.push_back(item);
44  }
45 
46  return true;
47 }
@ FSTRDB_BOUNDARY
Definition: CFSTRDB.h:36
char ngrp[hec_name_size]
Definition: CFSTRDB.h:165
std::vector< CItem > ItemList
Definition: CFSTRDB.h:182
virtual bool Read(class CHECData *hecd, char *header_line)
virtual void Write(class CHECData *hecd)
virtual void Clear()
virtual ~CFSTRDB_Boundary()
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