Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Dof:
- def __init__(self, strU_, strF_):
- self.strU = strU_ # essential variable name
- self.strF = strF_ # natural variable name
- self.bryF = lambda t: 0.0 # essential boundary value (python function)
- self.bryU = 0.0 # natural boundary value
- self.eq_id = -1 # equation number related to the global system
- self.presc = False # flag for prescribed essential boundary condition
- self.history = [[], [], [], [], []] # saved values of variables along time
- class Node:
- def __init__(self):
- self.dofs = [] # list for degrees of freedom
- self.id = -1 # node identification number
- self.save_history = False # flag for saving history
- def add_dof(self, dof_U, dof_F):
- """ Adds a new degree of freedom """
- # check if dof_U is already contained in dofs list
- found = False
- for dof in self.dofs:
- if dof.strU == dof_U:
- found = True
- break
Add Comment
Please, Sign In to add comment