No result when outputting Craig-Bampton reduced matrices with DMIGPCH

eit56611
eit56611 Altair Community Member
edited October 2020 in Community Q&A

Hello,

 

I get no reduced matrices output to an ASCII file when trying with a Craig-Bampton reduction in Optistruct. Below is my procedure:

 

I have built a simple model to learn how to output the Craig-Bampton reduced matrices into an ASCII file, perhaps a PCH file. My model is a simple beam meshed with second order tets as below:

 

image.png.9a7e58b5dfedc66fca7b16f066ddd421.png

 

The blue rigids are RBE2s and the yellow BCs are ASET1s as I am also preparing this model for Adams MNF output.

 

For CMSMETH, I have created a load collector with card image CMSMETH, method set to 'CB' and NMODES set to 5 to extract the first five fixed interface modes.

 

I have a DTI_UNITS card open as below:

 

image.png.d38bac08e314db77fb7969af8eaad0fb.png

 

Then I have a GLOBAL_CASE_CONTROL card open as below:

 

image.png.0acda7297cbb4d9e7e278bade774f7ac.png

 

Also, I have a PARAM card open with EXTOUT set to DMIGPCH as below:

 

image.png.99ee9975061a2db53b85978cc83f364c.png

 

Finally, I have an OUTPUT card open for MNF creation as below:

 

image.png.5de7f778fb09e760495a7bc6a65c9d8c.png

 

I can afford do a separate run for ADAMSMNF output if I need to. What I really need first is to be able to extract the Craig-Bampton reduced matrices to an ASCII file. Any help would be much appreciated. Thank you.

 

Best regards

Answers

  • eit56611
    eit56611 Altair Community Member
    edited April 2020

    Hello again,

     

    I wanna post an update as it could be a possible bug. When I solve the exact same fem file with optistruct 2017.2, it generated the reduced mass and stiffness matrices as expected. The matrix dimensions are correct as I've checked in the out file. However, when I try to solve the same fem file in version 2019.1, I don't get a PCH file as I explained in my first post. Can I get some help on this? Is this a bug?

     

    UPDATE: Optistruct generates the PCH file with the reduced mass and stiffness matrices if one selects 'CBN' instead of 'CB' in the CMSMETH card in 2019.1. 

     

    Thanks.

     

    Best regards 

  • FaroukM
    FaroukM Altair Community Member
    edited April 2020

    it generated the reduced mass and stiffness matrices as expected

    Hi

    Do you have any idea how to read the KAAX.pch file ? I saw the documentation and I didn't understand how to read it ...

    Thanks in advance,

  • eit56611
    eit56611 Altair Community Member
    edited April 2020

    Hi

    Do you have any idea how to read the KAAX.pch file ? I saw the documentation and I didn't understand how to read it ...

    Thanks in advance,

    Hello,

     

    Yes. Please take a look at this document by Middle East Technical University, taken from Tom Irvine's Vibrationdata blog: https://drive.google.com/file/d/0Bw1VlHh5X_tTdUZRYkh4WGxJMWM/view

  • FaroukM
    FaroukM Altair Community Member
    edited April 2020

    Hello,

     

    Yes. Please take a look at this document by Middle East Technical University, taken from Tom Irvine's Vibrationdata blog: https://drive.google.com/file/d/0Bw1VlHh5X_tTdUZRYkh4WGxJMWM/view

    Thank you so much ! I appreciate it ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

     

    I will let you know if I find something about *k.op2 / *m.op2 files.

  • eit56611
    eit56611 Altair Community Member
    edited April 2020

    Thank you so much ! I appreciate it ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

     

    I will let you know if I find something about *k.op2 / *m.op2 files.

    Thank you. I have written a small C++ program to read the PCH file and extract the system matrices in complete form into the memory where they can be used for further analysis or just printing. Actually, Tom Irvine also has shared such a program on his blog but I think it only does printing. In my project I need to also have the matrices in memory so I can work with them. I will drop a GitHub link here with necessary instructions in a few days.

  • FaroukM
    FaroukM Altair Community Member
    edited April 2020

    Thank you. I have written a small C++ program to read the PCH file and extract the system matrices in complete form into the memory where they can be used for further analysis or just printing. Actually, Tom Irvine also has shared such a program on his blog but I think it only does printing. In my project I need to also have the matrices in memory so I can work with them. I will drop a GitHub link here with necessary instructions in a few days.

    Yeah, I'm doing the same thing ... I need all matrices (M, C and K). If you can drop it, I will use it for sure. Thanks in advance.

  • eit56611
    eit56611 Altair Community Member
    edited April 2020

    Yeah, I'm doing the same thing ... I need all matrices (M, C and K). If you can drop it, I will use it for sure. Thanks in advance.

    Hello,

     

    I've shared a small C++ code on GitHub to extract the K and M matrices. There's a small example included as well. I can quickly add support for the C matrix but I don't know the identifier for it (like it is KAAX for K and MAAX for M). If you can tell me the identifier for C then I'll add it into the program. 

     

    https://github.com/denizbmech/pchmatexport

  • FaroukM
    FaroukM Altair Community Member
    edited April 2020

    Hello,

     

    I've shared a small C++ code on GitHub to extract the K and M matrices. There's a small example included as well. I can quickly add support for the C matrix but I don't know the identifier for it (like it is KAAX for K and MAAX for M). If you can tell me the identifier for C then I'll add it into the program. 

     

    https://github.com/denizbmech/pchmatexport

     

    Thank you some much.

     

    I have some suggestions, if you don't mind  :

    •  In the README.md, I would like to add eigen lib sources (git clone https://gitlab.com/libeigen/eigen.git ) to install Eigens headers or simply to move Eigen folder in pchmatexport.h folder (if you're not root).
    • Replace #include <Eigen/Dense> with #include 'Eigen/Dense'

     

    Thank you again ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

  • eit56611
    eit56611 Altair Community Member
    edited April 2020

     

    Thank you some much.

     

    I have some suggestions, if you don't mind  :

    •  In the README.md, I would like to add eigen lib sources (git clone https://gitlab.com/libeigen/eigen.git ) to install Eigens headers or simply to move Eigen folder in pchmatexport.h folder (if you're not root).
    • Replace #include <Eigen/Dense> with #include 'Eigen/Dense'

     

    Thank you again ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

     

    Your welcome, and thank you for your suggestions. I will look into them. I have added a small but important explanation to the readme. If you have been unable to run the code, I suggest you take a look at the explanation. Good luck. 

  • FaroukM
    FaroukM Altair Community Member
    edited April 2020

     

    Your welcome, and thank you for your suggestions. I will look into them. I have added a small but important explanation to the readme. If you have been unable to run the code, I suggest you take a look at the explanation. Good luck. 

     

    It works very well after adding Eigen folder to the master folder ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

    Thank you so muck again. I added a small contribution to write and export the matrices to an ASCII file (Please see the main file bellow) :

     

    #include <iostream>
    #include <fstream>
    #include <string>
    #include 'pchmatexport.h'

     

    int main() {

        std::string pchAddress('/Users/faroukmaaboudallah/Desktop/test.pch');

        auto stifmat = PCH::read_matrix(pchAddress, PCH::MATRIX::STIF);
        //auto massmat = PCH::read_matrix(pchAddress, PCH::MATRIX::MASS);

        std::cout << stifmat << std::endl;
        
        std::ofstream file('test.txt');

        if (file.is_open())
        {
        file << 'Stiffness matrix K :\n' << stifmat << '\n';
        file << 'K' << '\n' << stifmat << '\n';
        }
        
        return 0;
    }

     

  • eit56611
    eit56611 Altair Community Member
    edited April 2020

     

    It works very well after adding Eigen folder to the master folder ;)/emoticons/default_wink.png' srcset='/emoticons/wink@2x.png 2x' title=';)' width='20' />

    Thank you so muck again. I added a small contribution to write and export the matrices to an ASCII file (Please see the main file bellow) :

     

    #include <iostream>
    #include <fstream>
    #include <string>
    #include 'pchmatexport.h'

     

    int main() {

        std::string pchAddress('/Users/faroukmaaboudallah/Desktop/test.pch');

        auto stifmat = PCH::read_matrix(pchAddress, PCH::MATRIX::STIF);
        //auto massmat = PCH::read_matrix(pchAddress, PCH::MATRIX::MASS);

        std::cout << stifmat << std::endl;
        
        std::ofstream file('test.txt');

        if (file.is_open())
        {
        file << 'Stiffness matrix K :\n' << stifmat << '\n';
        file << 'K' << '\n' << stifmat << '\n';
        }
        
        return 0;
    }

     

    Thanks a lot! Also, looks like there was a bug in the first version of the script. I've just fixed it. Please download it again.

    We are diverging from the topic now so please feel free to contact me at denizb@alumni.ubc.ca for further discussion regarding this subject.