Skip to content
Snippets Groups Projects
Select Git revision
  • 93d2637bbd3d2bcfdf54418e4404c6a5d65ba36a
  • master default protected
  • ujwal_21_08_2024
  • dev_mm_pf
  • cyrielle
  • vinayak
  • dev_mm_torchSCRU
  • debug_mm_pf
  • newStructureNonLocal
  • Mohamed_stochasticDMN
  • dev_mm_bench
  • stochdmn
  • revert-351ff7aa
  • ujwal_29April2024
  • dev_mm_ann
  • mohamed_vevp
  • ujwal_debug
  • ujwal_2ndApril2024
  • ujwal_October_2023
  • gabriel
  • SFEM
  • v4.0
  • v3.2.3_multiplePhase
  • v3.5
  • v3.3.2
  • v3.4
  • v3.3
  • ver3.2
  • verJulienWork
  • ver3.1
  • ver2
  • ver1.1.2
  • ver1.1.1
  • ver1.1
34 results

model.py

Blame
  • FunctionSpaceVector.cpp 1.29 KiB
    #include "Mapper.h"
    #include "FunctionSpaceVector.h"
    
    FunctionSpaceVector::FunctionSpaceVector(GroupOfElement& goe,
                                             const Basis& basis){
      scalar = false;
      build(goe, basis);
    }
    
    FunctionSpaceVector::~FunctionSpaceVector(void){
      // Done by FunctionSpace
    }
    
    fullVector<double> FunctionSpaceVector::
    interpolateInABC(const MElement& element,
                     const std::vector<double>& coef,
                     double abc[3]) const{
    
      // Get Jacobian //
      fullMatrix<double> invJac(3, 3);
      (*basis)[0]->getReferenceSpace().getJacobian(element,
                                                   abc[0], abc[1], abc[2],
                                                   invJac);
      invJac.invertInPlace();
    
      // Get Basis Functions //
      const size_t nFun = (*basis)[0]->getNFunction();
      fullMatrix<double> fun(nFun, 3);
    
      (*basis)[0]->getFunctions(fun, element, abc[0], abc[1], abc[2]);
    
      // Interpolate (in Reference Place) //
      fullMatrix<double> val(1, 3);
      val(0, 0) = 0;
      val(0, 1) = 0;
      val(0, 2) = 0;
    
      for(size_t i = 0; i < nFun; i++){
        val(0, 0) += fun(i, 0) * coef[i];
        val(0, 1) += fun(i, 1) * coef[i];
        val(0, 2) += fun(i, 2) * coef[i];
      }
    
      // Return Interpolated Value //
      fullVector<double> map(3);
      Mapper::hCurl(val, 0, 0, invJac, map);
      return map;
    }