#include "AlartCurnierGenerated.h"
#include "assert.h"                                   // for assert
#include "fc3d_AlartCurnierABGenerated.h"             // for fc3d_AlartCurni...
#include "fc3d_AlartCurnierFABGenerated.h"            // for fc3d_AlartCurni...
#include "fc3d_AlartCurnierFGenerated.h"              // for fc3d_AlartCurni...
#include "fc3d_AlartCurnierJeanMoreauABGenerated.h"   // for fc3d_AlartCurni...
#include "fc3d_AlartCurnierJeanMoreauFABGenerated.h"  // for fc3d_AlartCurni...
#include "fc3d_AlartCurnierJeanMoreauFGenerated.h"    // for fc3d_AlartCurni...
#include "op3x3.h"                                    // for cpy3x3, cpy3, SET3

void fc3d_AlartCurnierFunctionGenerated(
  double *reaction,
  double *velocity,
  double mu,
  double *rho,
  double *f,
  double *A,
  double *B)
{
  double result[21];

  assert(reaction);
  assert(velocity);
  assert(rho);

  SET3(reaction);
  SET3(velocity);
  SET3(rho);


  if(f && A && B)
  {

    fc3d_AlartCurnierFABGenerated(
      *reaction0, *reaction1, *reaction2,
      *velocity0, *velocity1, *velocity2,
      mu,
      *rho0, *rho1, *rho2,
      result);
    cpy3(result, f);
    cpy3x3(result + 3, A);
    cpy3x3(result + 12, B);
  }

  else
  {
    if(f)
    {
      fc3d_AlartCurnierFGenerated(
        *reaction0, *reaction1, *reaction2,
        *velocity0, *velocity1, *velocity2,
        mu,
        *rho0, *rho1, *rho2,
        result);
      cpy3(result, f);
    }

    if(A && B)
    {
      fc3d_AlartCurnierABGenerated(
        *reaction0, *reaction1, *reaction2,
        *velocity0, *velocity1, *velocity2,
        mu,
        *rho0, *rho1, *rho2,
        result);
      cpy3x3(result, A);
      cpy3x3(result + 9, B);
    }
  }
}

void fc3d_AlartCurnierJeanMoreauFunctionGenerated(
  double *reaction,
  double *velocity,
  double mu,
  double *rho,
  double *f,
  double *A,
  double *B)
{
  double result[21];

  assert(reaction);
  assert(velocity);
  assert(rho);

  SET3(reaction);
  SET3(velocity);
  SET3(rho);


  if(f && A && B)
  {

    fc3d_AlartCurnierJeanMoreauFABGenerated(
      *reaction0, *reaction1, *reaction2,
      *velocity0, *velocity1, *velocity2,
      mu,
      *rho0, *rho1, *rho2,
      result);
    cpy3(result, f);
    cpy3x3(result + 3, A);
    cpy3x3(result + 12, B);
  }

  else
  {
    if(f)
    {
      fc3d_AlartCurnierJeanMoreauFGenerated(
        *reaction0, *reaction1, *reaction2,
        *velocity0, *velocity1, *velocity2,
        mu,
        *rho0, *rho1, *rho2,
        result);
      cpy3(result, f);
    }

    if(A && B)
    {
      fc3d_AlartCurnierJeanMoreauABGenerated(
        *reaction0, *reaction1, *reaction2,
        *velocity0, *velocity1, *velocity2,
        mu,
        *rho0, *rho1, *rho2,
        result);
      cpy3x3(result, A);
      cpy3x3(result + 9, B);
    }
  }
}
