On 06/02/2015 10:58 AM, Ronghai Wu wrote:
Dear Robert Cimrman,
I have two new questions, could you please give me some tips: 1)I have been using C_11, C_12 and C_44 to define stiffness tensor of cubic crystal, then repeat to all elements, basically as shown below,
self.stiffness_gene[i] = np.array([[self.C_11[i], self.C_12[i], 0.], [self.C_12[i], self.C_11[i], 0.], [0., 0., self.C_44[i]]]) self.m = Material('m', function=self.D_function)
def D_function(self, ts, coors, mode, term=None, **kwargs): if mode != 'qp': return _, weights = term.integral.get_qp('2_4') self.n_qp = weights.shape[0] self.val_D = np.repeat(self.stiffness_gene, self.n_qp, axis=0) return {'function' : self.val_D}
So you are solving a 2D problem, right?
However, what if I have a full stiffness tensor as below. I want to prescribe each component then use this full stiffness tensor. It seems the stiffness tensor in sfepy only supports 3*3 shape or 9 components. So, the question is how can I implement a full stiffness tensor? \begin{bmatrix} C_{11} & C_{12} & C_{13} & C_{14} & C_{15} & C_{16} \\ C_{12} & C_{22} & C_{23} & C_{24} & C_{25} & C_{26} \\ C_{13} & C_{23} & C_{33} & C_{34} & C_{35} & C_{36} \\ C_{14} & C_{24} & C_{34} & C_{44} & C_{45} & C_{46} \\ C_{15} & C_{25} & C_{35} & C_{45} & C_{55} & C_{56} \\ C_{16} & C_{26} & C_{36} & C_{46} & C_{56} & C_{66} \end{bmatrix}
This is supported in the same way as the 3x3 above, but you have to use a 3D mesh/problem. Use it with the dw_lin_elastic term (see e.g. examples/linear_elasticity/prestress_fibres.py)
- if I have a 'for' loop and at each iteration of the 'for' loop, I use sfepy solve a static-linear-elastic mechanical equilibrium equation, basically as below,
for self.t_step in range(self.nt):
self.prestress = Material('prestress', function=self.prestress_function) self.m = Material('m', function=self.D_function) ............. self.pb.time_update(ebcs=Conditions()) self.pb.update_materials() self.vec = self.pb.solve()However, I find that as the loop goes on, the computer Mem is increasing, after the Mem if full, then Swp is increasing, after several hours more, Swp is also full and computer crashes. I guess sfepy is stalling something big at each loop, so Mem accumulates constantly, but I cannot figure out what's exactly wrong. Do you have any idea about this? Thanks.
What sfepy version are you using? Could you retry it with the latest release (2015.2), if you have not had it already? If the problem persists, it seems like a bug. Then you can try using [1] (see expecially "Executing external scripts" section) to locate the memory leak.
Thanks, r.