v0.15.0
Loading...
Searching...
No Matches
MoFEM::GetBlockScalingMethod< TS > Struct Template Reference

get time scaling method More...

#include "src/boundary_conditions/ScalingMethod.hpp"

Public Member Functions

 GetBlockScalingMethod ()=delete
 

Static Public Member Functions

template<typename... Args>
static boost::shared_ptr< ScalingMethodget (boost::shared_ptr< ScalingMethod > ts, std::string file_prefix, std::string file_suffix, std::string block_name, Args &&...args)
 

Static Private Member Functions

static auto check_file_exists (std::string &&file_name)
 

Detailed Description

template<typename TS>
struct MoFEM::GetBlockScalingMethod< TS >

get time scaling method

Template Parameters
TS
Examples
EshelbianPlasticity.cpp.

Definition at line 107 of file ScalingMethod.hpp.

Constructor & Destructor Documentation

◆ GetBlockScalingMethod()

template<typename TS >
MoFEM::GetBlockScalingMethod< TS >::GetBlockScalingMethod ( )
delete

Member Function Documentation

◆ check_file_exists()

template<typename TS >
static auto MoFEM::GetBlockScalingMethod< TS >::check_file_exists ( std::string && file_name)
inlinestaticprivate

Definition at line 133 of file ScalingMethod.hpp.

133 {
134 namespace fs = std::filesystem;
135 if (!fs::exists(file_name) || !fs::is_regular_file(file_name)) {
136 return false;
137 }
138 return true;
139 }

◆ get()

template<typename TS >
template<typename... Args>
static boost::shared_ptr< ScalingMethod > MoFEM::GetBlockScalingMethod< TS >::get ( boost::shared_ptr< ScalingMethod > ts,
std::string file_prefix,
std::string file_suffix,
std::string block_name,
Args &&... args )
inlinestatic

Definition at line 113 of file ScalingMethod.hpp.

114 {
115
116 auto get_file_name = [&]() {
117 return file_prefix + "_" + block_name + file_suffix;
118 };
119
120 if (check_file_exists(get_file_name())) {
121 MOFEM_LOG_CHANNEL("WORLD");
122 MOFEM_LOG_TAG("WORLD","GetBlockScalingMethod");
123 MOFEM_LOG("WORLD", Sev::inform)
124 << "Block history file found: " << get_file_name();
125 MOFEM_LOG_CHANNEL("WORLD");
126 return boost::make_shared<TS>(get_file_name(), args...);
127 } else {
128 return ts;
129 }
130 }
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
static auto check_file_exists(std::string &&file_name)

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