topopt / TopOpt_in_PETSc

Topology optimization for linear elastic minimum compliance with volume constraints on cartesian grids in 3D using PETSc.
http:\\www.topopt.dtu.dk/PETSc
200 stars 74 forks source link

PETSc 3.7.5 error: cannot convert ‘PetscBool’ to ‘PCMGGalerkinType’ in PCMGSetGalerkin(PC, PCMGGalerkinType) #5

Closed huntrontrakkr closed 7 years ago

huntrontrakkr commented 7 years ago

Hi,

It seems that there is an issue while compiling with a newer version of PETSc:

/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);

topopt commented 7 years ago

Hi,

I've just done a check of the framework with PETSc versions 3.7.5 and 3.7.6 - and cannot reproduce the error you have encountered. Also the petsc documentation indicates that the interface to PCMGSetGalerkin() is correct in LinearElasticity. So could you provide more information on your setup, i.e. what platform you use and how did the verification of your PETSc installation state (result of the test after compiling)?

Niels

huntrontrakkr commented 7 years ago

I'm currently utilizing a recent clone from https://bitbucket.org/petsc/petsc in order to achieve cuda acceleration. the config command included: ./configure --download-mpich --with-cuda=1 --with-cusp=1 --with-thrust=1 --with-precision=double --with-clanguage=c Compilation was successful and both test and streams worked at the end of compilation. I apologize for miss-attributing the version number.

huntrontrakkr commented 7 years ago

I was able to find documentation on the function here: https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/PCMG/PCMGSetGalerkin.html

topopt commented 7 years ago

Thanks for the clarification and thanks for the heads up regarding the change in method interface for the next version of PETSc. I will, however, wait with updating the code until the PETSc developers release a new version officially - but have added a comment in the README file stating the possible issues with using newest git branch. In case you have not already resolved your issue you should use the PCMGGalerkinType to PC_MG_GALERKIN_BOTH.

jessweakly commented 4 years ago

Has this error been fixed? I am seeing this same error for both LinearElasticity and PDEFilter come up on Ubuntu 18.04 using Petsc-11.4.1. I would greatly appreciate if someone can share how to fix it.