Opened 2 years ago

#5425 assigned defect

Non-scalar overconstrained connections

Reported by: Jonathan Kämpe Owned by: Jonathan Kämpe
Priority: major Milestone:
Component: Modelica/FrontEnd Version: trunk
Keywords: Cc:

Description

The following test cases does not flatten correctly. We do not consider handle array expressions for overconstrained connect equations.

    model Test4
        type C1 = Real[2];
        
        type C0
            extends C1;
            
            function equalityConstraint
                input C0 c1;
                input C0 c2;
                output Real[2] y = c1.x - c2.x;
            algorithm
            end equalityConstraint;
        end C0;
        
        connector C = C0;
        
        C c1;
        C c2;
    equation
        connect(c1,c2);
        Connections.root(c1);
    end Test4;
    
    model Test5
        type C1 = Real[2];
        
        type C0
            extends C1;
            
            function equalityConstraint
                input C0 c1;
                input C0 c2;
                output Real[2] y = c1.x - c2.x;
            algorithm
            end equalityConstraint;
        end C0;
        
        connector C = C0[2];
        
        C c1;
        C c2;
    equation
        connect(c1,c2);
        Connections.root(c1);
    end Test5;
    
    model Test6
        type C1 = Real[2];
        
        type C0
            extends C1;
            
            function equalityConstraint
                input C0 c1;
                input C0 c2;
                output Real[2] y = c1.x - c2.x;
            algorithm
            end equalityConstraint;
        end C0;
        
        connector C = C0;
        
        C[2] c1;
        C[2] c2;
    equation
        connect(c1,c2);
        Connections.root(c1[1]);
        Connections.root(c1[2]);
    end Test6;
    
    model Test75
        model M
            record C0
                Real[2] x;
                
                function equalityConstraint
                    input C0 c1;
                    input C0 c2;
                    output Real[2] y = c1.x - c2.x;
                algorithm
                end equalityConstraint;
            end C0;
            
            connector C = C0;
            
            C c1;
            C c2;
        equation
            Connections.root(c1);
        end M;
        
        M[2] m1;
        M[2] m2;
    equation
        connect(m1.c1, m2.c2);
        
    end Test75;
    
    model Test8
        record C0
            Real[2] x;
            
            function equalityConstraint
                input C0 c1;
                input C0 c2;
                output Real[2] y = c1.x - c2.x;
            algorithm
            end equalityConstraint;
        end C0;
        
        connector C = C0[2];
        
        C c1;
        C c2;
    equation
        connect(c1,c2);
        Connections.root(c1);
    end Test8;
    
    model Test9
        record C0
            Real[2] x;
            
            function equalityConstraint
                input C0 c1;
                input C0 c2;
                output Real[2] y = c1.x - c2.x;
            algorithm
            end equalityConstraint;
        end C0;
        
        connector C = C0;
        
        C[2] c1;
        C[2] c2;
    equation
        connect(c1,c2);
        Connections.root(c1[1]);
        Connections.root(c1[2]);
    end Test9;

Change History (0)

Note: See TracTickets for help on using tickets.