Search in sources :

Example 26 with EquationSet

use of gov.sandia.n2a.eqset.EquationSet in project n2a by frothga.

the class BackendC method getOutputVariables.

@Override
public ParameterDomain getOutputVariables(MNode model) {
    try {
        if (model == null)
            return null;
        EquationSet s = new EquationSet(model);
        if (s.name.length() < 1)
            s.name = "Model";
        s.resolveLHS();
        return s.getOutputParameters();
    } catch (Exception error) {
        return null;
    }
}
Also used : EquationSet(gov.sandia.n2a.eqset.EquationSet)

Example 27 with EquationSet

use of gov.sandia.n2a.eqset.EquationSet in project n2a by frothga.

the class BackendDataC method analyzeLastT.

public void analyzeLastT(EquationSet s) {
    boolean hasIntegrated = localIntegrated.size() > 0;
    for (EquationSet p : s.parts) {
        if (hasIntegrated)
            break;
        hasIntegrated = ((BackendDataC) p.backendData).globalIntegrated.size() > 0;
    }
    boolean dtCanChange = dt != null && dt.equations.size() > 0 && !dt.hasAttribute("initOnly");
    // dt could also change if we use a variable-step integrator. There are currently no plans to implement one.
    lastT = hasIntegrated && (eventTargets.size() > 0 || dtCanChange);
}
Also used : EquationSet(gov.sandia.n2a.eqset.EquationSet)

Example 28 with EquationSet

use of gov.sandia.n2a.eqset.EquationSet in project n2a by frothga.

the class BackendDataC method setLocalNeedPath.

public void setLocalNeedPath(EquationSet s) {
    EquationSet c = s.container;
    // Don't set flag, because we know that path() will return "".
    if (c == null && s.isSingleton())
        return;
    needLocalPath = true;
    setParentNeedPath(s);
}
Also used : EquationSet(gov.sandia.n2a.eqset.EquationSet)

Example 29 with EquationSet

use of gov.sandia.n2a.eqset.EquationSet in project n2a by frothga.

the class JobC method analyzeEvents.

public void analyzeEvents(EquationSet s) throws Backend.AbortRun {
    BackendDataC bed = (BackendDataC) s.backendData;
    bed.analyzeEvents(s);
    for (EquationSet p : s.parts) analyzeEvents(p);
}
Also used : EquationSet(gov.sandia.n2a.eqset.EquationSet)

Example 30 with EquationSet

use of gov.sandia.n2a.eqset.EquationSet in project n2a by frothga.

the class JobC method findLiveReferences.

public void findLiveReferences(EquationSet s) {
    for (EquationSet p : s.parts) {
        findLiveReferences(p);
    }
    if (s.lethalConnection || s.lethalContainer) {
        ArrayList<Object> resolution = new ArrayList<Object>();
        NavigableSet<EquationSet> touched = new TreeSet<EquationSet>();
        if (!(s.backendData instanceof BackendDataC))
            s.backendData = new BackendDataC();
        findLiveReferences(s, resolution, touched, ((BackendDataC) s.backendData).localReference, false);
    }
}
Also used : EquationSet(gov.sandia.n2a.eqset.EquationSet) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList)

Aggregations

EquationSet (gov.sandia.n2a.eqset.EquationSet)34 Variable (gov.sandia.n2a.eqset.Variable)10 AccessVariable (gov.sandia.n2a.language.AccessVariable)9 ConnectionBinding (gov.sandia.n2a.eqset.EquationSet.ConnectionBinding)7 ArrayList (java.util.ArrayList)7 Operator (gov.sandia.n2a.language.Operator)6 Scalar (gov.sandia.n2a.language.type.Scalar)6 MPart (gov.sandia.n2a.eqset.MPart)5 VariableReference (gov.sandia.n2a.eqset.VariableReference)4 Constant (gov.sandia.n2a.language.Constant)4 Type (gov.sandia.n2a.language.Type)4 Visitor (gov.sandia.n2a.language.Visitor)4 TreeSet (java.util.TreeSet)4 EventSource (gov.sandia.n2a.backend.internal.InternalBackendData.EventSource)3 EventTarget (gov.sandia.n2a.backend.internal.InternalBackendData.EventTarget)3 MNode (gov.sandia.n2a.db.MNode)3 ParseException (gov.sandia.n2a.language.ParseException)3 Text (gov.sandia.n2a.language.type.Text)3 AbortRun (gov.sandia.n2a.plugins.extpoints.Backend.AbortRun)3 FileNotFoundException (java.io.FileNotFoundException)3