30 return i1 + 10000 * i2;
54 double alpha,
double beta)
56 r = beta * r + alpha * m * v;
64 double alpha,
double beta)
66 r.
gemm(m, v, alpha, beta);
80 std::vector<std::pair<Dof, typename dofTraits<T>::MatType> >
linear;
163 long int ent_to,
int type_to)
165 Dof from (ent_from, type_from);
166 Dof to (ent_to, type_to);
167 std::pair<Dof,Dof> p = std::make_pair(from,to);
198 inline bool isFixed(
long int ent,
int type)
const
222 std::size_t size =
unknown.size();
226 virtual inline void numberDof(
const std::vector<Dof> &R)
228 for(std::size_t i = 0; i < R.size(); i++) this->
numberDof(R[i]);
236 std::vector<dataVec> &Vals)
238 for(std::size_t i = 0; i < keys.size(); i++) {
243 int ndofs = keys.size();
244 size_t originalSize = Vals.size();
245 Vals.resize(originalSize + ndofs);
246 for(
int i = 0; i < ndofs; ++i)
getDofValue(keys[i], Vals[originalSize + i]);
263 typename std::map<Dof, dataVec>::const_iterator it =
fixed.find(key);
264 if(it !=
fixed.end()) {
279 auto itx =
unknown.find(it->second);
288 typename std::map<Dof, dataVec>::const_iterator it =
ghostValue.find(key);
302 typename std::map<Dof, dataVec>::const_iterator it =
fixed.find(key);
303 if(it !=
fixed.end()) {
309 typename std::map<Dof, DofAffineConstraint<dataVec> >::const_iterator it =
313 val = it->second.shift;
314 for(
unsigned i = 0; i < (it->second).linear.size(); i++) {
340 typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
344 for(
unsigned i = 0; i < (itConstraint->second).linear.size(); i++) {
350 typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
354 for(
unsigned i = 0; i < (itConstraint->second).linear.size(); i++) {
372 typename std::map<Dof, dataVec>::iterator itFixed =
fixed.find(C);
373 if(itFixed !=
fixed.end()) {
386 for(std::size_t itR = 0; itR < keys.size(); itR++) {
387 for(std::size_t itC = 0; itC < keys.size(); itC++) {
404 typename std::map<Dof, dataVec>::iterator itFixed =
fixed.find(C);
405 if(itFixed !=
fixed.end()) {
419 virtual inline void assemble(std::vector<Dof> &R, std::vector<Dof> &C,
426 for(std::size_t i = 0; i < R.size(); i++) {
430 for(std::size_t i = 0; i < C.size(); i++) {
435 std::vector<int> NR(R.size()), NC(C.size());
437 for(std::size_t i = 0; i < R.size(); i++) {
444 for(std::size_t i = 0; i < C.size(); i++) {
451 for(std::size_t i = 0; i < R.size(); i++) {
453 for(std::size_t j = 0; j < C.size(); j++) {
458 typename std::map<Dof, dataVec>::iterator itFixed =
460 if(itFixed !=
fixed.end()) {
472 for(std::size_t j = 0; j < C.size(); j++) {
484 printf(
"coucou RHS\n");
486 for(std::size_t i = 0; i < R.size(); i++) {
492 std::vector<int> NR(R.size());
493 for(std::size_t i = 0; i < R.size(); i++) {
500 for(std::size_t i = 0; i < R.size(); i++) {
505 typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
509 for(
unsigned j = 0; j < (itConstraint->second).linear.size(); j++) {
513 assemble((itConstraint->second).linear[j].first, tmp);
524 for(std::size_t i = 0; i < R.size(); i++) {
529 std::vector<int> NR(R.size());
530 for(std::size_t i = 0; i < R.size(); i++) {
537 for(std::size_t i = 0; i < R.size(); i++) {
539 for(std::size_t j = 0; j < R.size(); j++) {
544 typename std::map<Dof, dataVec>::iterator itFixed =
546 if(itFixed !=
fixed.end()) {
558 for(std::size_t j = 0; j < R.size(); j++) {
564 inline void assemble(
int entR,
int typeR,
int entC,
int typeC,
570 int iCompC,
int iFieldC,
const dataMat &value)
584 typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
588 for(
unsigned j = 0; j < (itConstraint->second).linear.size(); j++) {
592 assemble((itConstraint->second).linear[j].first, tmp);
619 typename std::map<const std::string, linearSystem<dataMat> *>::iterator it =
624 Msg::Error(
"Current matrix %s not found ", name.c_str());
630 typename std::map<const std::string, linearSystem<dataMat> *>::iterator it =
647 typename std::map<Dof, DofAffineConstraint<dataVec> >::const_iterator it =
650 affineconstraint = it->second;
661 typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
666 for(
unsigned i = 0; i < (itConstraint->second).linear.size(); i++) {
669 assemble(R, (itConstraint->second).linear[i].first, tmp);
677 typename std::map<Dof, DofAffineConstraint<dataVec> >::iterator
682 for(
unsigned i = 0; i < (itConstraint->second).linear.size(); i++) {
685 assemble((itConstraint->second).linear[i].first, C, tmp);
693 R.reserve(
fixed.size());
694 typename std::map<Dof, dataVec>::iterator it;
695 for(it =
fixed.begin(); it !=
fixed.end(); ++it) {
696 R.push_back(it->first);
702 typename std::map<Dof, dataVec>::iterator it;
703 for(it =
fixed.begin(); it !=
fixed.end(); ++it) {