Coder Social home page Coder Social logo

topopt / topopt_in_petsc Goto Github PK

View Code? Open in Web Editor NEW
195.0 25.0 74.0 7.07 MB

Topology optimization for linear elastic minimum compliance with volume constraints on cartesian grids in 3D using PETSc.

Home Page: http:\\www.topopt.dtu.dk/PETSc

C++ 94.12% Python 5.88%

topopt_in_petsc's Introduction

TopOpt_in_PETSc

A 3D large-scale topology optimization code using PETSc

The code (or framework) presented on this page is a fully parallel framework for conducting very large scale topology optimziation on structured grids. For more details see www.topopt.dtu.dk/PETSc.

Updated and refactored to remove dependence of TopOpt.cc/h in all other classe, June, 2019, Niels Aage

To clone repository:

git clone https://github.com/topopt/TopOpt_in_PETSc.git

NOTE: The code requires PETSc version 3.11.0 or newer ! Also note that the code is not tested against the development branch on git.

This code has been tested on:

  • Linux systems including: Ubuntu 18.04, Red hat enterprise linux 8

This code requires the following external software to work:

  • PETSc version 3.11.4 or earlier (though never than 3.8.x)
  • Requires LAPACK/BLAS
  • Requires MPI

Compile following rules in makefile_ref

Normal compilation time of framework, e.g. 4s: "make topopt -j"

Run the base example by typing e.g.: "mpirun -np 4 ./topopt"

Postprocess results using Python 2.6: "bin2vtu #" where # refers to the iteration number

Visualize using ParaView (version 5.7 or earlier)

The expected result of the base code is the (but on a coarse mesh!) cantilever beam from: Aage, N., Andreassen, E., & Lazarov, B. S. (2015). Topology optimization using PETSc: An easy-to-use, fully parallel, open source topology optimization framework. Structural and Multidisciplinary Optimization, 51(3), 565–572. https://doi.org/10.1007/s00158-014-1157-0

Extensions:

An extension of the code including manufacturing filters/constraints can be found here: https://github.com/edofersan/MaximumSize_on_TopOpt_in_PETSc

topopt_in_petsc's People

Contributors

topopt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

topopt_in_petsc's Issues

Inlcude problem PETSc 12.xx

The latest build of PETSc requires the inclusion of headers to be changed to "" from <> for all local files.

Retrieve vtu file with bin2vtu results in 'Could not read header format'

I cannot retrieve the vtu files from the output.dat file. I tried for several iterations. E.g.:
python2.6 bin2vtu.py 440

Results in:

iter: 440 
rm: cannot remove 'output*.vtu': No such file or directory 
Reading in mesh information 
Could not read header format... exiting

Any suggestions?

xold in TopOpt.h/cc

The xold vector in the TopOpt class should be removed, since it is a leftover from a previous version with an OC design update.

Fix: Remove from TopOpt.h/cc and modify the DesignChange method in MMA.h/cc

What does ux、x stand for?

I ran the sample program and found the variables ux, uy, and uz in the paraview. I want to know what this represents

PETSc 3.11.3 error: cannot convert ‘PetscBool’ to ‘PCMGGalerkinType’ for argument ‘2’ to ‘PetscErrorCode PCMGSetGalerkin(PC, PCMGGalerkinType)’

Hi all,
I am using the newest version of PETSc for my work.
However I got an error while compiling with a newer version of PETSc3.11.3 as following:
"LinearElasticity.cc:1811:32: error: cannot convert ‘PetscBool’ to ‘PCMGGalerkinType’ for argument ‘2’ to ‘PetscErrorCode PCMGSetGalerkin(PC, PCMGGalerkinType)’
PCMGSetGalerkin(pc,PETSC_TRUE);"
Can you help me to solve this problem?

Thank you very much,
Best Regards,
Tran Quang Dat.

PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range

Hi all,

I am using PETSc 3.7.3 for my problem.
I got an error when my program ran some iterations:
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: likely location of problem given in stack below
[0]PETSC ERROR: --------------------- Stack Frames ------------------------------------
[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
[0]PETSC ERROR: INSTEAD the line number of the start of the function
[0]PETSC ERROR: is given.
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Signal received
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.7.7, Sep, 25, 2017
[0]PETSC ERROR: ./topopt on a arch-linux2-c-debug named tranquangdat-System-Product-Name by tranquangdat Sat Aug 17 11:31:46 2019
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --download-mpich –download-f2cblaslapack=1
[0]PETSC ERROR: #1 User provided function() line 0 in unknown file
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[cli_0]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

Could you please help me to fix this problem?

Thank you very much,

Best Regards,
Tran Quang Dat.

LinearElasticity.cc error

Dear all,

are there anyone have the problem when run make topopt with the error like this?, can you help me to see the problem.

/Documents/TopOpt_in_PETSc/LinearElasticity.cc:613:32: error: cannot convert ‘PetscBool’ to ‘PCMGGalerkinType’ for argument ‘2’ to ‘PetscErrorCode PCMGSetGalerkin(PC, PCMGGalerkinType)’
PCMGSetGalerkin(pc,PETSC_TRUE);

Parallel speedup

I ran the catilever example in the documentation: mpiexec -np 2 ./topopt.
It ran fine, but the -np argument to mpiexec does not seem to do anything useful.
It just runs duplicate copies of the same simulation with no speedup.
Is there something I need to do to take advantage of multiple CPUs?
I am running on an Apple M1 chip.

Is that possible to use the PETSc-MMA with the overlapping Schwarz domain decomposition (DM) algorithm.

Thank you for the development of the PETSc-MMA, and making it available on Github. I am using  the overlapping Schwarz domain decomposition (DM) algorithm, and I am trying to build your MMA as a dynamic library and link it to my code. However, I have an issue. My understanding is that in your parallel framework the domain decomposition method results in several sub-domains without an overlapping area. But in the overlapping Schwarz domain decomposition algorithm there are overlapping areas. When I tested your MMA, it behaves well with 1 thread under DM algorithm, while the more threads yields wrong results.
I was wondering if it is possible to use your PETSc-MMA with DM algorithm. Thank you in advance for helping me with this question.

Memory use for big models

Hi,

When I am testing the standard problem with large meshes: 4 to 40 million elements, I see that the memory requirements go up into more than a 100GB's. For these testes I used between 16 and 48 cores and a density filter with a very small filter radius.

Is this memory usage normal or is there a way to decrease the amount of memory required?

Best, Thijs

Problem with plotting

Dear all,

I am trying to reproduce the example. I ran:

mpiexec -np 4 ./topopt -filter 2 -rmin 0.2 -volfrac 0.3 -maxItr 160

then

python bin2vtu.py 18.

However, when opening the file output_00018.vtu, I get an empty box:

screen shot 2018-02-22 at 09 43 23

Can you give me a hint please?

THank you for your help,

Romain

Terminate called after throwing an instance of 'std::bad_array_new_length'

Hi all,
I am using the PETSc 3.7.7 and want to update to new version of the PETSc 3.11.3.
I got an error while compiling with a newer version of PETSc 3.11.3 as following:
" terminate called after throwing an instance of 'std::bad_array_new_length'
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
what(): std::bad_array_new_length"
There was no error when I used the older version PETSc 3.7.7.
Can you help me to solve this problem?

Thank you very much,
Best Regards,
Tran Quang Dat.

makefile_ref

Hey! I'm getting
./makefile_ref: line 2: all: command not found
./makefile_ref: line 3: CFLAGS: command not found
./makefile_ref: line 15: include: command not found
./makefile_ref: line 16: include: command not found
./makefile_ref: line 17: include: command not found
./makefile_ref: line 19: topopt:: command not found
./makefile_ref: line 21: -: command not found
./makefile_ref: line 22: main.o: command not found
./makefile_ref: line 25: myclean:: command not found

when I'm running makefile_ref.
I've installed PETSc 3.13, MPI and BLAS/LAPACK
any idea in what am I doing wrong?
Thanks!!

bin2vtu problem

the bin2vtuy converter is not compatible with newest paraview versions. Can only be used with PV 5.7 or earlier

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.