waves
Basic FE playground
wAssign.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 WASSIGN_H
18 #define WASSIGN_H
19 
20 #include "flow.h"
21 #include "wGroup.h"
22 #include "wF0Ps.h"
23 #include <vector>
24 #include <string>
25 #include <Eigen/Dense>
26 
27 namespace flow
28 {
29 
34 class FLOW_API Assign : public tbox::Group
35 {
36 public:
37  std::vector<tbox::Node *> nodes;
38 #ifndef SWIG
39  F0Ps *f;
40 
41  Assign(std::shared_ptr<tbox::MshData> _msh, int no);
42  Assign(std::shared_ptr<tbox::MshData> _msh, std::string const &name);
43  virtual ~Assign();
44 
45  void apply(std::vector<double> &vec);
46 #endif
47 
48 private:
49  void getNodes();
50 };
51 
56 class FLOW_API Initial : public Assign
57 {
58 public:
59  Initial(std::shared_ptr<tbox::MshData> _msh, int no, int dim, double alpha, double beta = 0.0);
60  Initial(std::shared_ptr<tbox::MshData> _msh, std::string const &name, int dim, double alpha, double beta = 0.0);
61  virtual ~Initial() { std::cout << "~Initial()\n"; }
62 
63 #ifndef SWIG
64  virtual void write(std::ostream &out) const override;
65 #endif
66 };
67 
72 class FLOW_API Dirichlet : public Assign
73 {
74 public:
75  Dirichlet(std::shared_ptr<tbox::MshData> _msh, int no, int dim, double alpha, double beta = 0.0, bool pin = false);
76  Dirichlet(std::shared_ptr<tbox::MshData> _msh, std::string const &name, int dim, double alpha, double beta = 0.0);
77  virtual ~Dirichlet() { std::cout << "~Dirichlet()\n"; }
78 
79 #ifndef SWIG
80  virtual void write(std::ostream &out) const override;
81 #endif
82 };
83 
84 } // namespace flow
85 
86 #endif //WASSIGN_H
flow::Assign
Manage assign type condition.
Definition: wAssign.h:34
flow::Dirichlet
Manage Dirchlet boundary condition.
Definition: wAssign.h:72
flow::F0Ps
Scalar functions depending on spatial position.
Definition: wF0Ps.h:30
flow::Initial::~Initial
virtual ~Initial()
Definition: wAssign.h:61
FLOW_API
#define FLOW_API
Definition: flow.h:29
flow::Assign::nodes
std::vector< tbox::Node * > nodes
nodes of the boundary
Definition: wAssign.h:37
flow
Namespace for flow module.
Definition: flow.h:37
flow::Initial
Manage initial condition.
Definition: wAssign.h:56
wF0Ps.h
flow::Assign::f
F0Ps * f
position-based function to compute the boundary value
Definition: wAssign.h:39
flow.h
flow::Dirichlet::~Dirichlet
virtual ~Dirichlet()
Definition: wAssign.h:77