Exemple #1
0
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 );
}
Exemple #2
0
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 );
}
Exemple #3
0
/*!
  @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( &gtd, 1, nQP, dim * nEPU, 1 );
    fmf_createAlloc( &gtdf, 1, nQP, dim * nEPU, nEP );
  } else {
    int32 sym = (dim + 1) * dim / 2;
    fmf_createAlloc( &dfp, 1, nQP, sym, 1 );
    fmf_createAlloc( &gtdfp, 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( &gtd );
    fmf_freeDestroy( &gtdf );
  } else {
    fmf_freeDestroy( &dfp );
    fmf_freeDestroy( &gtdfp );
  }

  return( ret );
}
Exemple #4
0
int32 dw_piezo_coupling( FMField *out, FMField *strain, FMField *charge_grad,
			 FMField *mtxG, VolumeGeometry *vg,
			 int32 mode )
{
  int32 ii, nEPU, nEPP, dim, sym, nQP, ret = RET_OK;
  FMField *gtgp = 0, *gtgtgp = 0, *ge = 0, *gctge = 0, *gg = 0, *gctgg = 0;

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

  if ((mode == 0) || (mode == 1)) {
    nEPP = out->nCol;
  } else {
    nEPP = out->nRow;
  }

  if (mode == 0) { 
    fmf_createAlloc( &gtgp, 1, nQP, sym, 1 );
    fmf_createAlloc( &gtgtgp, 1, nQP, dim * nEPU, 1 );
  } else if (mode == 2) {
    fmf_createAlloc( &ge, 1, nQP, dim, 1 );
    fmf_createAlloc( &gctge, 1, nQP, nEPP, 1 );
  } else {
    fmf_createAlloc( &gg, 1, nQP, dim, dim * nEPU );
    fmf_createAlloc( &gctgg, 1, nQP, nEPP, dim * nEPU );
  }

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

    if (mode == 0) { // vector - grad
      FMF_SetCell( charge_grad, ii );

      fmf_mulATB_nn( gtgp, mtxG, charge_grad );
      form_sdcc_actOpGT_VS3( gtgtgp, vg->bfGM, gtgp );
      fmf_sumLevelsMulF( out, gtgtgp, vg->det->val );

    } else if (mode == 2) { // vector - div
      FMF_SetCell( strain, ii );

      fmf_mulAB_nn( ge, mtxG, strain );
      fmf_mulATB_nn( gctge, vg->bfGM, ge );
      fmf_sumLevelsMulF( out, gctge, vg->det->val );

    } else { // matrix - div, grad
      form_sdcc_actOpG_RM3( gg, mtxG, vg->bfGM );
      fmf_mulATB_nn( gctgg, vg->bfGM, gg );
      if (mode == 1) { // matrix - grad
	fmf_sumLevelsTMulF( out, gctgg, vg->det->val );
      } else { // matrix - div
	fmf_sumLevelsMulF( out, gctgg, vg->det->val );
      }
    }
    ERR_CheckGo( ret );
  }

 end_label:
  if (mode == 0) {
    fmf_freeDestroy( &gtgp );
    fmf_freeDestroy( &gtgtgp );
  } else if (mode == 2) {
    fmf_freeDestroy( &ge );
    fmf_freeDestroy( &gctge );
  } else {
    fmf_freeDestroy( &gg );
    fmf_freeDestroy( &gctgg );
  }

  return( ret );
}
Exemple #5
0
/*!
  @par Revision history:
  - 03.08.2006, c
  - 29.11.2006
*/
int32 dw_lin_elastic( FMField *out, float64 coef, FMField *strain,
		      FMField *mtxD, VolumeGeometry *vg,
		      int32 isDiff )
{
  int32 ii, dim, sym, nQP, nEP, ret = RET_OK;
  FMField *stress = 0;
  FMField *res = 0, *gtd = 0, *gtdg = 0;

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

/*       fmf_print( mtxD, stdout, 0 ); */
/*   output( "%d %d %d %d %d %d\n", offset, nEl, nEP, nQP, dim, elList_nRow ); */
  if (isDiff) {
    fmf_createAlloc( &gtd, 1, nQP, nEP * dim, sym );
    fmf_createAlloc( &gtdg, 1, nQP, nEP * dim, nEP * dim );

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

      form_sdcc_actOpGT_M3( gtd, vg->bfGM, mtxD );
      form_sdcc_actOpG_RM3( gtdg, gtd, vg->bfGM );
      fmf_sumLevelsMulF( out, gtdg, vg->det->val );

      ERR_CheckGo( ret );
    }
  } else {
    fmf_createAlloc( &stress, 1, nQP, sym, 1 );
    fmf_createAlloc( &res, 1, nQP, dim * nEP, 1 );

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

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

  // E.g. 1/dt.
  fmfc_mulC( out, coef );

 end_label:
  if (isDiff) {
    fmf_freeDestroy( &gtd );
    fmf_freeDestroy( &gtdg );
  } else {
    fmf_freeDestroy( &res ); 
    fmf_freeDestroy( &stress ); 
  }

  return( ret );
}
Exemple #6
0
/*!
  @par Revision history:
  - 07.03.2006, c
*/
int32 dw_lin_elastic_iso( FMField *out, FMField *strain,
			  FMField *lam, FMField *mu, VolumeGeometry *vg,
			  int32 isDiff )
{
  int32 ii, dim, sym, nQP, nEP, ret = RET_OK;
  FMField *stress = 0;
  FMField *res = 0, *d11 = 0, *gtd11 = 0, *gtd11g = 0;

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

  if (isDiff) {
    fmf_createAlloc( &d11, 1, nQP, sym, sym );
    fmf_createAlloc( &gtd11, 1, nQP, nEP * dim, sym );
    fmf_createAlloc( &gtd11g, 1, nQP, nEP * dim, nEP * dim );

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

      mat_le_tanModuli11( d11, lam, mu, 0 );
/*       fmf_print( d11, stdout, 0 ); */
/*       sys_pause(); */

      form_sdcc_actOpGT_M3( gtd11, vg->bfGM, d11 );
      form_sdcc_actOpG_RM3( gtd11g, gtd11, vg->bfGM );
      fmf_sumLevelsMulF( out, gtd11g, vg->det->val );

      ERR_CheckGo( ret );
    }
  } else {
    fmf_createAlloc( &stress, strain->nCell, nQP, sym, 1 );
    fmf_createAlloc( &res, 1, nQP, dim * nEP, 1 );

    mat_le_stress( stress, strain, lam, mu );

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

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

 end_label:
  if (isDiff) {
    fmf_freeDestroy( &d11 );
    fmf_freeDestroy( &gtd11 );
    fmf_freeDestroy( &gtd11g );
  } else {
    fmf_freeDestroy( &res );
    fmf_freeDestroy( &stress );
  }

  return( ret );
}