constcurve.c File Reference

#include <stdlib.h>
#include <math.h>
#include "constrain.h"
#include "rio.h"

Include dependency graph for constcurve.c:

Go to the source code of this file.

Data Structures

struct  sCCurveData

Defines

#define ZERO(v)   ((fabs(v)<Tolerance)?1:0)

Functions

static void DiffVec (sCoord *in0, sCoord *in1, sCoord *out)
static double ProdEscalar (sCoord *in0, sCoord *in1)
static void CrossProd (sCoord *in0, sCoord *in1, sCoord *out)
static double VecLen (sCoord *vec)
static double Dist (sCoord *in0, sCoord *in1)
static void VecNormalize (sCoord *vec, sCoord *n)
static sCoord DirNormalize (sCoord *p1, sCoord *p2)
static int LineBounds (sCoord *c, sCoord *pi, sCoord *pf)
static int Invert3x3 (double a[3][3], double b[3][3])
static int CheckPoint (sCoord *c, sCoord *pi, sCoord *pf)
static int _checkPointInExtrem (sConstrain *c, sCoord *p, int *id)
static int PolyInvSurf (sConstrain *c, sCoord *p, double *dist)
static int _curvePolySlide (sConstrain *c, double dist, void **elm, sCoord *p)
static void EvaluateTolerance (sConstrain *c)
static int _curveToLocal (sConstrain *c, sCoord *p, void **elm, double jac[3][3])
static int _curveToGlobal (sConstrain *c, sCoord *p, void **elm, double ijac[3][3])
static int _curveSlide (sConstrain *c, sCoord *p, void **elm, sCoord *d, double ijac[3][3], sCoord *pl)
static void ConstCurveNew (int, int, int, sConstrain **, sConstrain **)
static void ConstCurveFree (sConstrain *)
static void ConstCurveRead (sConstrain *)
static void ConstCurveBuild (sConstrain *)
static int ConstCurveLocal (sConstrain *c, sCoord *p, void **elm, double *g, double *l)
static int ConstCurveGlobal (sConstrain *c, sCoord *p, void **elm, double *l, double *g)
static int ConstCurveSlide (sConstrain *c, sCoord *p, void **elm, sCoord *d, double *l, double *g, sCoord *pl)
void ConstCurveInit (void)

Variables

static double Tolerance = 1.0e+10


Detailed Description

Author:
Joao Luiz Elias Campos.
Date:
June 22, 2004

Definition in file constcurve.c.


Define Documentation

#define ZERO (  )     ((fabs(v)<Tolerance)?1:0)

Definition at line 128 of file constcurve.c.

Referenced by Invert3x3(), LineBounds(), NodeApplyForce(), NodeApplyVelocity(), PrescribedValues(), PrincipalTensor(), and UpdatePrescribedValues().


Function Documentation

static int _checkPointInExtrem ( sConstrain c,
sCoord p,
int *  id 
) [static]

Definition at line 360 of file constcurve.c.

References sNode::coord, CrossProd(), DirNormalize(), sConstrain::elems, ElmConnect, sConstrain::nodes, sConstrain::numElems, ProdEscalar(), and VecLen().

Referenced by _curveToGlobal(), _curveToLocal(), and PolyInvSurf().

Here is the call graph for this function:

Here is the caller graph for this function:

static int _curvePolySlide ( sConstrain c,
double  dist,
void **  elm,
sCoord p 
) [static]

Dada uma curva (c) e o comprimento (dist) que se pretende projetar sobre a curva, a funcao calcula e retorna o ponto (p) correspondente ao comprimento projetado e a identificacao do segmento (elm) onde encontra-se o ponto. Caso o comprimento passado por parametro seja maior que o comprimento da curva a funcao retornara 0(zero).

Definition at line 500 of file constcurve.c.

References sNode::coord, Dist(), sConstrain::elems, ElmConnect, sConstrain::nodes, sConstrain::numElems, sCoord::x, sCoord::y, and sCoord::z.

Referenced by _curveSlide().

Here is the call graph for this function:

Here is the caller graph for this function:

static int _curveSlide ( sConstrain c,
sCoord p,
void **  elm,
sCoord d,
double  ijac[3][3],
sCoord pl 
) [static]

Definition at line 711 of file constcurve.c.

References _curvePolySlide(), ElmConnect, ElmJacobian, PolyInvSurf(), sCoord::x, sCoord::y, and sCoord::z.

Referenced by ConstCurveSlide().

Here is the call graph for this function:

Here is the caller graph for this function:

static int _curveToGlobal ( sConstrain c,
sCoord p,
void **  elm,
double  ijac[3][3] 
) [static]

Definition at line 657 of file constcurve.c.

References _checkPointInExtrem(), CheckPoint(), sNode::coord, sConstrain::elems, ElmConnect, ElmJacobian, sConstrain::nodes, and sConstrain::numElems.

Referenced by ConstCurveGlobal().

Here is the call graph for this function:

Here is the caller graph for this function:

static int _curveToLocal ( sConstrain c,
sCoord p,
void **  elm,
double  jac[3][3] 
) [static]

Definition at line 604 of file constcurve.c.

References _checkPointInExtrem(), CheckPoint(), sNode::coord, sConstrain::elems, ElmConnect, ElmJacobian, sConstrain::nodes, and sConstrain::numElems.

Referenced by ConstCurveLocal().

Here is the call graph for this function:

Here is the caller graph for this function:

static int CheckPoint ( sCoord c,
sCoord pi,
sCoord pf 
) [static]

Dada uma reta definida pelos pontos pi e pf, verifica se o ponto c dado encontra-se sobre a reta.

Parameters:
pi - ponto inicial da reta.
pf - ponto final da reta.
c - ponto a ser testado.
Returns:
Retorna 1 se o ponto c está sobre a reta ou 0 se o ponto não está sobre a reta.

Definition at line 324 of file constcurve.c.

References CrossProd(), DiffVec(), Invert3x3(), LineBounds(), sCoord::x, sCoord::y, and sCoord::z.

Referenced by _curveToGlobal(), _curveToLocal(), and PolyInvSurf().

Here is the call graph for this function:

Here is the caller graph for this function:

static void ConstCurveBuild ( sConstrain c  )  [static]

Definition at line 988 of file constcurve.c.

References sConstrain::data, sConstrain::elems, ElmConnect, ElmJacobian, ElmNumNodes, sCCurveData::ijac, sCCurveData::jac, and sConstrain::numNodes.

Referenced by ConstCurveInit().

Here is the caller graph for this function:

static void ConstCurveFree ( sConstrain c  )  [static]

Definition at line 807 of file constcurve.c.

References sConstrain::data, sConstrain::elems, ElmFree, sConstrain::nodes, sConstrain::numElems, and sConstrain::numNodes.

Referenced by ConstCurveInit().

Here is the caller graph for this function:

static int ConstCurveGlobal ( sConstrain c,
sCoord p,
void **  elm,
double *  l,
double *  g 
) [static]

Definition at line 1053 of file constcurve.c.

References _curveToGlobal(), and NDof.

Referenced by ConstCurveInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void ConstCurveInit ( void   ) 

Definition at line 1104 of file constcurve.c.

References sConstClass::build, ConstClass, ConstCurveBuild(), ConstCurveFree(), ConstCurveGlobal(), ConstCurveLocal(), ConstCurveNew(), ConstCurveRead(), ConstCurveSlide(), CURVE, sConstClass::free, sConstClass::global, sConstClass::local, sConstClass::new, sConstClass::read, sConstClass::slide, and Tolerance.

Referenced by ConstrainInit().

Here is the call graph for this function:

Here is the caller graph for this function:

static int ConstCurveLocal ( sConstrain c,
sCoord p,
void **  elm,
double *  g,
double *  l 
) [static]

Definition at line 1030 of file constcurve.c.

References _curveToLocal(), and NDof.

Referenced by ConstCurveInit().

Here is the call graph for this function:

Here is the caller graph for this function:

static void ConstCurveNew ( int  label,
int  num_nodes,
int  num_elems,
sConstrain **  c,
sConstrain **  clst 
) [static]

Definition at line 775 of file constcurve.c.

References ContNumConstrainRead, and CURVE.

Referenced by ConstCurveInit().

Here is the caller graph for this function:

static void ConstCurveRead ( sConstrain c  )  [static]

Definition at line 836 of file constcurve.c.

References sNode::coord, sNode::curve, DirNormalize(), sNode::dof, DSP_NO, sNode::dspIteration, sNode::dspTime, sConstrain::elems, ElmConnect, ElmNew, ElmRead, ElmSetConnect, ElmUpdateConnect, EvaluateTolerance(), FORCE, sNode::id, LINE2, nf, sConstrain::nodes, NONE, sConstrain::numElems, sConstrain::numNodes, sDof::psi, sNode::rezone, sDof::x, sCoord::x, sDof::y, sCoord::y, sDof::z, and sCoord::z.

Referenced by ConstCurveInit().

Here is the call graph for this function:

Here is the caller graph for this function:

static int ConstCurveSlide ( sConstrain c,
sCoord p,
void **  elm,
sCoord d,
double *  l,
double *  g,
sCoord pl 
) [static]

Definition at line 1076 of file constcurve.c.

References _curveSlide(), and NDof.

Referenced by ConstCurveInit().

Here is the call graph for this function:

Here is the caller graph for this function:

static void CrossProd ( sCoord in0,
sCoord in1,
sCoord out 
) [static]

Calcula o produto vetorial entre dois vetores.

Parameters:
in0 - vetor 1.
in1 - vetor 2.
out - retorna o produto vetorial entre o vetor 1 e o vetor 2.

Definition at line 184 of file constcurve.c.

References sCoord::x, sCoord::y, and sCoord::z.

Referenced by _checkPointInExtrem(), and CheckPoint().

Here is the caller graph for this function:

static void DiffVec ( sCoord in0,
sCoord in1,
sCoord out 
) [static]

Calcula a diferença entre dois vetores.

Parameters:
in0 - vetor 1.
in1 - vetor 2.
out - retorna a diferença entre o vetor 1 e o vetor 2 (in0 - in1).

Definition at line 157 of file constcurve.c.

References sCoord::x, sCoord::y, and sCoord::z.

Referenced by CheckPoint(), and Dist().

Here is the caller graph for this function:

static sCoord DirNormalize ( sCoord p1,
sCoord p2 
) [static]

Cálcula e retorna a direção normalizada de uma reta dado dois pontos. p1 é o ponto inicial da reta e p2 é o ponto final.

Definition at line 230 of file constcurve.c.

References VecNormalize(), sCoord::x, sCoord::y, and sCoord::z.

Referenced by _checkPointInExtrem(), and ConstCurveRead().

Here is the call graph for this function:

Here is the caller graph for this function:

static double Dist ( sCoord in0,
sCoord in1 
) [static]

Calcula a distancia entre dois pontos.

Definition at line 202 of file constcurve.c.

References DiffVec(), and VecLen().

Referenced by _curvePolySlide(), EvaluateTolerance(), and PolyInvSurf().

Here is the call graph for this function:

Here is the caller graph for this function:

static void EvaluateTolerance ( sConstrain c  )  [static]

Calcula a tolerância usada pelas funções de check geométrico deste pacote em função de cada curva lida.

Definition at line 583 of file constcurve.c.

References sNode::coord, Dist(), sConstrain::elems, ElmConnect, sConstrain::nodes, sConstrain::numElems, and Tolerance.

Referenced by ConstCurveRead(), ConstShotRead(), and ConstSurfaceRead().

Here is the call graph for this function:

Here is the caller graph for this function:

static int Invert3x3 ( double  a[3][3],
double  b[3][3] 
) [static]

Inverte uma matriz 3x3.

Parameters:
a - matriz a ser invertida.
b - matriz invertida.
Returns:
Retorna 1 se foi possível inverter a matriz ou 0 se não foi possível inverter (determinante nulo).

Definition at line 282 of file constcurve.c.

References ZERO.

Referenced by CheckPoint().

Here is the caller graph for this function:

static int LineBounds ( sCoord c,
sCoord pi,
sCoord pf 
) [static]

Verifica se um ponto (c) está dentro dos limites da bounding box definida por (pi,pf).

Parameters:
pi - ponto inicial da reta.
pf - ponto final da reta.
c - ponto a ser testado.
Returns:
Retorna 1 se o ponto estiver dentro dos limites, caso contrário retorna 0.

Definition at line 253 of file constcurve.c.

References MAX, MIN, sCoord::x, sCoord::y, sCoord::z, and ZERO.

Referenced by CheckPoint().

Here is the caller graph for this function:

static int PolyInvSurf ( sConstrain c,
sCoord p,
double *  dist 
) [static]

Dada uma curva (c) e um ponto qualquer (p) sobre ela, a funcao calcula e retorna o comprimento do primeiro ponto inicial da curva até o ponto p e a identificacao do segmento (id) onde encontra-se o ponto. Se o ponto p não estiver sobre a curva a função retornará -1 como identificacao do segmento.

Definition at line 431 of file constcurve.c.

References _checkPointInExtrem(), CheckPoint(), sNode::coord, Dist(), sConstrain::elems, ElmConnect, sConstrain::nodes, and sConstrain::numElems.

Referenced by _curveSlide().

Here is the call graph for this function:

Here is the caller graph for this function:

static double ProdEscalar ( sCoord in0,
sCoord in1 
) [static]

Calcula o produto escalar entre dois vetores.

Parameters:
in0 - vetor 1.
in1 - vetor 2. retorna valor do produto.

Definition at line 170 of file constcurve.c.

References sCoord::x, sCoord::y, and sCoord::z.

Referenced by _checkPointInExtrem().

Here is the caller graph for this function:

static double VecLen ( sCoord vec  )  [static]

Calcula o comprimento de um vetor.

Definition at line 194 of file constcurve.c.

References sCoord::x, sCoord::y, and sCoord::z.

Referenced by _checkPointInExtrem(), Dist(), and VecNormalize().

Here is the caller graph for this function:

static void VecNormalize ( sCoord vec,
sCoord n 
) [static]

Calcula a direcao normalizada do vetor vec e a retorna na forma de um vetor n.

Definition at line 215 of file constcurve.c.

References VecLen(), sCoord::x, sCoord::y, and sCoord::z.

Referenced by DirNormalize().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

double Tolerance = 1.0e+10 [static]

Definition at line 122 of file constcurve.c.

Referenced by ConstCurveInit(), ConstShotInit(), ConstSurfaceInit(), and EvaluateTolerance().


Generated on Tue Oct 23 11:23:39 2007 for Relax by  doxygen 1.5.3