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