Skip to main content

csv-export

Export curing simulation results to CSV with node coordinates and displacements. Invoke when user needs CSV output, data export, or result comparison.

소스 정보

저장소
Cai-aa/CAE-Agent-Hub
최근 소스 활동
2026년 9월 28일 07:48
감지된 SKILL.md 언어
영어
스타
1,209
포크
152

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
csv-export
description
Export curing simulation results to CSV with node coordinates and displacements. Invoke when user needs CSV output, data export, or result comparison.
# CSV Export ## Description Export curing simulation results to CSV with node coordinates and displacements. Invoke when user needs CSV output, data export, or result comparison. ## Content ### CSV Format The exported CSV file uses the following column format: ``` Node,X,Y,Z,U1,U2,U3 ``` - `Node`: Node label (integer) - `X, Y, Z`: Node coordinates - `U1, U2, U3`: Displacement components from the sp step last frame ### Complete Export Script ```python import os from abaqusConstants import * work_dir = 'C:\\Users\\...\\work_directory' recipes = ['P8_mold_recipe_1', 'P8_mold_recipe_2', 'P8_mold_recipe_3'] for name in recipes: odb_path = os.path.join(work_dir, name + '.odb') odb = session.openOdb(name=name+'_odb', path=odb_path, readOnly=True) inst = odb.rootAssembly.instances['P8-1'] last_frame = odb.steps['sp'].frames[-1] u_field = last_frame.fieldOutputs['U'] u_map = {} for val in u_field.values: u_map[val.nodeLabel] = (val.data[0], val.data[1], val.data[2]) csv_path = os.path.join(work_dir, name + '.csv') lines = ['Node,X,Y,Z,U1,U2,U3'] for node in inst.nodes: nid = node.label x, y, z = node.coordinates if nid in u_map: u1, u2, u3 = u_map[nid] lines.append('%d,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f' % (nid, x, y, z, u1, u2, u3)) with open(csv_path, 'w') as f: f.write('\n'.join(lines)) odb.close() ``` ### Output Details - **8-ply model:** 5445 nodes exported - **4-ply model:** 3025 nodes exported - Data is extracted from the sp step (springback) last frame, which represents the final deformation ### Usage Scenarios #### Comparing Ply Layups Use the CSV output to compare different ply layup configurations: - Symmetry analysis of deformation patterns - Identifying maximum displacement locations - Comparing springback magnitudes across recipes #### Extending with Additional Fields The script can be extended to include additional field outputs by adding more columns: ```python # Add stress (S) components s_field = last_frame.fieldOutputs['S'] s_map = {} for val in s_field.values: s_map[val.elementLabel] = val.data # Add state variables (SDV1-4) sdv1_field = last_frame.fieldOutputs['SDV1'] sdv1_map = {} for val in sdv1_field.values: sdv1_map[val.elementLabel] = val.data ``` Available additional fields: - `S` — Stress (6 components: S11, S22, S33, S12, S13, S23) - `PE` — Plastic strain - `SDV1` to `SDV4` — State variables ### Notes - Use the `%` operator for string formatting (Abaqus uses Python 2.7) - Always close the ODB after processing each recipe - The CSV files are saved in the same work directory as the ODB files - Node coordinates are retrieved from `instance.nodes`, not from a COORD field output
GitHub에서 보기