Commit 8a029b43 authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

remove c-files

parent 7c8e83d7
This diff is collapsed.
This diff is collapsed.
static char mc_version[] = "MATLAB Compiler 1.0 infun";
/*
* MATLAB Compiler: 1.0
* Date: Oct 20, 1995
* Arguments: -rvv getderiv
*/
#include <math.h>
#include "mex.h"
#include "mcc.h"
void
mexFunction(
int nlhs_,
Matrix *plhs_[],
int nrhs_,
Matrix *prhs_[]
)
{
int ci_, i_, j_;
unsigned flags_;
Matrix *Mplhs_[32], *Mprhs_[32];
/***************** Compiler Assumptions ****************
*
* RM0_ real vector/matrix temporary
* det <function>
* detjac real scalar
* dn real vector/matrix
* dndksi real vector/matrix
* dndx real vector/matrix
* getderiv <function being defined>
* inv <function>
* ip real scalar
* jac real vector/matrix
* jaci real vector/matrix
* k real scalar
* length <function>
* nodcoord real vector/matrix
* nsd integer scalar
*******************************************************/
Matrix dndx;
double detjac;
Matrix jac;
Matrix jaci;
Matrix dndksi;
Matrix nodcoord;
double ip;
int ip_set_ = 0;
int nsd;
double k;
Matrix dn;
Matrix RM0_;
mccRealInit(dndksi);
mccImport(&dndksi, ((nrhs_>0) ? prhs_[0] : 0), 0, 0);
mccRealInit(nodcoord);
mccImport(&nodcoord, ((nrhs_>1) ? prhs_[1] : 0), 0, 0);
ip = mccImportReal(&ip_set_, (nrhs_>2) ? prhs_[2] : 0, "ip");
mccRealInit(dndx);
mccRealInit(jac);
mccRealInit(jaci);
mccRealInit(dn);
mccRealInit(RM0_);
/* % [dndx,detjac,jac,jaci]=getderiv(dndksi,nodcoord,ip); */
/* % input: */
/* % dndksi : derivatives of the shape function n with respect to local coord. */
/* % dndksi(1:nlnodes,1:nint*nsd), */
/* % nlnodes : number of nodes of the element */
/* % nint : number if integration points */
/* % nsd : space dimension = length(coord(1,:)); */
/* % nodcoord : coordinates of the nodal points */
/* % nodcoord(1:nlnodes,1:nsd) */
/* % ip : integration point number */
/* % output: */
/* % dndx : derivatives of the shape function n with respect to global coor. */
/* % in integration point ip */
/* % dndx(1:nlnodes,1:nsd) */
/* % detjac : determinant of the jacobian matrix */
/* % jac : jacobian of the transformation matrix from local to gloval coor. */
/* % jaci : inv(jac) */
/* nsd = length(nodcoord(1,:)); */
if( nodcoord.flags & mccNOTSET )
{
mexErrMsgTxt( "variable nodcoord undefined, line 24" );
}
RM0_.dmode = mxNUMBER;
{
int m_=1, n_=1, cx_ = 0;
double t_;
double *p_RM0_;
int I_RM0_=1;
double *p_nodcoord;
int I_nodcoord=1, J_nodcoord;
m_ = mcmCalcResultSize(m_, &n_, 1, nodcoord.n);
mccAllocateMatrix(&RM0_, m_, n_);
mccCheckMatrixSize(&nodcoord, 1, n_);
I_RM0_ = (RM0_.m != 1 || RM0_.n != 1);
p_RM0_ = RM0_.pr;
if (nodcoord.m == 1 && nodcoord.n == 1) { I_nodcoord = J_nodcoord = 0; }
else { I_nodcoord=1; J_nodcoord=nodcoord.m-m_; }
p_nodcoord = nodcoord.pr + (1-1) + nodcoord.m * 0;
for (j_=0; j_<n_; ++j_, p_nodcoord += J_nodcoord)
{
for (i_=0; i_<m_; ++i_, p_RM0_+=I_RM0_, p_nodcoord+=I_nodcoord)
{
*p_RM0_ = *p_nodcoord;
;
}
}
}
RM0_.dmode = mxNUMBER;
nsd = mccGetLength(&RM0_);
/* k=nsd*(ip-1); */
if( !ip_set_ )
{
mexErrMsgTxt( "variable ip undefined, line 26" );
}
k = (nsd * (ip - 1));
/* dn(:,1:nsd) = dndksi(:,k+1:k+nsd); */
if( dndksi.flags & mccNOTSET )
{
mexErrMsgTxt( "variable dndksi undefined, line 28" );
}
mccColon2(&RM0_, (k + 1), (k + nsd));
{
int m_=1, n_=1, cx_ = 0;
double t_;
double *p_dn;
int I_dn=1, J_dn;
double *p_dndksi;
int I_dndksi=1;
double *p_RM0_;
int I_RM0_=1;
m_ = mcmCalcResultSize(m_, &n_, dndksi.m, (RM0_.m * RM0_.n));
mccGrowMatrix(&dn, m_, nsd);
mccCheckMatrixSize(&dndksi, m_, mccGetMaxIndex(&RM0_ ,dndksi.n));
if (dn.m == 1 && dn.n == 1) { I_dn = J_dn = 0; }
else { I_dn=1; J_dn=dn.m-m_; }
p_dn = dn.pr + 0 + dn.m * ((int)(1 - .5));
I_RM0_ = (RM0_.m != 1 || RM0_.n != 1);
p_RM0_ = RM0_.pr;
for (j_=0; j_<n_; ++j_, p_dn += J_dn, p_RM0_ += I_RM0_)
{
p_dndksi = dndksi.pr + dndksi.m * ((int)(*p_RM0_ - .5)) + 0;
for (i_=0; i_<m_; ++i_, p_dn+=I_dn, p_dndksi+=I_dndksi)
{
*p_dn = *p_dndksi;
;
}
}
}
dn.dmode = mxNUMBER;
/* jac = dn'*nodcoord; */
mccConjTrans(&RM0_, &dn);
mccRealMatrixMultiply(&jac, &RM0_, &nodcoord);
/* detjac = det(jac); */
Mprhs_[0] = &jac;
Mplhs_[0] = 0;
mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "det", 31);
detjac = mccImportReal(0, Mplhs_[ 0 ], " (getderiv, line 31): detjac");
/* jaci = inv(jac); */
Mprhs_[0] = &jac;
Mplhs_[0] = &jaci;
mccCallMATLAB(1, Mplhs_, 1, Mprhs_, "inv", 32);
/* dndx = dn*jaci'; */
mccConjTrans(&RM0_, &jaci);
mccRealMatrixMultiply(&dndx, &dn, &RM0_);
mccReturnFirstValue(&plhs_[0], &dndx);
if (nlhs_ > 1) mccReturnScalar(&plhs_[1], detjac, 0., mccSET|mccNOTFIRST);
mccReturnValue(&plhs_[2], &jac);
mccReturnValue(&plhs_[3], &jaci);
return;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment