MPI의 이해
YADE에서는 Distribued memeory를 이용한 병렬 가속화를 지원한다. 명령어는 mpirun이다. mpirun을 실행하면 신기한 현상이 하나 생기는데, body가 증가하는 것이다. 오잉? 예를 들어보자. 초기생성모델이다. 박스를 먼저, Sphere를 다음에, 그리고 Topcap을 생성하였다. 그렇다면 O.bodies로 body object가 어떻게 생성되었는지 확인해 보자. In [1]: len(O.bodies) Out[1]: 613 body는 총 613개가 생성되었다. In [2]: O.bodies[0].dict() Out[2]: {'id': 0, 'groupMask': 1, 'flags': 1, 'subdomain': 0, 'material': , 'state': , 'shape': , '..
더보기
YADE의 Material
YADE는 기본적으로 Defaul Material이 지정되어 있다. 그래서, YADE를 실행 후 확인을 해 보면, In [2]: len(O.materials) Out[2]: 0 material container가 비어있다. 오잉? 그렇다면 body를 만들어 보자 O.bodies.append(utils.facet(vertices=[(0,0,0),(0,1,0),(1,1,1)], wire=True, highlight=False)) Facet을 하나 만들어다. 이제 다시 확인해 보면 In [7]: len(O.materials) Out[7]: 1 material container가 채워졌다. 이때 채워지는 것은 Default값으로 들어가는데, 확인해 보면 In [8]: O.materials[0].dict() Ou..
더보기
Body의 종류 확인방법
In [75]: isinstance(O.bodies[1].shape,Facet) Out[75]: True In [76]: isinstance(O.bodies[1].shape,Sphere) Out[76]: False 더 쉬운방법은 In [10]: O.bodies[10].dict() Out[10]: {'id': 10, 'groupMask': 1, 'flags': 1, 'subdomain': 4, 'material': , 'state': , 'shape': , 'bound': , 'clumpId': -1, 'chain': -1, 'iterBorn': 0, 'timeBorn': 0.0}
더보기
O.engines 내용 확인방법
O.engines는 List type 컨테이너 이다. 예를 들어, O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()], # collision geometry [Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics" [Law2_ScGeom_FrictPhys_CundallStrack()] # contact law -- apply forces ), NewtonIntegrator(gravity=(0, 0, -9.81), d..
더보기