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();
}

COPYRIGHT © 2022 · GID · CIMNE