v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MatOps::AgingFpyTimeScale Struct Reference
Inheritance diagram for MatOps::AgingFpyTimeScale:
[legend]
Collaboration diagram for MatOps::AgingFpyTimeScale:
[legend]

Public Member Functions

std::vector< int > getStep (const double time)
 
 TimeScale (std::string file_name="", bool error_if_file_not_given=false, ScalingFun def_scaling_fun=[](double time) { return time;})
 TimeScale constructor.
 
 TimeScale (std::string file_name, std::string delimiter, bool error_if_file_not_given=false, ScalingFun def_scaling_fun=[](double time) { return time;})
 TimeScale constructor.
 
- Public Member Functions inherited from MoFEM::TimeScale
 TimeScale (std::string file_name="", bool error_if_file_not_given=false, ScalingFun def_scaling_fun=[](double time) { return time;})
 TimeScale constructor.
 
 TimeScale (std::string file_name, std::string delimiter, bool error_if_file_not_given=false, ScalingFun def_scaling_fun=[](double time) { return time;})
 TimeScale constructor.
 
double getScale (const double time)
 Get scaling at a given time.
 
- Public Member Functions inherited from MoFEM::ScalingMethod
 ScalingMethod ()=default
 
virtual ~ScalingMethod ()=default
 

Additional Inherited Members

- Public Types inherited from MoFEM::TimeScale
using ScalingFun = std::function< double(double)>
 
- Public Attributes inherited from MoFEM::TimeScale
std::string fileName = ""
 
PetscBool argFileScale = PETSC_FALSE
 

Detailed Description

Definition at line 32 of file MatAmentumUmat.cpp.

Member Function Documentation

◆ getStep()

std::vector< int > MatOps::AgingFpyTimeScale::getStep ( const double  time)
inline

Definition at line 36 of file MatAmentumUmat.cpp.

36 {
37
38 auto equiv_step = TimeScale::getScale(time);
39 auto step_before = static_cast<int>(std::floor(equiv_step));
40 auto step_after = static_cast<int>(std::ceil(equiv_step));
41 std::vector<int> step_times = {step_before, step_after};
42 return step_times;
43 }
double getScale(const double time)
Get scaling at a given time.

◆ TimeScale() [1/2]

MoFEM::TimeScale::TimeScale ( std::string  file_name,
std::string  delimiter,
bool  error_if_file_not_given = false,
ScalingFun  def_scaling_fun = [](double time) { return time; } 
)

TimeScale constructor.

Parameters
file_namePath to input CSV data file
delimiterCharacter which is used to separate the data in a csv row, by default it is ','
error_if_file_not_givenIf file name is not provided, the constructor will throw an error if this flag is set to true or throw a warning and use linear scaling if this flag is set to false

Definition at line 58 of file ScalingMethod.cpp.

29 : fileName(file_name), errorIfFileNotGiven(error_if_file_not_given),
30 defScalingMethod(def_scaling_fun) {
31 CHK_THROW_MESSAGE(timeData(file_name, delimiter),
32 "Error in reading time data");
33}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
std::string fileName
ScalingFun defScalingMethod
MoFEMErrorCode timeData(std::string fileName, std::string delimiter)

◆ TimeScale() [2/2]

MoFEM::TimeScale::TimeScale ( std::string  file_name = "",
bool  error_if_file_not_given = false,
ScalingFun  def_scaling_fun = [](double time) { return time; } 
)

TimeScale constructor.

Parameters
file_namePath to input CSV data file
error_if_file_not_givenIf file name is not provided, the constructor will throw an error if this flag is set to true or throw a warning and use linear scaling if this flag is set to false

Definition at line 44 of file ScalingMethod.cpp.

24 : TimeScale(file_name, defaultDelimiter, error_if_file_not_given,
25 def_scaling_fun) {}
TimeScale(std::string file_name="", bool error_if_file_not_given=false, ScalingFun def_scaling_fun=[](double time) { return time;})
TimeScale constructor.
static const std::string defaultDelimiter
comma or space

The documentation for this struct was generated from the following file: