trixi-framework / trixi-framework/libtrixi

Initial API for data transfers between main program and libtrixi

Open
#43 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
3
Forks
3
Avg merge
1d 14h
Merged PRs (30d)
1

Description

Here are some initial thoughts for an API that would allow one to do more than just control the main time integration loop from outside. The idea is to keep this initial post updated (by anyone) with the results of the subsequent discussion.

Basic querying

Functions to get basic information from Trixi.jl.

int trixi_ndims(int handle);         // Return number of spatial dimensions
int trixi_nelements(int handle);     // Return number of elements (cells)
int trixi_polydeg(int handle);       // Return polynomial degree of DGSEM approximation
int trixi_nvariables(int handle);    // Return number of (conservative) variables
int trixi_ndofs(int handle);         // Return total number of degrees of freedom
int trixi_ndofs_element(int handle); // Return number of degrees of freedom for one element
Raw data exchange

Direct access to solution data u.

void trixi_load_u(double* u, int handle);        // Load data from Trixi.jl into `u`
void trixi_store_u(const double* u, int handle); // Store data from `u` in Trixi.jl
Block-structured data exchange

DGSEM has >> 1 degrees of freedom (DOF) per element. However, other programs might not care for our Gauss node distribution and just want equidistant data (a.k.a. finite-volume-type block-structured data), e.g., 8x8x8 cell-centered values per element. Thus we provide convenience functions that allow loading and storing in such block-structured format and do the conversion to Gauss nodes internally.

void trixi_set_blocksize(int blocksize, int handle);   // Set 1D block size
int  trixi_get_blocksize(int handle);                  // Get 1D block size
int  trixi_ndofs_block(int handle);                    // Return total #DOFs for block-structured data
void trixi_load_u_block(double* u, int handle);        // Load block-structured data from Trixi.jl
void trixi_store_u_block(const double* u, int handle); // Store block structured data in Trixi.jl

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the proposed trixi_ndims, trixi_load_u, trixi_store_u, and block-structured trixi_* entry points in this issue. Review the existing C/Fortran interface exposed by libtrixi and the follow-up discussion before deciding the API shape. Done means an agreed, implemented data-transfer API with documented behavior for querying, raw data, and block-structured data.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, julia
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.