PKR Core

Documentation

PKR Core documentation

This page is a self-contained overview of the PKR Core workspace: how to bring in or generate a structure, run an analysis, organize results with Study and Report, and move data in and out of the tool. No GitHub account or repository access is required.

Getting started

Quick start

Open the tool from /app/ and either generate a structure from the Structure menu or import an existing one. From there, pick an analysis type such as Conductivity, Diffusion, Elasticity, Permeability, Invasion percolation, or CO2 adsorption, configure the calculation conditions, and run it. Use the Study menu to sweep a parameter or build a DOE matrix across many structures, and use the Report tab to review charts and summary metrics once a run finishes. Save your work at any point as a .pkz project file, or export individual results as CSV, mesh, or image-stack files.

Structures

Structure generation and import

The Structure menu can generate voxel structures procedurally, including foam-like, layered, and woven-fiber generators, as well as particle, fiber, and platelet packing fillers. Existing structures can be imported instead: native .leS voxel files, .pkz project archives, .stl and .obj surface meshes (voxelized on import), image-stack sequences, and headerless 8-bit raw volumes (.raw / .bin). Large structures can be coarsened by combining blocks of voxels into a single cell, which speeds up downstream analysis at the cost of fine detail. The Materials panel assigns physical properties to the voxel labels present in the loaded structure before any analysis is run.

Analysis

Running an analysis

Each analysis type (Conductivity, Diffusion, Elasticity, Permeability, Invasion percolation, CO2 adsorption) has its own Calculation Conditions card where you choose a solve method and direction before running. Most properties offer more than one method: a full 3D field solver that captures curved paths through the structure, a fast straight-column estimate, and a reduced-order graph-network solver that is selected by default. Results appear alongside the current structure in the analysis workbench, and feed automatically into the Report tab and, when applicable, the Study run history.

Study and Report

Study and Report

The Study menu drives the Parametric Study workspace, where a base recipe is swept across a single parameter or expanded into a full DOE (design of experiments) matrix, then executed as a batch of cases with undo/redo over edits to the case list. Cases and their generated structures can be imported and exported as CSV and ZIP for reuse outside the tool. The Report tab (labeled Report in the app menu bar) collects the resulting charts and summary metrics for the current structure and run history, including composition, pore size, connectivity, tortuosity, and transport-graph views, so a full parameter sweep can be reviewed without re-running each case individually.

Data formats

Import and export formats

.leS is the native voxel structure format, storing a grid header followed by per-voxel material labels. .pkz is a project archive that bundles a structure together with its recipe and, optionally, analysis results, so a full session can be saved and reopened later. Beyond these two native formats, PKR Core can import .stl and .obj surface meshes, image-stack sequences, and headerless 8-bit raw volumes (.raw / .bin, which have no header, so the grid dimensions and voxel size are entered in the tool before import), and can export results as CSV tables, mesh files (.stl, VTK), image stacks, and zipped bundles for parametric-study cases and comparison reports.

Accuracy

About the reduced-order models

The graph-network method, selected by default for Conductivity, Diffusion, and related analyses, reduces the solid or pore skeleton to a network and solves that network instead of the full voxel field. This makes it fast on open or complex structures, but it is a fast approximation, not an exact field solution: it returns a scalar result without a field contour and can miss effects that only appear in a full 3D solve. When precision matters more than speed, switch the Method selector to the 3D field solver, which solves the potential field across every voxel and captures curved paths through the structure, at a higher computational cost. Treat graph-network results as a quick screening estimate to guide which cases are worth a full solve.

API access

API and AI integration

Everything in the workspace is also reachable through a REST API, which is the supported entry point for external tools, scripts, and AI agents. The API base URL is https://api.pakericore.app, and business endpoints such as generate, analyze, and workflows/run require an issued token sent as Authorization: Bearer <token>.

Get a token from /app/ under the Settings & API Tokens tab: open the API Token Dashboard and use Issue API Token. The full token value is shown only once, right after issuing it, so copy it somewhere safe before leaving the page.

The complete API contract is published as an OpenAPI specification at https://api.pakericore.app/api/v1/openapi.yaml, served without authentication so it can be fetched directly by tooling. If you are pointing an AI agent at PKR Core, this single line is enough context for it to start calling the API on its own:

Use this OpenAPI specification to call PKR Core: https://api.pakericore.app/api/v1/openapi.yaml

A ready-made request body for the examples below can be pulled from GET /api/v1/examples, which returns a list of named example recipes. The three calls below cover the core workflow: generate a structure, analyze it, and run a multi-step workflow in one request.

curl -X POST https://api.pakericore.app/api/v1/generate \
  -H "Authorization: Bearer $PKR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipe": {"generatorType": "foamLike", "grid": {"nx": 64, "ny": 64, "nz": 64, "voxelSizeUm": 1}}}'
curl -X POST https://api.pakericore.app/api/v1/analyze \
  -H "Authorization: Bearer $PKR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipe": {"generatorType": "foamLike", "grid": {"nx": 64, "ny": 64, "nz": 64, "voxelSizeUm": 1}}, "backend": "wasm"}'

For an AI agent that wants to request several steps in a single call instead of chaining multiple requests, workflows/run accepts a full workflow definition and returns all of its results together:

curl -X POST https://api.pakericore.app/api/v1/workflows/run \
  -H "Authorization: Bearer $PKR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workflow": {"recipe": {"generatorType": "foamLike", "grid": {"nx": 64, "ny": 64, "nz": 64, "voxelSizeUm": 1}}, "requestedOutputs": ["metrics"]}}'

Errors from any endpoint share the same body shape, so a single handler can parse all of them:

{"error": {"code": "invalid_request", "message": "recipe is required."}}

No GitHub account or repository access is needed to use the API: the base URL, the token flow above, and the OpenAPI specification are everything required to get started.