update main

This commit is contained in:
张壹 2022-07-24 07:41:22 +08:00
parent 1eb3ca8df8
commit 693e4ef3ff
2 changed files with 21 additions and 0 deletions

17
config.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
cmd=${1}
package=gm3d
address=/opt/stow
taress=/usr/local
if [[ ${cmd} == "configure" && ! -d "build/" ]]; then
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
elif [[ ${cmd} == "configure" ]]; then
cd build && rm -rf * && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
elif [[ ${cmd} == "build" ]]; then
cd build && make
elif [[ ${cmd} == "install" ]]; then
cd build && sudo make install
sudo stow --dir=${address} --target=${taress} ${package}
fi

View File

@ -61,6 +61,10 @@ DeltaT, DeltaTx, DeltaTy, DeltaTz, Hax, Hay and Za for magnetic data.",
{ {
gm3d_instance.BuildRegularGrid(dimension.c_str()); gm3d_instance.BuildRegularGrid(dimension.c_str());
if (modelname != "NULL") gm3d_instance.AddModels(modelname.c_str()); if (modelname != "NULL") gm3d_instance.AddModels(modelname.c_str());
else
{
GCTL_ShowWhatError("No model parameters is found.", GCTL_WARNING_ERROR, 0, 0, 0);
}
gm3d_instance.RegisteredOuput(remove_null); gm3d_instance.RegisteredOuput(remove_null);
gm3d_instance.OutMshFile(out_mshname.c_str(), elename); gm3d_instance.OutMshFile(out_mshname.c_str(), elename);
} }