Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Core

Core classes provided by the library. More...

+ Collaboration diagram for Core:

Classes

class  Feel::Application
 provides information about the Application More...
 
class  Feel::AssertContext
 contains details about a failed assertion More...
 
class  Feel::Environment
 Initialize, finalize, and query the Feel++ environment. More...
 
class  Feel::Factory< AbstractProduct, IdentifierType, ProductCreator, FactoryErrorPolicy >
 Implements a generic object Factory. More...
 
class  Feel::FactoryClone< AbstractProduct, ProductCreator, FactoryErrorPolicy >
 Implements a generic cloning object Factory. More...
 
class  Feel::math::Constant< Tag, Rep >
 Structure that holds a constant with different numerical representation. More...
 
class  Feel::MemoryUsage
 class to query for memory usage More...
 
class  Feel::meta::Context< StorageType >
 Context class. More...
 
class  Feel::Singleton< T >
 implement the Singleton pattern More...
 
class  Feel::TypeInfo
 wrapper for std::type_info More...
 
class  Feel::VisitorBase
 The base class of any Acyclic Visitor. More...
 
class  Feel::VisitorBaseImpl< TList, R >
 Implements non-strict visitation (you can implement only part of the Visit functions) More...
 
class  Feel::WorldComm
 Provides interface to MPI Communicators. More...
 

Typedefs

using Feel::worldcomm_ptr_t = std::shared_ptr< WorldComm >
 WorldComm shared_ptr alias type.
 
using Feel::worldcomm_t = WorldComm
 WorldComm alias type.
 
using Feel::worldscomm_ptr_t = std::vector< worldcomm_ptr_t >
 WorldsComm shared_ptr alias type.
 

Enumerations

enum  Feel::DebugLevels { DEBUG_INFO = 0 , DEBUG_WARN = 1 , DEBUG_ERROR = 2 , DEBUG_FATAL = 3 }
 Area debugging tool. More...
 

Functions

AboutData Feel::makeAboutDefault (std::string name)
 default makeAbout function to define the AboutData structure of the Feel++ application More...
 
worldscomm_ptr_t Feel::makeWorldsComm (int n, WorldComm &wc)
 Create a WorldsComm shared_ptr of size n from cloning wc. More...
 
worldscomm_ptr_t Feel::makeWorldsComm (int n, worldcomm_ptr_t const &wc)
 Create a WorldsComm shared_ptr of size n from cloning shared_ptr wc. More...
 
std::string Feel::prefixvm (std::string const &prefix, std::string const &opt, std::string const &sep=".")
 Function that compute the command line option prefix for the option variable map. More...
 
template<typename T >
std::vector< T > Feel::range (T &&beg, T &&end)
 return a range of integers between beg and end with a step of 1 More...
 
template<typename T >
std::vector< T > Feel::range (T &&beg, T &&end, T &&step)
 Provides range of integers. More...
 
template<typename T >
std::vector< T > Feel::range (T &&end)
 return a range of integers between 0 and end with a step of 1 More...
 
std::string Feel::sanitize (std::string const &s)
 trim string to remove special characters More...
 

Variables

constexpr bool do_reduce = true
 Log if condition satisfied when NDEBUG is not defined. More...
 

Detailed Description

Core classes provided by the library.

Macros

Assertion Macros

Assertions

It is a good practice to check expected conditions in your program frequently to detect errors as early as possible. Feel++ uses google-glog and its CHECK macros for this purpose.

The CHECK macro provides the ability to abort the application when a condition is not met, similar to the assert macro defined in the standard C library.

CHECK
CHECK aborts the application if a condition is not true. Unlike assert, it is not controlled by NDEBUG, so the check will be executed regardless of compilation mode. Therefore, fp->Write(x) in the following example is always executed:
CHECK(fp->Write(x) == 4) << "Write failed!";
CHECK_EQ, CHECK_NE, CHECK_LE, CHECK_LT, CHECK_GE, and CHECK_GT
There are various helper macros for equality/inequality checks - CHECK_EQ, CHECK_NE, CHECK_LE, CHECK_LT, CHECK_GE, and CHECK_GT. They compare two values, and log a FATAL message including the two values when the result is not as expected. The values must have operator<<(ostream, ...) defined. You may append to the error message like so:
CHECK_NE(1, 2) << ": The world must be ending!";
We are very careful to ensure that each argument is evaluated exactly once, and that anything which is legal to pass as a function argument is legal here. In particular, the arguments may be temporary expressions which will end up being destroyed at the end of the apparent statement, for example:
CHECK_EQ(string("abc")[1], ’b’);
The compiler reports an error if one of the arguments is a pointer and the other is NULL. To work around this, simply static_cast NULL to the type of the desired pointer.
CHECK_EQ(some_ptr, static_cast<SomeType*>(NULL));
Better yet, use the CHECK_NOTNULL macro:
CHECK_NOTNULL(some_ptr);
some_ptr->DoSomething();
DCHECK
Some check may be enabled only in Debug mode. To do this use DCHECK which is enabled is NDEBUG is not:
DCHECK(fp->Write(x) == 4) << "Write failed!";

Attribute Macros

Feel C++ Compiler Hints

  1. #INLINE
  2. #FEELPP_RESTRICT

Feel Attribute Macros

  1. #FEELPP_EXPORT and #FEELPP_NO_EXPORT
  2. #FEELPP_PACKED
  3. #FEELPP_DEPRECATED
  4. #FEELPP_ISLIKELY and #FEELPP_ISUNLIKELY

Types

Types

Real Numbers

Feel defines a number of types that are used in the library.

  1. real32_type 32 bits real number type
  2. real64_type 64 bits real number type

Integers

Feel defines a number of integer type that have controlled bit size. These types are constructed automatically by Feel in order to have platform independent integer types.

Here is the list of signed integers:

  1. int1_type a 1 bit signed integer
  2. int8_type a 8 bit signed integer
  3. int16_type a 16 bit signed integer
  4. int32_type a 32 bit signed integer
  5. int64_type a 64 bit signed integer

Here is the list of unsigned integers:

  1. uint1_type a 1 bit unsigned integer
  2. uint8_type a 8 bit unsigned integer
  3. uint16_type a 16 bit unsigned integer
  4. uint32_type a 32 bit unsigned integer
  5. uint64_type a 64 bit unsigned integer

Feel defines a number of useful aliases for integers

  1. dim_type an alias to uint16_type used to identify dimensions
  2. rank_type an alias to uint16_type used for mpi process ranks
  3. size_type an alias to size_t used as indices for arrays, vectors or matrices

Feel++ defines also some invalid number associated to each unsigned integer types. it usually serves to identify a situation where something went wrong. The invalid value corresponds to the maximum value of the unsigned type.

  1. invalid_uint8_type_value
  2. invalid_uint16_type_value
  3. invalid_uint32_type_value
  4. invalid_uint64_type_value
  5. invalid_dim_type_value
  6. invalid_rank_type_value
  7. invalid_v<size_type>

Enumeration Type Documentation

◆ DebugLevels

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/debug.cpp>

Area debugging tool.

VLOG(1) provides a debug stream to which you can pass a number, say 100, associated to an area of the code, say a class A. In the implementation of the class A, you use debug statement like

void A::f() { DVLOG(2) << "A::f() is called.\n"; do something here }

Now the debug message "A::f() is called." will be seen only if the area 100 is defined in the environment(shell) variable DEBUG while executing a program A::f() is called runWithA that makes use of our class A.

‍runwithA --> no debug message related to A export DEBUG="100" runwithA A::f() is called.

With this tool you can select the area you want to debug explicitly while keeping the others hidden.

Author
Christophe Prud'homme (chris.nosp@m.toph.nosp@m.e.pru.nosp@m.dhom.nosp@m.me@fe.nosp@m.elpp.nosp@m..org)

Function Documentation

◆ makeAboutDefault()

FEELPP_EXPORT AboutData Feel::makeAboutDefault ( std::string  name)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/environment.cpp>

default makeAbout function to define the AboutData structure of the Feel++ application

Parameters
namename or short name of the application

◆ makeWorldsComm() [1/2]

worldscomm_ptr_t Feel::makeWorldsComm ( int  n,
WorldComm &  wc 
)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/worldcomm.hpp>

Create a WorldsComm shared_ptr of size n from cloning wc.

Parameters
nsize of the WorldsComm
wcWorldComm to be cloned to fill the WorldsComm entries
Returns
the WorldsComm shared_ptr

◆ makeWorldsComm() [2/2]

worldscomm_ptr_t Feel::makeWorldsComm ( int  n,
worldcomm_ptr_t const &  wc 
)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/worldcomm.hpp>

Create a WorldsComm shared_ptr of size n from cloning shared_ptr wc.

Parameters
nsize of the WorldsComm
wcshares_ptr WorldComm to be cloned to fill the WorldsComm entries
Returns
the WorldsComm shared_ptr

◆ prefixvm()

std::string Feel::prefixvm ( std::string const &  prefix,
std::string const &  opt,
std::string const &  sep = "." 
)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/feel.cpp>

Function that compute the command line option prefix for the option variable map.

Parameters
prefixprefix
optoption
sepseparator between sections of the option

Referenced by Feel::FeelModels::ModelPhysic< Dim >::hasParameter(), and Feel::FeelModels::ModelMeasuresStorageValues::updateParameterValues().

◆ range() [1/3]

template<typename T >
std::vector< T > Feel::range ( T &&  beg,
T &&  end 
)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/range.hpp>

return a range of integers between beg and end with a step of 1

References Feel::range().

◆ range() [2/3]

template<typename T >
std::vector< T > Feel::range ( T &&  beg,
T &&  end,
T &&  step 
)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/range.hpp>

Provides range of integers.

range(stop)

range(start, stop[, step])
std::vector< T > range(T &&beg, T &&end, T &&step)
Provides range of integers.
Definition: range.hpp:63

This is a versatile function to create lists containing arithmetic progressions. It is most often used in for loops. The arguments must be plain integers. If the step argument is omitted, it defaults to 1. If the start argument is omitted, it defaults to 0. The full form returns a list of plain integers [start, start + step, start + 2 * step, ...]. If step is positive, the last element is the largest start + i * step less than stop; if step is negative, the last element is the smallest start + i * step greater than stop. step must not be zero.

range(10) : 0,1,2,3,4,5,6,7,8,9
range(1,10) : 1,2,3,4,5,6,7,8,9
range(1,10,2) : 1,3,5,7,9
Note
Boost.irange should be preferred to range

Referenced by Feel::TwoSpacesMap< SpaceType >::build(), Feel::vf::evaluate(), Feel::vf::minmax(), Feel::vf::normLinf(), Feel::range(), Feel::rank(), Feel::TimeSet::save(), and Feel::FeelModels::FluidMechanics< ConvexType, BasisVelocityType, BasisPressureType >::BodyBoundaryCondition::updateElasticVelocityWithRotation().

◆ range() [3/3]

template<typename T >
std::vector< T > Feel::range ( T &&  end)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/range.hpp>

return a range of integers between 0 and end with a step of 1

References Feel::range().

◆ sanitize()

std::string Feel::sanitize ( std::string const &  s)

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/feel.cpp>

trim string to remove special characters

Note
Ensight variable description forbids ( [ + @ ! * $ ) ] - space # ^ /) see ensight gold file format documentation

trim string removing all leading and trailing spaces and replace all special characters " ;:," inside the block by a _

Parameters
sa string to be trimmed

Referenced by Feel::detail::ExportFieldSet< MeshType, N >::add(), and Feel::detail::ExportFieldSet< MeshType, N >::addRegions().

Variable Documentation

◆ do_reduce

constexpr bool do_reduce = true
constexpr

#include </data/cemosis/github-actions-runner/actions-runner-feelpp-1/_work/feelpp/feelpp/feelpp/feel/feelcore/feel.hpp>

Log if condition satisfied when NDEBUG is not defined.

This macro is enabled only if NDEBUG is not defined which is to say that the macro will be activited when debugging

DVLOG_IF( INFO, param < 10 ) << "print only if param < 10";

enable reduce for mpi communication