void DiracKernel::computeOffDiagJacobian(unsigned int jvar) { if (jvar == _var.number()) { computeJacobian(); } else { DenseMatrix<Number> & ke = _assembly.jacobianBlock(_var.number(), jvar); const std::vector<unsigned int> * multiplicities = _drop_duplicate_points ? NULL : &_local_dirac_kernel_info.getPoints()[_current_elem].second; unsigned int local_qp = 0; Real multiplicity = 1.0; for (_qp = 0; _qp < _qrule->n_points(); _qp++) { _current_point = _physical_point[_qp]; if (isActiveAtPoint(_current_elem, _current_point)) { if (!_drop_duplicate_points) multiplicity = (*multiplicities)[local_qp++]; for (_i=0; _i<_test.size(); _i++) for (_j=0; _j<_phi.size(); _j++) ke(_i, _j) += multiplicity * computeQpOffDiagJacobian(jvar); } } } }
void DiracKernel::computeResidual() { DenseVector<Number> & re = _assembly.residualBlock(_var.number()); for (_qp = 0; _qp < _qrule->n_points(); _qp++) { _current_point=_physical_point[_qp]; if (isActiveAtPoint(_current_elem, _current_point)) { for (_i = 0; _i < _test.size(); _i++) re(_i) += computeQpResidual(); } } }
void DiracKernel::computeJacobian() { DenseMatrix<Number> & ke = _assembly.jacobianBlock(_var.number(), _var.number()); for (_qp = 0; _qp < _qrule->n_points(); _qp++) { _current_point = _physical_point[_qp]; if (isActiveAtPoint(_current_elem, _current_point)) for (_i = 0; _i < _test.size(); _i++) for (_j = 0; _j < _phi.size(); _j++) { ke(_i, _j) += computeQpJacobian(); } } }
void DiracKernel::computeOffDiagJacobian(unsigned int jvar) { if (jvar == _var.number()) { computeJacobian(); } else { DenseMatrix<Number> & ke = _assembly.jacobianBlock(_var.number(), jvar); for (_qp = 0; _qp < _qrule->n_points(); _qp++) { _current_point = _physical_point[_qp]; if (isActiveAtPoint(_current_elem, _current_point)) for (_i=0; _i<_test.size(); _i++) for (_j=0; _j<_phi.size(); _j++) ke(_i, _j) += computeQpOffDiagJacobian(jvar); } } }
void DiracKernel::computeResidual() { DenseVector<Number> & re = _assembly.residualBlock(_var.number()); const std::vector<unsigned int> * multiplicities = _drop_duplicate_points ? NULL : &_local_dirac_kernel_info.getPoints()[_current_elem].second; unsigned int local_qp = 0; Real multiplicity = 1.0; for (_qp = 0; _qp < _qrule->n_points(); _qp++) { _current_point = _physical_point[_qp]; if (isActiveAtPoint(_current_elem, _current_point)) { if (!_drop_duplicate_points) multiplicity = (*multiplicities)[local_qp++]; for (_i = 0; _i < _test.size(); _i++) re(_i) += multiplicity * computeQpResidual(); } } }