File: OneDimData.py

package info (click to toggle)
stopt 5.12%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 8,860 kB
  • sloc: cpp: 70,456; python: 5,950; makefile: 72; sh: 57
file content (23 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright (C) 2016 EDF
# All Rights Reserved
# This code is published under the GNU Lesser General Public License (GNU LGPL)
# Some data being constant per mesh in one dimensional setting
class OneDimData:
    
    # Constructor
    # p_grid  One dimensional grid
    # p_values values on the grid
    def __init__(self, p_grid, p_values):
        
        self.m_grid = p_grid
        self.m_values = p_values
        
        if (len(p_values) == p_grid.getNbStep() + 1) == False:
            pass
        
    # get the value interpolated constant per mesh at a given point
    # p_coord   the abscissa
    # return interpolated value
    def get(self, p_coord):
        
        return self.m_values[self.m_grid.getMesh(p_coord)]