개요
입력파일
Hyfeast의 커맨드라인 유한요소 해석프로그램인 hfAnalyzer는 텍스트 입력파일을 읽어 해석을 수행한다. 입력파일은 *Node, *Element 등과 같이 *로 시작하는 예약된 키워드로 시작하는 명령어 블록 구조로 구성된다. 다음은 간단한 프레임 해석에 대한 입력 파일이다.
# Portal Frame Example
*Node
1, 0., 0.
2, 0.,10.
3,10.,10.
4,10., 0.
*Element, Type=B2D2H, ELSet=ALL
1, 1, 2
2, 2, 3
3, 3, 4
*Material, Type=IsoElasticity, Name=beam
210E9, 0.3, 0, 7700 # E, nu, alpha, density
*Section, Type=Beam, Name=BeamSection, Mass=Lumped
*Cell, TYPE=Rectangle, MAT=beam
0.4, 0.1
*Distribution, TYPE=Section
ALL, BeamSection
*Constraint, Type=Support, Name=BC
1, X|Y|RZ
4, X|Y|RZ
*Load, Type=Concentric, Name=LC2
2,X,100E3
*NSet, Type=SELECT, Name=23
2, 3
*NSet, Type=SELECT, Name=14
1, 4
#---------- Static analysis for nodal concentric load
*Step, Type=Static, Name=Case1
*Activate, Type=Element
ALL
*Activate, Type=Constraint
BC
*Activate, Type=Load
LC2
*Output, Frequency=1
D,FN,BSF
*Print, File=Case1.prn
D@23, FN@14
#---------- Frequency extraction analysis
*Step, Type=Frequency, Name=Case2
10
*Activate, Type=Element
ALL
*Activate, Type=Constraint
BC
*Output
D # if frequency step, D means mode shape.
*Print, File=Case2.prn
입력 텍스트 파일에서 사용되는 일반규칙을 나열한 것이다.
- 한글과 같은 Non-Ascii 문자가 존재하는 경우 UTF-8로 인코딩되어야 한다.
- 입력파일은 텍스트파일이며 한 줄씩 순차적으로 읽어 들여 파싱한다.
- 공백라인은 무시하고, # 문자로 설명문(comment)을 작성할 수 있다.
- 문자를 사용하여 다음 줄과 연결(concatenation)할 수 있다.
- 예약된 키워드(keyword)는 대소문자를 구분하지 않으나, 사용자 정의 문자열(예: 요소집합 이름 등)은 대소문자를 구분한다.
-
각 라인은 n1, n2, n3 또는 n1, ..., ID=id1, ... 등과 같은 형태를 가지는 프리포맷(free format)이다. 이때 파싱의 대상이 되는 토큰(token)은 등호(=), 쉼표(,)를 기준으로 구분된다. 프로그램 내부적으로 작동하는 방식은 다음과 같다.
- 등호(=)를 찾아 등호의 왼쪽 키워드를 인식
- 프리포맷(free format) 형태로 인식된 각각을 쉼표(,)를 구분자로 각 토큰으로 분할
- 이중따옴표로 둘러싸인 경우 하나의 토큰으로 인식
-
실수나 정수로 입력이 되는 부분은 간단한 산술 연산을 수행할 수 있다. 예를 들어
1+2*(10+2)와 같은 산술 연산을 수행한다. 연산식 내에 공백이 존재하는 경우 토큰으로 분리되므로 공백이 존재하면 안된다. 만약 공백이 존재하는 경우 하나의 토큰으로 인식하게 하려면 이중따옴표를 사용하여야 한다(예“1 + 2*(10+2)”) -
산술식에서는 20*sin(30*deg) 등과 같이 다음에서 미리 정의된 함수, 상수 등을 사용할 수 있다.
f(x)형태의 함수:sin,cos,tan,acos,atan,cosh,sinh,tanh,abs,exp,log,log10,sqrt,step,sgnf(x,y)형태의 함수:pow,max,min- Constant:
pi,e,deg
-
문자열이 입력되는 부분에서 공백이 있는 경우 이중따옴표로 묶어주어야 한다. 예를 들어
*Material, TYPE=IsoElasticity, Name="the material") - 파일명을 문자열로 입력받는 경우 상대경로, 절대경로를 모두 인식한다. 만약 경로상에 공백이 있는 경우 이중따옴표로 묶어주어야 한다. 상대경로는 입력파일이 존재하는 디렉토리를 기준으로 한다. 예를 들어 다음과 같다.
*Include, File=모델1.inp
*Include, File=템플릿/모델1.inp
*Include, File=“템플릿 폴더/모델 1.inp” ← 공백이 있는 경우 이중따옴표 적용
*Include, File="./템플릿/프레임 모델.inp" ← .은 현재 디렉토리 .
*Include, File="../프레임 모델.inp“ ← ..은 부모 디렉토리
*Include, File="D:/DevProg/HFC4.0/EXAMPLE/프레임 모델.inp" ← 절대 경로
*로 시작하는 명령어(command)는 크게 모델링 명령, 해석 명령, 기타 명령로 구분할 수 있다. 다음은 명령어를 요약한 것이다.
절점 명령
*Node: Define a node.*NSet: Define a nset.*NGen: Generate nodes with a line pattern and assign them to a nset.*NFill: Generate nodes with a filling pattern and assign them to a nset.*NCopy: Copy a nset.*NProp: Define nodal properties
요소 명령
*Element: Define an element.*ELSet: Define an elset.*ELGen: Generate elements and assign them to an elset.*ELCopy: Copy an elset.*Section: Define a section.
하중과 구속조건 명령
*Load: Define a load.*Constraint: Define a constraint.
프라퍼티 명령
*Material: Define a material.*Function: Define a function.*Surface: Define surface*Construction: Define auxiliary geometric entities – spline and construction line.*CoordinateSystem: Define a coordinate system.
해석 명령
*Step: Define analysis step*Activate: Activate elements, constraints, and loads*Inactivate: Inactivate elements, constraints, and loads*Convergence: Assign convergence criteria*SolutionAlgorithm: Assign solution algorithm for equilibrium iteration*TimeIntegration: Assign time integration scheme for dynamic step*RayleighDamping: Assign Rayleigh damping for dynamic step*Modal: Set dynamic analysis with modal analysis and assign modal damping ratios.*State: Set the element's state.*Output: Assign requests for field output for output file(ODB file).*Print: Assign requests for printing fields for a specified text file.*Check: Assign request for field check
해석 결과 관리 명령
*PostStep: Generate new step from other step's results*History: Assign request for history output.*PostHistory: Extract history output from existing steps.*HDB: Load HDB file(.hdb)
모델링 편의 명령
*Include: Include an external file.*Parameter: Assign a preset of parameter expression.*Distribution: Assign nodal and element properties.*Model: Generate a template model.
기타 명령
*Environment: Setup environment*Stop: Setup control parameters*TestMaterial: Test material model for given strain history
해석실행
hfAnalyzer는 CLI(Command-Line Interface)에서 구동되는 프로그램이다. 명령행에 hfAnalyzer와 이후 입력파일을 타이핑하면 해석이 가능하다.
> hfAnalyzer frame.inp
명령행 실행시의 입력파일 외에 다양한 추가 옵션이 있는데 이는 -h 옵션으로 알 수 있다.
> hfAnalyzer -h
단순히 hfAnalyzer를 타이핑하여 실행하면 interactive하게 구동할 수 있다.
> hfAnalyzer
... Input file 등 필요한 정보를 interactive하게 타이핑
해석을 실행하면 다양한 결과 파일이 만들어진다. 예를 들어 입력파일이 frame.inp라고 가정하면(즉, > hfAnalyzer frame.inp 실행) 해석결과를 담고 있는 hdb 파일 생성한다. hdb 파일은 hfVisualizer 전용파일로서,
- hfVisualizer를 프리프로세싱 모드에서는 해석결과가 없이 입력파일 정보만 담고 있지만
- 포스트프로세싱 모드에서는 입력파일 정보와 더불어 해석결과를 담고 있다.
hdb 파일은 hdf5(디폴트), text, binary의 세가지 형식으로 생성할 수 있다. 다음은 각각에서 생성되는 파일을 정리한 것이다.
hdf5인 경우
> hfAnalyzer frame.inp
- frame.h5.hdb : hdb file with hdf5 format
- frame.log : log file
- frame.chk : chk file (reproduced inp file)
- frame-step1.rst : restart file for step
- frame-step2.rst
- ...
text 인 경우
> hfAnalyzer frame.inp -f text
- frame.text.hdb : hdb file with text format (containing result)
- frame.text.hdb.info : hdb file with text format (containing info)
- frame.text.hdb.inp : hdb file with text format (containing inp file)
- frame.log
- frame.chk
- frame-step1.rst
- frame-step2.rst
- ...
binary 인 경우
>hfAnalyzer frame.inp -f binary
- frame.bin.hdb : hdb file with binary format
- frame.log
- frame.chk
- frame-step1.rst
- frame-step2.rst
- ...
파라미터 입력 제어
기본사용법
hfAnalyzer를 명령행에서 실행할 때 -p 옵션을 통해 파라미터 입력을 제어할 수 있다. 입력파일은 이 -p 옵션에서 주어지는 표현을 사용하여 미리 작성되어 있으면 된다.
example.inp
...
*Material. Type=IsoElasticity, Name=concrete
<E>, 0.18
*Node, Offset=<BaseN>
1, 10, 0, 1
...
일 때
> hfAnalyzer example.inp -p "<E>=20E9, <BaseN>=1000"
을 실행하면 입력파일에서 <E>와 <BaseN>이 주어진 값으로 치환되고, 출력 파일의 기본 이름(base name)도 example-20E9-1000으로 설정된다(출력 파일이 example-20E9-1000.h5.hdb, example-20E9-1000.log 등). -p 이후의 표현식은 "key=value, ..." 형태이고 ""로 둘러싸여야 하며, 입력 파일에서 key는 value로 치환되게 된다. 이때 key는 다른 문자열과 구분되어야 하기 때문에 <A>, $A$ 등과 같이 일반적으로 잘 사용하지 않는 기호로 둘러싸는 것이 좋다. 예를 들어 예를 들어 "<E>=20E9, <B>=7.3" 와 같이 쓰면 <K>는 20E9로, <B>는 7.3으로 치환하게 된다. 한편 파라미터 표현식내부에서 토큰은 {}로 묶을 수 있다. 예를 들어 "<K>={R,12.3}, <B>=7.3" 등과 같이 쓰면 <K>는 R,12.3로 치환된다.
이러한 파라미터 표현식은 입력 파일내에서 *Include 문을 사용할 때도 쓸 수 있다. 예를 들어
example.inp
...
*Include, File=Mat, P="<E>=20E9, <DEN>=2300"
...
mat.inp
*Material. Type=IsoElasticity, Name=concrete
<E>, 0.18, ,<DEN>
고급사용법
최상위 입력파일(*Include 문으로 포함되는 입력파일이 아닌 입력파일)에서는 *Parameter 문을 적용하여 보다 세밀하게 파라미터 문을 쓸 수 있다.
example.inp
...
*Parameter, Name=Concrete, "<E>=25E9, <nu>=0.16, <den>=2450", Default
*Parameter, Name=Steel, "<E>=200E9, <nu>=0.3, <den>=7850"
*Material. Type=IsoElasticity, Name=Wall
<E>, <nu>, 0., <den>
...
*Parameter는 미리 정의된 파라미터 표현식으로 이해할 수 있다. 따라서 *Parameter 표현식의 이름은 중복하여 지정할 수 없다. Default는 hfAnalyzer 실행시 -p 옵션을 사용하지 않을 때 사용하는 표현식을 의미한다. 따라서 여러개의 *Parameter 문이 있는 경우 Default 한번만 사용할 수 있다. 다음은 hfAnalyzer에서 사용한 예이다.
> hfAnalyzer example.inp
→ Default 속성이 있는 파라미터 표현식이 적용(여기서는 Concrete)
→ 출력 파일 기본 이름(file base name)은 ex (example-Concrete.h5.hdb, ...)
> hfAnalyzer example.inp -p "Concrete"
→ Concrete로 명명된 파라미터 표현식이 적용
→ 출력 파일 기본 이름(file base name)은 example-Concrete (example-Concrete.h5.hdb, ...)
> hfAnalyzer example.inp -p "Steel"
→ Steel로 명명된 파라미터 표현식이 적용
→ 출력 파일 기본 이름(file base name)은 example-Steel (example-Steel.h5.hdb, ...)
> hfAnalyzer example.inp -p "<E>=20E9, <nu>=0.16, <den>=2300"
→ *Parameter 문을 사용하지 않음.
→ 출력 파일 기본 이름(file base name)은 example-20E9-0.16-2300 (example-20E9-0.16-2300.h5.hdb, ...)
> hfAnalyzer example.inp -p "Concrete:<E>=30E9"
→ Concrete로 명명된 파라미터 표현식이 적용하되, <E>는 30E9를 사용
→ 출력 파일 기본 이름(file base name)은 example-Concrete (example-Concrete.h5.hdb, ...)
한편 <PARAMETER>라는 특수문자열을 입력파일에 사용 가능하다.
example.inp
...
*Parameter, Name=Concrete, "<E>=25E9, <nu>=0.16, <den>=2450", Default
*Parameter, Name=Steel, "<E>=200E9, <nu>=0.3, <den>=7850"
*Material. Type=IsoElasticity, Name=Wall
<E>, <nu>, 0., <den>
...
*Step, TYPE=Static, Name=SelfWeight
...
*Print, File=<DB>-<PARAMETER>-<STEP>.prn
...
<DB>는 입력파일, <PARAMETER>는 파라미터문의 이름, <STEP>은 현재 해석스텝 명이다. 따라서 위 해석에서 디폴트 파라미터문이 작동하도록 실행했다면, example-Concrete-SelfWeight.prn 이 *Print 문의 대상 파일이 된다. 주의할 점은 hfAnalyzer 실행에서 -p 문을 적용하지 않고 Default 파라미터문이 사용되는 경우에도 <PARAMETER>가 치환된다는 점이다.
> hfAnalyzer example.inp
→ Default 속성이 있는 파라미터 표현식이 적용(여기서는 Concrete)
→ 출력 파일 기본 이름(file base name)은 input (example-Concrete.h5.hdb, ...)이나
→ Print 파일명은 example-Concrete-SelfWeight.prn
> hfAnalyzer example.inp -p "Concrete"
→ Concrete로 명명된 파라미터 표현식이 적용
→ 출력 파일 기본 이름(file base name)은 input-Concrete (example-Concrete.h5.hdb, ...)
→ Print 파일명은 example-Concrete-SelfWeight.prn
> hfAnalyzer example.inp -p "Steel"
→ Steel로 명명된 파라미터 표현식이 적용
→ 출력 파일 기본 이름(file base name)은 example-Steel (example-Steel.h5.hdb, ...)
→ Print 파일명은 example-Steel-SelfWeight.prn
hfAnalyzer 실행시 -o 옵션으로 출력파일을 재지정할 수 있다. 다음은 재지정된 출력파일명의 예이다.
> hfAnalyzer example.inp -o output -p "<C>=I, <K>=12.3, <P>=7"
→ output.h5.hdb, ...
> hfAnalyzer example.inp -o "output-<PARAMETER>" -p "WT"
→ output-WT.hdb, ...
> hfAnalyzer example.inp -o "output-<PARAMETER>-<K>" -p "WT:<K>=12.3"
→ output-WT-12.3.h5.odb, ...
> hfAnalyzer example.inp -o "output-<K>" -p "WT:<K>=12.3"
→ output-12.3.h5.odb