Skip to main content

Python framework for MYSTRAN validation

Project description

MYSTRAN validation

![pypi](https://img.shields.io/pypi/v/mystran_validation.svghttps://pypi.python.org/pypi/mystran_validation”)

Python framework for [MYSTRAN](http://https://github.com/dr-bill-c/MYSTRAN) validation.

  • Free software: MIT license

[[_TOC_]]

Features

Limitations

  • for now, only [a few vectors](#vectors) are implemented

  • Mystran results are based on .NEU result file, therefore, somewhere limited with available results. Plan is to migrate to OP2 parsing once it will have been developped.

Vectors

Currently implemented vectors:

  • [x] Displacements (3 translations, 3 rotations)

  • [x] Reactions (6-dof reactions)

  • [x] CBAR internal forces

  • [x] CBUSH internal forces

Next in the pipe:

  • [ ] CQUAD4 internal forces

  • [ ] CTRIA3 internal forces

A declarative Framework

mystran_validation is a python declarative framework dedicated to MYSTRAN test cases.

declarative means that end-user do not need to know python at-all. Test cases are declared as ini text files, pointing to relevant files, and describing the test itself.

Example:

[DEFAULT]
title = test 00
bulk = bulk_model.nas
reference = test_case_03.op2

[Checking Displs]
# we check all nodes displacements
description = check all displacements
vector = displacements

[Reactions]
# we check all nodes displacements
description = this is a multi-lines
        description
vector = reactions

The above configuration file describes two tests performed on bulk_model.nas (named “Checking Displs”). This test will check all displacements and all ractions against test_case_03.op2 file.

A flexible framework

Event though [many limitations] still remain, the framework features:

### tolerance management

The above example may be tweaked as follows:

[...]

[Displacements]
# we check all nodes displacements
description = check all displacements
vector = displacements
## we can reduce / increase tolerance
rtol = 1e-05 # default relative tolerance
atol = 1e-08 # default absolute tolerance

### checking data subset

Data subset can be checked by specifying gids, SubcaseIDs:

[...]

[Displacements]
# we check all nodes displacements
description = check all displacements
vector = displacements
## we can restrict checked data:
gids = 1, 2
SubcaseIDs = 1,2

### Manual references

Beside reference results file, one can specify a value by-hand as follows:

[Displacements II]
description = Check one single value
vector = displacements
## restrict check to MYSTRAN subset:
gids = 1
SubcaseIDs = 2
axis = 6
reference = 0.00513
atol = 1e-06

USAGE

mystran-validation is a command-line tool. The main entry point is the mystran-val command. mystran-val –help for options and arguments.

The main command mystran-val run will trigger all the test-suites found in the tests repository.

Configuration

mystran-validation finds its settings from a central configuration file located under:

  • Linux: /home/<user>/.config/mystran-validation/config.ini

  • Windows: C:\Users\<user>\AppData\Roaming\numeric\mystran-validation\config.ini

By default, only the [DEFAULT] section is present. You can create any number of profile by adding a new section with relevant name:

[dev]
mystran-bin = path/to/dev/mystran/version

You can now pass --profile dev to maystran-val command.

Overriding test repository

The test repository is defaulted to $HOME/mystran_test_cases and can be overridden by passing --rootdir option:

$ mystran-val --rootdir ~/another-repo run

Specifying MYSTRAN binary to use

MYSTRAN Binary is found with the following scheme:

  • from –mystran-bin (-m short option) passed option

  • from “mystran-bin” value in configuration file

Starting from scratch

After installing mystran-validation (eg using [pipx](https://pypi.org/project/pipx/)), you will need to setup a tests repository. This can be done automatically by using (without additional options):

mystran-val init

This will create:

  • a configuration file in /.config/mystran-validation/config.ini

  • an example folder with two simple models, .OP2 for reference and a .ini file ready to be ran.

You can crate as many profiles as you wish in the configuration file. Just add a new section like:

[dev] mystran-bin = /path/to/mystran rootdir = ~/mystran-test-cases

Yo will then be able to run test-cases per profile:

mystran-val -p toto run

Running your first run

Once your repository is setup, trigger your first test-cases checking:

mystran-val run

Or, if toto profile is defined in the configuration file:

mystran-val -p toto run

If you need to override MYSTRAN binary:

mystran-val -m “path/to/my/mystran” run

History

0.1.0 (2021-05-17)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mystran_validation-0.18.0.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

mystran_validation-0.18.0-py2.py3-none-any.whl (42.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mystran_validation-0.18.0.tar.gz.

File metadata

  • Download URL: mystran_validation-0.18.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for mystran_validation-0.18.0.tar.gz
Algorithm Hash digest
SHA256 1a0d50c360bce615e976cceb3c43dc214743b1b7199ea5425a54b5de73f71770
MD5 ba50803a8862652220ce0fd206b945c4
BLAKE2b-256 59eb5f2f448733cf46a28d11535786655df197e6973d419bbea0cda7b77f91e1

See more details on using hashes here.

File details

Details for the file mystran_validation-0.18.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mystran_validation-0.18.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 64779706b4605b1bbf300cd978de5cf370d81a656b2ac5dcdd19f4c47e901754
MD5 7a351ba310cc33d07f7cb9300385bccd
BLAKE2b-256 39eb2dff0d8cc5a1992bf3bc3abacc12334ee6cb24dc4f4b707ced83fd1ec31a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page