450{
452
454
456
457 Calculus primal_calculus;
459
460 {
461
462 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(2,2)) );
463 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(4,2)) );
464 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(2,4)) );
465 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(4,4)) );
466 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(2,6)) );
467 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(4,6)) );
468
469 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(1,2)) );
470
471
472 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(3,2), Calculus::KSpace::NEG) );
473 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(3,2), Calculus::KSpace::POS) );
474 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(2,3), Calculus::KSpace::NEG) );
475 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(4,3), Calculus::KSpace::POS) );
476 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(3,4), Calculus::KSpace::NEG) );
477 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(2,5), Calculus::KSpace::POS) );
478 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(4,5), Calculus::KSpace::NEG) );
479 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(3,6), Calculus::KSpace::POS) );
480
481 primal_calculus.eraseCell( primal_calculus.myKSpace.uCell(
Point(1,2)) );
482
483
484 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(3,3)) );
485 primal_calculus.insertSCell( primal_calculus.myKSpace.sCell(
Point(3,5)) );
486
487 primal_calculus.updateIndexes();
488
491 for (Calculus::ConstIterator iter_property=primal_calculus.begin(), iter_property_end=primal_calculus.end(); iter_property!=iter_property_end; iter_property++)
492 {
493 const Calculus::Cell cell = iter_property->first;
494 const Calculus::Property property = iter_property->second;
495 const Dimension dim = primal_calculus.myKSpace.uDim(cell);
496 const Calculus::SCell signed_cell = primal_calculus.myKSpace.signs(cell, property.flipped ? Calculus::KSpace::NEG : Calculus::
KSpace::POS);
497
498 ASSERT( signed_cell == primal_calculus.getSCell(
dim,
PRIMAL, property.index) );
499
502 << " " << signed_cell
503 << " " << property.primal_size
504 << " " << property.dual_size
505 << " " << property.index
506 << " " << (property.flipped ? "negative" : "positive")
507 << endl;
508 }
510 }
511
512
513 Calculus dual_calculus;
515
516 {
517
518 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(7,3)) );
519 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(9,3)) );
520 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(7,5)) );
521 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(9,5)) );
522 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(7,7)) );
523 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(9,7)) );
524
525 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(6,3)) );
526
527
528 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(8,3), Calculus::KSpace::NEG) );
529 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(8,3), Calculus::KSpace::POS) );
530 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(7,4), Calculus::KSpace::POS) );
531 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(9,4), Calculus::KSpace::NEG) );
532 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(8,5), Calculus::KSpace::NEG) );
533 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(7,6), Calculus::KSpace::NEG) );
534 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(9,6), Calculus::KSpace::POS) );
535 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(8,7), Calculus::KSpace::POS) );
536
537 dual_calculus.eraseCell( dual_calculus.myKSpace.uCell(
Point(6,3)) );
538
539
540 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(8,4)) );
541 dual_calculus.insertSCell( dual_calculus.myKSpace.sCell(
Point(8,6)) );
542
543 dual_calculus.updateIndexes();
544
547 for (Calculus::ConstIterator iter_property=dual_calculus.begin(), iter_property_end=dual_calculus.end(); iter_property!=iter_property_end; iter_property++)
548 {
549 const Calculus::Cell cell = iter_property->first;
550 const Calculus::Property property = iter_property->second;
551 const Dimension dim = dual_calculus.myKSpace.uDim(cell);
552 const Calculus::SCell signed_cell = dual_calculus.myKSpace.signs(cell, property.flipped ? Calculus::KSpace::NEG : Calculus::
KSpace::POS);
553
554 ASSERT( signed_cell == dual_calculus.getSCell(
dim,
PRIMAL, property.index) );
555
558 << " " << signed_cell
559 << " " << property.primal_size
560 << " " << property.dual_size
561 << " " << property.index
562 << " " << (property.flipped ? "negative" : "positive")
563 << endl;
564 }
566 }
567
568 {
571 board << primal_calculus;
572 board << dual_calculus;
573 board.
saveSVG(
"operators_structure.svg");
574 }
575
577
578 const Calculus::PrimalDerivative0 primal_d0 = primal_calculus.derivative<0,
PRIMAL>();
579 const Calculus::DualDerivative0 dual_d0p = dual_calculus.derivative<0,
DUAL>();
580 {
583
584#if defined(TEST_HARDCODED_ORDER)
585 Eigen::MatrixXd d0_th(7, 6);
586 d0_th <<
587 -1, 1, 0, 0, 0, 0,
588 1, 0, 0, -1, 0, 0,
589 0, 0, 1, 0, 0, -1,
590 0, 0, 0, 0, -1, 1,
591 0, -1, 1, 0, 0, 0,
592 0, 0, -1, 1, 0, 0,
593 0, 0, 0, -1, 1, 0;
594 FATAL_ERROR( Eigen::MatrixXd(primal_d0.myContainer) == d0_th );
595
596 Eigen::MatrixXd d0p_th(7, 6);
597 d0p_th <<
598 1, -1, 0, 0, 0, 0,
599 0, 0, -1, 1, 0, 0,
600 0, 1, 0, -1, 0, 0,
601 0, 0, 1, 0, -1, 0,
602 0, 0, 0, 0, 1, -1,
603 -1, 0, 1, 0, 0, 0,
604 0, 0, 0, -1, 0, 1;
605 FATAL_ERROR( Eigen::MatrixXd(dual_d0p.myContainer) == d0p_th );
606#endif
607 }
608
609 const Calculus::PrimalDerivative1 primal_d1 = primal_calculus.derivative<1,
PRIMAL>();
610 const Calculus::DualDerivative1 dual_d1p = dual_calculus.derivative<1,
DUAL>();
611 {
614
615#if defined(TEST_HARDCODED_ORDER)
616 Eigen::MatrixXd d1_th(2, 7);
617 d1_th <<
618 1, 1, 0, 0, 1, 1, 0,
619 0, 0, -1, -1, 0, -1, -1;
620 FATAL_ERROR( Eigen::MatrixXd(primal_d1.myContainer) == d1_th );
621
622 Eigen::MatrixXd d1p_th(2, 7);
623 d1p_th <<
624 -1, -1, -1, 0, 0, -1, 0,
625 0, 1, 0, 1, 1, 0, 1;
626 FATAL_ERROR( Eigen::MatrixXd(dual_d1p.myContainer) == d1p_th );
627#endif
628 }
629
630 {
633
634 FATAL_ERROR( Eigen::MatrixXd((primal_d1*primal_d0).myContainer) == Eigen::MatrixXd::Zero(2,6) );
635 FATAL_ERROR( Eigen::MatrixXd((dual_d1p*dual_d0p).myContainer) == Eigen::MatrixXd::Zero(2,6) );
636 }
637
638 const Calculus::PrimalHodge0 primal_h0 = primal_calculus.hodge<0,
PRIMAL>();
639 const Calculus::DualHodge0 dual_h0p = dual_calculus.hodge<0,
DUAL>();
640 const Calculus::DualHodge2 primal_h2p = primal_calculus.hodge<2,
DUAL>();
641 const Calculus::PrimalHodge2 dual_h2 = dual_calculus.hodge<2,
PRIMAL>();
642 {
647
648 FATAL_ERROR( Eigen::MatrixXd(primal_h0.myContainer) == Eigen::MatrixXd::Identity(6,6) );
649 FATAL_ERROR( Eigen::MatrixXd(dual_h0p.myContainer) == Eigen::MatrixXd::Identity(6,6) );
650 FATAL_ERROR( Eigen::MatrixXd(primal_h2p.myContainer) == Eigen::MatrixXd::Identity(6,6) );
651 FATAL_ERROR( Eigen::MatrixXd(dual_h2.myContainer) == Eigen::MatrixXd::Identity(6,6) );
652 }
653
654 const Calculus::PrimalHodge2 primal_h2 = primal_calculus.hodge<2,
PRIMAL>();
655 const Calculus::DualHodge2 dual_h2p = dual_calculus.hodge<2,
DUAL>();
656 const Calculus::DualHodge0 primal_h0p = primal_calculus.hodge<0,
DUAL>();
657 const Calculus::PrimalHodge0 dual_h0 = dual_calculus.hodge<0,
PRIMAL>();
658 {
663
664 FATAL_ERROR( Eigen::MatrixXd(primal_h2.myContainer) == Eigen::MatrixXd::Identity(2,2) );
665 FATAL_ERROR( Eigen::MatrixXd(dual_h2p.myContainer) == Eigen::MatrixXd::Identity(2,2) );
666 FATAL_ERROR( Eigen::MatrixXd(primal_h0p.myContainer) == Eigen::MatrixXd::Identity(2,2) );
667 FATAL_ERROR( Eigen::MatrixXd(dual_h0.myContainer) == Eigen::MatrixXd::Identity(2,2) );
668 }
669
670 const Calculus::DualDerivative0 primal_d0p = primal_calculus.derivative<0,
DUAL>();
671 const Calculus::PrimalDerivative0 dual_d0 = dual_calculus.derivative<0,
PRIMAL>();
672 {
675
676#if defined(TEST_HARDCODED_ORDER)
677 Eigen::MatrixXd d0p_th_transpose(2, 7);
678 d0p_th_transpose <<
679 1, 1, 0, 0, 1, 1, 0,
680 0, 0, -1, -1, 0, -1, -1;
681 FATAL_ERROR( Eigen::MatrixXd(primal_d0p.myContainer) == d0p_th_transpose.transpose() );
682
683 Eigen::MatrixXd minus_d0_th_transpose(2, 7);
684 minus_d0_th_transpose <<
685 -1, -1, -1, 0, 0, -1, 0,
686 0, 1, 0, 1, 1, 0, 1;
687 FATAL_ERROR( Eigen::MatrixXd(dual_d0.myContainer) == -minus_d0_th_transpose.transpose() );
688#endif
689 }
690
691 const Calculus::DualDerivative1 primal_d1p = primal_calculus.derivative<1,
DUAL>();
692 const Calculus::PrimalDerivative1 dual_d1 = dual_calculus.derivative<1,
PRIMAL>();
693 {
696
697#if defined(TEST_HARDCODED_ORDER)
698 Eigen::MatrixXd minus_d1p_th_transpose(7, 6);
699 minus_d1p_th_transpose <<
700 -1, 1, 0, 0, 0, 0,
701 1, 0, 0, -1, 0, 0,
702 0, 0, 1, 0, 0, -1,
703 0, 0, 0, 0, -1, 1,
704 0, -1, 1, 0, 0, 0,
705 0, 0, -1, 1, 0, 0,
706 0, 0, 0, -1, 1, 0;
707 FATAL_ERROR( Eigen::MatrixXd(primal_d1p.myContainer) == -minus_d1p_th_transpose.transpose() );
708
709 Eigen::MatrixXd d1_th_transpose(7, 6);
710 d1_th_transpose <<
711 1, -1, 0, 0, 0, 0,
712 0, 0, -1, 1, 0, 0,
713 0, 1, 0, -1, 0, 0,
714 0, 0, 1, 0, -1, 0,
715 0, 0, 0, 0, 1, -1,
716 -1, 0, 1, 0, 0, 0,
717 0, 0, 0, -1, 0, 1;
718 FATAL_ERROR( Eigen::MatrixXd(dual_d1.myContainer) == d1_th_transpose.transpose() );
719#endif
720 }
721
722 const Calculus::PrimalHodge1 primal_h1 = primal_calculus.hodge<1,
PRIMAL>();
723 const Calculus::DualHodge1 dual_h1p = dual_calculus.hodge<1,
DUAL>();
724 const Calculus::DualHodge1 primal_h1p = primal_calculus.hodge<1,
DUAL>();
725 const Calculus::PrimalHodge1 dual_h1 = dual_calculus.hodge<1,
PRIMAL>();
726 {
731
732 FATAL_ERROR( Eigen::MatrixXd(primal_h1.myContainer) == Eigen::MatrixXd::Identity(7,7) );
733 FATAL_ERROR( Eigen::MatrixXd(dual_h1p.myContainer) == -Eigen::MatrixXd::Identity(7,7) );
734 FATAL_ERROR( Eigen::MatrixXd((primal_h1p*primal_h1).myContainer) == -Eigen::MatrixXd::Identity(7,7) );
735 FATAL_ERROR( Eigen::MatrixXd((dual_h1*dual_h1p).myContainer) == -Eigen::MatrixXd::Identity(7,7) );
736 FATAL_ERROR( Eigen::MatrixXd((primal_h1*primal_h1p).myContainer) == -Eigen::MatrixXd::Identity(7,7) );
737 FATAL_ERROR( Eigen::MatrixXd((dual_h1p*dual_h1).myContainer) == -Eigen::MatrixXd::Identity(7,7) );
738 }
739
741
748
750
751 {
756
757 {
758 Calculus::PrimalForm1::Container dx_container(7);
759 dx_container << -1, 0, 0, -1, 0, 1, 0;
760 const Calculus::PrimalForm1 primal_dx(primal_calculus, dx_container);
761 const Calculus::PrimalVectorField primal_dx_field = primal_calculus.sharp(primal_dx);
762
763 Calculus::PrimalForm1::Container dxp_container(7);
764 dxp_container << 1, -1, 0, 0, 1, 0, 0;
765 const Calculus::DualForm1 dual_dx(dual_calculus, dxp_container);
766 const Calculus::DualVectorField dual_dx_field = dual_calculus.sharp(dual_dx);
767
768 {
771 board << primal_calculus;
772 board << primal_dx << primal_dx_field;
773 board << dual_calculus;
774 board << dual_dx << dual_dx_field;
775 board.
saveSVG(
"operators_sharp_dx_primal.svg");
776 }
777
778#if defined(TEST_HARDCODED_ORDER)
779 FATAL_ERROR( primal_dx_field.myCoordinates.col(0) == Eigen::VectorXd::Ones(6) );
780 FATAL_ERROR( primal_dx_field.myCoordinates.col(1) == Eigen::VectorXd::Zero(6) );
781 FATAL_ERROR( dual_dx_field.myCoordinates.col(0) == Eigen::VectorXd::Ones(6) );
782 FATAL_ERROR( dual_dx_field.myCoordinates.col(1) == Eigen::VectorXd::Zero(6) );
783#endif
784 }
785
786 {
787 Calculus::PrimalForm1::Container dy_container(7);
788 dy_container << 0, 1, 1, 0, -1, 0, -1;
789 const Calculus::PrimalForm1 primal_dy(primal_calculus, dy_container);
790 const Calculus::PrimalVectorField primal_dy_field = primal_calculus.sharp(primal_dy);
791
792 Calculus::PrimalForm1::Container dyp_container(7);
793 dyp_container << 0, 0, 1, 1, 0, -1, -1;
794 const Calculus::DualForm1 dual_dy(dual_calculus, dyp_container);
795 const Calculus::DualVectorField dual_dy_field = dual_calculus.sharp(dual_dy);
796
797 {
800 board << primal_calculus;
801 board << primal_dy << primal_dy_field;
802 board << dual_calculus;
803 board << dual_dy << dual_dy_field;
804 board.
saveSVG(
"operators_sharp_dy_primal.svg");
805 }
806
807#if defined(TEST_HARDCODED_ORDER)
808 FATAL_ERROR( primal_dy_field.myCoordinates.col(0) == Eigen::VectorXd::Zero(6) );
809 FATAL_ERROR( primal_dy_field.myCoordinates.col(1) == Eigen::VectorXd::Ones(6) );
810 FATAL_ERROR( dual_dy_field.myCoordinates.col(0) == Eigen::VectorXd::Zero(6) );
811 FATAL_ERROR( dual_dy_field.myCoordinates.col(1) == Eigen::VectorXd::Ones(6) );
812#endif
813 }
814 }
815
816 {
821
822 {
823 Calculus::DualForm1::Container dx_container(7);
824 dx_container << 0, -1, -1, 0, 1, 0, 1;
825 const Calculus::DualForm1 primal_dx(primal_calculus, dx_container);
826 const Calculus::DualVectorField primal_dx_field = primal_calculus.sharp(primal_dx);
827
828 Calculus::DualForm1::Container dxp_container(7);
829 dxp_container << 0, 0, 1, 1, 0, -1, -1;
830 const Calculus::PrimalForm1 dual_dx(dual_calculus, dxp_container);
831 const Calculus::PrimalVectorField dual_dx_field = dual_calculus.sharp(dual_dx);
832
833 {
836 board << primal_calculus;
837 board << primal_dx << primal_dx_field;
838 board << dual_calculus;
839 board << dual_dx << dual_dx_field;
840 board.
saveSVG(
"operators_sharp_dx_dual.svg");
841 }
842
843#if defined(TEST_HARDCODED_ORDER)
844 FATAL_ERROR( primal_dx_field.myCoordinates.col(0) == Eigen::VectorXd::Ones(2) );
845 FATAL_ERROR( primal_dx_field.myCoordinates.col(1) == Eigen::VectorXd::Zero(2) );
846 FATAL_ERROR( dual_dx_field.myCoordinates.col(0) == Eigen::VectorXd::Ones(2) );
847 FATAL_ERROR( dual_dx_field.myCoordinates.col(1) == Eigen::VectorXd::Zero(2) );
848#endif
849 }
850
851 {
852 Calculus::DualForm1::Container dy_container(7);
853 dy_container << -1, 0, 0, -1, 0 , 1, 0;
854 const Calculus::DualForm1 primal_dy(primal_calculus, dy_container);
855 const Calculus::DualVectorField primal_dy_field = primal_calculus.sharp(primal_dy);
856
857 Calculus::DualForm1::Container dyp_container(7);
858 dyp_container << -1, 1, 0, 0, -1, 0, 0;
859 const Calculus::PrimalForm1 dual_dy(dual_calculus, dyp_container);
860 const Calculus::PrimalVectorField dual_dy_field = dual_calculus.sharp(dual_dy);
861
862 {
865 board << primal_calculus;
866 board << primal_dy << primal_dy_field;
867 board << dual_calculus;
868 board << dual_dy << dual_dy_field;
869 board.
saveSVG(
"operators_sharp_dy_dual.svg");
870 }
871
872#if defined(TEST_HARDCODED_ORDER)
873 FATAL_ERROR( primal_dy_field.myCoordinates.col(0) == Eigen::VectorXd::Zero(2) );
874 FATAL_ERROR( primal_dy_field.myCoordinates.col(1) == Eigen::VectorXd::Ones(2) );
875 FATAL_ERROR( dual_dy_field.myCoordinates.col(0) == Eigen::VectorXd::Zero(2) );
876 FATAL_ERROR( dual_dy_field.myCoordinates.col(1) == Eigen::VectorXd::Ones(2) );
877#endif
878 }
879 }
880
882
884
885 {
890
891 Calculus::PrimalVectorField::Coordinates dx_coords(6,2);
892 dx_coords.col(0) = Eigen::VectorXd::Ones(6);
893 dx_coords.col(1) = Eigen::VectorXd::Zero(6);
894
895 Calculus::PrimalVectorField::Coordinates dy_coords(6,2);
896 dy_coords.col(0) = Eigen::VectorXd::Zero(6);
897 dy_coords.col(1) = Eigen::VectorXd::Ones(6);
898
899 const Calculus::PrimalVectorField primal_dx_field(primal_calculus, dx_coords);
900 const Calculus::PrimalForm1 primal_dx = primal_calculus.flat(primal_dx_field);
901 const Calculus::DualVectorField dual_dx_field(dual_calculus, dx_coords);
902 const Calculus::DualForm1 dual_dx = dual_calculus.flat(dual_dx_field);
903
904 {
907 board << primal_calculus;
908 board << primal_dx << primal_dx_field;
909 board << dual_calculus;
910 board << dual_dx << dual_dx_field;
911 board.
saveSVG(
"operators_flat_dx_primal.svg");
912 }
913
914 const Calculus::PrimalVectorField primal_dy_field(primal_calculus, dy_coords);
915 const Calculus::PrimalForm1 primal_dy = primal_calculus.flat(primal_dy_field);
916 const Calculus::DualVectorField dual_dy_field(dual_calculus, dy_coords);
917 const Calculus::DualForm1 dual_dy = dual_calculus.flat(dual_dy_field);
918
919 {
922 board << primal_calculus;
923 board << primal_dy << primal_dy_field;
924 board << dual_calculus;
925 board << dual_dy << dual_dy_field;
926 board.
saveSVG(
"operators_flat_dy_primal.svg");
927 }
928
929#if defined(TEST_HARDCODED_ORDER)
930 Calculus::PrimalForm1::Container dx_container(7);
931 dx_container << -1, 0, 0, -1, 0, 1, 0;
932 Calculus::PrimalForm1::Container dxp_container(7);
933 dxp_container << 1, -1, 0, 0, 1, 0, 0;
934 FATAL_ERROR( primal_dx.myContainer == dx_container );
935 FATAL_ERROR( dual_dx.myContainer == dxp_container );
936
937 Calculus::PrimalForm1::Container dy_container(7);
938 dy_container << 0, 1, 1, 0, -1, 0, -1;
939 Calculus::PrimalForm1::Container dyp_container(7);
940 dyp_container << 0, 0, 1, 1, 0, -1, -1;
941 FATAL_ERROR( primal_dy.myContainer == dy_container );
942 FATAL_ERROR( dual_dy.myContainer == dyp_container );
943#endif
944 }
945
946 {
951
952 Calculus::PrimalVectorField::Coordinates dx_coords(2,2);
953 dx_coords.col(0) = Eigen::VectorXd::Ones(2);
954 dx_coords.col(1) = Eigen::VectorXd::Zero(2);
955
956 Calculus::PrimalVectorField::Coordinates dy_coords(2,2);
957 dy_coords.col(0) = Eigen::VectorXd::Zero(2);
958 dy_coords.col(1) = Eigen::VectorXd::Ones(2);
959
960 const Calculus::DualVectorField primal_dx_field(primal_calculus, dx_coords);
961 const Calculus::DualForm1 primal_dx = primal_calculus.flat(primal_dx_field);
962 const Calculus::PrimalVectorField dual_dx_field(dual_calculus, dx_coords);
963 const Calculus::PrimalForm1 dual_dx = dual_calculus.flat(dual_dx_field);
964
965 {
968 board << primal_calculus;
969 board << primal_dx << primal_dx_field;
970 board << dual_calculus;
971 board << dual_dx << dual_dx_field;
972 board.
saveSVG(
"operators_flat_dx_dual.svg");
973 }
974
975 const Calculus::DualVectorField primal_dy_field(primal_calculus, dy_coords);
976 const Calculus::DualForm1 primal_dy = primal_calculus.flat(primal_dy_field);
977 const Calculus::PrimalVectorField dual_dy_field(dual_calculus, dy_coords);
978 const Calculus::PrimalForm1 dual_dy = dual_calculus.flat(dual_dy_field);
979
980 {
983 board << primal_calculus;
984 board << primal_dy << primal_dy_field;
985 board << dual_calculus;
986 board << dual_dy << dual_dy_field;
987 board.
saveSVG(
"operators_flat_dy_dual.svg");
988 }
989
990#if defined(TEST_HARDCODED_ORDER)
991 Calculus::PrimalForm1::Container dx_container(7);
992 dx_container << 0, -1, -1, 0, 1, 0, 1;
993 Calculus::PrimalForm1::Container dxp_container(7);
994 dxp_container << 0, 0, 1, 1, 0, -1, -1;
995 FATAL_ERROR( primal_dx.myContainer == dx_container );
996 FATAL_ERROR( dual_dx.myContainer == dxp_container );
997
998 Calculus::PrimalForm1::Container dy_container(7);
999 dy_container << -1, 0, 0, -1, 0, 1, 0;
1000 Calculus::PrimalForm1::Container dyp_container(7);
1001 dyp_container << -1, 1, 0, 0, -1, 0, 0;
1002 FATAL_ERROR( primal_dy.myContainer == dy_container );
1003 FATAL_ERROR( dual_dy.myContainer == dyp_container );
1004#endif
1005 }
1006
1008
1009
1011}
void initKSpace(ConstAlias< TDomain > domain)
DGtal::uint32_t Dimension