preCICE v3.0.0
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions | Variables
precice Namespace Reference

Main namespace of the precice library. More...

Namespaces

namespace  acceleration
 contains implementations of acceleration schemes.
 
namespace  action
 contains actions to modify exchanged data.
 
namespace  com
 contains the data communication abstraction layer.
 
namespace  config
 
namespace  constants
 contains names for files and common value types.
 
namespace  cplscheme
 contains implementations of coupling schemes for coupled simulations.
 
namespace  detail
 
namespace  impl
 
namespace  io
 provides Import and Export of the coupling mesh and data.
 
namespace  logging
 contains the logging framework.
 
namespace  m2n
 contains the logic of the parallel communication between participants.
 
namespace  mapping
 contains data mapping from points to meshes.
 
namespace  math
 provides general mathematical constants and functions.
 
namespace  mesh
 provides Mesh, Data and primitives.
 
namespace  partition
 contains the partitioning of distributed meshes.
 
namespace  profiling
 contains profiling utilities.
 
namespace  query
 contains geometrical queries.
 
namespace  testing
 contains the testing framework.
 
namespace  time
 contains the time interpolation logic.
 
namespace  tooling
 Contains the preCICE tooling API.
 
namespace  utils
 contains precice-related utilities.
 
namespace  xml
 contains the XML configuration parser.
 

Classes

class  Participant
 Main Application Programming Interface of preCICE. Include using #include <precice/precice.hpp>. More...
 
class  span
 A C++ 11 implementation of the non-owning C++20 std::span type. More...
 

Typedefs

using EdgeID = int
 
using TriangleID = int
 
using TetrahedronID = int
 
using DataID = int
 
using MeshID = int
 
using Rank = int
 
using string_view = ::precice::span<const char>
 forwards-compatible typedef for C++17 std::string_view.
 
using byte = unsigned char
 
using VertexID = int
 

Functions

template<typename ElementType , std::size_t Extent>
constexpr span< ElementType, Extent > make_span (span< ElementType, Extent > s) noexcept
 
template<typename T , std::size_t N>
constexpr span< T, N > make_span (T(&arr)[N]) noexcept
 
template<typename T , std::size_t N>
PRECICE_SPAN_ARRAY_CONSTEXPR span< T, N > make_span (std::array< T, N > &arr) noexcept
 
template<typename T , std::size_t N>
PRECICE_SPAN_ARRAY_CONSTEXPR span< const T, N > make_span (const std::array< T, N > &arr) noexcept
 
template<typename Container >
constexpr span< typenamestd::remove_reference< decltype(*detail::data(std::declval< Container & >()))>::type make_span (Container &cont)
 
template<typename Container >
constexpr span< const typename Container::value_type > make_span (const Container &cont)
 
template<typename ElementType , std::size_t Extent>
span< const byte,((Extent==dynamic_extent) ? dynamic_extent :sizeof(ElementType) *Extent)> as_bytes (span< ElementType, Extent > s) noexcept
 
template<class ElementType , size_t Extent, typename std::enable_if<!std::is_const< ElementType >::value, int >::type = 0>
span< byte,((Extent==dynamic_extent) ? dynamic_extent :sizeof(ElementType) *Extent)> as_writable_bytes (span< ElementType, Extent > s) noexcept
 
template<std::size_t N, typename E , std::size_t S>
constexpr auto get (span< E, S > s) -> decltype(s[N])
 
std::string getVersionInformation ()
 Returns information on the version of preCICE.
 
template<typename T >
auto refToSpan (T &element)
 Wraps a single element into a span.
 

Variables

bool syncMode = false
 Enabled further inter- and intra-solver synchronisation.
 
PRECICE_SPAN_INLINE_VAR constexpr std::size_t dynamic_extent = SIZE_MAX
 

Detailed Description

Main namespace of the precice library.

Generic test function that is called from the tests for MPIPortsCommunication, MPIDirectCommunication and SocketCommunication

forward declarations.

Typedef Documentation

◆ byte

using precice::byte = unsigned char

Definition at line 135 of file span.hpp.

◆ DataID

using precice::DataID = int

Type used for the IDs of data (incl. gradient data)

Definition at line 25 of file Types.hpp.

◆ EdgeID

using precice::EdgeID = int

Type used for the IDs of edges

Definition at line 10 of file Types.hpp.

◆ MeshID

using precice::MeshID = int

Type used for the IDs of meshes

Definition at line 30 of file Types.hpp.

◆ Rank

using precice::Rank = int

Type used to represent local ranks of a parallel participant.

The primary participant has Rank 0.

Definition at line 37 of file Types.hpp.

◆ string_view

forwards-compatible typedef for C++17 std::string_view.

The string_view is a read-only view into sequence of characters.

A good mental model for this type is a struct containing a pointer and a size like the following:

struct string_view {
const char* first;
size_t size;
};
A C++ 11 implementation of the non-owning C++20 std::span type.
Definition span.hpp:284

It can be constructed from:

  • a pointer to a NULL-terminated C-string
  • a pointer and a size
  • a pointer to the first and one past the last element
  • std::string can directly convert itself to std::string_view.

In practise, using a function such as Participant::getMeshDimensions() that expects a string_view looks like this:

You can directly pass the string literal:

getMeshDimensions("MyMesh");

Or you can pass something string-like:

// one of
const char* meshName = "MyMesh";
std::string meshName = "MyMesh";
// followed by
getMeshDimensions(meshName);

Definition at line 63 of file Participant.hpp.

◆ TetrahedronID

Type used for the IDs of tetrahedra

Definition at line 20 of file Types.hpp.

◆ TriangleID

using precice::TriangleID = int

Type used for the IDs of triangles

Definition at line 15 of file Types.hpp.

◆ VertexID

using precice::VertexID = int

Type used identify a vertex on a mesh.

These IDs are always bound to a mesh. Using a VertexID on another mesh is not allowed and not guaranteed to result in an error. The only valid way of receiving these IDs are by using setMeshVertex(), setMeshVertices(), getMeshVertexIDsAndCoordinates().

There is no guarantee on the values of vertex IDs. Do not rely on them to start at zero or be continuous.

Definition at line 13 of file Types.hpp.

Function Documentation

◆ as_bytes()

template<typename ElementType , std::size_t Extent>
span< const byte,((Extent==dynamic_extent) ? dynamic_extent :sizeof(ElementType) *Extent)> precice::as_bytes ( span< ElementType, Extent > s)
noexcept

Definition at line 586 of file span.hpp.

◆ as_writable_bytes()

template<class ElementType , size_t Extent, typename std::enable_if<!std::is_const< ElementType >::value, int >::type = 0>
span< byte,((Extent==dynamic_extent) ? dynamic_extent :sizeof(ElementType) *Extent)> precice::as_writable_bytes ( span< ElementType, Extent > s)
noexcept

Definition at line 596 of file span.hpp.

◆ get()

template<std::size_t N, typename E , std::size_t S>
constexpr auto precice::get ( span< E, S > s) -> decltype(s[N])
constexpr

Definition at line 602 of file span.hpp.

◆ getVersionInformation()

PRECICE_API std::string precice::getVersionInformation ( )

Returns information on the version of preCICE.

Returns a semicolon-separated C-string containing:

1) the version of preCICE 2) the revision information of preCICE 3) the configuration of preCICE including MPI, PETSC, PYTHON

Definition at line 70 of file Tooling.cpp.

◆ make_span() [1/6]

template<typename Container >
constexpr span< const typename Container::value_type > precice::make_span ( const Container & cont)
constexpr

Definition at line 578 of file span.hpp.

◆ make_span() [2/6]

template<typename T , std::size_t N>
PRECICE_SPAN_ARRAY_CONSTEXPR span< const T, N > precice::make_span ( const std::array< T, N > & arr)
noexcept

Definition at line 563 of file span.hpp.

◆ make_span() [3/6]

template<typename Container >
constexpr span< typenamestd::remove_reference< decltype(*detail::data(std::declval< Container & >()))>::type precice::make_span ( Container & cont)
constexpr

Definition at line 571 of file span.hpp.

◆ make_span() [4/6]

template<typename ElementType , std::size_t Extent>
constexpr span< ElementType, Extent > precice::make_span ( span< ElementType, Extent > s)
constexprnoexcept

Definition at line 544 of file span.hpp.

◆ make_span() [5/6]

template<typename T , std::size_t N>
PRECICE_SPAN_ARRAY_CONSTEXPR span< T, N > precice::make_span ( std::array< T, N > & arr)
noexcept

Definition at line 556 of file span.hpp.

◆ make_span() [6/6]

template<typename T , std::size_t N>
constexpr span< T, N > precice::make_span ( T(&) arr[N])
constexprnoexcept

Definition at line 550 of file span.hpp.

◆ refToSpan()

template<typename T >
auto precice::refToSpan ( T & element)

Wraps a single element into a span.

Definition at line 9 of file span_tools.hpp.

Variable Documentation

◆ dynamic_extent

PRECICE_SPAN_INLINE_VAR constexpr std::size_t precice::dynamic_extent = SIZE_MAX
constexpr

Definition at line 144 of file span.hpp.

◆ syncMode

bool precice::syncMode = false
extern

Enabled further inter- and intra-solver synchronisation.

Definition at line 17 of file PartitionOfUnityMapping.hpp.