void ExodusOutputT::AssembleQA (ArrayT<StringT>& qa) const { time_t now; time(&now); char date[40], time[20]; strftime(date, 40, "%x", localtime(&now)); strftime(time, 20, "%X", localtime(&now)); qa.Allocate (4); qa[0] = fCodeName; qa[1] = fVersion; qa[2] = date; qa[3] = time; }
void ParaDynOutputT::OpenGeometryFile (ParaDynT& par, ofstream& geo) const { StringT label = "atoms"; StringT geofile; geofile = CreateFileName (label); geo.open (geofile); // header int h = 0; ArrayT<StringT> header; header.Allocate (1); header[h] = " ITEM: NUMBER OF ATOMS"; par.WriteHeader (geo, header); }
// maybe someday this will be added to iArrayT ? void NodeManagerPrimitive::RemoveRepeats (ArrayT<int>& n) const { iArrayT nodes; nodes.Swap (n); nodes.SortAscending(); // determine number of nodes int count = 1; for (int m=1; m < nodes.Length(); m++) if (nodes[m] != nodes[m-1]) count++; // collect nodes, only once n.Allocate (count); int *pnew = n.Pointer(); int *pold = nodes.Pointer(); *pnew++ = *pold++; for (int ni=1; ni < nodes.Length(); ni++, *pold++) if (*pold != nodes[ni-1]) *pnew++ = *pold; }