-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgsBasePde.h
56 lines (41 loc) · 1.4 KB
/
gsBasePde.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/** @file gsBasePde.h
@brief IMHO, a useless class, but it is necessary to use the gsAssembler class.
Contains proper information for elasticity and Navier-Stokes solvers.
This file is part of the G+Smo library.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Author(s): A. Shamanskiy
*/
#pragma once
#include <gsPde/gsPde.h>
#include <gsCore/gsPiecewiseFunction.h>
namespace gismo
{
template<class T>
class gsBasePde : public gsPde<T>
{
public:
/// Default constructor
gsBasePde( ) { }
/// Constructor
gsBasePde(const gsMultiPatch<T> &domain,
const gsBoundaryConditions<T> &bc,
const gsPiecewiseFunction<T> &rhs)
: gsPde<T>(domain,bc), m_rhs(rhs)
{
m_unknownDim.setOnes(m_rhs.targetDim());
}
/**
* @brief gives the number of rhs functions of the PDEs
*/
virtual int numRhs() const { return 1; }
/// Prints the object as a string.
virtual std::ostream &print(std::ostream &os) const { return os; }
const gsFunction<T> * rhs() const { return &m_rhs.piece(0); }
virtual int numUnknowns() const {return m_rhs.targetDim();}
protected:
using gsPde<T>::m_unknownDim;
gsPiecewiseFunction<T> m_rhs;
};
} // namespace gismo