Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Latest Threads
Steps to build third part...
Forum: MYSTRAN
Last Post: ceanwang
11-16-2020, 12:46 AM
» Replies: 2
» Views: 156
Trying to add sparse matr...
Forum: MYSTRAN
Last Post: ceanwang
10-28-2020, 04:37 AM
» Replies: 4
» Views: 344
hfcNASTRAN95 - Pre/Post p...
Forum: NASTRAN-95
Last Post: ceanwang
10-18-2020, 08:39 AM
» Replies: 2
» Views: 938
NASTRAN-95 vs MYSTRAN
Forum: NASTRAN-95
Last Post: Admin
09-29-2020, 02:58 PM
» Replies: 16
» Views: 5,279
pyNastran
Forum: Pre/Post Processors
Last Post: mesheb82
09-28-2020, 08:08 PM
» Replies: 0
» Views: 206
hfcMystran - Pre/Post pro...
Forum: Pre/Post Processors
Last Post: Admin
09-28-2020, 07:23 PM
» Replies: 1
» Views: 219
CQUAD4 in bending test
Forum: MYSTRAN
Last Post: Admin
09-13-2020, 01:53 AM
» Replies: 27
» Views: 3,412
Sparse Solver Notes
Forum: MYSTRAN
Last Post: Admin
09-07-2020, 07:39 PM
» Replies: 0
» Views: 1,208
Comparation of OS specifi...
Forum: MYSTRAN
Last Post: Admin
09-01-2020, 04:45 AM
» Replies: 5
» Views: 980
Batch file to solve test ...
Forum: MYSTRAN
Last Post: ceanwang
08-31-2020, 02:03 AM
» Replies: 1
» Views: 442

 
  Steps to build third party package under Windows 10
Posted by: ceanwang - 11-13-2020, 11:46 PM - Forum: MYSTRAN - Replies (2)

Hi,

Take building SuperLU as an example.

First you need to install these two packages:
1. cmake https://cmake.org/
2. gnu for Windows https://sourceforge.net/projects/mingw-w64/

And add their bin folders into Windows PATH. Then you can start to build SuperLU. 

1. Download from https://github.com/xiaoyeli/superlu
    On that page, click  Code, select Download ZIP
2. Unzip it into D:\MYSTRAN\superlu-master folder
3. Copy w.bat (see attached) into D:\MYSTRAN\superlu-master (Rename the attached w.txt as w.bat)
4. On lower left corner of Windows desktop, inside the search area, type CMD, then press Enter key to start cmd.exe - the windows terminal. 
5. Change to D:\MYSTRAN\superlu-master folder
6. Type w in the windows terminal command line, then press Enter key to run w.bat  It will find the tools needed to build SuperLU. It will generate  a  D:\MYSTRAN\superlu-master\Build_win10 folder and changed into that folder.
7. Type make, then press Enter key to build SuperLU.



Attached Files
.txt   w.txt (Size: 325 bytes / Downloads: 3)
Print this item

  Trying to add sparse matrix code to LK2/REDUCE_KFF_TO_KAA.f90
Posted by: ceanwang - 10-14-2020, 11:55 PM - Forum: MYSTRAN - Replies (4)

Hi,

Trying to use SuperLU sparse solver which is from https://github.com/xiaoyeli/superlu

First: Inputs for SuperLU are:

Code:
            !NROW=n=400
            !NCOL=n=400
            !NNZERO=nnz=1920
            !values
            !rowind - row index
            !colptr - column pointer
Have to map MYSTRAN's I_KOO, J_KOO, KOO to these.

Second: Output for SuperLU is b(i), i=1,n after solving. Need to map this b(i) to what MYSTRAN is called.

Help is appreciated.

Cheers

Cean




The code is like this:

Existing Banded:

Code:
         IF (SOLLIB == 'BANDED  ') THEN                    ! Use LAPACK

            KOO_SDIA   = 0
            EQUIL_KOO  = 'N'
            INFO = 0
            CALL SYM_MAT_DECOMP_LAPACK ( SUBR_NAME, 'KOO', 'O ', NDOFO, NTERM_KOO, I_KOO, J_KOO, KOO, 'Y', KOORAT, EQUIL_KOO,      &
                                         RCONDK, DEB_PRT, EQUED, KOO_SDIA, K_INORM, RCOND, KOO_SCALE_FACS, INFO )

Newly added Sparse:

Code:
        ELSE IF (SOLLIB == 'SPARSE  ') THEN

            ! Add sparse matrix code here to decompose matrix KOO
           
            !use SuperLU subroutine hbcode1(nrow, ncol, nnzero, values, rowind, colptr)
            !call hbcode1(n, n, nnz, values, rowind, colptr)
            !NROW=n=400
            !NCOL=n=400
            !NNZERO=nnz=1920
            !values
            !rowind - row index
            !colptr - column pointer

            nrhs = 1
            ldb = n
            do i = 1, n
               b(i) = 1
            enddo

            ! First, factorize the matrix. The factors are stored in *factors* handle.
            iopt = 1
            call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr,
     $                      b, ldb, factors, info )
    
            if (info .eq. 0) then
               write (*,*) 'Factorization succeeded'
            else
               write(*,*) 'INFO from factorization = ', info
            endif

            ! Second, solve the system using the existing factors.
            iopt = 2
            call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr,
     $                      b, ldb, factors, info )

            if (info .eq. 0) then
               write (*,*) 'Solve succeeded'
               write (*,*) (b(i), i=1, 10)
            else
               write(*,*) 'INFO from triangular solve = ', info
            endif

            ! Last, free the storage allocated inside SuperLU
            iopt = 3
            call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr,
     $                      b, ldb, factors, info )

Here is SuperLU's test data g20.rua

https://github.com/xiaoyeli/superlu/blob...LE/g20.rua

It has 400 rows, 400 columns and 1920 none zero values. The data is arrange as COLPTR, ROWIND and VALUES.

Print this item

  pyNastran
Posted by: mesheb82 - 09-28-2020, 08:08 PM - Forum: Pre/Post Processors - No Replies

I'm the developer of pyNastran, which you can find out about over at:
 - https://github.com/SteveDoyle2/pyNastran

I've added support for Mystran (the BDF and for the GUI).  You can flag the deck as a Mystran file by putting the following on the first line of your BDF:
$ pyNastran: version=mystran

If you just use the standard install, you won't have mystran support, but if you install from git (see the install guide), you will.
 - https://pynastran-git.readthedocs.io/en/...rom-source

There's probably still a few PARAMs that I'm not validating, so bug me over at:
 - https://github.com/SteveDoyle2/pyNastran/issues
if you find something wrong.

Also, an FYI, it's a bit stricter than Mystran (there's an embedded blank), so a card like:
SPC1, 1, 12 34, 42

is invalid, but:
SPC1, 1, 1234, 42

is fine.  That's just per the MSC/NX Nastran documentation, which I try to follow as best as I can.

Print this item

  hfcMystran - Pre/Post processing for Mystran
Posted by: ceanwang - 09-25-2020, 01:36 AM - Forum: Pre/Post Processors - Replies (1)

Hi,

The project is at https://github.com/ceanwang/hfcMystran

Some case photos could be seen from here:
https://forum.freecadweb.org/viewtopic.php?f=18&t=46171

Regards,

Cean

Print this item

  Sparse Solver Notes
Posted by: Admin - 09-07-2020, 07:39 PM - Forum: MYSTRAN - No Replies

This thread is in-work, but provides some basic information about to implement a sparse solver to MYSTRAN.

----------------------
MYSTRAN Information
----------------------

In the following link, there are notes for how to incorporate a sparse solver. PaStiX seems to be best option for this. More information about PaStiX will be added later.

https://mystran.com/notes/Sparse_Solver_Notes.pdf

----------------------
PaStiX Information
----------------------
http://pastix.gforge.inria.fr/files/README-txt.html

https://www.labri.fr/perso/ramet/

https://gitlab.inria.fr/solverstack/pastix

https://gforge.inria.fr/forum/forum.php?...oup_id=186

Print this item

  Comparation of OS specified files
Posted by: ceanwang - 08-31-2020, 02:57 AM - Forum: MYSTRAN - Replies (5)

Hi,

Under Sources\Specifics, there are files for Windows and Linux system.

Here is a script to compare them. Put the script under Sources\Specifics folder and run cpSrc.bat, the difference will saved in a cpDiff.txt file.

For GET_INI_FILNAM.f90, the difference is:

Code:
InputObject                                                                                                           
-----------                                                                                                           
! ##################################################################################################################...
! Gets name (incl path) of the MYSTRAN.INI initialization file. This is the Linux version which uses '/' as a folder...
         INIFIL(MYSTRAN_DIR_LEN+1:MYSTRAN_DIR_LEN+2)  = '/'                                                           
                                                                                                                      
! Gets name (incl path) of the MYSTRAN.INI initialization file. This is the Windows version which uses '\' as a fold...
         INIFIL(MYSTRAN_DIR_LEN+1:MYSTRAN_DIR_LEN+2)  = '\'           
There should be a way to work for both OSes, '\\' ?


For GET_MYSTRAN_DIR.f90, the difference is:

Code:
InputObject                                                                                                           
-----------                                                                                                           
! ##################################################################################################################...
      CHARACTER(FILE_NAM_MAXLEN*BYTE), INTENT(OUT) :: MYSTRAN_DIR       ! Directory where program executable (and IN...
      INTRINSIC                                    :: GET_ENVIRONMENT_VARIABLE                                        
      CALL GET_ENVIRONMENT_VARIABLE ( 'MYSTRAN_directory', MYSTRAN_DIR, MYSTRAN_DIR_LEN  )                            
! Gets the environment variable MYSTRAN_DIR that tells Windows where the MYSTRAN executable is located. The user mus...
! environment variable on their computer                                                                              
      CHARACTER(FILE_NAM_MAXLEN*BYTE), INTENT(OUT) :: MYSTRAN_DIR       ! Directory where executable (and INI file) ...
      INTRINSIC                                    :: GETENV                                                          
      CALL GETENV ( 'MYSTRAN_directory', MYSTRAN_DIR )                                                                
      MYSTRAN_DIR_LEN = FILE_NAM_MAXLEN                                                                               
      DO I=FILE_NAM_MAXLEN,1,-1                                                                                       
         IF (MYSTRAN_DIR(I:I) /= ' ') THEN                                                                            
            EXIT                                                                                                      
         ELSE                                                                                                         
            MYSTRAN_DIR_LEN = MYSTRAN_DIR_LEN - 1                                                                     
            CYCLE                                                                                                     
         ENDIF                                                                                                        
      ENDDO                 

I think GET_ENVIRONMENT_VARIABLE (Fortran 2003 and later) and GETENV (backwards compatibility with GNU Fortran 77) could use one to work for both OSes. In new code, programmers should consider the use of the GET_ENVIRONMENT_VARIABLE.

For READ_CL.f90,  the difference is:

Code:
InputObject                                                                                                           
-----------                                                                                                           
! Begin MIT license text.                                                                                             
! _______________________________________________________________________________________________________             
! Copyright 2019 Dr William R Case, Jr (dbcase29@gmail.com)                                                           
! Permission is hereby granted, free of charge, to any person obtaining a copy of this software and                   
! associated documentation files (the "Software"), to deal in the Software without restriction, including             
! without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell             
! copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to                
! the following conditions:                                                                                           
! The above copyright notice and this permission notice shall be included in all copies or substantial                
! portions of the Software and documentation.                                                                         
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS                                             
! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,                                         
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE                                         
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER                                              
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,                                       
! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN                                           
! THE SOFTWARE.                                                                                                       
! _______________________________________________________________________________________________________             
! End MIT license text.                                                                                               
! ##################################################################################################################...
All are comments. So there should be no difference for this file.



Attached Files
.zip   cpSrc.zip (Size: 544 bytes / Downloads: 0)
Print this item

  BANDIT crash on Windows (MSYS+CMake build)
Posted by: borges - 08-28-2020, 04:51 PM - Forum: MYSTRAN - Replies (15)

I think it's a good idea to sum up all the information regarding the whole BANDIT/CMake/Windows situationin a thread over here.

Here's a quick run-down of what happened:

  1. In the interest of getting a consistent, faster build process (without Code::Blocks) and supporting Linux, I updated Cean's CMakeLists.txt file, enabling users to compile MYSTRAN (using gfortran) under both Linux and Windows (using MSYS).
  2. The resulting binaries worked fine on Linux, but caused runtime errors on Windows. Those crashes originated in WRITE calls in BANDIT.
  3. We were unable to find an explanation for the uncovered OS-dependent behavior. It's a really weird glitch in how the runtime is treating opened files.
  4. In the interest of getting this improved build process out there, I also commented out all offending WRITE calls. After that change, the Windows binary seems to work.
That's the current state of my fork: CMake cross-platform improved build spec and silenced BANDIT.

Some extra points that came up during discussion and are very much worth mentioning:
  • BANDIT is comprised of legacy F77 code. This may be related to the "quirky" behavior across OSes.
  • Even though the test cases run on Windows after silencing BANDIT, it still reports BANDIT failed (code 4). That doesn't happen on Linux. Maybe the glitch causing this inconsistent behavior runs deeper than we previously thought.
  • That may explain why others were unable to reproduce this behavior in simple test programs.
  • Since integrating a better solver (PaStiX) is in the works and it doesn't need BANDIT, "fixing" BANDIT doesn't seem worth the effort. PaStiX should be the priority.
  • Still, until that's done, it's good to have an alternative build process working.

Print this item

  Help to get a NEU output
Posted by: ceanwang - 08-28-2020, 12:09 AM - Forum: MYSTRAN - Replies (1)

Hi,

I am trying this shell_bending.txt case but can't get a NEU result file. What is the setting to also have a NEU output?

https://www.mystran.com/forums/showthread.php?tid=46

Regards,

Cean

Print this item

  CQUAD4 in bending test
Posted by: O_Stodieck - 08-27-2020, 06:01 PM - Forum: MYSTRAN - Replies (27)

Hi, 

I am getting some unexpected results running the attached cantilevered composite plate model in Mystran 11.0. :

  • The model is a flat plate in the X-Y plane, with dimensions of 1.5m x 0.15m and fully fixed at one of the short ends. 
  • A Z-direction shear force is applied through an RBE3 at the unsupported end (Grid 737).
  • I would expect a Z-deflection at Grid 737 close to T3 = 0.29625 (simple CLT calculation and in agreement with other FEM solvers)
  • But I am getting T3 = 0.03613559 at Grid 737 instead.
  • AUTO SPC forces are zero (constraining Z-rotations / drilling DOF on the CQUADs only)
Any ideas what could trigger this behaviour?

Do you have a simple test case for shell (CQUAD4) element bending that I can run to test the installation? 
Thanks.



Attached Files
.txt   shell_bending.txt (Size: 122.08 KB / Downloads: 22)
Print this item

  Batch file to solve test cases in one folder
Posted by: ceanwang - 08-24-2020, 10:58 PM - Forum: MYSTRAN - Replies (1)

Hi,

Same as the 3-TestRuns folder, create a 8-Test folder and save this msolve.bat file in it. Please remove the txt extension.
Run, it will solve all dat files in 3-TestRuns\Statics\Banded\CurrentRuns folder.

Regards,

Cean


After solving all the cases, you could compare the newly generated *.ANS to the corresponding *.ARC files under the 3-TestRuns\Statics\Banded\Archive folder using these two bat files. Also save and run in 8-test folder. Please remove the txt extension.

cpARC.bat will call compareARC.ps1 to compare the pair of files line by line. compareARC.ps1 is a Window 10 PowerShell's script. It will write the difference into the cpDiff.txt file.

The problem at the moment for me is that the ARC file treat 0 different to my ANS file. One has - sign at the front of 0. I think if the exe is generate by same compiler, there will be no problem.



Attached Files
.txt   msolve.bat.txt (Size: 2.29 KB / Downloads: 1)
.txt   cpArc.bat.txt (Size: 76 bytes / Downloads: 1)
.txt   compareArc.ps1.txt (Size: 8.64 KB / Downloads: 1)
Print this item