apdl-parser 0.1.0

Parser for ANSYS APDL text listings (NLIST/ELIST/DLIST/PRNSOL)
Documentation
  • Coverage
  • 0%
    0 out of 33 items documented0 out of 2 items with examples
  • Size
  • Source code size: 26.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.22 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • indraine/apdl-parser
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • indraine

apdl-parser

Русская версия: README.ru.md

A small Rust library for parsing ANSYS APDL text listings (output of commands like NLIST, ELIST, DLIST, PRNSOL).

It is useful when you need to extract mesh data / results from APDL text output and feed them into your own pipeline (CSV/JSON export, postprocessing, quality checks, Python integration, etc.).

Features

  • Parses whitespace-separated data lines into strongly typed structs:
    • Nlist: node coordinates (NLIST)
    • Elist: element info and its nodes (ELIST)
    • Dlist: tabular data like node label real imag (DLIST)
    • Prnsol: nodal results example (PRNSOL, currently NODE TEMP)
  • Includes a generic helper get_list() to read a file and parse it into Vec<T>.

Typical use cases

  • Mesh export from APDL into your own format (nodes/elements) for further geometry processing.
  • Model quality checks (detect numbering gaps, validate coordinates/materials/element types).
  • Results postprocessing: collect values from PRNSOL/DLIST and generate plots/reports.
  • CI / simulation pipelines: compare results between model versions, regression tests.

Installation

Add the dependency to your Cargo.toml:

[dependencies]
apdl-parser = { git = "https://github.com/indraine/apdl-parser" }

After publishing to crates.io you can switch to a normal version requirement.

Usage

Example: read NLIST from a file

use std::path::Path;

use apdl_parser::{Nlist, get_list};

fn main() -> anyhow::Result<()> {
    let nodes: Vec<Nlist> = get_list(Path::new("NLIST.txt"))?;
    println!("nodes: {}", nodes.len());
    println!("{nodes:#?}");
    Ok(())
}

Examples for repository files (files/*.lis)

This repository contains a files/ folder with sample listings. You can run them via the included examples:

cargo run --example parse_nlist
cargo run --example parse_elist
cargo run --example parse_dlist
cargo run --example parse_prnsol

Example: parse a single line

use apdl_parser::Elist;

fn main() -> anyhow::Result<()> {
    let e: Elist = "1  1  1  0  0  0  10  20  30".parse()?;
    println!("{e:?}");
    Ok(())
}

Supported types

  • Nlistsrc/nlist.rs
  • Elistsrc/elist.rs
  • Dlistsrc/dlist.rs
  • Prnsolsrc/prnsol.rs

Roadmap (ideas)

  • More PRNSOL variants (not only TEMP).
  • Stricter format validation and better error messages.
  • CSV/JSON export (in a separate crate to keep core dependencies minimal).
  • Optional f64 support.

License

Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.