BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
en_CutAlgorithm.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_EN_CUTALGORITHM_HPP
13#define BELFEM_EN_CUTALGORITHM_HPP
14#include "typedefs.hpp"
15#include "stringtools.hpp"
16
17namespace belfem
18{
19 namespace mesh
20 {
21 enum class CutAlgorithm
22 {
24 CCR = 1,
27 UNDEFINED = 4
28 };
29
30 inline string
31 to_string( CutAlgorithm aCutAlgorithm )
32 {
33 switch ( aCutAlgorithm )
34 {
36 return "pellikka";
38 return "ccr";
40 return "belted tree";
42 return "generalized pellikka";
43 default:
44 return "undefined";
45 }
46 }
47
48 inline CutAlgorithm
49 to_cut_algorithm( const string & aCutAlgorithm )
50 {
51 uint tNumAlgorithms = static_cast< uint >( CutAlgorithm::UNDEFINED );
52 string tCutAlgorithm = string_to_lower( aCutAlgorithm );
53
54 for ( uint a=0; a<tNumAlgorithms; ++a )
55 {
56 if ( to_string( static_cast< CutAlgorithm >( a ) ) == tCutAlgorithm )
57 {
58 return static_cast< CutAlgorithm >( a );
59 }
60 }
62 }
63
64 }
65}
66
67#endif //BELFEM_EN_CUTALGORITHM_HPP
Definition cl_BeltedTree.hpp:27
Definition cl_EF_EdgeFunction.hpp:17
CutAlgorithm
Definition en_CutAlgorithm.hpp:22
@ UNDEFINED
Definition en_CutAlgorithm.hpp:27
@ BeltedTree
Definition en_CutAlgorithm.hpp:25
@ CCR
Definition en_CutAlgorithm.hpp:24
@ PellikkaGeneralized
Definition en_CutAlgorithm.hpp:26
@ Pellikka
Definition en_CutAlgorithm.hpp:23
CutAlgorithm to_cut_algorithm(const string &aCutAlgorithm)
Definition en_CutAlgorithm.hpp:49
string to_string(CutAlgorithm aCutAlgorithm)
Definition en_CutAlgorithm.hpp:31
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
std::string string_to_lower(const std::string &aString)
convert the string to lower case
Definition stringtools.cpp:267