waves
Basic FE playground
wProblem.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 University of Liège
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef WPROBLEM_H
18 #define WPROBLEM_H
19 
20 #include "heat.h"
21 #include "wObject.h"
22 #include <memory>
23 #include <iostream>
24 #include <vector>
25 
26 using namespace tbox;
27 
28 namespace heat
29 {
30 
35 class HEAT_API Problem : public fwk::wSharedObject
36 {
37 public:
38  std::shared_ptr<MshData> msh;
39 #ifndef SWIG
40  std::vector<std::shared_ptr<Medium>> media;
41  std::vector<std::shared_ptr<Dirichlet>> dBCs;
42 
43  std::vector<std::shared_ptr<Source>> srcs;
44  std::vector<std::shared_ptr<Boundary>> bnds;
45 
46  std::shared_ptr<Periodic> pdic;
47 #endif
48 
49 public:
50  Problem(std::shared_ptr<MshData> _msh);
51  virtual ~Problem();
52 
53  void add(std::shared_ptr<Medium> m) { media.push_back(m); }
54  void add(std::shared_ptr<Dirichlet> d) { dBCs.push_back(d); }
55  void add(std::shared_ptr<Source> s) { srcs.push_back(s); }
56  void add(std::shared_ptr<Boundary> b) { bnds.push_back(b); }
57  void add(std::shared_ptr<Periodic> p) { pdic = p; }
58 
59 #ifndef SWIG
60  void initElems();
61  virtual void write(std::ostream &out) const override;
62 #endif
63 };
64 
65 } // namespace heat
66 
67 #endif //WPROBLEM_H
HEAT_API
#define HEAT_API
Definition: heat.h:29
heat::Problem::add
void add(std::shared_ptr< Source > s)
Definition: wProblem.h:55
heat
this namespace avoids conflicts with similar names in 'waves'
Definition: heat.h:38
heat::Problem
a class containing the problem parameters
Definition: wProblem.h:35
heat::Problem::add
void add(std::shared_ptr< Dirichlet > d)
Definition: wProblem.h:54
heat::Problem::add
void add(std::shared_ptr< Boundary > b)
Definition: wProblem.h:56
heat::Problem::bnds
std::vector< std::shared_ptr< Boundary > > bnds
prescribed fluxes on the boundary
Definition: wProblem.h:44
heat::Problem::srcs
std::vector< std::shared_ptr< Source > > srcs
volumic sources
Definition: wProblem.h:43
heat::Problem::media
std::vector< std::shared_ptr< Medium > > media
Materials.
Definition: wProblem.h:40
heat.h
heat::Problem::msh
std::shared_ptr< MshData > msh
Mesh structure.
Definition: wProblem.h:38
heat::Problem::add
void add(std::shared_ptr< Medium > m)
Definition: wProblem.h:53
heat::Problem::dBCs
std::vector< std::shared_ptr< Dirichlet > > dBCs
Dirichlet boundary conditions.
Definition: wProblem.h:41
heat::Problem::pdic
std::shared_ptr< Periodic > pdic
periodic BC
Definition: wProblem.h:46
heat::Problem::add
void add(std::shared_ptr< Periodic > p)
Definition: wProblem.h:57