[petsc-dev] C++ error

Satish Balay balay at mcs.anl.gov
Mon Jul 13 18:11:36 CDT 2020


$ git grep DMPlexLandFormLandau_Internal
include/petsc/private/dmpleximpl.h:PETSC_INTERN PetscErrorCode DMPlexLandFormLandau_Internal(Vec, Mat, const PetscInt, void *);
src/dm/impls/plex/landau/plexland.c:  DMPlexLandFormLandau_Internal - Evaluates Jacobian matrix.
src/dm/impls/plex/landau/plexland.c:PetscErrorCode DMPlexLandFormLandau_Internal(Vec a_X, Mat JacP, const PetscInt dim, void *a_ctx)
src/ts/utils/dmplexts.c:PETSC_INTERN PetscErrorCode DMPlexLandFormLandau_Internal(Vec, Mat, const PetscInt, void *);
src/ts/utils/dmplexts.c:    ierr = DMPlexLandFormLandau_Internal(X,ctx->J,dim,(void*)ctx);CHKERRQ(ierr);
src/ts/utils/dmplexts.c:    ierr = DMPlexLandFormLandau_Internal(X,ctx->J,dim,(void*)ctx); CHKERRQ(ierr);


You'll need the PETSC_EXTERN in include/petsc/private/dmpleximpl.h  and remove the duplicate prototype listing from src/ts/utils/dmplexts.c

Satish


> I tried to add code to DMPlexts.c and am getting this error:
> 
> https://gitlab.com/petsc/petsc/-/jobs/636828148
> 
> dmplexts.c:(.text+0x1a0f): undefined reference to
> `DMPlexLandFormLandau_Internal'
> 1648 <https://gitlab.com/petsc/petsc/-/jobs/636828148#L1648>
> 
> with this code:
> 
> PETSC_INTERN PetscErrorCode DMPlexLandFormLandau_Internal(Vec a_X, Mat
> JacP, const PetscInt dim, void *a_ctx);
> /*@
>   DMPlexLandIFunction
> @*/
> PetscErrorCode DMPlexLandIFunction(TS ts,PetscReal time_dummy,Vec X,Vec
> X_t,Vec F,void *actx)
> {
> .....
>     ierr =
> DMPlexLandFormLandau_Internal(X,ctx->J,dim,(void*)ctx);CHKERRQ(ierr);
> 
> I tried with EXTERN also. Any ideas?
> Thanks,
> Mark
> 



More information about the petsc-dev mailing list