diff --git a/src/test/java/org/orekit/propagation/integration/IntegrableGeneratorTest.java b/src/test/java/org/orekit/propagation/integration/IntegrableGeneratorTest.java deleted file mode 100644 index fe5d7bc081a18235dc42731b66817fd305226c43..0000000000000000000000000000000000000000 --- a/src/test/java/org/orekit/propagation/integration/IntegrableGeneratorTest.java +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright 2002-2021 CS GROUP - * Licensed to CS GROUP (CS) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * CS licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.orekit.propagation.integration; - -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator; -import org.hipparchus.ode.nonstiff.DormandPrince853Integrator; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.orekit.Utils; -import org.orekit.forces.gravity.potential.GravityFieldFactory; -import org.orekit.forces.gravity.potential.SHMFormatReader; -import org.orekit.frames.FramesFactory; -import org.orekit.orbits.EquinoctialOrbit; -import org.orekit.orbits.Orbit; -import org.orekit.orbits.OrbitType; -import org.orekit.propagation.SpacecraftState; -import org.orekit.propagation.numerical.NumericalPropagator; -import org.orekit.propagation.semianalytical.dsst.DSSTPropagator; -import org.orekit.time.AbsoluteDate; -import org.orekit.utils.PVCoordinates; - -public class IntegrableGeneratorTest { - - private double mu; - private AbsoluteDate initDate; - private SpacecraftState initialState; - private double[][] tolerance; - - /** Test for issue #401 - * with a numerical propagator */ - @Test - public void testInitNumerical() { - - // setup - final double reference = 1.25; - InitCheckerEquations checker = new InitCheckerEquations(reference); - Assert.assertFalse(checker.wasCalled()); - - // action - AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 200, tolerance[0], tolerance[1]); - integrator.setInitialStepSize(60); - NumericalPropagator propagatorNumerical = new NumericalPropagator(integrator); - propagatorNumerical.setInitialState(initialState.addAdditionalState(checker.getName(), reference)); - propagatorNumerical.addAdditionalEquations(checker); - propagatorNumerical.propagate(initDate.shiftedBy(600)); - - // verify - Assert.assertTrue(checker.wasCalled()); - - } - - /** Test for issue #401 - * with a DSST propagator */ - @Test - public void testInitDSST() { - - // setup - final double reference = 3.5; - InitCheckerEquations checker = new InitCheckerEquations(reference); - Assert.assertFalse(checker.wasCalled()); - - // action - AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(0.001, 200, tolerance[0], tolerance[1]); - integrator.setInitialStepSize(60); - DSSTPropagator propagatorDSST = new DSSTPropagator(integrator); - propagatorDSST.setInitialState(initialState.addAdditionalState(checker.getName(), reference)); - propagatorDSST.addAdditionalEquations(checker); - propagatorDSST.propagate(initDate.shiftedBy(600)); - - // verify - Assert.assertTrue(checker.wasCalled()); - - } - - @Before - public void setUp() { - Utils.setDataRoot("regular-data:potential/shm-format"); - GravityFieldFactory.addPotentialCoefficientsReader(new SHMFormatReader("^eigen_cg03c_coef$", false)); - mu = GravityFieldFactory.getUnnormalizedProvider(0, 0).getMu(); - final Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6); - final Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0); - initDate = AbsoluteDate.J2000_EPOCH; - final Orbit orbit = new EquinoctialOrbit(new PVCoordinates(position, velocity), - FramesFactory.getEME2000(), initDate, mu); - initialState = new SpacecraftState(orbit); - tolerance = NumericalPropagator.tolerances(0.001, orbit, OrbitType.EQUINOCTIAL); - } - - @After - public void tearDown() { - initDate = null; - initialState = null; - tolerance = null; - } - - public static class InitCheckerEquations implements AdditionalEquations { - - private double expected; - private boolean called; - - public InitCheckerEquations(final double expected) { - this.expected = expected; - this.called = false; - } - - @Override - public void init(SpacecraftState initiaState, AbsoluteDate target) { - Assert.assertEquals(expected, initiaState.getAdditionalState(getName())[0], 1.0e-15); - called = true; - } - - @Override - public double[] derivatives(SpacecraftState s) { - return new double[] { 1.5 }; - } - - @Override - public String getName() { - return "linear"; - } - - @Override - public int getDimension() { - return 1; - } - - public boolean wasCalled() { - return called; - } - - } - -} diff --git a/src/test/java/org/orekit/propagation/numerical/AbsolutePartialDerivativesEquationsTest.java b/src/test/java/org/orekit/propagation/numerical/AbsolutePartialDerivativesEquationsTest.java index 8ba6f036519c047f41e338bf0e44074e30aa8a2a..243888a86035ad11a0a9dd43b588aaf8a9d665cb 100644 --- a/src/test/java/org/orekit/propagation/numerical/AbsolutePartialDerivativesEquationsTest.java +++ b/src/test/java/org/orekit/propagation/numerical/AbsolutePartialDerivativesEquationsTest.java @@ -84,16 +84,12 @@ public class AbsolutePartialDerivativesEquationsTest { } /** - * check {@link PartialDerivativesEquations#computeDerivatives(SpacecraftState, - * double[])} correctly sets the satellite velocity. + * check {@link PartialDerivativesEquations#derivatives(SpacecraftState)} correctly sets the satellite velocity. */ @Test public void testComputeDerivativesStateVelocity() { - //setup - double[] pdot = new double[36]; - //action - pde.computeDerivatives(state, pdot); + pde.derivatives(state); //verify MatcherAssert.assertThat(forceModel.accelerationDerivativesPosition.toVector3D(), is(pv.getPosition())); diff --git a/src/test/java/org/orekit/propagation/numerical/PartialDerivativesEquationsTest.java b/src/test/java/org/orekit/propagation/numerical/PartialDerivativesEquationsTest.java index 5ed154f2a51b0783d9ab9011946c0e322641e9ba..9fac276efcf42db5951fc0ab951e14672478fa98 100644 --- a/src/test/java/org/orekit/propagation/numerical/PartialDerivativesEquationsTest.java +++ b/src/test/java/org/orekit/propagation/numerical/PartialDerivativesEquationsTest.java @@ -86,16 +86,12 @@ public class PartialDerivativesEquationsTest { } /** - * check {@link PartialDerivativesEquations#computeDerivatives(SpacecraftState, - * double[])} correctly sets the satellite velocity. + * check {@link PartialDerivativesEquations#derivatives(SpacecraftState)} correctly sets the satellite velocity. */ @Test - public void testComputeDerivativesStateVelocity() { - //setup - double[] pdot = new double[36]; - + public void testDerivativesStateVelocity() { //action - pde.computeDerivatives(state, pdot); + pde.derivatives(state); //verify MatcherAssert.assertThat(forceModel.accelerationDerivativesPosition.toVector3D(), is(pv.getPosition())); diff --git a/src/test/java/org/orekit/propagation/semianalytical/dsst/DSSTPartialDerivativesEquationsTest.java b/src/test/java/org/orekit/propagation/semianalytical/dsst/DSSTPartialDerivativesEquationsTest.java index 02d286a5f5d7221896f744ca71403d915f6d68f9..9330b4d870e0275270b29ccf09e7b9e582d6e6a8 100644 --- a/src/test/java/org/orekit/propagation/semianalytical/dsst/DSSTPartialDerivativesEquationsTest.java +++ b/src/test/java/org/orekit/propagation/semianalytical/dsst/DSSTPartialDerivativesEquationsTest.java @@ -449,7 +449,7 @@ public class DSSTPartialDerivativesEquationsTest { try { partials.setInitialJacobians(new SpacecraftState(orbit), new double[6][6], new double[6][3]); - partials.computeDerivatives(new SpacecraftState(orbit), new double[6]); + partials.derivatives(new SpacecraftState(orbit)); Assert.fail("an exception should have been thrown"); } catch (OrekitException oe) { Assert.assertEquals(OrekitMessages.INITIAL_MATRIX_AND_PARAMETERS_NUMBER_MISMATCH, @@ -625,17 +625,14 @@ public class DSSTPartialDerivativesEquationsTest { } /** - * check {@link DSSTPartialDerivativesEquations#computeDerivatives(SpacecraftState, - * double[])}. + * check {@link DSSTPartialDerivativesEquations#erivatives(SpacecraftState)}. * */ @Test - public void testComputeDerivatives() { - //setup - double[] pdot = new double[36]; + public void testDerivatives() { //action - pde.computeDerivatives(state, pdot); + pde.derivatives(state); //verify MatcherAssert.assertThat(forceModel.sma.getReal(), is(state.getA()));