AI Assistant
Accessing state var...
 
Notifications
Clear all

Accessing state variables in MSC Marc

2 Posts
2 Users
0 Reactions
2,837 Views
Posts: 1
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@maxhamed)
Unpaid Intern
Joined: 2 years ago
[#2706]

Hello,

I am wondering what is the best way to access the values of state variables in the WKSLP-subroutine in MSC Marc? Common blocks?

 

//M


1 Reply




Posts: 14
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@joedoe)
Junior Engineer
Joined: 8 years ago

To access state variables in the WKSLP subroutine in MSC Marc, there are a few approaches, but using common blocks is indeed one of the most common and efficient methods. Here's a brief overview:

1. Common blocks: This is typically the recommended way to access state variables in MSC Marc user subroutines. Common blocks allow you to share data between different parts of your Fortran program, including subroutines.

2. Subroutine arguments: Some state variables are passed directly as arguments to the WKSLP subroutine.

3. Using the "statev" array: This array is often used to store and access user-defined state variables.

Let me elaborate on using common blocks, as you specifically asked about this method:

Common blocks in MSC Marc are predefined and contain various state variables and other important data. For the WKSLP subroutine, you would typically use the "KOMSTR" common block. Here's an example of how you might use it:

fortran

subroutine wkslp(...)
include 'concom'
include 'creeps'
...
common/komstr/strains(6),stresses(6),dstres(6),statev(nstatv)
...
end subroutine wkslp

By including these common blocks, you gain access to various state variables. For example:
- `strains` array contains the strain components
- `stresses` array contains the stress components
- `statev` array allows access to user-defined state variables

This method is efficient because it doesn't require passing large amounts of data as subroutine arguments, and it allows easy access to a wide range of program variables.


Reply







Share: