summaryrefslogtreecommitdiff
path: root/src/basis.h
blob: 08f23ee49800b8e96d3d2d59375528eceb78f342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Basis sets for pseudospectral methods
 * Copyright (C) 2016 Anton Khirnov <anton@khirnov.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MD_BASIS_H
#define MD_BASIS_H

enum MDBasisEvalType {
    MD_BASIS_EVAL_TYPE_VALUE,
    MD_BASIS_EVAL_TYPE_DIFF1,
    MD_BASIS_EVAL_TYPE_DIFF2,
};

enum MDBasisFamily {
    MD_BASIS_FAMILY_TB_EVEN,
    MD_BASIS_FAMILY_SB_EVEN,
    MD_BASIS_FAMILY_SB_ODD,
    MD_BASIS_FAMILY_COS_EVEN,
};

typedef struct MDBasisSetContext MDBasisSetContext;

int md_basis_init(MDBasisSetContext **ctx, enum MDBasisFamily family, double sf);
void md_basis_free(MDBasisSetContext **ctx);

double md_basis_eval(const MDBasisSetContext *ctx, enum MDBasisEvalType type,
                     double coord, unsigned int order);
double md_basis_colloc_point(const MDBasisSetContext *ctx, unsigned int order,
                             unsigned int idx);

#endif /* MD_BASIS_H */