xc
Constraint.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //Constraint.h
29 
30 #ifndef Constraint_h
31 #define Constraint_h
32 
33 #include "domain/component/ContinuaReprComponent.h"
34 
35 
36 namespace XC {
40 //
44 //
45 //
49  {
50  protected:
52  bool initialized;
53 
54  int sendData(Communicator &);
55  int recvData(const Communicator &);
56  public:
57  // constructors
58  Constraint(int classTag);
59  Constraint(int spTag, int nodeTag, int classTag);
60  ~Constraint(void);
61 
62  void setNodeTag(const int &nt);
63  virtual int getNodeTag(void) const;
64  virtual const Node *getNode(void) const;
65  virtual int getNodeIdx(void) const;
66  virtual int applyConstraint(double loadFactor)= 0;
67  virtual bool affectsNode(int ) const;
68  virtual bool affectsNodeAndDOF(int , int ) const;
69 
70  void setDomain(Domain *);
71 
72  virtual int getVtkCellType(void) const;
73 
74  boost::python::dict getPyDict(void) const;
75  void setPyDict(const boost::python::dict &);
76  virtual void Print(std::ostream &s, int flag =0) const;
77  };
78 } // end of XC namespace
79 
80 #endif
81 
82 
virtual const Node * getNode(void) const
Returns a pointer to the constrained node.
Definition: Constraint.cc:106
int recvData(const Communicator &)
Receives members through the communicator argument.
Definition: Constraint.cc:159
int constrNodeTag
constrained node tag
Definition: Constraint.h:51
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Constraint.cc:177
virtual bool affectsNode(int) const
Returns true ifafecta to the node cuyo tag being passed as parameter.
Definition: Constraint.cc:134
Communication parameters between processes.
Definition: Communicator.h:66
virtual bool affectsNodeAndDOF(int, int) const
Returns true if the constraint affects the node and DOF arguments.
Definition: Constraint.cc:138
int sendData(Communicator &)
Send members through the communicator argument.
Definition: Constraint.cc:149
void setNodeTag(const int &nt)
Sets the identifier of the node that will be constrained.
Definition: Constraint.cc:94
bool initialized
a flag to avoid recomputing the intial value in setDomain if already initialized
Definition: Constraint.h:52
Constraint(int classTag)
Default constructor; receives the tag of the class as a paramenter.
Definition: Constraint.cc:38
Base class for components used to represent the material (continuum).
Definition: ContinuaReprComponent.h:39
virtual int getNodeIdx(void) const
Returns an index for the node (used for VTK arrays).
Definition: Constraint.cc:124
virtual int getVtkCellType(void) const
returns the VTK cell type.
Definition: Constraint.cc:193
~Constraint(void)
Destructor.
Definition: Constraint.cc:50
virtual void Print(std::ostream &s, int flag=0) const
Prints some information about the constraint.
Definition: Constraint.cc:170
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class for model constraints.
Definition: Constraint.h:48
virtual int getNodeTag(void) const
Returns the identifier of the constrained node.
Definition: Constraint.cc:99
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Mesh node.
Definition: Node.h:111
void setDomain(Domain *)
Sets the domain for the constraint.
Definition: Constraint.cc:62
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Constraint.cc:185