本文整理汇总了C++中FMF_SetCell函数的典型用法代码示例。如果您正苦于以下问题:C++ FMF_SetCell函数的具体用法?C++ FMF_SetCell怎么用?C++ FMF_SetCell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FMF_SetCell函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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( >d, 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( >d );
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( >d, 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( >d );
return( ret );
}
开发者ID:snilek,项目名称:sfepy,代码行数:32,代码来源:terms_diffusion.c
示例16: 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
示例17: d_biot_div
/*!
@par Revision history:
- c: 05.03.2008, r: 05.03.2008
*/
int32 d_biot_div( FMField *out, float64 coef, FMField *state, FMField *strain,
FMField *mtxD, Mapping *vg )
{
int32 ii, nQP, ret = RET_OK;
FMField *dtgu = 0, *pftdtgu = 0;
nQP = vg->bfGM->nLev;
/* fmf_print( mtxD, stdout, 0 ); */
fmf_createAlloc( &dtgu, 1, nQP, 1, 1 );
fmf_createAlloc( &pftdtgu, 1, nQP, 1, 1 );
for (ii = 0; ii < out->nCell; ii++) {
FMF_SetCell( out, ii );
FMF_SetCell( mtxD, ii );
FMF_SetCell( vg->det, ii );
FMF_SetCell( state, ii );
FMF_SetCell( strain, ii );
fmf_mulATB_nn( dtgu, mtxD, strain );
fmf_mulATB_nn( pftdtgu, state, dtgu );
fmf_sumLevelsMulF( out, pftdtgu, vg->det->val );
ERR_CheckGo( ret );
}
// E.g. 1/dt.
fmfc_mulC( out, coef );
end_label:
fmf_freeDestroy( &dtgu );
fmf_freeDestroy( &pftdtgu );
return( ret );
}
开发者ID:AshitaPrasad,项目名称:sfepy,代码行数:39,代码来源:termsBiot.c
示例18: dw_biot_grad
/*!
@par Revision history:
- 03.08.2006, c
- 01.12.2006
*/
int32 dw_biot_grad( FMField *out, float64 coef, FMField *pressure_qp,
FMField *mtxD, Mapping *svg, Mapping *vvg,
int32 isDiff )
{
int32 ii, nEPU, nEP, dim, nQP, ret = RET_OK;
FMField *dfp = 0, *gtdfp = 0, *gtd = 0, *gtdf = 0;
nQP = vvg->bfGM->nLev;
dim = vvg->bfGM->nRow;
nEPU = vvg->bfGM->nCol;
nEP = svg->bf->nCol;
/* fmf_print( mtxD, stdout, 0 ); */
if (isDiff == 1) {
fmf_createAlloc( >d, 1, nQP, dim * nEPU, 1 );
fmf_createAlloc( >df, 1, nQP, dim * nEPU, nEP );
} else {
int32 sym = (dim + 1) * dim / 2;
fmf_createAlloc( &dfp, 1, nQP, sym, 1 );
fmf_createAlloc( >dfp, 1, nQP, dim * nEPU, 1 );
}
for (ii = 0; ii < out->nCell; ii++) {
FMF_SetCell( out, ii );
FMF_SetCell( mtxD, ii );
FMF_SetCell( vvg->bfGM, ii );
FMF_SetCell( vvg->det, ii );
if (isDiff == 1) {
FMF_SetCellX1( svg->bf, ii );
form_sdcc_actOpGT_M3( gtd, vvg->bfGM, mtxD );
fmf_mulAB_nn( gtdf, gtd, svg->bf );
fmf_sumLevelsMulF( out, gtdf, vvg->det->val );
} else {
FMF_SetCell( pressure_qp, ii );
fmf_mulAB_nn( dfp, mtxD, pressure_qp );
form_sdcc_actOpGT_VS3( gtdfp, vvg->bfGM, dfp );
fmf_sumLevelsMulF( out, gtdfp, vvg->det->val );
}
ERR_CheckGo( ret );
}
// E.g. 1/dt.
fmfc_mulC( out, coef );
end_label:
if (isDiff) {
fmf_freeDestroy( >d );
fmf_freeDestroy( >df );
} else {
fmf_freeDestroy( &dfp );
fmf_freeDestroy( >dfp );
}
return( ret );
}
开发者ID:AshitaPrasad,项目名称:sfepy,代码行数:62,代码来源:termsBiot.c
示例19: d_sd_st_grad_div
/*!
@par Revision history:
- 24.10.2007, c
*/
int32 d_sd_st_grad_div( FMField *out, FMField *divU, FMField *gradU,
FMField *divW, FMField *gradW, FMField *divMV,
FMField *gradMV, FMField *coef,
VolumeGeometry *vg_u, int32 mode )
{
int32 ii, nQP, ret = RET_OK;
FMField *scalar1 = 0, *scalar2 = 0;
nQP = vg_u->bfGM->nLev;
fmf_createAlloc( &scalar1, 1, nQP, 1, 1 );
if (mode == 1) {
fmf_createAlloc( &scalar2, 1, nQP, 1, 1 );
}
for (ii = 0; ii < out->nCell; ii++) {
FMF_SetCell( out, ii );
FMF_SetCell( coef, ii );
FMF_SetCell( divU, ii );
FMF_SetCell( divW, ii );
FMF_SetCell( vg_u->det, ii );
if (mode == 0) {
// (div u, div w)
fmf_mulATB_nn( scalar1, divU, divW );
fmf_mul( scalar1, coef->val );
fmf_sumLevelsMulF( out, scalar1, vg_u->det->val );
} else if (mode == 1) {
FMF_SetCell( divMV, ii );
FMF_SetCell( gradU, ii );
FMF_SetCell( gradW, ii );
FMF_SetCell( gradMV, ii );
// div u div w div nu ...
fmf_mulATB_nn( scalar1, divU, divW );
fmf_mulATB_nn( scalar2, divMV, scalar1 );
// ... - (gu : gnu^T) div w ...
sub_mul_gradddgrad_scalar( scalar2, gradMV, gradU, divW );
// ... - (gw : gnu^T) div u
sub_mul_gradddgrad_scalar( scalar2, gradMV, gradW, divU );
fmf_mul( scalar2, coef->val );
fmf_sumLevelsMulF( out, scalar2, vg_u->det->val );
}
ERR_CheckGo( ret );
}
end_label:
fmf_freeDestroy( &scalar1 );
if (mode == 1) {
fmf_freeDestroy( &scalar2 );
}
return( ret );
}
开发者ID:mikegraham,项目名称:sfepy,代码行数:63,代码来源:termsAdjointNavierStokes.c
示例20: vg_getElementDiameters
/*!
@par Revision history:
- 09.01.2006, c
- 10.01.2006
*/
int32 vg_getElementDiameters( VolumeGeometry *obj, FMField *out,
int32 *edges, int32 edges_nRow, int32 edges_nCol,
float64 *coorIn, int32 nNod, int32 dim,
int32 *conn, int32 nEl, int32 nEP,
int32 *elList, int32 elList_nRow,
int32 mode )
{
int32 ii, ie, id, iel, nd;
float64 val0 = 0.0, val1 = 0.0, vv, aux = 0.0, exponent;
if ((mode < 0) && (mode > 2)) {
errput( ErrHead "ERR_Switch\n" );
return( RET_Fail );
}
/* output( "%d %d %d %d %d %d %d\n", */
/* edges_nRow, edges_nCol, nNod, dim, nEl, nEP, elList_nRow ); */
nd = obj->bfGM->nRow; // Can be <> dim.
exponent = 1.0 / ((float64) dim);
for (ii = 0; ii < elList_nRow; ii++) {
iel = elList[ii];
FMF_SetCell( out, ii );
if ((mode == 0) || (mode == 2)) {
val0 = 0.0;
for (ie = 0; ie < edges_nRow; ie++) {
vv = 0.0;
for (id = 0; id < nd; id++) {
aux = coorIn[dim*conn[nEP*iel+edges[2*ie+1]]+id]
- coorIn[dim*conn[nEP*iel+edges[2*ie+0]]+id];
/* output( "%d %d %d %d %f %f %f\n", ii, iel, ie, id, aux, */
/* coorIn[dim*conn[nEP*iel+edges[2*ie+1]]+id], */
/* coorIn[dim*conn[nEP*iel+edges[2*ie+0]]+id] ); */
/* sys_pause(); */
vv += aux * aux;
}
/* output("%f\n", sqrt(vv)); */
val0 = Max( val0, vv );
out->val[0] = val0;
}
}
if ((mode == 1) || (mode == 2)) {
FMF_SetCell( obj->volume, iel );
val1 = pow( 0.16 * obj->volume->val[0], exponent );
out->val[0] = val1;
}
if (mode == 2) {
out->val[0] = Max( val0, val1 );
}
}
return( RET_OK );
}
开发者ID:olivierverdier,项目名称:sfepy,代码行数:58,代码来源:geometry.c
注:本文中的FMF_SetCell函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论