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


C++ FMF_SetCell函数代码示例

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


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

示例1: d_piezo_coupling

int32 d_piezo_coupling( FMField *out, FMField *strain, FMField *charge_grad,
			FMField *mtxG, VolumeGeometry *vg )
{
  int32 ii, dim, nQP, ret = RET_OK;
  FMField *ge = 0, *gptge = 0;

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

  fmf_createAlloc( &ge, 1, nQP, dim, 1 );
  fmf_createAlloc( &gptge, 1, nQP, 1, 1 );

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

    fmf_mulAB_nn( ge, mtxG, strain );
    fmf_mulATB_nn( gptge, charge_grad, ge );
    fmf_sumLevelsMulF( out, gptge, vg->det->val );
    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &ge );
  fmf_freeDestroy( &gptge );

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

示例2: dw_permeability_r

/*!
  @par Revision history:
  - c: 23.04.2007, r: 23.01.2008
*/
int32 dw_permeability_r( FMField *out, FMField *mtxD, VolumeGeometry *vg,
			 int32 *conn, int32 nEl, int32 nEP,
			 int32 *elList, int32 elList_nRow )
{
  int32 ii, iel, nQP, ret = RET_OK;
  FMField *gtd = 0;

  nQP = vg->bfGM->nLev;

  fmf_createAlloc( &gtd, 1, nQP, 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 );
    if (mtxD->nCell > 1) {
      FMF_SetCell( mtxD, ii );
    }

    fmf_mulATB_nn( gtd, vg->bfGM, mtxD );
    fmf_sumLevelsMulF( out, gtd, vg->det->val );
    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &gtd ); 

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

示例3: sg_print

/*!
  @par Revision history:
  - c: 21.12.2005, r: 18.01.2008
*/
int32 sg_print( SurfaceGeometry *obj, FILE *file, int32 mode )
{
  int32 ii;

  fprintf( file, "SurfaceGeometry: mode %d, nFa %d, nQP %d, dim: %d, nFP: %d\n",
	   obj->mode, obj->nFa, obj->nQP, obj->dim, obj->nFP );
  fprintf( file, "totalArea: %.5f\n", obj->totalArea );

  for (ii = 0; ii < obj->det->nCell; ii++) {
    FMF_SetCell( obj->normal, ii );
    FMF_SetCell( obj->det, ii );
    FMF_SetCell( obj->area, ii );
    
    fprintf( file, "%d normal:\n", ii );
    fmf_print( obj->normal, file, mode );
    
    fprintf( file, "%d det:\n", ii );
    fmf_print( obj->det, file, mode );
    
    fprintf( file, "%d area:\n", ii );
    fmf_print( obj->area, file, mode );

    if (obj->bfBGM) {
      FMF_SetCell( obj->bfBGM, ii );
      fprintf( file, "%d bfBGM:\n", ii );
      fmf_print( obj->bfBGM, file, mode );
    }

  }

  return( RET_OK );
}
开发者ID:olivierverdier,项目名称:sfepy,代码行数:36,代码来源:geometry.c

示例4: 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

示例5: dw_hdpm_cache

/*!
  @par Revision history:
  - 30.07.2007, from dw_hdpm_cache()
*/
int32 dq_cauchy_strain( FMField *out, FMField *state, int32 offset,
			VolumeGeometry *vg,
			int32 *conn, int32 nEl, int32 nEP )
{
  int32 ii, dim, sym, nQP, ret = RET_OK;
  FMField *st = 0, *disG = 0;

  state->val = FMF_PtrFirst( state ) + offset;

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

  sym = (dim + 1) * dim / 2;
  fmf_createAlloc( &st, 1, 1, nEP, dim );
  fmf_createAlloc( &disG, 1, nQP, dim, dim );

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

    ele_extractNodalValuesNBN( st, state, conn + nEP * ii );
    fmf_mulAB_n1( disG, vg->bfGM, st );
    form_sdcc_strainCauchy_VS( out, disG );
/*       fmf_print( out, stdout, 0 ); */
/*       sys_pause(); */
    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &st ); 
  fmf_freeDestroy( &disG ); 

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

示例6: vg_print

/*!
  @par Revision history:
  - 11.10.2005, c
  - 12.10.2005
  - 12.10.2006
*/
int32 vg_print( VolumeGeometry *obj, FILE *file, int32 mode )
{
  int32 ii;

  fprintf( file, "VolumeGeometry: mode %d, nEl %d, nQP %d, dim: %d, nEP: %d\n",
	   obj->mode, obj->nEl, obj->nQP, obj->dim, obj->nEP );
  fprintf( file, "totalVolume: %.5f\n", obj->totalVolume );

  for (ii = 0; ii < obj->det->nCell; ii++) {
    FMF_SetCell( obj->bfGM, ii );
    FMF_SetCell( obj->det, ii );
    FMF_SetCell( obj->volume, ii );
    
    fprintf( file, "%d bfGM:\n", ii );
    fmf_print( obj->bfGM, file, mode );
    
    fprintf( file, "%d det:\n", ii );
    fmf_print( obj->det, file, mode );
    
    fprintf( file, "%d volume:\n", ii );
    fmf_print( obj->volume, file, mode );
  }


  return( RET_OK );
}
开发者ID:olivierverdier,项目名称:sfepy,代码行数:32,代码来源:geometry.c

示例7: 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

示例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: d_mass_scalar

/*!
  @par Revision history:
  - 04.09.2007, c
*/
int32 d_mass_scalar( FMField *out, FMField *coef,
		     FMField *stateP, FMField *stateQ,
		     FMField *bf, VolumeGeometry *vg )
{
  int32 ii, dim, nQP, ret = RET_OK;
  FMField *qftfp = 0;

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

  fmf_createAlloc( &qftfp, 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 );
    if (coef->nCell > 1) {
      FMF_SetCell( coef, ii );
    }
    fmf_mulATB_nn( qftfp, stateQ, stateP );
    fmf_mul( qftfp, coef->val );

    fmf_sumLevelsMulF( out, qftfp, vg->det->val );

    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &qftfp );

  return( ret );
}
开发者ID:renatocoutinho,项目名称:sfepy,代码行数:37,代码来源:termsMass.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: 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

示例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: d_diffusion

/*!
  @par Revision history:
  - c: 12.03.2007, r: 23.01.2008
*/
int32 d_diffusion( FMField *out, FMField *gradP1, FMField *gradP2,
		   FMField *mtxD, Mapping *vg )
{
  int32 ii, dim, nQP, ret = RET_OK;
  FMField *dgp2 = 0, *gp1tdgp2 = 0;

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

  fmf_createAlloc( &dgp2, 1, nQP, dim, 1 );
  fmf_createAlloc( &gp1tdgp2, 1, nQP, 1, 1 );

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

    fmf_mulAB_nn( dgp2, mtxD, gradP2 );
    fmf_mulATB_nn( gp1tdgp2, gradP1, dgp2 );
    fmf_sumLevelsMulF( out, gp1tdgp2, vg->det->val );

    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &dgp2 );
  fmf_freeDestroy( &gp1tdgp2 );

  return( ret );
}
开发者ID:snilek,项目名称:sfepy,代码行数:38,代码来源:terms_diffusion.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: dw_diffusion_r

/*!
  @par Revision history:
  - c: 23.04.2007, r: 23.01.2008
*/
int32 dw_diffusion_r( FMField *out, FMField *mtxD, Mapping *vg )
{
  int32 ii, nQP, nEP, ret = RET_OK;
  FMField *gtd = 0;

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

  fmf_createAlloc( &gtd, 1, nQP, nEP, 1 );

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

    fmf_mulATB_nn( gtd, vg->bfGM, mtxD );
    fmf_sumLevelsMulF( out, gtd, vg->det->val );
    ERR_CheckGo( ret );
  }

 end_label:
  fmf_freeDestroy( &gtd );

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


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