getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-users] Dirichlet boundary condition on vertex


From: James Zhou
Subject: [Getfem-users] Dirichlet boundary condition on vertex
Date: Thu, 27 Oct 2011 22:30:29 -0400

Dear all,

I have exactly the same question as in http://www.mail-archive.com/address@hidden

In particular, I want to fixed a component of some a set of vertex in 3D.  Can anyone give an example on how to use the constraint brick in python?  Here is my obviously failed attempt:

H = []; R = []
b4 = gf.MdBrick("constraint", b2, 'eliminated');

# Loop though all dof nodes looking for nodes satisfy the constraint criteria
for dof in mfu.basic_dof_nodes():
    if (abs(dof[1] + 0.125) < 1e-6):
        # constrain the y component of dof to 0
        H.append([0,0,0,0,1,0,0,0,0]);
        R.append([0,0,0]);
    else:
        # dof is not part of the constraint.
        H.append([0,0,0,0,0,0,0,0,0]);
        R.append([0,0,0]);
b4.constraints(H, R);

Thank you very much!
James

reply via email to

[Prev in Thread] Current Thread [Next in Thread]