141 {
142
144
145 char time_file_name[255];
146 PetscBool flg = PETSC_FALSE;
149 time_file_name, 255, &flg);
150
151 if (!flg) {
154 "*** ERROR %s (time_data FILE NEEDED)",
nAme.c_str());
156 }
157
158 FILE *time_data = fopen(time_file_name, "r");
159 if (time_data == NULL) {
161 "*** ERROR data file < %s > open unsuccessful", time_file_name);
162 }
163 double no1 = 0.0;
168 while (!feof(time_data)) {
170 fscanf(time_data, "%lf %lf %lf %lf", &no1, &no2(0), &no2(1), &no2(2));
172 fgetc(time_data);
173 continue;
174 }
177 "*** ERROR read data file error (check input time data file) "
178 "{ n = %d }",
180 }
182 }
183 int r = fclose(time_data);
185
186 for (
auto &[ts, vec] :
tSeries) {
187 PetscPrintf(PETSC_COMM_WORLD,
188 "** read vector %3.2e time %3.2e %3.2e %3.2e\n",
189 ts, vec(0), vec(1), vec(2));
190 }
191 }
192 if (r != 0) {
193 SETERRQ(PETSC_COMM_SELF, 1, "*** ERROR file close unsuccessful");
194 }
196
200 };
201
203}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'n', SPACE_DIM > n
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
virtual FTensor::Tensor1< double, SPACE_DIM > getVectorFromData(const double time)