Dhondtguido / CalculiX

This repository contains the source files of CalculiX, a three-dimensional Finite Element Program (www.calculix.de).
GNU General Public License v2.0
72 stars 16 forks source link

Save CalculiX [ccx] simulation results in several csv files, based on variable, set and timestep #72

Open efirvida opened 7 months ago

efirvida commented 7 months ago

I Add the ability to export the simulation results in csv format, for some .dat and .frd results. I didn't check all cases, just the cases I need but I think its a good starting point.

3rav commented 6 months ago

Windows error:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: dynamic/ccx_2.21_MT.a(csv.o):csv.c:(.text+0x118): undefined reference to `strndup'
collect2.exe: error: ld returned 1 exit status

Add to csv.c

char *strndup(char *str, int chars)
{
    char *buffer;
    int n;

    buffer = (char *) malloc(chars +1);
    if (buffer)
    {
        for (n = 0; ((n < chars) && (str[n] != 0)) ; n++) buffer[n] = str[n];
        buffer[n] = 0;
    }

    return buffer;
}

Similar to: https://github.com/gustafson/CalculiX/pull/1

efirvida commented 6 months ago

@3rav Done!!. Please test it, I can´t do it