8#ifndef model_LinearWeakAssembler_H_
9#define model_LinearWeakAssembler_H_
26 template<
typename LinearWeakFormType,
short unsigned int DimMinusDomainDim>
30 const LinearWeakFormType&
lwf;
35 assert(0 &&
"LinearWeakAssembler: DimMinusDomainDim must be 0 or 1.");
40 template<
typename LinearWeakFormType>
46 constexpr static int dim=IntegrationDomainType::dim;
54 constexpr static int evalCols=LinearFormType::evalCols;
58 const LinearWeakFormType&
lwf;
66 Eigen::Matrix<double,Eigen::Dynamic,1>
assemble()
const
69 const auto t0= std::chrono::system_clock::now();
71 Eigen::Matrix<double,Eigen::Dynamic,1> _globalVector(Eigen::Matrix<double,Eigen::Dynamic,1>::Zero(
lwf.field().gSize()));
73 for (
size_t k=0;
k<
lwf.domain.size();++
k)
83 const size_t gI=
lwf.domain.element(
k).node(nodeID_I).gID*
dofPerNode+nodeDof_I;
84 _globalVector(gI) += ve(
i);
94 return (*
lwf.linearForm)(ele,bary)*ele.absJ(bary);
99 template<
typename LinearWeakFormType>
105 constexpr static int dim=IntegrationDomainType::dim;
113 constexpr static int evalCols=LinearFormType::evalCols;
117 const LinearWeakFormType&
lwf;
125 Eigen::Matrix<double,Eigen::Dynamic,1>
assemble()
const
127 std::cout<<
"Assembling LinearWeakForm on faces ("<<
lwf.domain.size()<<
" faces) ..."<<std::flush;
128 const auto t0= std::chrono::system_clock::now();
130 Eigen::Matrix<double,Eigen::Dynamic,1> _globalVector(Eigen::Matrix<double,Eigen::Dynamic,1>::Zero(
lwf.field().gSize()));
132 for (
size_t k=0;
k<
lwf.domain.size();++
k)
135 const int f(
lwf.domain[
k].second);
142 const size_t gI= ele.node(nodeID_I).gID*
dofPerNode+nodeDof_I;
143 _globalVector(gI) += ve(
i);
146 std::cout<<
" done.["<<(std::chrono::duration<double>(std::chrono::system_clock::now()-
t0)).
count()<<
" sec]"<<std::endl;
147 return _globalVector;
152 const int& boundaryFace)
const
function int_R syms a b c u real f
size_t InstanceCount< Derived >::count
static VectorHigherDimD x2l(const VectorDimD &X)
static Eigen::Matrix< double, dim+1, 1 > face2domainBary(const Eigen::Matrix< double, dim, 1 > &b1, const int &boundaryFace)
static Eigen::Matrix< double, dim, 1 > jGN(const Eigen::Matrix< double, dim, 1 > &jgn)
const LinearWeakFormType & lwf
LinearWeakAssembler(const LinearWeakFormType &lwf_in)