Belos Version of the Day
Loading...
Searching...
No Matches
Belos_Details_registerLinearSolverFactory.cpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Belos: Block Linear Solvers Package
4//
5// Copyright 2004-2016 NTESS and the Belos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
12#include "Teuchos_ConfigDefs.hpp" // for __attribute__((weak)) check
13
14// FIXME (mfh 23 Aug 2015) Belos' main library is upstream from
15// libraries where Belos' Epetra and Tpetra specializations live.
16// That's why we need to use weak symbols here. Otherwise, link
17// errors result. Fixing this requires the same run-time registration
18// solution that Bug 6392 is all about.
19
20#if defined(HAVE_BELOS_TPETRA) && defined(HAVE_TEUCHOS_CXX_ATTRIBUTE_WEAK)
21namespace Belos {
22namespace Details {
23namespace Tpetra {
24 extern void __attribute__((weak)) registerLinearSolverFactory ();
25} // namespace Tpetra
26} // namespace Details
27} // namespace Belos
28#endif // defined(HAVE_BELOS_TPETRA) && defined(HAVE_TEUCHOS_CXX_ATTRIBUTE_WEAK)
29
30//
31// FIXME (mfh 23 Aug 2015) We should add Thyra as well.
32//
33
34namespace Belos {
35namespace Details {
36
37void
39{
40#if defined(HAVE_BELOS_TPETRA) && defined(HAVE_TEUCHOS_CXX_ATTRIBUTE_WEAK)
41 // It's a weak symbol, so it might be NULL.
42 if (::Belos::Details::Tpetra::registerLinearSolverFactory != NULL) {
43 ::Belos::Details::Tpetra::registerLinearSolverFactory ();
44 }
45#endif // defined(HAVE_BELOS_TPETRA) && defined(HAVE_TEUCHOS_CXX_ATTRIBUTE_WEAK)
46}
47
48} // namespace Details
49} // namespace Belos
50
51
Implementation of Trilinos::Details::LinearSolverFactory.
Declaration of Belos::Details::registerLinearSolverFactory.
Alternative run-time polymorphic interface for operators.
void registerLinearSolverFactory()
Register Belos' LinearSolverFactory with the central repository, for all enabled combinations of temp...

Generated for Belos by doxygen 1.9.8