[Users] Error in a function

Erik Schnetter schnetter at cct.lsu.edu
Wed Sep 9 12:01:50 CDT 2020


Erik

If you are trying to call this function as
"Initial_Setup(CCTK_ARGUMENTS);", then this won't work. You have to
call it as "Initial_Setup(CCTK_PASS_CTOC);". If you look for the
string "CTOC" in the users' guide you'll find more details.

-erik

On Wed, Sep 9, 2020 at 12:44 AM Erik Rodrígo Jiménez Vázquez
<erjive at ciencias.unam.mx> wrote:
>
> Hello everybody,
>
> I'm writing a function to set initial conditions, but I need to use an interative method and I need to operate over some arrays (grid functions) that I previously declared in the interface.ccl file.
>
> This is an example of one of the functions that I'm currently writing.
>
> #include "cctk.h"
> #include "cctk_Arguments.h"
> #include "cctk_Parameters.h"
> #include "ID.h"
>
> void Initial_Setup(CCTK_ARGUMENTS)
> {
>
>   DECLARE_CCTK_ARGUMENTS;
>   DECLARE_CCTK_PARAMETERS;
>
>   int index;
>
>   int i,j,k;
>   int ierr;
>
>   for (k=0; k<cctk_lsh[2]; k++)
>     {
>       for (j=0; j<cctk_lsh[1]; j++)
>         {
>           for (i=0; i<cctk_lsh[0]; i++)
>             {
>               index = CCTK_GFINDEX3D(cctkGH,i,j,k);
>
>               phi[index] = 1.0;
>               pi [index] = 0.0;
>             }
>         }
>     }
>
> }
>
> where pi and phi are the grid functions previously defined in the interface.ccl and the header "ID.h" is where I defined the function Initial_Setup
>
> When I call the function in the main function and compile it I get
>
> error: type name is not allowed
>     Initial_Setup(CCTK_ARGUMENTS);
> error: expression must have arithmetic type
>     Initial_Setup(CCTK_ARGUMENTS);
>
> these errors are the same for the other functions. All these functions are not scheduled but the main function is. What is the problem?
>
> Any help will be apreciated.
>
> Erik
>
> _______________________________________________
> 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/


More information about the Users mailing list