예제 #1
0
FormulationEMDA::FormulationEMDA(DDMContextEMDA& context){
  // Save DDMContext //
  this->context = &context;

  // Get Domain and FunctionSpace from DDMContext //
  fspace  = &context.getFunctionSpace();  // Testing Field and Unknown Field
  fspaceG = &context.getFunctionSpaceG(); // DDM Field
  ddomain = &context.getDomain();

  // Check GroupOfElement Stats: Uniform Mesh //
  pair<bool, size_t> uniform = ddomain->isUniform();
  size_t               eType = uniform.second;

  if(!uniform.first)
    throw Exception("FormulationEMDA needs a uniform mesh");

  // Wavenumber & Chi //
  this->k   = context.getWavenumber();
  this->chi = context.getChi();

  // Basis //
  basis = &fspace->getBasis(eType);

  // Gaussian Quadrature //
  gauss = new Quadrature(eType, basis->getOrder(), 2);

  // Pre-evalution //
  const fullMatrix<double>& gC = gauss->getPoints();
  basis->preEvaluateFunctions(gC);

  // Get DDM Dofs from DDMContext //
  const map<Dof, Complex>& ddm = context.getDDMDofs();

  // Local Terms //
  if(fspace->isScalar()){
    jac      = new GroupOfJacobian(*ddomain, gC, "jacobian");
    localLHS = new TermFieldField<double>(*jac, *basis, *gauss);
    localRHS =
      new TermProjectionField<Complex>(*jac, *basis, *gauss, *fspaceG, ddm);
  }

  else{
    jac      = new GroupOfJacobian(*ddomain, gC, "invert");
    localLHS = new TermGradGrad<double>(*jac, *basis, *gauss);
    localRHS =
      new TermProjectionGrad<Complex>(*jac, *basis, *gauss, *fspaceG, ddm);
  }
}
예제 #2
0
FormulationUpdateEMDA::FormulationUpdateEMDA(DDMContextEMDA& context){
  // Save DDMContext //
  this->context = &context;

  // Get Domain and FunctionSpace from DDMContext //
  fspace  = &context.getFunctionSpace();
  ddomain = &context.getDomain();

  // Check GroupOfElement Stats: Uniform Mesh //
  pair<bool, size_t> uniform = ddomain->isUniform();
  size_t               eType = uniform.second;

  if(!uniform.first)
    throw Exception("FormulationUpdateEMDA needs a uniform mesh");

  // Wavenumber & Chi //
  this->k   = context.getWavenumber();
  this->chi = context.getChi();

  // Basis //
  basis = &fspace->getBasis(eType);

  // Gaussian Quadrature //
  gauss = new Quadrature(eType, basis->getOrder(), 2);

  // Pre-evalution //
  const fullMatrix<double>& gC = gauss->getPoints();
  basis->preEvaluateFunctions(gC);

  // Jacobian //
  jac = new GroupOfJacobian(*ddomain, gC, "jacobian");

  // Init Volume Solution //
  FormulationHelper::initDofMap(*fspace, *ddomain, sol);

  // Local Terms //
  lGout = new TermFieldField<double>(*jac, *basis, *gauss);

  // NB: lGin & lU will be computed at update, when volume System is available
  lGin = NULL;
  lU   = NULL;
}