当前位置: 首页>>代码示例>>C++>>正文


C++ ERR_CheckGo函数代码示例

本文整理汇总了C++中ERR_CheckGo函数的典型用法代码示例。如果您正苦于以下问题:C++ ERR_CheckGo函数的具体用法?C++ ERR_CheckGo怎么用?C++ ERR_CheckGo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ERR_CheckGo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: conn_alloc

int32 conn_alloc(MeshConnectivity *conn, uint32 num, uint32 n_incident)
{
  int32 ret = RET_OK;

  if ((conn->num > 0) && (conn->n_incident > 0)) {
    conn_free(conn);
  }

  if (num > 0) {
    conn->num = num;
    conn->offsets = alloc_mem(uint32, num + 1);
    ERR_CheckGo(ret);
  }

  if (n_incident > 0) {
    conn->n_incident = n_incident;
    conn->indices = alloc_mem(uint32, n_incident);
    ERR_CheckGo(ret);
  } else if (num == 0) { // Empty connectivity.
    conn->n_incident = n_incident;
    conn->indices = 0;
  }

 end_label:
  if (ERR_Chk) {
    conn_free(conn);
  }

  return(ret);
}
开发者ID:clazaro,项目名称:sfepy,代码行数:30,代码来源:mesh.c

示例2: mem_check_ptr

int32 mem_check_ptr(char *p, int lineNo, char *funName,
                    char *fileName, char *dirName)
{
  int32 ret = RET_OK;
  float64 *endptr;
  size_t hsize = sizeof(AllocSpaceAlign);
  AllocSpace *head = (AllocSpace *) (p - hsize);

  if (head->cookie != AL_CookieValue) {
    errput("%s, %s, %s, %d: ptr: %p, cookie: %d\n",
           dirName, fileName, funName, lineNo,
           p, head->cookie);
    if (head->cookie == AL_AlreadyFreed) {
      errput("memory was already freed!\n");
    }
    ERR_CheckGo(ret);
  }

  endptr = (float64 *) (p + head->size);
  if (endptr[0] != AL_CookieValue) {
    errput("%s %s %s %d:\n",
           dirName, fileName, funName, lineNo);
    if (endptr[0] == AL_AlreadyFreed) {
      errput("already freed!\n");
    } else {
      errput("damaged tail!\n");
    }
    ERR_CheckGo(ret);
  }

 end_label:
  return(ret);
}
开发者ID:AshitaPrasad,项目名称:sfepy,代码行数:33,代码来源:common_python.c

示例3: dw_mass_scalar

/*!
  @par Revision history:
  - 01.02.2008, c
*/
int32 dw_mass_scalar( FMField *out, FMField *coef,
		      FMField *state, FMField *bf, VolumeGeometry *vg,
		      int32 isDiff )
{
  int32 ii, dim, nQP, nEP, ret = RET_OK;
  FMField *ftfp = 0, *ftf = 0, *cftf = 0;

  nQP = vg->bfGM->nLev;
  nEP = vg->bfGM->nCol;
  dim = vg->bfGM->nRow;

  if (isDiff) {
    fmf_createAlloc( &ftf, 1, nQP, nEP, nEP );
    fmf_createAlloc( &cftf, 1, nQP, nEP, nEP );

    fmf_mulATB_nn( ftf, bf, bf );

    for (ii = 0; ii < out->nCell; ii++) {
      FMF_SetCell( out, ii );
      FMF_SetCell( vg->det, ii );
      if (coef->nCell > 1) {
	FMF_SetCell( coef, ii );
      }

      fmf_mulAF( cftf, ftf, coef->val );
      fmf_sumLevelsMulF( out, cftf, vg->det->val );

      ERR_CheckGo( ret );
    }
  } else {
    fmf_createAlloc( &ftfp, 1, nQP, nEP, 1 );

    for (ii = 0; ii < out->nCell; ii++) {
      FMF_SetCell( out, ii );
      FMF_SetCell( state, ii );
      FMF_SetCell( vg->det, ii );
      if (coef->nCell > 1) {
	FMF_SetCell( coef, ii );
      }

      bf_actt( ftfp, bf, state );
      fmf_mul( ftfp, coef->val );
      fmf_sumLevelsMulF( out, ftfp, vg->det->val );

      ERR_CheckGo( ret );
    }
  }

 end_label:
  if (isDiff) {
    fmf_freeDestroy( &ftf );
    fmf_freeDestroy( &cftf );
  } else {
    fmf_freeDestroy( &ftfp );
  }

  return( ret );
}
开发者ID:renatocoutinho,项目名称:sfepy,代码行数:62,代码来源:termsMass.c

示例4: dw_surf_mass_scalar

/*!
  @par Revision history:
  - 09.03.2009, c
*/
int32 dw_surf_mass_scalar( FMField *out, FMField *coef,
			   FMField *state, FMField *bf, SurfaceGeometry *sg,
			   int32 isDiff )
{
  int32 ii, nFP, ret = RET_OK;
  FMField *ftfp = 0, *ftf = 0, *cftf = 0;

  nFP = bf->nCol;

  if (isDiff) {
    fmf_createAlloc( &ftf, 1, sg->nQP, nFP, nFP );
    fmf_createAlloc( &cftf, 1, sg->nQP, nFP, nFP );

    fmf_mulATB_nn( ftf, bf, bf );

    for (ii = 0; ii < out->nCell; ii++) {
      FMF_SetCell( out, ii );
      FMF_SetCell( sg->det, ii );
      if (coef->nCell > 1) {
	FMF_SetCell( coef, ii );
      }

      fmf_mulAF( cftf, ftf, coef->val );
      fmf_sumLevelsMulF( out, cftf, sg->det->val );

      ERR_CheckGo( ret );
    }
  } else {
    fmf_createAlloc( &ftfp, 1, sg->nQP, nFP, 1 );

    for (ii = 0; ii < out->nCell; ii++) {
      FMF_SetCell( out, ii );
      FMF_SetCell( sg->det, ii );
      if (coef->nCell > 1) {
	FMF_SetCell( coef, ii );
      }
      FMF_SetCell( state, ii );

      bf_actt( ftfp, bf, state );
      fmf_mulAF( ftfp, ftfp, coef->val );
      fmf_sumLevelsMulF( out, ftfp, sg->det->val );

      ERR_CheckGo( ret );
    }
  }

end_label:
  if (isDiff) {
    fmf_freeDestroy( &ftf );
    fmf_freeDestroy( &cftf );
  } else {
    fmf_freeDestroy( &ftfp );
  }

  return( ret );
}
开发者ID:renatocoutinho,项目名称:sfepy,代码行数:60,代码来源:termsMass.c

示例5: mesh_transpose

int32 mesh_transpose(Mesh *mesh, int32 d1, int32 d2)
{
  int32 ret = RET_OK;
  uint32 n_incident;
  uint32 ii;
  uint32 *nd2 = 0;
  uint32 D = mesh->topology->max_dim;
  MeshEntityIterator it2[1], it1[1];
  MeshConnectivity *c12 = 0; // d1 -> d2 - to compute

  debprintf("transpose %d -> %d\n", d1, d2);

  if (d1 >= d2) {
    errput("d1 must be smaller than d2 in mesh_transpose()!\n");
    ERR_CheckGo(ret);
  }

  c12 = mesh->topology->conn[IJ(D, d1, d2)];

  // Count entities of d2 -> d1.
  conn_alloc(c12, mesh->topology->num[d1], 0);
  ERR_CheckGo(ret);
  nd2 = c12->offsets + 1;

  for (mei_init(it2, mesh, d2); mei_go(it2); mei_next(it2)) {
    for (mei_init_conn(it1, it2->entity, d1); mei_go(it1); mei_next(it1)) {
      nd2[it1->entity->ii]++;
    }
  }

  // c12->offsets now contains counts - make a cumsum to get offsets.
  for (ii = 1; ii < c12->num + 1; ii++) {
    c12->offsets[ii] += c12->offsets[ii-1];
  }

  n_incident = c12->offsets[c12->num];
  debprintf("transpose n_incident (%d -> %d): %d\n", d1, d2, n_incident);

  // Fill in the indices.
  conn_alloc(c12, 0, n_incident);
  ERR_CheckGo(ret);
  for (ii = 0; ii < c12->n_incident; ii++) {
    c12->indices[ii] = UINT32_None; // "not set" value.
  }

  for (mei_init(it2, mesh, d2); mei_go(it2); mei_next(it2)) {
    for (mei_init_conn(it1, it2->entity, d1); mei_go(it1); mei_next(it1)) {
      conn_set_to_free(c12, it1->entity->ii, it2->entity->ii);
      ERR_CheckGo(ret);
    }
  }

 end_label:
  return(ret);
}
开发者ID:clazaro,项目名称:sfepy,代码行数:55,代码来源:mesh.c

示例6: d_of_nsSurfMinDPress

/*!
  @par Revision history:
  - 23.03.2007, c
*/
int32 d_of_nsSurfMinDPress( FMField *out, FMField *pressure,
                            float64 weight, float64 bpress,
			    SurfaceGeometry *sg, int32 isDiff )
{
  int32 ii, iqp, nQP, ret = RET_OK;
  float64 aux;
  FMField *out1 = 0, *pressQP = 0;

  nQP = sg->det->nLev;

  if (isDiff == 0) {
    fmf_createAlloc( &out1, 1, 1, 1, 1 );

    fmf_createAlloc( &pressQP, 1, nQP, 1, 1 );

    aux = 0.0;
    for (ii = 0; ii < pressure->nCell; ii++) {
      FMF_SetCell( pressure, ii );
      FMF_SetCell( sg->det, ii );

      for (iqp = 0; iqp < nQP; iqp++) {
	pressQP->val[iqp] -= pressure->val[iqp] - bpress;
      }
      fmf_sumLevelsMulF( out1, pressQP, sg->det->val );
      aux += out1->val[0];

      ERR_CheckGo( ret );
    }
    out->val[0] = aux * weight;
  } else {
    for (ii = 0; ii < out->nCell; ii++) {
      FMF_SetCell( out, ii );
      FMF_SetCell( sg->det, ii );
      FMF_SetCellX1( sg->bf, ii );
      fmf_sumLevelsTMulF( out, sg->bf, sg->det->val );

      ERR_CheckGo( ret );
    }
    fmfc_mulC( out, weight );
  }

 end_label:
  if (isDiff == 0) {
    fmf_freeDestroy( &out1 );
    fmf_freeDestroy( &pressQP );
  }

  return( ret );
}
开发者ID:mikegraham,项目名称:sfepy,代码行数:53,代码来源:termsAdjointNavierStokes.c

示例7: d_of_nsMinGrad

/*!
  @par Revision history:
  - 23.01.2006, c
  - 02.03.2006
  - 27.07.2006
*/
int32 d_of_nsMinGrad( FMField *out, FMField *grad,
		      FMField *viscosity, VolumeGeometry *vg )
{
  int32 ii, nQP, ret = RET_OK;
  float64 aux;
  FMField *out1 = 0, *gvel2 = 0;

  nQP = vg->bfGM->nLev;

  fmf_createAlloc( &out1, 1, 1, 1, 1 );
  fmf_createAlloc( &gvel2, 1, nQP, 1, 1 );

  FMF_SetFirst( out );
  aux = 0.0;
  for (ii = 0; ii < grad->nCell; ii++) {
    FMF_SetCell( grad, ii );
    FMF_SetCell( viscosity, ii );
    FMF_SetCell( vg->det, ii );

    fmf_mulATB_nn( gvel2, grad, grad );
    fmf_mul( gvel2, viscosity->val );
    fmf_sumLevelsMulF( out1, gvel2, vg->det->val );
    aux += out1->val[0];

    ERR_CheckGo( ret );
  }

  out->val[0] = aux * 0.5;

 end_label:
  fmf_freeDestroy( &out1 );
  fmf_freeDestroy( &gvel2 );

  return( ret );
}
开发者ID:mikegraham,项目名称:sfepy,代码行数:41,代码来源:termsAdjointNavierStokes.c

示例8: de_cauchy_stress

/*!
  @par Revision history:
  - c: 25.03.2008
*/
int32 de_cauchy_stress( FMField *out, FMField *strain,
			FMField *mtxD,  VolumeGeometry *vg,
			int32 mode )
{
  int32 ii, dim, sym, nQP, ret = RET_OK;
  FMField *stress = 0;

  nQP = vg->bfGM->nLev;
  dim = vg->bfGM->nRow;
  sym = (dim + 1) * dim / 2;

  fmf_createAlloc( &stress, 1, nQP, sym, 1 );

  for (ii = 0; ii < out->nCell; ii++) {
    FMF_SetCell( out, ii );
    FMF_SetCell( mtxD, ii );
    FMF_SetCell( strain, ii );
    FMF_SetCell( vg->det, ii );

    fmf_mulAB_nn( stress, mtxD, strain );
    fmf_sumLevelsMulF( out, stress, vg->det->val );
    if (mode == 1) {
      FMF_SetCell( vg->volume, ii );
      fmf_mulC( out, 1.0 / vg->volume->val[0] );
    }
    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &stress );

  return( ret );
}
开发者ID:taldcroft,项目名称:sfepy,代码行数:37,代码来源:termsLinElasticity.c

示例9: de_cauchy_strain

/*!
  @par Revision history:
  - 21.09.2006, c
*/
int32 de_cauchy_strain( FMField *out, FMField *strain,
			VolumeGeometry *vg, int32 mode )
{
  int32 ii, dim, sym, nQP, ret = RET_OK;

  nQP = vg->bfGM->nLev;
  dim = vg->bfGM->nRow;
  sym = (dim + 1) * dim / 2;

  for (ii = 0; ii < out->nCell; ii++) {
    FMF_SetCell( out, ii );
    FMF_SetCell( strain, ii );
    FMF_SetCell( vg->det, ii );

    fmf_sumLevelsMulF( out, strain, vg->det->val );
    if (mode == 1) {
      FMF_SetCell( vg->volume, ii );
      fmf_mulC( out, 1.0 / vg->volume->val[0] );
    }
    ERR_CheckGo( ret );
  }

 end_label:
  return( ret );
}
开发者ID:taldcroft,项目名称:sfepy,代码行数:29,代码来源:termsLinElasticity.c

示例10: dw_lin_prestress

int32 dw_lin_prestress( FMField *out, FMField *stress, VolumeGeometry *vg,
			int32 *elList, int32 elList_nRow, int32 isDiff )
{
  int32 ii, iel, dim, nQP, nEP, ret = RET_OK;
  FMField *res = 0;

  nQP = vg->bfGM->nLev;
  nEP = vg->bfGM->nCol;
  dim = vg->bfGM->nRow;

  fmf_createAlloc( &res, 1, nQP, dim * nEP, 1 );

    for (ii = 0; ii < elList_nRow; ii++) {
      iel = elList[ii];

      FMF_SetCell( out, ii );
      FMF_SetCell( vg->bfGM, iel );
      FMF_SetCell( vg->det, iel );
      FMF_SetCell( stress, iel );

      form_sdcc_actOpGT_VS3( res, vg->bfGM, stress );
      fmf_sumLevelsMulF( out, res, vg->det->val );
      ERR_CheckGo( ret );
    }

 end_label:
    fmf_freeDestroy( &res ); 

  return( ret );
}
开发者ID:taldcroft,项目名称:sfepy,代码行数:30,代码来源:termsLinElasticity.c

示例11: d_surf_lcouple

int32 d_surf_lcouple( FMField *out, FMField *stateP, FMField *gradQ, FMField *coef,
                      Mapping *sg )
{
    int32 ii, dim, nQP, ret = RET_OK;
    FMField *aux1 = 0, *aux2 = 0;

    nQP = stateP->nLev;
    dim = coef->nRow;

    fmf_createAlloc(&aux1, 1, nQP, dim, 1);
    fmf_createAlloc(&aux2, 1, nQP, 1, 1);

    for (ii = 0; ii < out->nCell; ii++) {
        if (coef->nCell > 1)
            FMF_SetCell( coef, ii );

        FMF_SetCell( out, ii );
        FMF_SetCell( sg->det, ii );
        FMF_SetCell(stateP, ii);
        FMF_SetCell(gradQ, ii);

        fmf_mulAB_nn(aux1, coef, stateP);
        fmf_mulATB_nn(aux2, gradQ, aux1);
        fmf_sumLevelsMulF(out, aux2, sg->det->val);

        ERR_CheckGo( ret );
    }

end_label:
    fmf_freeDestroy(&aux1);
    fmf_freeDestroy(&aux2);

    return( ret );
}
开发者ID:adesam01,项目名称:sfepy,代码行数:34,代码来源:terms_acoustic.c

示例12: dw_lin_strain_fib

int32 dw_lin_strain_fib( FMField *out, FMField *mtxD, FMField *mat,
			 Mapping *vg )
{
  int32 ii, dim, sym, nQP, nEP, ret = RET_OK;
  FMField *aux1 = 0, *aux2 = 0;

  nQP = vg->bfGM->nLev;
  nEP = vg->bfGM->nCol;
  dim = vg->bfGM->nRow;
  sym = (dim + 1) * dim / 2;

  fmf_createAlloc( &aux1, 1, nQP, nEP * dim, sym );
  fmf_createAlloc( &aux2, 1, nQP, nEP * dim, 1 );

  for (ii = 0; ii < out->nCell; ii++) {
    FMF_SetCell( out, ii );
    FMF_SetCell( mtxD, ii );
    FMF_SetCell( mat, ii );
    FMF_SetCell( vg->bfGM, ii );
    FMF_SetCell( vg->det, ii );

    form_sdcc_actOpGT_M3( aux1, vg->bfGM, mtxD );
    fmf_mulAB_nn( aux2, aux1, mat );
    fmf_sumLevelsMulF( out, aux2, vg->det->val );
    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &aux1 );
  fmf_freeDestroy( &aux2 );

  return( ret );
}
开发者ID:LeiDai,项目名称:sfepy,代码行数:33,代码来源:terms_elastic.c

示例13: dw_lin_prestress

int32 dw_lin_prestress( FMField *out, FMField *stress, Mapping *vg )
{
  int32 ii, dim, nQP, nEP, ret = RET_OK;
  FMField *res = 0;

  nQP = vg->bfGM->nLev;
  nEP = vg->bfGM->nCol;
  dim = vg->bfGM->nRow;

  fmf_createAlloc( &res, 1, nQP, dim * nEP, 1 );

    for (ii = 0; ii < out->nCell; ii++) {
      FMF_SetCell( out, ii );
      FMF_SetCell( vg->bfGM, ii );
      FMF_SetCell( vg->det, ii );
      FMF_SetCell( stress, ii );

      form_sdcc_actOpGT_VS3( res, vg->bfGM, stress );
      fmf_sumLevelsMulF( out, res, vg->det->val );
      ERR_CheckGo( ret );
    }

 end_label:
    fmf_freeDestroy( &res );

  return( ret );
}
开发者ID:LeiDai,项目名称:sfepy,代码行数:27,代码来源:terms_elastic.c

示例14: d_sd_volume_dot

/*!
  mode == 0: \int pq
  mode == 1: \int pq div V

  Works for both scalars and vectors.

  @par Revision history:
  - 24.02.2006, c
  - 27.02.2006
*/
int32 d_sd_volume_dot( FMField *out, FMField *stateP, FMField *stateQ,
                       FMField *divMV, VolumeGeometry *vg, int32 mode )
{
  int32 ii, nQP, ret = RET_OK;
  FMField *pq = 0;

  nQP = vg->bfGM->nLev;

  fmf_createAlloc( &pq, 1, nQP, 1, 1 );

  for (ii = 0; ii < out->nCell; ii++) {
    FMF_SetCell( out, ii );
    FMF_SetCell( stateP, ii );
    FMF_SetCell( stateQ, ii );
    FMF_SetCell( vg->det, ii );

    fmf_mulATB_nn( pq, stateP, stateQ );

    if (mode == 1) {
      FMF_SetCell( divMV, ii );

      fmf_mul( pq, divMV->val );
    }
    fmf_sumLevelsMulF( out, pq, vg->det->val );

    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &pq );

  return( ret );
}
开发者ID:mikegraham,项目名称:sfepy,代码行数:43,代码来源:termsAdjointNavierStokes.c

示例15: d_sd_convect

/*!
  @par Revision history:
  - 22.03.2006, c
*/
int32 d_sd_convect( FMField *out, FMField *stateU, FMField *gradU,
		    FMField *stateW, FMField *divMV, FMField *gradMV,
		    VolumeGeometry *vg_u, int32 mode )
{
  int32 ii, dim, nQP, ret = RET_OK;
  FMField *aux11 = 0, *aux = 0, *fwgu = 0, *fwgugmv = 0;
  FMField gum[1], gmvm[1];

  nQP = vg_u->bfGM->nLev;
  dim = vg_u->bfGM->nRow;

  gum->nAlloc = -1;
  fmf_pretend( gum, gradU->nCell, nQP, dim, dim, gradU->val0 );

  fmf_createAlloc( &fwgu, 1, nQP, 1, dim );
  fmf_createAlloc( &aux11, 1, nQP, 1, 1 );

  if (mode == 1) {
    gmvm->nAlloc = -1;
    fmf_pretend( gmvm, gradMV->nCell, nQP, dim, dim, gradMV->val0 );

    fmf_createAlloc( &fwgugmv, 1, nQP, 1, dim );
    fmf_createAlloc( &aux, 1, nQP, 1, 1 );
  }

  for (ii = 0; ii < out->nCell; ii++) {
    FMF_SetCell( out, ii );
    FMF_SetCell( stateU, ii );
    FMF_SetCell( stateW, ii );
    FMF_SetCell( gum, ii );
    FMF_SetCell( vg_u->det, ii );

    fmf_mulATB_nn( fwgu, stateW, gum );
    fmf_mulAB_nn( aux11, fwgu, stateU );

    if (mode == 1) {
      FMF_SetCell( divMV, ii );
      FMF_SetCell( gmvm, ii );

      fmf_mul( aux11, divMV->val );

      fmf_mulAB_nn( fwgugmv, fwgu, gmvm );
      fmf_mulAB_nn( aux, fwgugmv, stateU );
      fmf_subAB_nn( aux11, aux11, aux );
    }
    fmf_sumLevelsMulF( out, aux11, vg_u->det->val );

    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &aux11 );
  fmf_freeDestroy( &fwgu );
  if (mode == 1) {
    fmf_freeDestroy( &fwgugmv );
    fmf_freeDestroy( &aux );
  }

  return( ret );
}
开发者ID:mikegraham,项目名称:sfepy,代码行数:64,代码来源:termsAdjointNavierStokes.c


注:本文中的ERR_CheckGo函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。