AbstractCartesianAdjointDerivativesProvider.java

  1. /* Copyright 2022-2024 Romain Serra
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.control.indirect.adjoint;

  18. import org.orekit.control.indirect.adjoint.cost.CartesianCost;
  19. import org.orekit.propagation.integration.AdditionalDerivativesProvider;

  20. /**
  21.  * Abstract class defining common things for Cartesian adjoint dynamics between standard and Field versions.
  22.  * @author Romain Serra
  23.  * @see AdditionalDerivativesProvider
  24.  * @see org.orekit.propagation.numerical.NumericalPropagator
  25.  * @since 12.2
  26.  */
  27. public class AbstractCartesianAdjointDerivativesProvider {

  28.     /** Name of the additional variables. */
  29.     private final String name;

  30.     /** Cost function. */
  31.     private final CartesianCost cost;

  32.     /**
  33.      * Constructor.
  34.      * @param cost cost function
  35.      */
  36.     public AbstractCartesianAdjointDerivativesProvider(final CartesianCost cost) {
  37.         this.name = cost.getAdjointName();
  38.         this.cost = cost;
  39.     }

  40.     /**
  41.      * Getter for the cost.
  42.      * @return cost
  43.      */
  44.     public CartesianCost getCost() {
  45.         return cost;
  46.     }

  47.     /** Getter for the name.
  48.      * @return name */
  49.     public String getName() {
  50.         return name;
  51.     }

  52.     /** Getter for the dimension.
  53.      * @return dimension
  54.      */
  55.     public int getDimension() {
  56.         return cost.getAdjointDimension();
  57.     }
  58. }