<commit_before>#include <iostream>
#include <cstdlib>
#include <cassert>

#include "../TextWriter.h"
#include "../VtkUgReader.h"
#include "../Tet.h"

using namespace cigma;

int main(void)
{
    TextWriter *writer = new TextWriter();
    writer->fp = stdout;

    VtkUgReader *reader = new VtkUgReader();
    //reader->open("strikeslip_tet4_0500m_t0.vtk");
    
    // -----------------------------------------------------------------------

    Tet tetcell;

    int ndofs = tetcell.n_nodes();
    const int npts = 5;
    const int nsd = 3;

    double refpts[npts*nsd] = {
        0.0, 0.0, 0.0,
        1.0, 0.0, 0.0,
        0.0, 1.0, 0.0,
        0.0, 0.0, 1.0,
        0.5, 0.5, 0.5
    };
    
    double tab[npts*ndofs];
    double tab_jet[npts*ndofs*nsd];
    tetcell.shape(npts, refpts, tab);
    tetcell.grad_shape(npts, refpts, tab_jet);

    for (int i = 0; i < npts; i++)
    {
        double *pt = &refpts[nsd*i];
        double u = pt[0];
        double v = pt[1];
        double w = pt[2];

        std::cout << i << " : ";

        std::cout << "x = ("
                  << u << " "
                  << v << " "
                  << w << ")  ";

        bool inside = tetcell.interior(u,v,w);
        std::cout << "in = " << inside << "  ";

        double *phi = &tab[ndofs*i];
        std::cout << "phi_k = ("
                  << phi[0] << " "
                  << phi[1] << " "
                  << phi[2] << " "
                  << phi[3] << ")  ";

        double *grad_phi = &tab_jet[i*ndofs*3];
        std::cout << "grad_phi = ("
                  << "(" << grad_phi[3*0 + 0] << " "
                         << grad_phi[3*0 + 1] << " "
                         << grad_phi[3*0 + 2] << "),"
                  << "(" << grad_phi[3*1 + 0] << " "
                         << grad_phi[3*1 + 1] << " "
                         << grad_phi[3*1 + 2] << "),"
                  << "(" << grad_phi[3*2 + 0] << " "
                         << grad_phi[3*2 + 1] << " "
                         << grad_phi[3*2 + 2] << "),"
                  << "(" << grad_phi[3*3 + 0] << " "
                         << grad_phi[3*3 + 1] << " "
                         << grad_phi[3*3 + 2] << ")"
                  << ")  ";


        double J[3][3];
        double detJ = tetcell.jacobian(u,v,w,J);
        std::cout << "detJ = " << detJ;

        std::cout << std::endl;
    }


    

    // -----------------------------------------------------------------------
    
    delete reader;
    
    writer->fp = NULL;
    delete writer;

    return 0;
}<commit_msg>Commented out unused I/O variables in TestTet, and changed phi_k to phi<commit_after>#include <iostream>
#include <cstdlib>
#include <cassert>

//#include "../TextWriter.h"
//#include "../VtkUgReader.h"
#include "../Tet.h"

using namespace cigma;

int main(void)
{
    //TextWriter writer;
    //writer.fp = stdout;

    //VtkUgReader *reader = new VtkUgReader();
    //reader->open("strikeslip_tet4_0500m_t0.vtk");
    
    // -----------------------------------------------------------------------

    Tet tetcell;

    int ndofs = tetcell.n_nodes();
    const int npts = 5;
    const int nsd = 3;

    double refpts[npts*nsd] = {
        0.0, 0.0, 0.0,
        1.0, 0.0, 0.0,
        0.0, 1.0, 0.0,
        0.0, 0.0, 1.0,
        0.5, 0.5, 0.5
    };
    
    double tab[npts*ndofs];
    double tab_jet[npts*ndofs*nsd];
    tetcell.shape(npts, refpts, tab);
    tetcell.grad_shape(npts, refpts, tab_jet);

    for (int i = 0; i < npts; i++)
    {
        double *pt = &refpts[nsd*i];
        double u = pt[0];
        double v = pt[1];
        double w = pt[2];

        std::cout << i << " : ";

        std::cout << "x = ("
                  << u << " "
                  << v << " "
                  << w << ")  ";

        bool inside = tetcell.interior(u,v,w);
        std::cout << "in = " << inside << "  ";

        double *phi = &tab[ndofs*i];
        std::cout << "phi = ("
                  << phi[0] << " "
                  << phi[1] << " "
                  << phi[2] << " "
                  << phi[3] << ")  ";

        double *grad_phi = &tab_jet[i*ndofs*3];
        std::cout << "grad_phi = ("
                  << "(" << grad_phi[3*0 + 0] << " "
                         << grad_phi[3*0 + 1] << " "
                         << grad_phi[3*0 + 2] << "),"

                  << "(" << grad_phi[3*1 + 0] << " "
                         << grad_phi[3*1 + 1] << " "
                         << grad_phi[3*1 + 2] << "),"

                  << "(" << grad_phi[3*2 + 0] << " "
                         << grad_phi[3*2 + 1] << " "
                         << grad_phi[3*2 + 2] << "),"

                  << "(" << grad_phi[3*3 + 0] << " "
                         << grad_phi[3*3 + 1] << " "
                         << grad_phi[3*3 + 2] << ")"
                  << ")  ";


        double J[3][3];
        double detJ = tetcell.jacobian(u,v,w,J);
        std::cout << "detJ = " << detJ;

        std::cout << std::endl;
    }


    

    // -----------------------------------------------------------------------
    
    //delete reader;

    return 0;
}
{'fraction_non_alphanumeric': 0.24148003894839337, 'fraction_numerical': 0.033495618305744886, 'mean_word_length': 1.111842105263158, 'pattern_counts': {'":': 0, '<': 227, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '881953', 'n_tokens_mistral': 1911, 'n_tokens_neox': 1754, 'n_words': 317}