12#ifndef BELFEM_FN_MESH_CONFIG_TAG_HPP
13#define BELFEM_FN_MESH_CONFIG_TAG_HPP
77 uint64_t tHash = 0xcbf29ce484222325ULL ;
79 for (
const char tChar : aText )
81 tHash ^=
static_cast< uint64_t
>(
82 static_cast< unsigned char >( tChar ) );
83 tHash *= 0x100000001b3ULL ;
106 if ( aWord.size() == 0 )
return false ;
108 bool tHasDigit = false ;
110 for (
const char tChar : aWord )
112 if ( tChar >=
'0' && tChar <=
'9' )
116 else if ( tChar !=
'+' && tChar !=
'-' && tChar !=
'.'
117 && tChar !=
'e' && tChar !=
'E' )
140 if ( tWords.
size() == 0 )
return "" ;
147 if ( tWords.
size() == 2 )
155 std::snprintf( tBuffer,
sizeof( tBuffer ),
"%.12g", tValue );
171 if ( tResult ==
"on" || tResult ==
"true" || tResult ==
"yes" )
175 if ( tResult ==
"off" || tResult ==
"false" || tResult ==
"no" )
193 const string & aPath,
200 +
"[" + std::to_string( aIndex ) +
"]" ;
204 const string & tKey = aSection->
key( k );
238 const string & aPath,
249 +
"[" + std::to_string( aIndex ) +
"]" ;
257 if ( tKey.find(
"terminal" ) == string::npos
258 && tKey.find(
"curve" ) == string::npos ) continue ;
260 aLines.
push( tPath +
"." + tKey +
" = "
289 for (
index_t k = aSection->
start() ; k < aSection->end() ; ++k )
294 if ( tWords.
size() < 4 ) continue ;
300 std::snprintf( tBuf,
sizeof( tBuf ),
"%.12g", tThickness );
302 aLines.
push( tPath +
".layer[" + std::to_string( tCount ) +
"].material = "
304 aLines.
push( tPath +
".layer[" + std::to_string( tCount ) +
"].thickness = "
311 aLines.
push( tPath +
".count = " + std::to_string( tCount ) );
335 aInputFile.
section(
"topology" ),
"", tLines );
357 aInputFile.
section(
"boundary conditions" ),
"", tLines );
363 aInputFile.
section(
"circuit" ),
"", tLines );
382 tLines.
push(
string(
"thinshell.ghost = " )
389 for (
const string & tLine : tLines )
391 tText += tLine +
"\n" ;
size_t size() const
return the size of the Cell
Definition cl_Cell.hpp:181
std::vector< T > & vector_data()
Definition cl_Cell.hpp:135
void push(const T &aValue)
push an entry to the end of the cell (copy version)
Definition cl_Cell.hpp:262
Definition fn_mesh_config_tag.hpp:92
string value_to_canonical(const string &aString)
Canonical form of one input value.
Definition fn_mesh_config_tag.hpp:136
void collect_layers(const input::Section *aSection, Cell< string > &aLines)
The layer stack of one thin shell.
Definition fn_mesh_config_tag.hpp:279
void collect_section(const input::Section *aSection, const string &aPath, Cell< string > &aLines, const index_t aIndex=0)
Emit every key of a section, then recurse into its subsections.
Definition fn_mesh_config_tag.hpp:191
bool looks_numeric(const string &aWord)
True if the WHOLE word is a single decimal number.
Definition fn_mesh_config_tag.hpp:104
void collect_terminals(const input::Section *aSection, const string &aPath, Cell< string > &aLines, const index_t aIndex=0)
Collect the current-injection domains from a section tree.
Definition fn_mesh_config_tag.hpp:236
Definition cl_EF_PENTA6TS.hpp:23
uint64_t mesh_config_tag(const InputFile &aInputFile)
Convenience: the tag of an input file.
Definition fn_mesh_config_tag.hpp:403
uint64_t mesh_config_hash(const string &aText)
The mesh CONFIGURATION tag: a fingerprint of the settings that decide how a .msh is turned into an en...
Definition fn_mesh_config_tag.hpp:75
string mesh_config_text(const InputFile &aInputFile)
The canonical text behind the tag.
Definition fn_mesh_config_tag.hpp:326
Definition cl_IFB_LINE3.hpp:21
bool ghost_facets_requested(const input::Section *aSolver)
true if the deck asks for duplicate interface dofs and ghost facets
Definition fn_FEM_ghost_switch.hpp:104
USER GUIDES:
Definition cl_Capacitor.cpp:16
value unit_to_si(const string &aString)
Definition stringtools.cpp:335
std::string string
Definition typedefs.hpp:26
real to_real(const std::string &aString)
convert string to real, return NAN if it is not real
Definition stringtools.cpp:316
std::string string_to_lower(const std::string &aString)
convert the string to lower case
Definition stringtools.cpp:267
uint32_t index_t
Definition typedefs.hpp:52
Cell< string > string_to_words(const std::string &aString, char aDelimiter)
create a cell of words from a string
Definition stringtools.cpp:201
double real
Definition typedefs.hpp:36