[Users] Calling a function in Thorn A from Thorn B

Erik Schnetter schnetter at cct.lsu.edu
Sat May 5 09:39:00 CDT 2018


Yes, this is the way to do it.

-erik

On Sat, May 5, 2018 at 03:30 Chris Stevens <c.stevens at ru.ac.za> wrote:

> Hi everyone,
>
> I am in a situation where I want to call a function whose argument is just
> CCTK_ARGUMENTS from another thorn. I am aware of the following:
>
> -- I can share functions defined between thorns through the interface.ccl
> of the thorns, but I do not know how to specify CCTK_ARGUMENTS in the
> interface file. I cannot seem to find the cctk_arguments.h header anywhere
> in the Cactus directory to see what the definition of this is?
>
> -- I can call functions with argument CCTK_ARGUMENTS within the same thorn
> by using CCTK_PASS_CTOC.
>
> As a current fix (copied from CTGamma code), I can write the function like
>
> void test(CCTK_POINTER_TO_CONST _cctkGH)
> {
>   const cGH* const cctkGH = _cctkGH;
>   DECLARE_CCTK_ARGUMENTS;
>   DECLARE_CCTK_PARAMETERS;
>
> }
>
> where this argument can now be passed through the interface file and seems
> to do a similar thing to CCTK_ARGUMENTS.
>
> Any help to figure out the best way to do this would be much appreciated!
>
> Thanks,
>
> Chris
> --
> Dr Chris Stevens
>
> Claude Leon Postdoctoral Fellow
>
> Department of Mathematics
>
> Rhodes University
>
> Room 5
>
> Ph: +27 46 603 8932
>
> Web: www.chrisdoesmaths.com
> _______________________________________________
> Users mailing list
> Users at einsteintoolkit.org
> http://lists.einsteintoolkit.org/mailman/listinfo/users
>
-- 
Erik Schnetter <schnetter at cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20180505/cfc5d27c/attachment.html 


More information about the Users mailing list