Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
FEDDCore.hpp
1#ifndef FEDDCORE_hpp
2#define FEDDCORE_hpp
3
4#define FEDD_TIMER
5#define FEDD_DETAIL_TIMER
6
7#include <stdint.h>
8#include <vector>
9#include <cstdlib>
10#include <iostream>
11#include <cmath>
12#include <numeric>
13#include <iosfwd>
14#include <string>
15#include <limits>
16#include <chrono>
17
18#include <boost/function.hpp>
19
20#include <Teuchos_RCPDecl.hpp>
21#include <Teuchos_RCPBoostSharedPtrConversions.hpp>
22#include <Teuchos_ParameterList.hpp>
23#include <Teuchos_XMLParameterListHelpers.hpp>
24#include <Teuchos_TimeMonitor.hpp>
25#include <Teuchos_CommandLineProcessor.hpp>
26
27#include <Thyra_LinearOpBase_decl.hpp>
28#include <Thyra_VectorSpaceBase_decl.hpp>
29#include <Thyra_VectorBase.hpp>
30
31#include <Tpetra_CrsMatrix.hpp>
32#include <Tpetra_Operator.hpp>
33
34#include "feddlib/core/core_config.h"
35#include "feddlib/core/General/DefaultTypeDefs.hpp"
36#include "feddlib/core/General/SmallMatrix.hpp"
37
38namespace FEDD {
39// template<class SC, class LO, class GO, class NO>
40// class InterfaceEntity;
41// enum EntityType {DefaultType,VertexType,EdgeType,FaceType,InteriorType,InterfaceType};
42// enum EntityFlag {DefaultFlag,StraightFlag,ShortFlag,NodeFlag};
43// enum DistanceFunction {ConstantDistanceFunction,InverseEuclideanDistanceFunction};
44//
45// template <class SC,class LO,class GO,class NO>
46// bool compareInterfaceEntities(Teuchos::RCP<InterfaceEntity<SC,LO,GO,NO> > iEa,
47// Teuchos::RCP<InterfaceEntity<SC,LO,GO,NO> > iEb)
48// {
49// return iEa->getUniqueID()<iEb->getUniqueID();
50// }
51//
52// template <class SC,class LO,class GO,class NO>
53// bool equalInterfaceEntities(Teuchos::RCP<InterfaceEntity<SC,LO,GO,NO> > iEa,
54// Teuchos::RCP<InterfaceEntity<SC,LO,GO,NO> > iEb)
55// {
56// return iEa->getUniqueID()==iEb->getUniqueID();
57// }
58
59//
60//#ifndef FEDD_TIMER_START
61//#define FEDD_TIMER_START(A,S) Teuchos::RCP<TimeMonitor> A = Teuchos::rcp(new Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("FEDD:") + std::string(S))));
62//#endif
63//
64//#ifndef FEDD_TIMER_STOP
65//#define FEDD_TIMER_STOP(A) A.reset();
66//#endif
67
68#define FEDDLIB_WARNING(CLASS,VERBOSE,OUTPUT) if (VERBOSE) std::cerr << std::setw(5) << " " << "[WARNING] " << CLASS << ": " << OUTPUT << std::endl;
69
70#define FEDDLIB_NOTIFICATION(CLASS,VERBOSE,OUTPUT) if (VERBOSE) std::cerr << std::setw(5) << " " << "[NOTIFICATION] " << CLASS << ": " << OUTPUT << std::endl;
71
72
73typedef unsigned UN;
74
75typedef std::tuple<int,int> tuple_intint_Type;
76typedef std::tuple<std::string,std::string,int,int> tuple_ssii_Type;
77typedef std::tuple<std::string,double> tuple_sd_Type;
78typedef std::vector<tuple_sd_Type> tuple_sd_vec_Type;
79typedef Teuchos::RCP<tuple_sd_vec_Type> tuple_sd_vec_ptr_Type;
80
81typedef std::vector<tuple_ssii_Type> tuple_disk_vec_Type;
82typedef Teuchos::RCP<tuple_disk_vec_Type> tuple_disk_vec_ptr_Type;
83
84typedef std::vector<std::string> string_vec_Type;
85typedef Teuchos::RCP<string_vec_Type> string_vec_ptr_Type;
86
87typedef std::vector<std::string> vec_string_Type;
88typedef std::vector<double> vec_dbl_Type;
89typedef std::vector<int> vec_int_Type;
90typedef std::vector<long long> vec_long_Type;
91typedef std::vector<default_lo> vec_LO_Type;
92typedef std::vector<default_go> vec_GO_Type;
93typedef std::vector<bool> vec_bool_Type;
94typedef std::vector<std::vector<double> > vec2D_dbl_Type;
95typedef std::vector<std::vector<int> > vec2D_int_Type;
96typedef std::vector<vec_long_Type > vec2D_long_Type;
97typedef std::vector<vec_LO_Type > vec2D_LO_Type;
98typedef std::vector<vec_GO_Type > vec2D_GO_Type;
99typedef std::vector<vec2D_dbl_Type> vec3D_dbl_Type;
100typedef std::vector<vec2D_long_Type > vec3D_long_Type;
101
102typedef Teuchos::RCP<vec_dbl_Type> vec_dbl_ptr_Type;
103typedef Teuchos::RCP<vec_int_Type> vec_int_ptr_Type;
104typedef Teuchos::RCP<vec_long_Type> vec_long_ptr_Type;
105typedef Teuchos::RCP<vec_GO_Type> vec_GO_ptr_Type;
106typedef Teuchos::RCP<vec2D_dbl_Type > vec2D_dbl_ptr_Type;
107typedef Teuchos::RCP<vec2D_int_Type > vec2D_int_ptr_Type;
108typedef Teuchos::RCP<vec2D_long_Type > vec2D_long_ptr_Type;
109typedef Teuchos::RCP<vec3D_dbl_Type> vec3D_dbl_ptr_Type;
110typedef std::vector<vec_long_ptr_Type> vec_long_ptr_vec_Type;
111typedef Teuchos::RCP<vec_long_ptr_vec_Type> vec_long_ptr_vec_ptr_Type;
112typedef std::vector<vec2D_int_Type> vec2D_int_vec_Type;
113typedef std::vector<vec2D_dbl_Type> vec2D_dbl_vec_Type;
114typedef std::vector<vec2D_int_ptr_Type> vec2D_int_ptr_vec_Type;
115typedef std::vector<vec2D_dbl_ptr_Type> vec2D_dbl_ptr_vec_Type;
116
117typedef Teuchos::RCP<vec2D_int_vec_Type> vec2D_int_vec_ptr_Type;
118typedef Teuchos::RCP<vec2D_dbl_vec_Type> vec2D_dbl_vec_ptr_Type;
119typedef Teuchos::RCP<vec2D_int_ptr_vec_Type> vec2D_int_ptr_vec_ptr_Type;
120typedef Teuchos::RCP<vec2D_dbl_ptr_vec_Type> vec2D_dbl_ptr_vec_ptr_Type;
121
122typedef Teuchos::RCP<vec3D_long_Type> vec3D_long_ptr_Type;
123
124typedef Teuchos::RCP<std::vector<vec_int_ptr_Type> > vec_int_ptr_vec_ptr_Type;
125
126typedef Teuchos::Time Time_Type;
127typedef Teuchos::RCP<Time_Type> TimePtr_Type;
128typedef Teuchos::TimeMonitor TimeMonitor_Type;
129
130typedef Teuchos::ParameterList ParameterList_Type;
131typedef Teuchos::RCP<ParameterList_Type> ParameterListPtr_Type;
132typedef Teuchos::RCP<const ParameterList_Type> ParameterListConstPtr_Type;
133
134typedef boost::function<double(double* x, int* parameters)> CoeffFunc_Type;
135typedef boost::function<double(double* x, double* parameters)> CoeffFuncDbl_Type;
136typedef boost::function<void(double* x, double* res, double* parameters)> RhsFunc_Type;
137typedef boost::function<void(double* x, double* res, double t, double* parameters)> GeneralFunc_Type;
138typedef boost::function<void(double* x, double* res)> Func_Type;
139
140template <typename SC>
142using ThyraOp_Type = Thyra::LinearOpBase<SC>;
143using ThyraVecSpace_Type = Thyra::VectorSpaceBase<SC>;
144using ThyraVec_Type = Thyra::VectorBase<SC>;
145};
146
147template <typename SC, typename LO, typename GO, typename NO>
149using TpetraMatrix_Type = Tpetra::CrsMatrix<SC, LO, GO, NO>;
150using TpetraOp_Type = Tpetra::Operator<SC, LO, GO, NO>;
151};
152
153}
154#endif
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36
Definition FEDDCore.hpp:141
Definition FEDDCore.hpp:148