Fix bug in getNodes() and some clean up in ApplyingBC

This commit is contained in:
jriegel 2013-08-15 19:35:52 +02:00
parent ac69b1fc7f
commit 58ba9d4498
3 changed files with 27 additions and 3 deletions

View File

@ -476,7 +476,7 @@ Py::Tuple FemMeshPy::getNodes(void) const
// Apply the matrix to hold the BoundBox in absolute space.
vec = Mtrx * vec;
tup.setItem(i, Py::asObject(new Base::VectorPy(Base::Vector3d(aNode->X(),aNode->Y(),aNode->Z()))));
tup.setItem(i, Py::asObject(new Base::VectorPy( vec )));
}
return tup;

View File

@ -1,9 +1,33 @@
def ApplyingBC_IC(Casedir,YoungModulus,PoissonCoeff,OUTER_GRID_No1,OUTER_GRID_No2,OUTER_GRID_No3) :
def ApplyingBC_IC(Casedir,YoungModulus,PoissonCoeff,OUTER_GRID_No1,OUTER_GRID_No2,OUTER_GRID_No3,Meshobject) :
# Variables generales
import os,subprocess
#
AC_file = open (str(Casedir + "/" + "Applied_Conditions.txt"),'w')
#
#Setup local coordinate system by using *TRANSFORM keyword to avoid any rigid body motions during isostatic clamping
#Outer_Grid_no_1 is origin, no_2 is on x-axis and no_3 is in local XY plane
#Therefore
#OUTER_GRID_No2-OUTER_GRID_No1,OUTER_GRID_No3-OUTER_GRID_No1 is the input for the TRansform keyword
AllNodes = Meshobject.FemMesh.Nodes
GridNode1 = AllNodes[OUTER_GRID_No1]
GridNode2 = AllNodes[OUTER_GRID_No2]
GridNode3 = AllNodes[OUTER_GRID_No3]
print GridNode1
a_x = GridNode2[0]-GridNode1[0]
a_y = GridNode2[1]-GridNode1[1]
a_z = GridNode2[2]-GridNode1[2]
b_x = GridNode3[0]-GridNode1[0]
b_y = GridNode3[1]-GridNode1[1]
b_z = GridNode3[2]-GridNode1[2]
AC_file.write("** \n")
AC_file.write("** Node Set for transformation card :\n")
AC_file.write("*Nset, nset=transformed_nodes\n")
AC_file.write(str(OUTER_GRID_No1)+","+str(OUTER_GRID_No2)+","+str(OUTER_GRID_No3)+"\n")
AC_file.write("** \n")
AC_file.write("** Transformation to avoid rigid body motions :\n")
AC_file.write("*TRANSFORM, nset=transformed_nodes\n")
AC_file.write(str(a_x)+","+str(a_y)+","+str(a_z)+","+str(b_x)+","+str(b_y)+","+str(b_z)+"\n")
AC_file.write("** \n")
# a) BOUNDARY conditions in order to prevent the billet to any solid displacement
AC_file.write("** \n")
AC_file.write("** BOUNDARY Conditions :\n")

View File

@ -349,7 +349,7 @@ class _JobControlTaskPanel:
#Check if the
MeshObject.FemMesh.writeABAQUS(str(Case_Dir + "/" + "geometry_fe_input.inp"))
IsoNodes = list(IsoNodes)
ApplyingBC_IC(Case_Dir, young_modulus,poisson_ratio,IsoNodes[0],IsoNodes[1],IsoNodes[2])
ApplyingBC_IC(Case_Dir, young_modulus,poisson_ratio,IsoNodes[0],IsoNodes[1],IsoNodes[2],MeshObject)
batch.write("cd \"" + str(Case_Dir) + "\"\n")
batch.write("ccx -i geometry_fe_input\n")