<div dir="ltr">Hi all,
<div><br></div><div>Me again !</div><div><br></div><div>I have read in previous posts that it is hard in Fortran to declare something similar to a typedef struct in C to manage a multicomponent problem. </div><div><br></div>
<div>Is it still the case ? Has the problem been solved ?</div><div><br></div><div>I am asking because my plan is to implement a multicomponent problem (in 1D), with many components that will be organized in arrays of two dimensions. In C I could define</div>
<div><br></div><div>typedef struct{</div><div>PetscScalar U;</div><div>PetscScalar V;</div><div>PetscScalar A[N][N];</div><div>} Field;</div><div><br></div><div>and then I could calculate the residual function with</div><div>
<br></div><div>F[i].U = ...</div><div>F[i].V = ...<br></div><div>F[i].A[k][n] = ...<br></div><div><br></div><div>which is quite convenient.</div><div><br></div><div>If in Fortran it is not possible to use a struct as in C, I am afraid I'll have to deal with</div>
<div><br></div><div>F(jdof,i) = ...</div><div><br></div><div>where I will have only jdof to address U, V and A[ ][ ], which can be difficult and not very convenient I guess. Before I move all my code to C, does anyone have an alternative idea to manage this multi(many)component problem in Fortran ?</div>
<div><br></div><div>Many thanks in advance for your help and suggestion !</div><div><br></div><div>Christophe</div></div>