-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTPZElasticity2DOtiTopo.h
85 lines (65 loc) · 2.95 KB
/
TPZElasticity2DOtiTopo.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef _TPZELASTICITY2DOTITOPO_H_
#define _TPZELASTICITY2DOTITOPO_H_
#include <Elasticity/TPZElasticity2D.h>
#include <TPZMatWithMem.h>
/*
desired memory:
sol = solution at the integration point
dsol = solution's derivatives
*/
//! Data to be stored at each integration point
struct TPZOtiTopoDensity{
STATE fDen = -1.;
[[nodiscard]] int ClassId() const;
//! Write to stream(serialization method)
void Write(TPZStream &buf, int withclassid) const;
//! Read from stream(serialization method)
void Read(TPZStream &buf, void *context);
//! Print contents(debugging method)
void Print(std::ostream &out) const;
};
inline std::ostream& operator<<( std::ostream& out, const TPZOtiTopoDensity& t ){
t.Print(out);
return out;
}
//! Implements a source for scattering problems of planar waveguides
class TPZElasticity2DOtiTopo : public TPZElasticity2D,
public TPZMatWithMem<TPZOtiTopoDensity>{
public:
TPZElasticity2DOtiTopo(int id, STATE E, STATE nu, STATE fx, STATE fy, int planestress = 1);
//! All constructors from base class shall be available
// using TPZElasticity2DOtiTopo::TPZElasticity2DOtiTopo;
//! Contribution to the matrix and rhs at the integration point
// void Contribute(const TPZMaterialDataT<STATE> &data, REAL weight,
// TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override
// {
// Contribute(data,weight,ef);
// }
// //! Contribution to the rhs at the integration point
// void Contribute(const TPZMaterialDataT<STATE> &data, REAL weight,
// TPZFMatrix<STATE> &ef) override;
// void FillDataRequirements(TPZMaterialData &data) const override;
/** @brief Returns the solution associated with the var index based on the finite element approximation */
void Solution(const TPZMaterialDataT<STATE> &data, int var,
TPZVec<STATE> &Solout) override;
//! Creates a copy of this instance
TPZElasticity2DOtiTopo * NewMaterial() const override;
//! Returns name of the class
std::string Name() const override { return "TPZElasticity2DOtiTopo"; }
//! Unique identifier for serialization purposes
[[nodiscard]] int ClassId() const override;
//! Write to stream(serialization method)
void Write(TPZStream &buf, int withclassid) const override;
//! Read from stream(serialization method)
void Read(TPZStream &buf, void *context) override;
/** @brief Returns the variable index associated with the name */
int VariableIndex(const std::string &name) const override;
/** @brief Calculates the element stiffness matrix */
void Contribute(const TPZMaterialDataT<STATE> &data, STATE weight,
TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override;
/**
* @brief Returns the number of variables associated with the variable indexed by var.
*/
int NSolutionVariables(int var) const override;
};
#endif /* _TPZELASTICITY2DOTITOPO_H_ */