146 {
148 char time_file_name[255];
149 PetscBool flg = PETSC_TRUE;
151 time_file_name, 255, &flg);
153 if (flg != PETSC_TRUE) {
155 "*** ERROR %s (time_data FILE NEEDED)",
nAme.c_str());
156 }
157 FILE *time_data = fopen(time_file_name, "r");
158 if (time_data == NULL) {
160 "*** ERROR data file < %s > open unsuccessful", time_file_name);
161 }
162 double no1 = 0.0;
165 while (!feof(time_data)) {
167 fscanf(time_data, "%lf %lf %lf %lf", &no1, &no2[0], &no2[1], &no2[2]);
169 fgetc(time_data);
170 continue;
171 }
174 "*** ERROR read data file error (check input time data file) "
175 "{ n = %d }",
177 }
179 }
180 int r = fclose(time_data);
182 std::map<double, VectorDouble>::iterator tit =
tSeries.begin();
183 for (; tit !=
tSeries.end(); tit++) {
184 PetscPrintf(PETSC_COMM_WORLD,
185 "** read accelerogram %3.2e time %3.2e %3.2e %3.2e\n",
186 tit->first, tit->second[0], tit->second[1], tit->second[2]);
187 }
188 }
189 if (r != 0) {
190 SETERRQ(PETSC_COMM_SELF, 1, "*** ERROR file close unsuccessful");
191 }
194 }
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
FTensor::Index< 'n', SPACE_DIM > n
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)