Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Constraint.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // Seismo Virtual Laboratory
4 // Module for Serial and Parallel Analysis of seismic
5 // wave propagation and soil-structure interaction simulation
6 // Copyright (C) 2018-2021, The California Institute of Technology
7 // All Rights Reserved.
8 //
9 // Commercial use of this program without express permission of the California
10 // Institute of Technology, is strictly prohibited. See file "COPYRIGHT" in
11 // main directory for information on usage and redistribution, and for a
12 // DISCLAIMER OF ALL WARRANTIES.
13 //
14 //==============================================================================
15 //
16 // Written by:
17 // Danilo S. Kusanovic (dkusanov@caltech.edu)
18 // Elnaz E. Seylabi (elnaze@unr.edu)
19 //
20 // Supervised by:
21 // Domniki M. Asimaki (domniki@caltech.edu)
22 //
23 // References :
24 // [1] Carlos Felippa. "Introduction to Finite Element Methods (ASEN 5007)":
25 // Multifreedom Constraints I, Fall 2005.
26 //
27 // Description:
30 //------------------------------------------------------------------------------
31 
32 #ifndef _CONSTRAINT_HPP_
33 #define _CONSTRAINT_HPP_
34 
35 #include <vector>
36 
44 class Constraint{
45 
46  public:
48  Constraint();
49 
56  Constraint(unsigned int slave, std::vector<unsigned int> master, std::vector<double> factors);
57 
59  ~Constraint();
60 
65  void SetSlaveInformation(unsigned int slave);
66 
71  void SetMasterInformation(std::vector<unsigned int> master);
72 
77  void SetCombinationFactors(std::vector<double> factors);
78 
81  unsigned int GetNumberOfConstraints() const;
82 
86  unsigned int GetSlaveInformation() const;
87 
92  const std::vector<unsigned int> GetMasterInformation() const;
93 
98  const std::vector<double> GetCombinationFactors() const;
99 
100  private:
102  unsigned int Slave;
103 
105  std::vector<unsigned int> Master;
106 
108  std::vector<double> Coefficients;
109 };
110 
111 #endif
void SetMasterInformation(std::vector< unsigned int > master)
Sets the master&#39;s free degree-of-freedom list numbering.
std::vector< double > Coefficients
The combination coefficient vector.
Definition: Constraint.hpp:108
void SetCombinationFactors(std::vector< double > factors)
Sets the master&#39;s combinational factors applied to degree-of-freedom list numbering.
Class for creating a linear kinematic relations between degree-of-freedom in the model.
Definition: Constraint.hpp:44
const std::vector< double > GetCombinationFactors() const
Gets the combinational factor list for each degree-of-freedom.
void SetSlaveInformation(unsigned int slave)
Sets the slave&#39;s node degree-of-freedom.
unsigned int GetSlaveInformation() const
Gets the slave free degree-of-freedom of this constraint.
unsigned int GetNumberOfConstraints() const
Gets the number of combinations applied to this slave degree-of-freedom.
Constraint()
Creates a empty Constraint to a degree-of-freedom.
unsigned int Slave
The slave total degree-of-freedom.
Definition: Constraint.hpp:102
~Constraint()
Destroys this Constraint.
std::vector< unsigned int > Master
The list of master free degree-of-freedom.
Definition: Constraint.hpp:105
const std::vector< unsigned int > GetMasterInformation() const
Gets the master list of total degree-of-freedom to be combined.