51VEMBED(rcsid=
"$Id: vmgrid.c 1615 2010-10-20 19:16:35Z sobolevnrm $")
57VPUBLIC Vmgrid* Vmgrid_ctor() {
61 thee = Vmem_malloc(VNULL, 1, sizeof(Vmgrid));
62 VASSERT(thee != VNULL);
63 VASSERT(Vmgrid_ctor2(thee));
68/* ///////////////////////////////////////////////////////////////////////////
69// Routine: Vmgrid_ctor2
70// Author: Nathan Baker
72VPUBLIC int Vmgrid_ctor2(Vmgrid *thee) {
76 if (thee == VNULL) return 0;
79 for (i=0; i<VMGRIDMAX; i++) thee->grids[i] = VNULL;
84/* ///////////////////////////////////////////////////////////////////////////
85// Routine: Vmgrid_dtor
86// Author: Nathan Baker
88VPUBLIC void Vmgrid_dtor(Vmgrid **thee) {
90 if ((*thee) != VNULL) {
92 Vmem_free(VNULL, 1, sizeof(Vmgrid), (void **)thee);
97/* ///////////////////////////////////////////////////////////////////////////
98// Routine: Vmgrid_dtor2
99// Author: Nathan Baker
101VPUBLIC void Vmgrid_dtor2(Vmgrid *thee) { ; }
103/* ///////////////////////////////////////////////////////////////////////////
104// Routine: Vmgrid_value
105// Author: Nathan Baker
107VPUBLIC int Vmgrid_value(Vmgrid *thee, double pt[3], double *value) {
112 VASSERT(thee != VNULL);
114 for (i=0; i<thee->ngrids; i++) {
115 rc = Vgrid_value(thee->grids[i], pt, &tvalue);
122 Vnm_print(2, "Vmgrid_value: Point (%g, %g, %g) not found in \
123hiearchy!\n", pt[0], pt[1], pt[2]);
128/* ///////////////////////////////////////////////////////////////////////////
129// Routine: Vmgrid_curvature
131// Notes: cflag=0 ==> Reduced Maximal Curvature
132// cflag=1 ==> Mean Curvature (Laplace)
133// cflag=2 ==> Gauss Curvature
134// cflag=3 ==> True Maximal Curvature
136// Authors: Nathan Baker
138VPUBLIC int Vmgrid_curvature(Vmgrid *thee, double pt[3], int cflag,
144 VASSERT(thee != VNULL);
146 for (i=0; i<thee->ngrids; i++) {
147 rc = Vgrid_curvature(thee->grids[i], pt, cflag, &tvalue);
154 Vnm_print(2, "Vmgrid_curvature: Point (%g, %g, %g) not found in \
155hiearchy!\n", pt[0], pt[1], pt[2]);
162/* ///////////////////////////////////////////////////////////////////////////
163// Routine: Vmgrid_gradient
165// Authors: Nathan Baker
167VPUBLIC int Vmgrid_gradient(Vmgrid *thee, double pt[3], double grad[3]) {
172 VASSERT(thee != VNULL);
174 for (i=0; i<thee->ngrids; i++) {
175 rc = Vgrid_gradient(thee->grids[i], pt, tgrad);
177 for (j=0; j<3; j++) grad[j] = tgrad[j];
182 Vnm_print(2, "Vmgrid_gradient: Point (%g, %g, %g) not found in \
183hiearchy!\n", pt[0], pt[1], pt[2]);
190/* ///////////////////////////////////////////////////////////////////////////
191// Routine: Vmgrid_addGrid
193// Authors: Nathan Baker
195VPUBLIC int Vmgrid_addGrid(Vmgrid *thee, Vgrid *grid) {
200 VASSERT(thee != VNULL);
203 Vnm_print(2, "Vmgrid_addGrid: Not adding VNULL grid!\n");
207 if (thee->ngrids >= VMGRIDMAX) {
208 Vnm_print(2, "Vmgrid_addGrid: Too many grids in hierarchy (max = \
210 Vnm_print(2, "Vmgrid_addGrid: Not adding grid!\n");
214 thee->grids[thee->ngrids] = grid;
#define VEMBED(rctag)
Allows embedding of RCS ID tags in object files.
Multiresolution oracle for Cartesian mesh data.