Force scale operator for reading two columns.
More...
#include <tutorials/src/TimeForceScale.hpp>
Force scale operator for reading two columns.
- Examples
- bone_adaptation.cpp, nonlinear_dynamics.cpp, Remodeling.cpp, and UnsaturatedFlow.hpp.
Definition at line 18 of file TimeForceScale.hpp.
◆ TimeForceScale() [1/2]
TimeForceScale::TimeForceScale |
( |
string |
name = "-my_time_data_file" , |
|
|
bool |
error_if_file_not_given = false |
|
) |
| |
|
inline |
◆ TimeForceScale() [2/2]
TimeForceScale::TimeForceScale |
( |
string |
name = "-my_time_data_file" , |
|
|
bool |
error_if_file_not_given = false |
|
) |
| |
|
inline |
◆ getForceScale() [1/2]
MoFEMErrorCode TimeForceScale::getForceScale |
( |
const double |
ts_t, |
|
|
double & |
scale |
|
) |
| |
|
inlinevirtual |
Reimplemented from MethodForForceScaling.
Definition at line 89 of file TimeForceScale.hpp.
96 SETERRQ(PETSC_COMM_SELF, 1,
"data file not read");
99 double t0 = 0, t1, s0 =
tSeries[0], s1,
dt;
100 std::map<double, double>::iterator tit =
tSeries.begin();
101 for (; tit !=
tSeries.end(); tit++) {
102 if (tit->first > ts_t) {
106 scale = s0 + ((s1 - s0) / (t1 - t0)) *
dt;
◆ getForceScale() [2/2]
MoFEMErrorCode TimeForceScale::getForceScale |
( |
const double |
ts_t, |
|
|
double & |
scale |
|
) |
| |
|
inlinevirtual |
Reimplemented from MethodForForceScaling.
Definition at line 89 of file TimeForceScale.hpp.
96 SETERRQ(PETSC_COMM_SELF, 1,
"data file not read");
99 double t0 = 0, t1, s0 =
tSeries[0], s1,
dt;
100 std::map<double, double>::iterator tit =
tSeries.begin();
101 for (; tit !=
tSeries.end(); tit++) {
102 if (tit->first > ts_t) {
106 scale = s0 + ((s1 - s0) / (t1 - t0)) *
dt;
◆ scaleNf() [1/2]
MoFEMErrorCode TimeForceScale::scaleNf |
( |
const FEMethod * |
fe, |
|
|
VectorDouble & |
Nf |
|
) |
| |
|
inlinevirtual |
◆ scaleNf() [2/2]
MoFEMErrorCode TimeForceScale::scaleNf |
( |
const FEMethod * |
fe, |
|
|
VectorDouble & |
Nf |
|
) |
| |
|
inlinevirtual |
◆ timeData() [1/2]
MoFEMErrorCode TimeForceScale::timeData |
( |
| ) |
|
|
inline |
Definition at line 36 of file TimeForceScale.hpp.
38 char time_file_name[255];
40 time_file_name, 255, &
fLg);
44 "*** ERROR %s (time_data FILE NEEDED)",
nAme.c_str());
48 "The %s file not provided. Loading scaled with time.",
52 FILE *time_data = fopen(time_file_name,
"r");
53 if (time_data == NULL) {
55 "*** ERROR data file < %s > open unsuccessful", time_file_name);
57 double no1 = 0.0, no2 = 0.0;
59 while (!feof(time_data)) {
60 int n = fscanf(time_data,
"%lf %lf", &no1, &no2);
61 if ((
n <= 0) || ((no1 == 0) && (no2 == 0))) {
67 "*** ERROR read data file error (check input time data file) "
73 int r = fclose(time_data);
75 std::map<double, double>::iterator tit =
tSeries.begin();
76 for (; tit !=
tSeries.end(); tit++) {
77 PetscPrintf(PETSC_COMM_WORLD,
"** read time series %3.2e time %3.2e\n",
78 tit->first, tit->second);
83 "*** ERROR file close unsuccessful");
◆ timeData() [2/2]
MoFEMErrorCode TimeForceScale::timeData |
( |
| ) |
|
|
inline |
Definition at line 36 of file TimeForceScale.hpp.
38 char time_file_name[255];
40 time_file_name, 255, &
fLg);
44 "*** ERROR %s (time_data FILE NEEDED)",
nAme.c_str());
48 "The %s file not provided. Loading scaled with time.",
52 FILE *time_data = fopen(time_file_name,
"r");
53 if (time_data == NULL) {
55 "*** ERROR data file < %s > open unsuccessful", time_file_name);
57 double no1 = 0.0, no2 = 0.0;
59 while (!feof(time_data)) {
60 int n = fscanf(time_data,
"%lf %lf", &no1, &no2);
61 if ((
n <= 0) || ((no1 == 0) && (no2 == 0))) {
67 "*** ERROR read data file error (check input time data file) "
73 int r = fclose(time_data);
75 std::map<double, double>::iterator tit =
tSeries.begin();
76 for (; tit !=
tSeries.end(); tit++) {
77 PetscPrintf(PETSC_COMM_WORLD,
"** read time series %3.2e time %3.2e\n",
78 tit->first, tit->second);
83 "*** ERROR file close unsuccessful");
◆ debug
int TimeForceScale::debug |
◆ errorIfFileNotGiven
bool TimeForceScale::errorIfFileNotGiven |
◆ fLg
PetscBool TimeForceScale::fLg |
◆ nAme
string TimeForceScale::nAme |
◆ readFile
int TimeForceScale::readFile |
◆ tSeries
The documentation for this struct was generated from the following file: