Skip to content

Framework to provide reference information #957

@RaphaelHeiniger

Description

@RaphaelHeiniger

📝 Description of the feature

We should think about a frame work that allows fields or in case of tables the table.column to have an attribute to know what type of keyword they a referencing. This would further allow the keyword to know about the references it contains. This would further allow to create a method that filters a keyword with all its references.

It should not be mandatory to provide this attribute. It could be one that is added during class generation if the reference data is provided in the manifest (or an additional file).

We have to take into account that the type of reference in a field might depend on the fields value. E.g. positive value --> reference is *DEFINE_FUNCTION keyword, negative value --> reference is DEFINE_CURVE keyword.

Probably there are other edge/corner case to capture.

As an example in the deck below I could get e.g. *PART keyword together with its *SECTION, MAT, and *DEFINE_CURVE with a keyword method get_referenced_keywords which could return e.g. a filter for the deck which then could be applied to the deck to get the referenced keywords.

mydeck = ansys.dyna.core.lib.deck()
mydeck.loads(mydeck_string)
mypart = mydeck.keywords[0]

mypart.get_referenced_keyword(level=3)

mydeck string =
`*KEYWORD
*PART
$# title
mypart
$# pid secid mid eosid hgid grav adpopt tmid
1 10 100
2 10 200
$
*SECTION_SHELL_TITLE
$# title
mysection referenced in part 1 and 2
$# secid elform shrf nip propt qr/irid icomp setyp
10
$# t1 t2 t3 t4 nloc marea idof edgset

$# bi bi bi bi bi bi bi bi

$
*MAT_ELASTIC_TITLE
$# title
my first material referenced in part 1
$# mid ro e pr da db k
100
$
*MAT_PIECEWISE_LINEAR_PLASTICITY_TITLE
$# title
my second material referenced in part 2
$# mid ro e pr sigy etan fail tdel
200
$# c p lcss lcsr vp
3000
$# eps1 eps2 eps3 eps4 eps5 eps6 eps7 eps8

$# es1 es2 es3 es4 es5 es6 es7 es8

$
*DEFINE_CURVE_TITLE
$# title
my curve referenced in my second material
$# lcid sidr sfa sfo offa offo dattyp
3000
$# a1 o1
0.0 0.0
1.0 1.0
*END

💡 Steps for implementing the feature

No response

🔗 Useful links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    KeywordsAnything related to keyword subpackageenhancementGeneral improvements to existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions