def BuildSpace(self): # Generating the Mesh Params = {'Nelems': self.Nelems, 'a': self.a, 'b': self.b} mesh = Mesh(**Params) # Retreiving the mesh ends up with a tuple with the Grid and its iterator (self.Grid, Grid_itr) = mesh.get_Mesh() print self.Grid i = 0 # Generate the elements over the Grid NodesPerElem = len(self.Shape_Funct.getSF_Names()) for k in Grid_itr: Segment_Props = {'k': i, 'Interval': self.Grid[k:k + NodesPerElem]} self.FE.insert(i, Finite_Element(**Segment_Props)) i = i + 1 # Calculate functionals for Element in self.FE: for funct in self.Shape_Funct.getSF_Names(): Element.Functional(self.Shape_Funct.getFunctional(funct))( Element.interval) # For each element assign p(x), q(x) and f(x) for Element in self.FE: Element.p_x = self.p_x Element.q_x = self.q_x Element.f_x = self.f_x # Creating the local symbolic Matrices and evaluating the numerical integrals over the interval for Element in self.FE: Element.create_stiff_local_Sym() Element.create_nodal_forces_local_Sym() Element.solve_stiff_local() Element.solve_forces_local()
def BuildSpace(self): # Generating the Mesh Params = {'Nelems': self.Nelems,'a': self.a,'b': self.b} mesh = Mesh(**Params) # Retreiving the mesh ends up with a tuple with the Grid and its iterator (self.Grid, Grid_itr) = mesh.get_Mesh() print self.Grid i = 0 # Generate the elements over the Grid NodesPerElem = len(self.Shape_Funct.getSF_Names()) for k in Grid_itr: Segment_Props = {'k':i,'Interval':self.Grid[k:k+NodesPerElem]} self.FE.insert(i,Finite_Element(**Segment_Props)) i=i+1 # Calculate functionals for Element in self.FE: for funct in self.Shape_Funct.getSF_Names(): Element.Functional(self.Shape_Funct.getFunctional(funct))(Element.interval) # For each element assign p(x), q(x) and f(x) for Element in self.FE: Element.p_x = self.p_x Element.q_x = self.q_x Element.f_x = self.f_x # Creating the local symbolic Matrices and evaluating the numerical integrals over the interval for Element in self.FE: Element.create_stiff_local_Sym() Element.create_nodal_forces_local_Sym() Element.solve_stiff_local() Element.solve_forces_local()