1   /* Copyright 2020-2025 Exotrail
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.propagation.conversion.averaging;
18  
19  import org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider;
20  import org.orekit.frames.Frame;
21  import org.orekit.time.AbsoluteDate;
22  
23  /**
24   * Abstract class representing averaged orbital state based on {@link UnnormalizedSphericalHarmonicsProvider}.
25   *
26   * @author Romain Serra
27   * @see AveragedOrbitalState
28   * @since 12.1
29   */
30  abstract class AbstractHarmonicsBasedOrbitalState extends AbstractAveragedOrbitalState {
31  
32      /** Spherical harmonics provider. */
33      private final UnnormalizedSphericalHarmonicsProvider harmonicsProvider;
34  
35      /**
36       * Protected constructor.
37       * @param date epoch
38       * @param frame reference frame
39       * @param harmonicsProvider spherical harmonics provider
40       */
41      protected AbstractHarmonicsBasedOrbitalState(final AbsoluteDate date, final Frame frame,
42                                                   final UnnormalizedSphericalHarmonicsProvider harmonicsProvider) {
43          super(date, frame);
44          this.harmonicsProvider = harmonicsProvider;
45      }
46  
47      /** {@inheritDoc} */
48      @Override
49      public double getMu() {
50          return harmonicsProvider.getMu();
51      }
52  
53      /**
54       * Getter for spherical harmonics provider.
55       * @return harmonics provider
56       */
57      public UnnormalizedSphericalHarmonicsProvider getHarmonicsProvider() {
58          return harmonicsProvider;
59      }
60  }