Chi-Tech
chi Namespace Reference

Namespaces

namespace  lua_utils
 

Data Structures

class  AggregateNodalValuePostProcessor
 
class  CellVolumeIntegralPostProcessor
 
class  ChiLog
 
class  ChiMPICommunicatorSet
 
class  Console
 
struct  CSTMemory
 
class  DirectedGraph
 
struct  DummyStream
 
class  Event
 
class  EventPublisher
 
class  EventSubscriber
 
class  GraphPartitioner
 
struct  GraphVertex
 
class  InputParameters
 
class  KBAGraphPartitioner
 
class  LinearGraphPartitioner
 
class  LogStream
 
class  Material
 
class  MaterialProperty
 
class  MaterialPropertyScalarFuncXYZTV
 
class  MPI_Info
 
class  ParameterBlock
 
class  PETScGraphPartitioner
 
class  Plugin
 
class  PostProcessor
 
class  PostProcessorPrinter
 
class  PPPrinterSubscribeHelper
 
struct  RegistryStatuses
 
class  SolverInfoPostProcessor
 
struct  SubSetInfo
 
class  SystemWideEventPublisher
 
class  Timer
 
class  TimingBlock
 
class  TimingLog
 

Typedefs

typedef std::shared_ptr< PostProcessorPostProcessorPtr
 
typedef chi_math::FunctionDimAToDimB SFXYZV
 

Enumerations

enum  StringSteamColorCode {
  RESET = 0 , FG_BOLD = 1 , FG_UNDERLINE = 4 , FG_BOLD_OFF = 21 ,
  FG_UNDERLINE_OFF = 24 , FG_RED = 31 , FG_GREEN = 32 , FG_YELLOW = 33 ,
  FG_BLUE = 34 , FG_MAGENTA = 35 , FG_CYAN = 36 , FG_WHITE = 37 ,
  FG_DEFAULT = 39
}
 
enum class  InputParameterTag { NONE = 0 , OPTIONAL = 1 , REQUIRED = 2 }
 
enum class  ParameterBlockType {
  INVALID_VALUE = 0 , BOOLEAN = 1 , FLOAT = 3 , STRING = 4 ,
  INTEGER = 5 , ARRAY = 98 , BLOCK = 99
}
 
enum class  PPType : int { NO_VALUE = 0 , SCALAR = 1 , VECTOR = 2 , ARBITRARY = 3 }
 
enum class  PPNumericFormat : int { FIXED = 0 , FLOATING_POINT = 1 , SCIENTIFIC = 2 , GENERAL = 3 }
 
enum class  ScalarPPTableFormat : int { VERTICAL = 0 , HORIZONTAL = 1 }
 

Functions

 RegisterLuaFunction (Console::LuaWrapperCall, chi_console, LuaWrapperCall)
 
int GetStandardEventCode (const std::string &event_name)
 
 RegisterChiObject (chi, KBAGraphPartitioner)
 
 RegisterChiObject (chi, LinearGraphPartitioner)
 
 RegisterChiObject (chi, PETScGraphPartitioner)
 
 RegisterChiObject (chi, Plugin)
 
std::string StringStreamColor (StringSteamColorCode code)
 
 RegisterChiObject (chi_objects, Material)
 
 RegisterChiObject (chi_objects, MaterialProperty)
 
 RegisterChiObject (chi_objects, MaterialPropertyScalarFuncXYZTV)
 
std::string ParameterBlockTypeName (ParameterBlockType type)
 
 RegisterChiObject (chi, AggregateNodalValuePostProcessor)
 
 RegisterChiObject (chi, CellVolumeIntegralPostProcessor)
 
 RegisterChiObjectParametersOnly (chi, PostProcessor)
 
 RegisterChiObject (chi, SolverInfoPostProcessor)
 
std::string StringLTrim (const std::string &s)
 
std::string StringRTrim (const std::string &s)
 
std::string StringTrim (const std::string &s)
 
std::vector< std::string > StringSplit (const std::string &input, const std::string &delim)
 
std::string StringUpToFirstReverse (const std::string &input, const std::string &search_string)
 
void AssertReadibleFile (const std::string &file_name)
 
void Sleep (std::chrono::duration< double > time)
 
std::string PrintIterationProgress (size_t current_iteration, size_t total_num_iterations, unsigned int num_intvls=10)
 
template<typename T , typename B >
bool VectorListHas (const std::vector< T > &list, const B &val)
 
std::vector< SubSetInfoMakeSubSets (size_t num_items, size_t desired_num_subsets)
 
constexpr uint32_t hash_djb2a (const std::string_view sv)
 
constexpr uint32_t operator""_hash (const char *str, size_t len)
 
template<typename T >
void WriteBinaryValue (std::ofstream &output_file, T value)
 
template<typename T >
ReadBinaryValue (std::ifstream &input_file)
 

Variables

const std::string WHITESPACE = " \n\r\t\f\v"
 

Detailed Description

Miscellaneous utilities. These utilities should have no dependencies.

Typedef Documentation

◆ PostProcessorPtr

typedef std::shared_ptr<PostProcessor> chi::PostProcessorPtr

Definition at line 59 of file chi_runtime.h.

◆ SFXYZV

Enumeration Type Documentation

◆ InputParameterTag

enum class chi::InputParameterTag
strong
Enumerator
NONE 
OPTIONAL 
REQUIRED 

Definition at line 14 of file input_parameters.h.

◆ ParameterBlockType

enum class chi::ParameterBlockType
strong
Enumerator
INVALID_VALUE 
BOOLEAN 
FLOAT 
STRING 
INTEGER 
ARRAY 
BLOCK 

Definition at line 13 of file parameter_block.h.

◆ PPNumericFormat

enum class chi::PPNumericFormat : int
strong
Enumerator
FIXED 
FLOATING_POINT 
SCIENTIFIC 
GENERAL 

Definition at line 18 of file PostProcessor.h.

◆ PPType

enum class chi::PPType : int
strong
Enumerator
NO_VALUE 
SCALAR 
VECTOR 
ARBITRARY 

Definition at line 10 of file PostProcessor.h.

◆ ScalarPPTableFormat

enum class chi::ScalarPPTableFormat : int
strong
Enumerator
VERTICAL 
HORIZONTAL 

Definition at line 28 of file PostProcessorPrinter.h.

◆ StringSteamColorCode

Enumerator
RESET 
FG_BOLD 
FG_UNDERLINE 
FG_BOLD_OFF 
FG_UNDERLINE_OFF 
FG_RED 
FG_GREEN 
FG_YELLOW 
FG_BLUE 
FG_MAGENTA 
FG_CYAN 
FG_WHITE 
FG_DEFAULT 

Definition at line 8 of file stringstream_color.h.

Function Documentation

◆ AssertReadibleFile()

void chi::AssertReadibleFile ( const std::string &  file_name)

Definition at line 64 of file chi_misc_utils.cc.

◆ GetStandardEventCode()

int chi::GetStandardEventCode ( const std::string &  event_name)

Gets the standard even code associated with the given name. If no code is found then 0 (i.e. Unknown Event) is returned.

Definition at line 7 of file EventCodes.cc.

◆ hash_djb2a()

constexpr uint32_t chi::hash_djb2a ( const std::string_view  sv)
inlineconstexpr

Popular and fast djb2a hashing algorithm.

Definition at line 64 of file chi_utils.h.

◆ MakeSubSets()

std::vector< SubSetInfo > chi::MakeSubSets ( size_t  num_items,
size_t  desired_num_subsets 
)

Subdivides a number of items (X) into a desired number of sub sets (Y). The remainder of X/Y, i.e. r=X/Y obeys the indentity r < Y. These items will be distributed to the first Y sub-sets. Example: MakeSubSets(6659, 8) generates subsets of sizes {833,833,833,832,832,832,832,832}.

Definition at line 10 of file subsets.cc.

◆ operator""_hash()

constexpr uint32_t chi::operator""_hash ( const char *  str,
size_t  len 
)
inlineconstexpr

Definition at line 73 of file chi_utils.h.

◆ ParameterBlockTypeName()

std::string chi::ParameterBlockTypeName ( ParameterBlockType  type)

Definition at line 9 of file paramater_block.cc.

◆ PrintIterationProgress()

std::string chi::PrintIterationProgress ( size_t  current_iteration,
size_t  total_num_iterations,
unsigned int  num_intvls = 10 
)

Print the percentage completed based on the given interval.

The function divides 100% into num_intvls intervals. If an iteration passes an interval boundary then that interval percentage will be printed.

Specifying 10 intervals will print after each 10% is completed. Specifying 4 intervals will print after each 25% is completed.

Definition at line 16 of file print_iter_progress.cc.

◆ ReadBinaryValue()

template<typename T >
T chi::ReadBinaryValue ( std::ifstream &  input_file)

Definition at line 84 of file chi_utils.h.

◆ RegisterChiObject() [1/10]

chi::RegisterChiObject ( chi  ,
AggregateNodalValuePostProcessor   
)

◆ RegisterChiObject() [2/10]

chi::RegisterChiObject ( chi  ,
CellVolumeIntegralPostProcessor   
)

◆ RegisterChiObject() [3/10]

chi::RegisterChiObject ( chi  ,
KBAGraphPartitioner   
)

◆ RegisterChiObject() [4/10]

chi::RegisterChiObject ( chi  ,
LinearGraphPartitioner   
)

◆ RegisterChiObject() [5/10]

chi::RegisterChiObject ( chi  ,
PETScGraphPartitioner   
)

◆ RegisterChiObject() [6/10]

chi::RegisterChiObject ( chi  ,
Plugin   
)

◆ RegisterChiObject() [7/10]

chi::RegisterChiObject ( chi  ,
SolverInfoPostProcessor   
)

◆ RegisterChiObject() [8/10]

chi::RegisterChiObject ( chi_objects  ,
Material   
)

◆ RegisterChiObject() [9/10]

chi::RegisterChiObject ( chi_objects  ,
MaterialProperty   
)

◆ RegisterChiObject() [10/10]

chi::RegisterChiObject ( chi_objects  ,
MaterialPropertyScalarFuncXYZTV   
)

◆ RegisterChiObjectParametersOnly()

chi::RegisterChiObjectParametersOnly ( chi  ,
PostProcessor   
)

◆ RegisterLuaFunction()

chi::RegisterLuaFunction ( Console::LuaWrapperCall  ,
chi_console  ,
LuaWrapperCall   
)

◆ Sleep()

void chi::Sleep ( std::chrono::duration< double >  time)

Puts the current thread to sleep.

Parameters
timeTime to sleep for.
Note
To specify different times std::chrono allows you to change the unit with, e.g., chi::Sleep(std::chrono::milliseconds(100)) sleeps for 100 milliseconds, std::Sleep(std::chrono::seconds(1)) sleeps for 1 second.

Definition at line 68 of file chi_timer.cc.

◆ StringLTrim()

std::string chi::StringLTrim ( const std::string &  s)

Trims whitespace from the front of a string.

Definition at line 10 of file chi_misc_utils.cc.

◆ StringRTrim()

std::string chi::StringRTrim ( const std::string &  s)

Trims whitespace from the back of a string.

Definition at line 17 of file chi_misc_utils.cc.

◆ StringSplit()

std::vector< std::string > chi::StringSplit ( const std::string &  input,
const std::string &  delim = " " 
)

Splits a string using the given delimiter. Consecutive delimiters are treated as one.

Definition at line 30 of file chi_misc_utils.cc.

◆ StringStreamColor()

std::string chi::StringStreamColor ( StringSteamColorCode  code)

Definition at line 5 of file stringstream_color.cc.

◆ StringTrim()

std::string chi::StringTrim ( const std::string &  s)

Trims whitespace from the front and back of a string.

Definition at line 24 of file chi_misc_utils.cc.

◆ StringUpToFirstReverse()

std::string chi::StringUpToFirstReverse ( const std::string &  input,
const std::string &  search_string 
)

The string portion, from the rear of the input string, up to encountering the search_string.

Definition at line 52 of file chi_misc_utils.cc.

◆ VectorListHas()

template<typename T , typename B >
bool chi::VectorListHas ( const std::vector< T > &  list,
const B &  val 
)

Definition at line 44 of file chi_utils.h.

◆ WriteBinaryValue()

template<typename T >
void chi::WriteBinaryValue ( std::ofstream &  output_file,
value 
)

Definition at line 79 of file chi_utils.h.

Variable Documentation

◆ WHITESPACE

const std::string chi::WHITESPACE = " \n\r\t\f\v"

Definition at line 20 of file chi_utils.h.