NeoPZ
pzbctension.h
Go to the documentation of this file.
1 
6 #ifndef BCTENSIONHPP
7 #define BCTENSIONHPP
8 
9 #include "pzbndcond.h"
10 #include "TPZPlacaOrthotropic.h"
11 #include "TPZMulticamadaOrtho.h"
12 
13 
14 template <class T, int N>
15 class TPZManVector;
18 
19 
24 class TPZBCTension : public TPZBndCond {
25 
27  int fCamada;
28  REAL fSign;
29 
30 private:
31 
32  public :
33 
35 
36  TPZBCTension(TPZMaterial * &material,int id,int type,TPZFMatrix<STATE> &val1,TPZFMatrix<STATE> &val2, REAL sign, TPZMulticamadaOrthotropic *mult, int camada);
37 
38  virtual int NFluxes() override { return Material()->NFluxes(); }
39 
40  virtual int NStateVariables() const override { return Material()->NStateVariables(); }
41 
42  void Contribute(TPZMaterialData &data, REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override {
43 
44  TPZFMatrix<REAL> &dphi = data.dphix;
45  TPZFMatrix<REAL> &phi = data.phi;
46  TPZManVector<REAL,3> &x = data.x;
47  TPZVec<STATE> &sol=data.sol[0];
48  TPZFMatrix<STATE> &dsol=data.dsol[0];
49  TPZFMatrix<REAL> &jacinv = data.jacinv;
50  TPZFMatrix<REAL> &axes = data.axes;
51 
52  int typekeep = fType;
53  if(fType == 4) {
54  TPZManVector<REAL,3> normal(3);
55  normal[0] = fSign*(axes(0,1)*axes(1,2)-axes(0,2)*axes(1,1));
56  normal[1] = fSign*(axes(0,2)*axes(1,0)-axes(0,0)*axes(1,2));
57  normal[2] = fSign*(axes(0,0)*axes(1,1)-axes(0,1)*axes(1,0));
58  TPZFNMatrix<9> tensor(3,3);
59  fMultCam->Tensor(x,fCamada,tensor);
60  int i,j;
61  Val2().Zero();
62  for(i=0; i<3; i++) {
63  for(j=0; j<3; j++) {
64  Val2()(i,0) += tensor(i,j)*normal[j];
65  }
66  }
67  fType = 1;
68  Material()->ContributeBC(data,weight,ek,ef,*this);
69  fType = typekeep;
70  } else {
71  TPZMaterialData data;
72  data.x = x;
73  data.jacinv = jacinv;
74  data.sol[0] = sol;
75  data.dsol[0] = dsol;
76  data.axes = axes;
77  data.phi = phi;
78  data.dphix = dphi;
79  TPZBndCond::Contribute(data,weight,ek,ef);
80  }
81 
82  }
83  void Contribute(TPZMaterialData &data, REAL weight,TPZFMatrix<STATE> &ef) override
84  {
85  TPZBndCond::Contribute(data,weight,ef);
86  }
87 public:
88 virtual int ClassId() const override;
89 
90 };
91 
92 #endif
TPZMulticamadaOrthotropic * fMultCam
Definition: pzbctension.h:26
Class which implements a tension boundary condition, where the tensor is computed from a finite eleme...
Definition: pzbctension.h:24
TPZManVector< REAL, 3 > x
value of the coordinate at the integration point
Implements a vector class which allows to use external storage provided by the user. Utility.
Definition: pzquad.h:16
Gerencia um conjunto de placas dispostas em forma multicamada.
virtual int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
Definition: pzbctension.cpp:20
void Tensor(TPZVec< REAL > &x, int placa, TPZFMatrix< REAL > &tensor)
Tensor which needs to be applied at the given coordinate.
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
TPZFNMatrix< 9, REAL > jacinv
value of the inverse of the jacobian at the integration point
TPZFMatrix< STATE > & Val2(int loadcase=0)
Definition: pzbndcond.h:255
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
Definition: pzbndcond.cpp:142
TPZBCTension(TPZMaterial *&material, int id, int type, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2, REAL sign, TPZMulticamadaOrthotropic *mult, int camada)
Definition: pzbctension.cpp:11
int Zero() override
Makes Zero all the elements.
Definition: pzfmatrix.h:651
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Definition: pzbctension.h:40
virtual int NFluxes()
Returns the number of components which form the flux function.
Definition: TPZMaterial.h:183
void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.
Definition: pzbctension.h:83
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
Contains the TPZPlacaOrthotropic class.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc)=0
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
int fType
boundary condition type
Definition: pzbndcond.h:98
void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
Definition: pzbctension.h:42
virtual int NFluxes() override
Returns the number of components which form the flux function.
Definition: pzbctension.h:38
Contains the TPZMulticamadaOrthotropic class.
TPZSolVec sol
vector of the solutions at the integration point
Implements computational element based on an interpolation space. Computational Element.
Definition: pzintel.h:27
TPZMaterial * Material() const
Definition: pzbndcond.h:263