Dave, Hong, thank you. Setting and getting the context from TS is definitely the way to go, as I have to compute an exchange of particle forces and geometry information. Working fine now.
Christian _______________________________ Christian Peco Regales, Ph.D. Postdoctoral Research Associate Civil and Environmental Engineering Pratt School of Engineering Duke University 2407 CIEMAS (office) Durham, NC 27708, USA email: [email protected] web: http://www.christianpeco.com<http://christianpeco.com> _______________________________ ________________________________ From: Dave May <[email protected]> Sent: Wednesday, March 30, 2016 2:38 PM To: Christian Peco Regales, Ph.D. Cc: [email protected] Subject: Re: [petsc-users] TS prestep function On 30 March 2016 at 19:54, Christian Peco Regales, Ph.D. <[email protected]<mailto:[email protected]>> wrote: I have started to use the TS environment to solve a diffusion problem with XFEM in which, at the beginning of every step, a number of values have to be recomputed in order to properly fill the Jacobian (e.g. change some quadrature weights). However, I see that the the function is expected with the format func(TS ts), with no possibility of getting a user context to perform the computations I need. There are a number of ways to get around this: [1] Set an application context on the TS http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetApplicationContext.html and retrieve via http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSGetApplicationContext.html [2] It sounds like your information is related to geometry, so you could bundle it into a DM and use http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetDM.html [3] The "nastiest" way is to use http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscContainerCreate.html#PetscContainerCreate and then compose the PetscContainer object with the TS object via http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscObjectCompose.html Thanks, Dave Is there a way to get around that? Thanks! Christian _______________________________ Christian Peco Regales, Ph.D. Postdoctoral Research Associate Civil and Environmental Engineering Pratt School of Engineering Duke University 2407 CIEMAS (office) Durham, NC 27708, USA email: [email protected]<mailto:[email protected]> web: http://www.christianpeco.com<http://christianpeco.com> _______________________________
