Guest User

Untitled

a guest
Dec 14th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. class Dof:
  2. def __init__(self, strU_, strF_):
  3. self.strU = strU_ # essential variable name
  4. self.strF = strF_ # natural variable name
  5. self.bryF = lambda t: 0.0 # essential boundary value (python function)
  6. self.bryU = 0.0 # natural boundary value
  7. self.eq_id = -1 # equation number related to the global system
  8. self.presc = False # flag for prescribed essential boundary condition
  9. self.history = [[], [], [], [], []] # saved values of variables along time
  10.  
  11. class Node:
  12.  
  13. def __init__(self):
  14. self.dofs = [] # list for degrees of freedom
  15. self.id = -1 # node identification number
  16. self.save_history = False # flag for saving history
  17.  
  18. def add_dof(self, dof_U, dof_F):
  19. """ Adds a new degree of freedom """
  20. # check if dof_U is already contained in dofs list
  21. found = False
  22. for dof in self.dofs:
  23. if dof.strU == dof_U:
  24. found = True
  25. break
Add Comment
Please, Sign In to add comment