본문 바로가기

LIGGGHTS

Atom은 죽지 않는다. ID를 남길 뿐이다. LIGGGHTS에서 Atom은 생성되면서 고유의 ID를 부여 받는다. 그리고 Atom은 box를 벗어나면 사라지게 된다. 이 과정에서 Atom의 ID가 rearrage되는가? 그렇지 않다. 이번 포스팅은 이로 인한 문제들을 살펴보도록 하자. 먼저, 예제를 보면 왼쪽부터 오른쪽으로 순차적으로 생성된 총 10개의 Atom들이다. 따라서, 왼쪽이 1번 그리고 제일 오른쪽이 10번 Atom이 되겠다. 1번과 10번 Atom이 결국 box밖으로 떨어지므로 남은 Atom은 총 8개이다. 따라서, Atom의 총 개수를 찾으면 8개로 나온다. Atom의 총 개수는 variable로 찾을 수 있다. variable N_atoms equal count(all) print " " print "=== PRINT LIVE AT.. 더보기
write_data and read_data LIGGGHTS에서 simuldation data를 저장하는 방법은 총 3가지가 있다. write_data, write_restart, write_dump write_data와 write_dump는 text 포맷으로 저장하며, write_restart는 binary 포맷을 지원한다. 문제는 저장 후 load시 simulation box 변경을 하는 경우이다. atom의 pluviation단계와 이후 단계에서 simulation영역이 달라지는 경우 LIGGGHTS에서는 load-balancing을 통한 processor grid를 재설정 하지 않기 때문에, simulation box의 사이즈를 조정하며 processor당 할당되는 simulation 영역을 최적화 해주어야 한다. 그런데, write_res.. 더보기
Variable of variable LIGGGHTS에서 equal, atom variable은 variable이 정의가 될 때 값이 정해지지 않고, fix, compute, print 등에서 조회될 때 값이 update된다. 예를 들어, 아래와 같은 경우 fix로 정의된 print시 매 ${screen_nstep}마다 servo_z_position variable이 호출되어 값이 update된다. fix topcap_ovp all mesh/surface/stress/servo file top_cap.stl type 2 com 0.0 0.0 ${topcap_ini_z} ctrlPV force axis 0 0 1 target_val ${topcap_force_z} vel_max ${topcap_vel_max} variable servo_z_p.. 더보기
Atom style variable의 연산 LIGGGHTS에서 variable은 equal style과 atom style로 구분된다. 예를들어 atom의 radius를 compute한 결과는 atom style (열벡터)로 얻어진다. compute cal_radius all property/atom update_on_run_end yes radius variable ak2 atom c_cal_radius variable ak3 atom (c_cal_radius)^2 이렇게 계산된 atom variable은 custom dump style로 출력 가능하다. dump dump_imsi2 all custom 100 ak1-*.txt v_ak2 v_ak3 출력 결과를 확인해 보면, ITEM: ATOMS v_ak2 v_ak3 0.00025 6.25e-0.. 더보기
Thermo style variable LIGGGHTS에서 thermo_style 명령어는 물리량을 화면에 출력하는 역할을 한다. thermo_style로 얻을 수 있는 여러 명령어를 variable로 넘기기 위해서는 equal style의 variable로 지정하면 된다. 예를 들어, thermo_style의 "vol"을 variable로 넘기기 위해서는 아래와 같이 지정하면 된다. variable total_atom_vol equal vol 그런데, thermo_style에서 vol은 atom의 총 volume을 나타내는 것이 아니라 simulation box의 volume이다. atom의 총 volume을 계산하기 위해서는 안타깝게도 loop를 돌려야 한다. 더보기
LOOP를 이용한 변수의 합 계산 variable k equal 0 label start_loop if "$k > 10" then "jump in.liggghts end_loop" # Do run stuff here... # Update your variables variable k equal $k+1 print "k = $k" jump in.liggghts start_loop label end_loop 참고 : LIGGGHTS Script에서는 연산에 스페이스를 허용하지 않는다. variable k equal $k + 1 # Error variable k equal $k+1 # OK 더보기
ATOM LOOP 여러 DEM프로그램들 (PFC, Yade 등)은 일반적인 스크립트 언 어 또는 파이썬을 지원하므로 Loop를 돌리는 것이 매우 간단한 작업이다. 특히, 시뮬레이션에 사용되는 Particle의 수와 특성을 인덱싱하여 뽑아내는 것이 매우 쉽다. 그러나, LIGGGHTS의 Script언어는 꽤나 독특한 형태이고, 사용되는 variable또한 equal style, atom style로 구분되며 각각 scalar, vector자료형을 가지므로 자료호환을 하려면 꽤나 고민을 많이 해야 된다. 아래는 오랜동안 고민하여 작성된 LIGGGHTS의 script로, 시뮬레이션에 사용된 atom의 개수를 찾아 loop를 돌려 id와 radius를 출력하는 script이다. 중요 "compute는 running 중 실행이 되.. 더보기
SERVO VARIABLE This mesh module stores a global vector with 9 components for access by various output commands. The first 3 components are equal to the total force on the mesh, the next 3 components store the total torque on the body exerted by the particles. Finally, the last 3 components are the coordinates (moved, scaled, rotated) of the reference point. f_id는 총 12개가 잡히는 것으로 확인 되나 9개만 의미 있으며 10, 11, 12는 7, .. 더보기