/
Additional information
GiD - The personal pre and post processor
Additional information
NOTE: In this example, a code for the program will be developed in C. Nevertheless, any programming language may be used.
The code of the program that calculates the center of mass (cmas2d.c) is as follows:
The cmas2d.c file
#include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <math.h> #define MAXMAT 1000 #define MAXCND 1000 char projname[1024]; int i, ielem, inod, icnd; double *x, *y; int *N, *imat; int nodc[MAXCND]; double rho[MAXMAT], wval[MAXCND]; int Nelem, Nnod, Nmat, Ncnd; double x_CG, y_CG; void input(void); void calculate(void); void output(void); void main( int argc, char *argv[] ) { strcpy( projname, argv[1] ); input(); calculate(); output(); }
, multiple selections available,
Related content
Interface definition
Interface definition
Read with this
Solver
Solver
More like this
Run the solver
Run the solver
More like this
DEFINING A PROBLEM TYPE
DEFINING A PROBLEM TYPE
More like this
Customization
Customization
More like this
Writing the calculation filesĀ
Writing the calculation filesĀ
More like this
COPYRIGHT Ā© 2022 Ā· GID Ā· CIMNE